monolish  0.17.3-dev.16
MONOlithic LInear 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 #include "./monolish_solver.hpp"
7 
8 namespace monolish {
12 namespace standard_eigen {
13 
39 template <typename MATRIX, typename Float>
40 class LOBPCG : public solver::solver<MATRIX, Float> {
41 private:
42  // TODO: support multiple lambda(eigenvalue)s
43  [[nodiscard]] int monolish_LOBPCG(MATRIX &A, vector<Float> &lambda,
45 
46 public:
55  [[nodiscard]] int solve(MATRIX &A, vector<Float> &lambda,
57 
58  void create_precond(MATRIX &A) {
59  throw std::runtime_error("this precond. is not impl.");
60  }
61 
63  throw std::runtime_error("this precond. is not impl.");
64  }
65 
73  [[nodiscard]] std::string name() const {
74  return "monolish::standard_eigen::LOBPCG";
75  }
76 
84  [[nodiscard]] std::string solver_name() const { return "LOBPCG"; }
85 };
108 template <typename MATRIX, typename Float>
109 class DC : public solver::solver<MATRIX, Float> {
110 private:
111  [[nodiscard]] int LAPACK_DC(MATRIX &A, vector<Float> &lambda);
112 
113 public:
114  [[nodiscard]] int solve(MATRIX &A, vector<Float> &lambda);
115 
116  void create_precond(MATRIX &A) {
117  throw std::runtime_error("this precond. is not impl.");
118  }
119 
121  throw std::runtime_error("this precond. is not impl.");
122  }
123 
131  [[nodiscard]] std::string name() const {
132  return "monolish::standard_eigen::DC";
133  }
134 
142  [[nodiscard]] std::string solver_name() const { return "DC"; }
143 };
145 } // namespace standard_eigen
146 } // namespace monolish
Dense format Matrix.
int LAPACK_DC(MATRIX &A, vector< Float > &lambda)
std::string name() const
get solver name "monolish::standard_eigen::DC"
void apply_precond(const vector< Float > &r, vector< Float > &z)
int solve(MATRIX &A, vector< Float > &lambda)
std::string solver_name() const
get solver name "LOBPCG"
int solve(MATRIX &A, vector< Float > &lambda, matrix::Dense< Float > &x)
calculate eigenvalues and eigenvectors or A by LOBPCG method(lib=0: monolish)
int monolish_LOBPCG(MATRIX &A, vector< Float > &lambda, matrix::Dense< Float > &x)
std::string name() const
get solver name "monolish::standard_eigen::LOBPCG"
void apply_precond(const vector< Float > &r, vector< Float > &z)
std::string solver_name() const
get solver name "DC"
monolish namespaces