TBTK
GreensFunction.h
Go to the documentation of this file.
1 /* Copyright 2017 Kristofer Bj√∂rnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_GREENS_FUNCTION
24 #define COM_DAFER45_TBTK_GREENS_FUNCTION
25 
26 #include "TBTK/Property/AbstractProperty.h"
27 #include "TBTK/TBTKMacros.h"
28 
29 #include <complex>
30 #include <vector>
31 
32 namespace TBTK{
33 namespace Property{
34 
36 class GreensFunction : public AbstractProperty<std::complex<double>>{
37 public:
39  enum class Type{
40  Advanced,
41  Retarded,
42  Principal,
43  NonPrincipal
44  };
45 
48 
51  const IndexTree &indexTree,
52  Type type,
53  double lowerBound,
54  double upperBound,
55  unsigned int resolution
56  );
57 
60  const IndexTree &indexTree,
61  Type type,
62  double lowerBound,
63  double upperBound,
64  unsigned int resolution,
65  const std::complex<double> *data
66  );
67 
69  GreensFunction(const GreensFunction &greensFunction);
70 
72  GreensFunction(GreensFunction &&greensFunction);
73 
76 
78  double getLowerBound() const;
79 
81  double getUpperBound() const;
82 
84  unsigned int getResolution() const;
85 
87 // const std::complex<double>* getData() const;
88 
90  const GreensFunction& operator=(const GreensFunction &rhs);
91 
94 private:
96  Type type;
97 
99  double lowerBound;
100 
102  double upperBound;
103 
105  unsigned int resolution;
106 
108 // std::complex<double> *data;
109 };
110 
111 inline double GreensFunction::getLowerBound() const{
112  return lowerBound;
113 }
114 
115 inline double GreensFunction::getUpperBound() const{
116  return upperBound;
117 }
118 
119 inline unsigned int GreensFunction::getResolution() const{
120  return resolution;
121 }
122 
123 /*inline const std::complex<double>* GreensFunction::getData() const{
124  return data;
125 }*/
126 
128  const GreensFunction &rhs
129 ){
130  if(this != &rhs){
132 
133  type = rhs.type;
134  lowerBound = rhs.lowerBound;
135  upperBound = rhs.upperBound;
136  resolution = rhs.resolution;
137 
138 /* data = new std::complex<double>[resolution];
139  for(unsigned int n = 0; n < resolution; n++)
140  data[n] = rhs.data[n];*/
141  }
142 
143  return *this;
144 }
145 
147  GreensFunction &&rhs
148 ){
149  if(this != &rhs){
150  AbstractProperty::operator=(std::move(rhs));
151 
152  type = rhs.type;
153  lowerBound = rhs.lowerBound;
154  upperBound = rhs.upperBound;
155  resolution = rhs.resolution;
156 /* data = rhs.data;
157  rhs.data = nullptr;*/
158  }
159 
160  return *this;
161 }
162 
163 }; //End namespace Property
164 }; //End namespace TBTK
165 
166 #endif
Type
Definition: GreensFunction.h:39
double getLowerBound() const
Definition: GreensFunction.h:111
Precompiler macros.
const GreensFunction & operator=(const GreensFunction &rhs)
Definition: GreensFunction.h:127
Abstract Property class.
Definition: AbstractProperty.h:41
Data structure for mapping physical indices to a linear index.
Definition: IndexTree.h:34
Definition: ModelFactory.h:35
AbstractProperty & operator=(const AbstractProperty &abstractProperty)
Definition: AbstractProperty.h:905
unsigned int getResolution() const
Definition: GreensFunction.h:119
double getUpperBound() const
Definition: GreensFunction.h:115
Property container for Green&#39;s function.
Definition: GreensFunction.h:36