monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
monolish_standard_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 standard_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, vector<Float> &lambda,
40 
41 public:
50  int solve(MATRIX &A, vector<Float> &lambda, matrix::Dense<Float> &x);
51 
52  void create_precond(MATRIX &A) {
53  throw std::runtime_error("this precond. is not impl.");
54  }
55 
57  throw std::runtime_error("this precond. is not impl.");
58  }
59 
67  std::string name() const { return "monolish::standard_eigen::LOBPCG"; }
68 };
69 
85 template <typename MATRIX, typename Float>
86 class DC : public solver::solver<MATRIX, Float> {
87 private:
88  int LAPACK_DC(MATRIX &A, vector<Float> &lambda);
89 
90 public:
91  int solve(MATRIX &A, vector<Float> &lambda);
92 
93  void create_precond(MATRIX &A) {
94  throw std::runtime_error("this precond. is not impl.");
95  }
96 
98  throw std::runtime_error("this precond. is not impl.");
99  }
100 
108  std::string name() const { return "monolish::standard_eigen::DC"; }
109 };
110 
111 } // namespace standard_eigen
112 } // namespace monolish
monolish::standard_eigen::DC::apply_precond
void apply_precond(const vector< Float > &r, vector< Float > &z)
Definition: monolish_standard_eigen.hpp:97
monolish::standard_eigen::LOBPCG::name
std::string name() const
get solver name "monolish::standard_eigen::LOBPCG"
Definition: monolish_standard_eigen.hpp:67
monolish::standard_eigen::DC::LAPACK_DC
int LAPACK_DC(MATRIX &A, vector< Float > &lambda)
monolish::standard_eigen::LOBPCG::apply_precond
void apply_precond(const vector< Float > &r, vector< Float > &z)
Definition: monolish_standard_eigen.hpp:56
monolish::standard_eigen::LOBPCG
LOBPCG solver.
Definition: monolish_standard_eigen.hpp:35
monolish::standard_eigen::DC::solve
int solve(MATRIX &A, vector< Float > &lambda)
monolish::matrix::Dense
Dense format Matrix.
Definition: monolish_coo.hpp:28
monolish::standard_eigen::LOBPCG::monolish_LOBPCG
int monolish_LOBPCG(MATRIX &A, vector< Float > &lambda, matrix::Dense< Float > &x)
monolish_common.hpp
monolish::standard_eigen::LOBPCG::create_precond
void create_precond(MATRIX &A)
Definition: monolish_standard_eigen.hpp:52
monolish::solver::solver
solver base class
Definition: monolish_solver.hpp:33
monolish::standard_eigen::DC::name
std::string name() const
get solver name "monolish::standard_eigen::DC"
Definition: monolish_standard_eigen.hpp:108
monolish
Definition: monolish_matrix_blas.hpp:9
monolish::standard_eigen::DC
Devide and Conquer solver.
Definition: monolish_standard_eigen.hpp:86
monolish_solver.hpp
monolish::standard_eigen::LOBPCG::solve
int solve(MATRIX &A, vector< Float > &lambda, matrix::Dense< Float > &x)
calculate eigenvalues and eigenvectors or A by LOBPCG method(lib=0: monolish)
monolish::vector
vector class
Definition: monolish_coo.hpp:25
monolish::standard_eigen::DC::create_precond
void create_precond(MATRIX &A)
Definition: monolish_standard_eigen.hpp:93