TBTK
SingleParticleContext.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_SINGLE_PARTICLE_CONTEXT
24 #define COM_DAFER45_TBTK_SINGLE_PARTICLE_CONTEXT
25 
26 #include "TBTK/Geometry.h"
28 #include "TBTK/Serializable.h"
30 #include "TBTK/Statistics.h"
31 
32 namespace TBTK{
33 
34 class FileReader;
35 
38 public:
41 
43  SingleParticleContext(const std::vector<unsigned int> &capacity);
44 
47  const SingleParticleContext &singleParticleContext
48  );
49 
52  SingleParticleContext &&singleParticleContext
53  );
54 
57  SingleParticleContext(const std::string &serialization, Mode mode);
58 
60  virtual ~SingleParticleContext();
61 
64 
67 
71  void setStatistics(Statistics statistics);
72 
76  Statistics getStatistics() const;
77 
78  /*** Sort HoppingAmplitudes. */
79  void sortHoppingAmplitudes();
80 
82  void constructCOO();
83 
88 
93 
98 
103 
105  void createGeometry(int dimensions, int numSpecifiers = 0);
106 
109 
111  std::string serialize(Mode mode) const;
112 private:
114  HoppingAmplitudeSet hoppingAmplitudeSet;
115 
117  SourceAmplitudeSet sourceAmplitudeSet;
118 
120  Statistics statistics;
121 
123  Geometry *geometry;
124 
126  friend class FileReader;
127 };
128 
130  this->statistics = statistics;
131 }
132 
134  return statistics;
135 }
136 
137 inline void SingleParticleContext::sortHoppingAmplitudes(){
138  hoppingAmplitudeSet.sort();
139 }
140 
142  hoppingAmplitudeSet.sort();
143  hoppingAmplitudeSet.constructCOO();
144 }
145 
147  return hoppingAmplitudeSet;
148 }
149 
150 inline const HoppingAmplitudeSet&
152  return hoppingAmplitudeSet;
153 }
154 
156  return sourceAmplitudeSet;
157 }
158 
159 inline const SourceAmplitudeSet&
161  return sourceAmplitudeSet;
162 }
163 
165  return geometry;
166 }
167 
168 }; //End of namespace TBTK
169 
170 #endif
The context for the single particle part of a Model.
Definition: SingleParticleContext.h:37
SingleParticleContext & operator=(const SingleParticleContext &rhs)
void constructCOO()
Definition: SingleParticleContext.h:141
HoppingAmplitude container.
Definition: HoppingAmplitudeSet.h:50
std::string serialize(Mode mode) const
Definition: Serializable.h:40
Enum class for Fermi-Dirac and Bose-Einstein statistics.
HoppingAmplitude container.
Definition: FileReader.h:50
void sort()
Definition: HoppingAmplitudeSet.h:469
void setStatistics(Statistics statistics)
Definition: SingleParticleContext.h:129
void createGeometry(int dimensions, int numSpecifiers=0)
SourceAmplitude container.
SourceAmplitudeSet & getSourceAmplitudeSet()
Definition: SingleParticleContext.h:155
HoppingAmplitudeSet & getHoppingAmplitudeSet()
Definition: SingleParticleContext.h:146
SourceAmplitude container.
Definition: SourceAmplitudeSet.h:39
Definition: ModelFactory.h:35
Statistics getStatistics() const
Definition: SingleParticleContext.h:133
Contains geometric information about a Model.
Definition: Geometry.h:35
Mode
Definition: Serializable.h:44
Abstract base class for serializable objects.
Contains geometric inforamtion about a Model.
Geometry * getGeometry()
Definition: SingleParticleContext.h:164
Statistics
Definition: Statistics.h:29