monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
monolish_generalized_eigen.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <omp.h>
3 #include <vector>
4 
5 #if defined USE_MPI
6 #include <mpi.h>
7 #endif
8 
9 #include "./monolish_solver.hpp"
11 
12 namespace monolish {
13 
17 namespace generalized_eigen {
18 
34 template <typename MATRIX, typename Float>
35 class LOBPCG : public solver::solver<MATRIX, Float> {
36 private:
37  // TODO: support multiple lambda(eigenvalue)s
38  int monolish_LOBPCG(MATRIX &A, MATRIX &B, vector<Float> &lambda,
39  matrix::Dense<Float> &x, int itype);
40 
41 public:
42  int solve(MATRIX &A, MATRIX &B, vector<Float> &lambda,
43  matrix::Dense<Float> &x, int itype);
44 
45  void create_precond(MATRIX &A) {
46  throw std::runtime_error("this precond. is not impl.");
47  }
48 
50  throw std::runtime_error("this precond. is not impl.");
51  }
52 
60  std::string name() const { return "monolish::generalized_eigen::LOBPCG"; }
61 };
62 
78 template <typename MATRIX, typename Float>
79 class DC : public solver::solver<MATRIX, Float> {
80 private:
81  int LAPACK_DC(MATRIX &A, MATRIX &B, vector<Float> &lambda, int itype);
82 
83 public:
84  int solve(MATRIX &A, MATRIX &B, vector<Float> &lambda, int itype);
85 
86  void create_precond(MATRIX &A) {
87  throw std::runtime_error("this precond. is not impl.");
88  }
89 
91  throw std::runtime_error("this precond. is not impl.");
92  }
93 
101  std::string name() const { return "monolish::generalized_eigen::DC"; }
102 };
103 
104 } // namespace generalized_eigen
105 } // namespace monolish
monolish::generalized_eigen::LOBPCG
LOBPCG solver.
Definition: monolish_generalized_eigen.hpp:35
monolish::generalized_eigen::DC::LAPACK_DC
int LAPACK_DC(MATRIX &A, MATRIX &B, vector< Float > &lambda, int itype)
monolish::matrix::Dense
Dense format Matrix.
Definition: monolish_coo.hpp:28
monolish::generalized_eigen::LOBPCG::name
std::string name() const
get solver name "monolish::generalized_eigen::LOBPCG"
Definition: monolish_generalized_eigen.hpp:60
monolish_common.hpp
monolish::generalized_eigen::DC::name
std::string name() const
get solver name "monolish::generalized_eigen::DC"
Definition: monolish_generalized_eigen.hpp:101
monolish::solver::solver
solver base class
Definition: monolish_solver.hpp:33
monolish::generalized_eigen::DC
Devide and Conquer solver.
Definition: monolish_generalized_eigen.hpp:79
monolish
Definition: monolish_matrix_blas.hpp:9
monolish::generalized_eigen::DC::create_precond
void create_precond(MATRIX &A)
Definition: monolish_generalized_eigen.hpp:86
monolish::generalized_eigen::DC::solve
int solve(MATRIX &A, MATRIX &B, vector< Float > &lambda, int itype)
monolish_solver.hpp
monolish::generalized_eigen::LOBPCG::create_precond
void create_precond(MATRIX &A)
Definition: monolish_generalized_eigen.hpp:45
monolish::generalized_eigen::LOBPCG::monolish_LOBPCG
int monolish_LOBPCG(MATRIX &A, MATRIX &B, vector< Float > &lambda, matrix::Dense< Float > &x, int itype)
monolish::vector
vector class
Definition: monolish_coo.hpp:25
monolish::generalized_eigen::LOBPCG::solve
int solve(MATRIX &A, MATRIX &B, vector< Float > &lambda, matrix::Dense< Float > &x, int itype)
monolish::generalized_eigen::DC::apply_precond
void apply_precond(const vector< Float > &r, vector< Float > &z)
Definition: monolish_generalized_eigen.hpp:90
monolish::generalized_eigen::LOBPCG::apply_precond
void apply_precond(const vector< Float > &r, vector< Float > &z)
Definition: monolish_generalized_eigen.hpp:49