QNANO
Abstract_Solver.h
1 #ifndef QNANO_NEW_ABSTRACT_SOLVER_DEFINED_H
2 #define QNANO_NEW_ABSTRACT_SOLVER_DEFINED_H
3 #include <cstdlib>
4 #include <complex>
5 #include "tools/Communicator.h"
6 #include "tools/Distribute_Block_Local.h"
7 
9 public:
10  virtual void setup()=0;
11  virtual void solve()=0;
12 
13  //If MPI is used: print only from thread 0. If MPI is not used, return always true
14  virtual bool should_print()const=0;
15 
16  //Access to eigenvector number i, might be local, might be global
18  virtual Distribute_Block_Local* new_Distribute_Block_Local(size_t totalsize)const{
19  return new Distribute_Block_Local(totalsize);
20  }
21  virtual Communicator* new_Communicator()const{
22  return new Communicator();
23  }
24 
25  virtual double get_eigenvalue(size_t i)=0;
26  virtual void get_EV_local_part(size_t i, std::complex<double> *ptr)=0;
27 
28  virtual ~Abstract_Solver();
29 };
30 
31 
32 #endif
Definition: Abstract_Solver.h:8
Definition: Communicator.h:19
Definition: Distribute_Block_Local.h:15
virtual Distribute_Block_Local * new_Distribute_Block_Local(size_t totalsize) const
Allocate new structure to parallelize data of size &#39;totalsize&#39;. May be a sequential Distrubute_Block_...
Definition: Abstract_Solver.h:18