25#ifndef __EIGENSOLVER_HPP__
26#define __EIGENSOLVER_HPP__
63 std::transform(name__.begin(), name__.end(), name__.begin(), ::tolower);
65 static const std::map<std::string, ev_solver_t> map_to_type = {
70 if (map_to_type.count(name__) == 0) {
72 s <<
"wrong label of eigen-solver : " << name__;
76 return map_to_type.at(name__);
121 virtual int solve(ftn_int matrix_size__,
dmatrix<std::complex<double>>& A__,
double* eval__,
122 dmatrix<std::complex<double>>& Z__)
136 virtual int solve(ftn_int matrix_size__,
dmatrix<std::complex<float>>& A__,
float* eval__,
137 dmatrix<std::complex<float>>& Z__)
151 virtual int solve(ftn_int matrix_size__, ftn_int nev__,
dmatrix<std::complex<double>>& A__,
double* eval__,
dmatrix<std::complex<double>>& Z__)
165 virtual int solve(ftn_int matrix_size__, ftn_int nev__,
dmatrix<std::complex<float>>& A__,
float* eval__,
dmatrix<std::complex<float>>& Z__)
180 virtual int solve(ftn_int matrix_size__,
dmatrix<std::complex<double>>& A__,
dmatrix<std::complex<double>>& B__,
181 double* eval__,
dmatrix<std::complex<double>>& Z__)
196 virtual int solve(ftn_int matrix_size__,
dmatrix<std::complex<float>>& A__,
dmatrix<std::complex<float>>& B__,
197 float* eval__,
dmatrix<std::complex<float>>& Z__)
212 virtual int solve(ftn_int matrix_size__, ftn_int nev__,
dmatrix<std::complex<double>>& A__,
213 dmatrix<std::complex<double>>& B__,
double* eval__,
dmatrix<std::complex<double>>& Z__)
228 virtual int solve(ftn_int matrix_size__, ftn_int nev__,
dmatrix<std::complex<float>>& A__,
229 dmatrix<std::complex<float>>& B__,
float* eval__,
dmatrix<std::complex<float>>& Z__)
260std::unique_ptr<Eigensolver>
261Eigensolver_factory(std::string name__);
Interface to different eigen-solvers.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< std::complex< double > > &A__, dmatrix< std::complex< double > > &B__, double *eval__, dmatrix< std::complex< double > > &Z__)
Solve a generalized eigen-value problem for N lowest eigen-pairs.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< std::complex< float > > &A__, float *eval__, dmatrix< std::complex< float > > &Z__)
Solve a standard eigen-value problem of a sub-matrix for N lowest eigen-pairs.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< std::complex< double > > &A__, double *eval__, dmatrix< std::complex< double > > &Z__)
Solve a standard eigen-value problem of a sub-matrix for N lowest eigen-pairs.
virtual int solve(ftn_int matrix_size__, dmatrix< float > &A__, float *eval__, dmatrix< float > &Z__)
Solve a standard eigen-value problem for all eigen-pairs.
const std::string error_msg_not_implemented
Common error message.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< std::complex< float > > &A__, dmatrix< std::complex< float > > &B__, float *eval__, dmatrix< std::complex< float > > &Z__)
Solve a generalized eigen-value problem for N lowest eigen-pairs.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< double > &A__, dmatrix< double > &B__, double *eval__, dmatrix< double > &Z__)
Solve a generalized eigen-value problem for N lowest eigen-pairs.
ev_solver_t type() const
Type of eigen-solver.
ev_solver_t ev_solver_type_
Type of the eigen-value solver.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< float > &A__, dmatrix< float > &B__, float *eval__, dmatrix< float > &Z__)
Solve a generalized eigen-value problem for N lowest eigen-pairs.
sddk::memory_t data_memory_t_
Type of input data memory.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< float > &A__, float *eval__, dmatrix< float > &Z__)
Solve a standard eigen-value problem of a sub-matrix for N lowest eigen-pairs.
virtual int solve(ftn_int matrix_size__, dmatrix< std::complex< float > > &A__, dmatrix< std::complex< float > > &B__, float *eval__, dmatrix< std::complex< float > > &Z__)
Solve a generalized eigen-value problem for all eigen-pairs.
virtual int solve(ftn_int matrix_size__, dmatrix< std::complex< double > > &A__, dmatrix< std::complex< double > > &B__, double *eval__, dmatrix< std::complex< double > > &Z__)
Solve a generalized eigen-value problem for all eigen-pairs.
sddk::memory_t host_memory_t() const
Type of host memory, required by the solver.
virtual int solve(ftn_int matrix_size__, dmatrix< double > &A__, double *eval__, dmatrix< double > &Z__)
Solve a standard eigen-value problem for all eigen-pairs.
sddk::memory_t data_memory_t() const
Type of input memory for the solver.
Eigensolver(ev_solver_t type__, bool is_parallel__, sddk::memory_t host_memory_t__, sddk::memory_t data_memory_t__)
Constructor.
virtual int solve(ftn_int matrix_size__, dmatrix< float > &A__, dmatrix< float > &B__, float *eval__, dmatrix< float > &Z__)
Solve a generalized eigen-value problem for all eigen-pairs.
sddk::memory_t host_memory_t_
Type of host memory needed for the solver.
virtual ~Eigensolver()
Destructor.
virtual int solve(ftn_int matrix_size__, dmatrix< std::complex< float > > &A__, float *eval__, dmatrix< std::complex< float > > &Z__)
Solve a standard eigen-value problem for all eigen-pairs.
bool is_parallel_
True if solver is MPI parallel.
bool is_parallel() const
Parallel or sequential solver.
virtual int solve(ftn_int matrix_size__, dmatrix< std::complex< double > > &A__, double *eval__, dmatrix< std::complex< double > > &Z__)
Solve a standard eigen-value problem for all eigen-pairs.
virtual int solve(ftn_int matrix_size__, ftn_int nev__, dmatrix< double > &A__, double *eval__, dmatrix< double > &Z__)
Solve a standard eigen-value problem of a sub-matrix for N lowest eigen-pairs.
virtual int solve(ftn_int matrix_size__, dmatrix< double > &A__, dmatrix< double > &B__, double *eval__, dmatrix< double > &Z__)
Solve a generalized eigen-value problem for all eigen-pairs.
Contains definition and implementation of distributed matrix class.
Memory management functions and classes.
memory_t
Memory types where the code can store data.
ev_solver_t get_ev_solver_t(std::string name__)
Get type of an eigen solver by name (provided as a string).
ev_solver_t
Type of eigen-value solver.
@ magma_gpu
MAGMA with GPU pointers.
@ cusolver
CUDA eigen-solver.
@ magma
MAGMA with CPU pointers.
std::enable_if_t< std::is_same< T, real_type< F > >::value, void > transform(::spla::Context &spla_ctx__, sddk::memory_t mem__, la::dmatrix< F > const &M__, int irow0__, int jcol0__, real_type< F > alpha__, Wave_functions< T > const &wf_in__, spin_index s_in__, band_range br_in__, real_type< F > beta__, Wave_functions< T > &wf_out__, spin_index s_out__, band_range br_out__)
Apply linear transformation to the wave-functions.
Namespace of the SIRIUS library.