QNANO
Eigen_Diagonalize_Sparse_Matrix.h
1 #ifndef QNANO_NEW_EIGEN_DIAGONALIZE_SPARSE_MATRIX_DEFINED_H
2 #define QNANO_NEW_EIGEN_DIAGONALIZE_SPARSE_MATRIX_DEFINED_H
3 
4 #include "eigen/include_Eigen.h"
5 #include "tools/Sparse_Matrix_Generator.h"
6 #include "tools/Abstract_Solver.h"
7 
9 public:
10  Sparse_Matrix_Generator *generator;
11 
12  Eigen::MatrixXcd A;
13  Eigen::SelfAdjointEigenSolver<Eigen::MatrixXcd> solver;
14 
15 
16  void generate_Matrix();
17  virtual void setup();
18  virtual void solve();
19  virtual bool should_print()const{
20  return true;
21  }
22  //virtual size_t get_local_EV_start()const;
23  //virtual size_t get_local_EV_blocksize()const;
24  virtual double get_eigenvalue(size_t i);
25  virtual void get_EV_local_part(size_t i, std::complex<double> *ptr);
26 
27 
28  void solve(Sparse_Matrix_Generator *generator);
29 
30  void print_eigenvalues(std::ostream &ofs=std::cout)const;
31  void print_eigenvalues(const std::string &filename)const;
32 
33  Eigen_Diagonalize_Sparse_Matrix() : generator(NULL) { }
35  : generator(generator_) {
36  }
37 
39  }
40 };
41 
42 #endif
Definition: Abstract_Solver.h:8
Definition: Sparse_Matrix_Generator.h:22
Definition: Eigen_Diagonalize_Sparse_Matrix.h:8