TBTK
Need a break? Support the development by playing Polarity Puzzles
DOS.h
Go to the documentation of this file.
1 /* Copyright 2016 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_DOS
24 #define COM_DAFER45_TBTK_DOS
25 
27 
28 namespace TBTK{
29 namespace Property{
30 
48 class DOS : public EnergyResolvedProperty<double>{
49 public:
51  DOS();
52 
58  DOS(double lowerBound, double upperBound, int resolution);
59 
66  DOS(
67  double lowerBound,
68  double upperBound,
69  int resolution,
70  const double *data
71  );
72 
79  DOS(const std::string &serialization, Mode mode);
80 
82  DOS& operator+=(const DOS &rhs);
83 
90  DOS operator+(const DOS &rhs) const;
91 
93  DOS& operator-=(const DOS &rhs);
94 
101  DOS operator-(const DOS &rhs) const;
102 
104  DOS& operator*=(const double &rhs);
105 
112  DOS operator*(const double &rhs) const;
113 
121  friend DOS operator*(const double &lhs, const DOS &rhs){
122  return rhs*lhs;
123  }
124 
126  DOS& operator/=(const double &rhs);
127 
134  DOS operator/(const double &rhs) const;
135 
137  virtual std::string toString() const;
138 
140  virtual std::string serialize(Mode mode) const;
141 };
142 
143 inline DOS::DOS(){
144 }
145 
146 inline DOS& DOS::operator+=(const DOS &rhs){
148 
149  return *this;
150 }
151 
152 inline DOS DOS::operator+(const DOS &rhs) const{
153  DOS dos = *this;
154 
155  return dos += rhs;
156 }
157 
158 inline DOS& DOS::operator-=(const DOS &rhs){
160 
161  return *this;
162 }
163 
164 inline DOS DOS::operator-(const DOS &rhs) const{
165  DOS dos = *this;
166 
167  return dos -= rhs;
168 }
169 
170 inline DOS& DOS::operator*=(const double &rhs){
172 
173  return *this;
174 }
175 
176 inline DOS DOS::operator*(const double &rhs) const{
177  DOS dos = *this;
178 
179  return dos *= rhs;
180 }
181 
182 inline DOS& DOS::operator/=(const double &rhs){
184 
185  return *this;
186 }
187 
188 inline DOS DOS::operator/(const double &rhs) const{
189  DOS dos = *this;
190 
191  return dos /= rhs;
192 }
193 
194 }; //End namespace Property
195 }; //End namespace TBTK
196 
197 #endif
TBTK::Property::DOS::operator*=
DOS & operator*=(const double &rhs)
Definition: DOS.h:170
TBTK::Property::DOS::operator/=
DOS & operator/=(const double &rhs)
Definition: DOS.h:182
TBTK::Property::DOS
Property container for density of states (DOS).
Definition: DOS.h:48
TBTK::Property::EnergyResolvedProperty
Base class for energy resolved Properties.
Definition: EnergyResolvedProperty.h:83
TBTK::Property::DOS::operator*
friend DOS operator*(const double &lhs, const DOS &rhs)
Definition: DOS.h:121
TBTK::Property::EnergyResolvedProperty::operator+=
EnergyResolvedProperty & operator+=(const EnergyResolvedProperty &rhs)
Definition: EnergyResolvedProperty.h:1195
EnergyResolvedProperty.h
Base class for energy resolved Properties.
TBTK::Property::EnergyResolvedProperty::operator-=
EnergyResolvedProperty & operator-=(const EnergyResolvedProperty &rhs)
Definition: EnergyResolvedProperty.h:1287
TBTK::Property::DOS::operator+
DOS operator+(const DOS &rhs) const
Definition: DOS.h:152
TBTK::Property::DOS::operator/
DOS operator/(const double &rhs) const
Definition: DOS.h:188
TBTK::Property::DOS::operator+=
DOS & operator+=(const DOS &rhs)
Definition: DOS.h:146
TBTK::Property::DOS::serialize
virtual std::string serialize(Mode mode) const
TBTK::Property::DOS::operator-
DOS operator-(const DOS &rhs) const
Definition: DOS.h:164
TBTK::Property::DOS::toString
virtual std::string toString() const
TBTK::Property::DOS::DOS
DOS()
Definition: DOS.h:143
TBTK::Property::EnergyResolvedProperty::operator/=
EnergyResolvedProperty & operator/=(const DataType &rhs)
Definition: EnergyResolvedProperty.h:1389
TBTK::Property::DOS::operator*
DOS operator*(const double &rhs) const
Definition: DOS.h:176
TBTK::Property::DOS::operator-=
DOS & operator-=(const DOS &rhs)
Definition: DOS.h:158
TBTK::Property::EnergyResolvedProperty::operator*=
EnergyResolvedProperty & operator*=(const DataType &rhs)
Definition: EnergyResolvedProperty.h:1379
TBTK::Serializable::Mode
Mode
Definition: Serializable.h:47