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