TBTK
Need a break? Support the development by playing Polarity Puzzles
EigenValues.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_EIGEN_VALUES
24 #define COM_DAFER45_TBTK_EIGEN_VALUES
25 
26 #include "TBTK/Property/AbstractProperty.h"
27 
28 namespace TBTK{
29 namespace Property{
30 
46 class EigenValues : public AbstractProperty<double>{
47 public:
51  EigenValues(int size);
52 
57  EigenValues(int size, const double *data);
58 
66  EigenValues(const std::string &serialization, Mode mode);
67 
69  EigenValues& operator+=(const EigenValues &rhs);
70 
77  EigenValues operator+(const EigenValues &rhs) const;
78 
80  EigenValues& operator-=(const EigenValues &rhs);
81 
88  EigenValues operator-(const EigenValues &rhs) const;
89 
91  EigenValues& operator*=(const double &rhs);
92 
99  EigenValues operator*(const double &rhs) const;
100 
109  const double &lhs,
110  const EigenValues &rhs
111  ){
112  return rhs*lhs;
113  }
114 
116  EigenValues& operator/=(const double &rhs);
117 
124  EigenValues operator/(const double &rhs) const;
125 
127  virtual std::string toString() const;
128 
130  std::string serialize(Mode mode) const;
131 private:
132 };
133 
136 
137  return *this;
138 }
139 
141  EigenValues eigenValues = *this;
142 
143  return eigenValues += rhs;
144 }
145 
148 
149  return *this;
150 }
151 
153  EigenValues eigenValues = *this;
154 
155  return eigenValues -= rhs;
156 }
157 
158 inline EigenValues& EigenValues::operator*=(const double &rhs){
160 
161  return *this;
162 }
163 
164 inline EigenValues EigenValues::operator*(const double &rhs) const{
165  EigenValues eigenValues = *this;
166 
167  return eigenValues *= rhs;
168 }
169 
170 inline EigenValues& EigenValues::operator/=(const double &rhs){
172 
173  return *this;
174 }
175 
176 inline EigenValues EigenValues::operator/(const double &rhs) const{
177  EigenValues eigenValues = *this;
178 
179  return eigenValues /= rhs;
180 }
181 
182 }; //End namespace Property
183 }; //End namespace TBTK
184 
185 #endif
EigenValues operator+(const EigenValues &rhs) const
Definition: EigenValues.h:140
EigenValues operator-(const EigenValues &rhs) const
Definition: EigenValues.h:152
std::string serialize(Mode mode) const
Property container for eigen values.
Definition: EigenValues.h:46
virtual std::string toString() const
friend EigenValues operator*(const double &lhs, const EigenValues &rhs)
Definition: EigenValues.h:108
EigenValues operator*(const double &rhs) const
Definition: EigenValues.h:164
AbstractProperty & operator*=(const DataType &rhs)
Definition: AbstractProperty.h:1321
Abstract Property class.
Definition: AbstractProperty.h:101
EigenValues & operator/=(const double &rhs)
Definition: EigenValues.h:170
EigenValues & operator*=(const double &rhs)
Definition: EigenValues.h:158
AbstractProperty & operator-=(const AbstractProperty &rhs)
Definition: AbstractProperty.h:1266
Definition: Boolean.h:32
EigenValues operator/(const double &rhs) const
Definition: EigenValues.h:176
EigenValues & operator+=(const EigenValues &rhs)
Definition: EigenValues.h:134
EigenValues & operator-=(const EigenValues &rhs)
Definition: EigenValues.h:146
Mode
Definition: Serializable.h:47
AbstractProperty & operator/=(const DataType &rhs)
Definition: AbstractProperty.h:1334
AbstractProperty & operator+=(const AbstractProperty &rhs)
Definition: AbstractProperty.h:1213