Xped
Loading...
Searching...
No Matches
UnitCell.hpp
Go to the documentation of this file.
1#ifndef XPED_UNIT_CELL_H_
2#define XPED_UNIT_CELL_H_
3
4#include <filesystem>
5#include <vector>
6
7#include "yas/serialize.hpp"
8#include "yas/std_types.hpp"
9
10#include "Xped/PEPS/Pattern.hpp"
11
12namespace Xped {
13
15{
16 explicit UnitCell(const Pattern& pat)
17 : Lx(pat.Lx)
18 , Ly(pat.Ly)
19 , pattern(pat)
20 {}
21
22 explicit UnitCell(const std::size_t Lx = 1, const std::size_t Ly = 1);
23
24 std::size_t Lx = 1;
25 std::size_t Ly = 1;
26
28
29 template <typename Ar>
30 void serialize(Ar& ar)
31 {
32 ar& YAS_OBJECT_NVP("UnitCell", ("Lx", Lx), ("Ly", Ly), ("pattern", pattern));
33 }
34
35 void loadFromMatlab(const std::filesystem::path& p, const std::string& root_name);
36
37 inline std::size_t uniqueSize() const { return pattern.uniqueSize(); }
38 inline std::size_t size() const { return Lx * Ly; }
39
40 inline std::size_t rows() const { return Lx; }
41 inline std::size_t cols() const { return Ly; }
42};
43
44} // namespace Xped
45
46#ifndef XPED_COMPILED_LIB
47# include "PEPS/UnitCell.cpp"
48#endif
49
50#endif
Definition: bench.cpp:62
Definition: Pattern.hpp:18
std::size_t uniqueSize() const
Definition: Pattern.hpp:43
Definition: UnitCell.hpp:15
Pattern pattern
Definition: UnitCell.hpp:27
std::size_t Ly
Definition: UnitCell.hpp:25
std::size_t cols() const
Definition: UnitCell.hpp:41
std::size_t size() const
Definition: UnitCell.hpp:38
std::size_t rows() const
Definition: UnitCell.hpp:40
std::size_t Lx
Definition: UnitCell.hpp:24
UnitCell(const Pattern &pat)
Definition: UnitCell.hpp:16
std::size_t uniqueSize() const
Definition: UnitCell.hpp:37
void serialize(Ar &ar)
Definition: UnitCell.hpp:30
void loadFromMatlab(const std::filesystem::path &p, const std::string &root_name)
Definition: UnitCell.cpp:26