TBTK
Need a break? Support the development by playing Polarity Puzzles
UnitCell.h
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 
17 
24 #ifndef COM_DAFER45_TBTK_UNIT_CELL
25 #define COM_DAFER45_TBTK_UNIT_CELL
26 
27 #include "TBTK/StateSet.h"
28 
29 namespace TBTK{
30 
31 class UnitCell : public StateSet{
32 public:
34  UnitCell(std::initializer_list<std::initializer_list<double>> latticeVectors, bool isOwner = true);
35 
37  UnitCell(const std::vector<std::vector<double>> &latticeVectors, bool isOwner = true);
38 
40  ~UnitCell();
41 
43  int getNumLatticeVectors() const;
44 
46  const std::vector<double>& getLatticeVector(int n) const;
47 
49  const std::vector<std::vector<double>>& getLatticeVectors() const;
50 private:
52  std::vector<std::vector<double>> latticeVectors;
53 };
54 
55 inline int UnitCell::getNumLatticeVectors() const{
56  return latticeVectors.size();
57 }
58 
59 inline const std::vector<double>& UnitCell::getLatticeVector(int n) const{
60  return latticeVectors.at(n);
61 }
62 
63 inline const std::vector<std::vector<double>>& UnitCell::getLatticeVectors() const{
64  return latticeVectors;
65 }
66 
67 }; //End of namespace TBTK
68 
69 #endif
70 
Definition: Boolean.h:32