ALPSCore reference
mesh.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 #include"alps/gf/mesh.hpp"
7 
8 namespace alps{
9 namespace gf{
10 
11 std::ostream &operator<<(std::ostream &os, const itime_mesh &M){
12  os<<"# "<<"IMAGINARY_TIME"<<" mesh: N: "<<M.extent()<<" beta: "<<M.beta()<<" statistics: ";
13  os<<(M.statistics()==statistics::FERMIONIC?"FERMIONIC":"BOSONIC");
14  os<<std::endl;
15  return os;
16 }
17 
18 std::ostream &operator<<(std::ostream &os, const power_mesh &M){
19  os<<"# "<<"POWER"<<" mesh: power: "<<M.power()<<" uniform: "<<M.uniform()<<" N: "<<M.extent()<<" beta: "<<M.beta()<<" statistics: ";
20  os<<(M.statistics()==statistics::FERMIONIC?"FERMIONIC":"BOSONIC");
21  os<<std::endl;
22  return os;
23 }
24 
25 std::ostream &operator<<(std::ostream &os, const momentum_realspace_index_mesh &M){
26  os << "# "<<M.kind()<<" mesh: N: "<<M.extent()<<" dimension: "<<M.dimension()<<" points: ";
27  for(int i=0;i<M.extent();++i){
28  os<<"(";
29  for(int d=0;d<M.dimension()-1;++d){ os<<M.points()[i][d]<<","; } os<<M.points()[i][M.dimension()-1]<<") ";
30  }
31  os<<std::endl;
32  return os;
33 }
34 
35 std::ostream &operator<<(std::ostream &os, const index_mesh &M){
36  os << "# "<<"INDEX"<<" mesh: N: "<<M.extent()<<std::endl;
37  return os;
38 }
39 
40 std::ostream &operator<<(std::ostream &os, const real_frequency_mesh &M){
41  os<<"# "<<"REAL_FREQUENCY"<<" mesh: N: "<<M.extent();
42  os<<std::endl;
43  return os;
44 }
45 
46 std::ostream &operator<<(std::ostream &os, const legendre_mesh &M){
47  os<<"# "<<"LEGENDRE"<<" mesh: N: "<<M.extent()<<" beta: "<<M.beta()<<" statistics: ";
48  os<<(M.statistics()==statistics::FERMIONIC?"FERMIONIC":"BOSONIC");
49  os<<std::endl;
50  return os;
51 }
52 
53  namespace detail {
54  // print 1D boost multiarray --- a 2D-point of a mesh
55  std::ostream& operator<<(std::ostream& s, const boost::multi_array<double, 1>& data)
56  {
57  typedef boost::multi_array<double, 1> data_type;
58  typedef data_type::const_iterator iterator_type;
59  s << "";
60  iterator_type it=data.begin();
61  if (data.end()!=it) s << *(it++);
62  for (; it!=data.end(); ++it) {
63  s << " " << *it;
64  }
65  s << " "; // << std::endl;
66  return s;
67  }
68  } // detail::
69 
70 } // gf::
71 } // alps::
int uniform() const
Definition: mesh.hpp:533
int extent() const
Definition: mesh.hpp:391
statistics::statistics_type statistics() const
Definition: mesh.hpp:402
int power() const
Definition: mesh.hpp:532
std::ostream & operator<<(std::ostream &os, const real_frequency_mesh &M)
Definition: mesh.cpp:40
int dimension() const
returns the spatial dimension
Definition: mesh.hpp:700
statistics::statistics_type statistics() const
Definition: mesh.hpp:544
const container_type & points() const
Definition: mesh.hpp:717
Mesh of real frequencies.
Definition: mesh.hpp:95
int extent() const
Definition: mesh.hpp:922
int extent() const
Returns the number of points.
Definition: mesh.hpp:698
int extent() const
Definition: mesh.hpp:831
statistics::statistics_type statistics() const
Definition: mesh.hpp:945
double beta() const
Getter variables for members.
Definition: mesh.hpp:401
double beta() const
Getter variables for members.
Definition: mesh.hpp:543
const std::string & kind() const
returns the mesh kind
Definition: mesh.hpp:702
double beta() const
getter functions for member variables
Definition: mesh.hpp:944
int extent() const
Definition: mesh.hpp:531