Majoranapp
A C++ library for studying MZM in non-interacting systems
Grid3DViewer.hpp
Go to the documentation of this file.
1 #ifndef SRC_VECTORVIEWERS_GRID3D_HPP
2 #define SRC_VECTORVIEWERS_GRID3D_HPP
3 
4 #include "../VectorViewer.hpp"
5 
22 {
23 
24 private:
25  static void ToCoord(int i, int &x, int &y, int &z, int L, int W)
26  {
27  x = i % L;
28  y = (i / L) % W;
29  z = i / (L * W);
30  }
31 
32 public:
33  static void View(arma::mat &vectors, int deg)
34  {
35  int rows = vectors.n_rows;
36  int cols = vectors.n_cols;
37 
38  std::cout << "# x y z ";
39  for (int col = 0; col < cols; col++)
40  for (int _deg = 0; _deg < deg / 2; _deg++)
41  std::cout << Info::Gamma(_deg) << "+(" << col << ") "
42  << Info::Gamma(_deg) << "-(" << col << ") ";
43  std::cout << std::endl;
44 
45 
46  for (int row = 0, site = 0,x,y,z; row < rows; row += deg, site++)
47  {
49 
50  std::cout << x << " " << y << " " << z << " ";
51  for (int col = 0; col < cols; col++)
52  {
53  for (int _deg = 0; _deg < deg; _deg++)
54  std::cout << vectors(row + _deg, col) << " ";
55  }
56  std::cout << std::endl;
57  }
58  }
59 };
60 
61 #endif
static int width
Definition: VectorViewer.hpp:20
displays vectors with sites numbered in 3D grid,
Definition: Grid3DViewer.hpp:21
static std::string Gamma(int deg)
selects gamma of a given degree deg
Definition: GammaASCII.hpp:52
static void ToCoord(int i, int &x, int &y, int &z, int L, int W)
Definition: Grid3DViewer.hpp:25
static int length
Definition: VectorViewer.hpp:19
static void View(arma::mat &vectors, int deg)
Definition: Grid3DViewer.hpp:33