monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
precond.cpp
Go to the documentation of this file.
1 #include "../../include/monolish_blas.hpp"
2 #include "../../include/monolish_equation.hpp"
3 #include "../internal/monolish_internal.hpp"
4 
5 namespace monolish {
7 // solver set precond /////////////////////////////////
9 template <typename MATRIX, typename T>
10 template <class PRECOND>
12  Logger &logger = Logger::get_instance();
13  logger.util_in(monolish_func);
14  precond.create_precond =
15  std::bind(&PRECOND::create_precond, &p, std::placeholders::_1);
16  logger.util_out();
17 }
18 
19 // none
20 template void solver::solver<matrix::Dense<double>, double>::set_create_precond(
22 template void solver::solver<matrix::Dense<float>, float>::set_create_precond(
24 
25 template void solver::solver<matrix::CRS<double>, double>::set_create_precond(
27 template void solver::solver<matrix::CRS<float>, float>::set_create_precond(
29 
30 template void
31 solver::solver<matrix::LinearOperator<double>, double>::set_create_precond(
33 template void
34 solver::solver<matrix::LinearOperator<float>, float>::set_create_precond(
36 
37 // jacobi
38 template void solver::solver<matrix::Dense<double>, double>::set_create_precond(
40 template void solver::solver<matrix::Dense<float>, float>::set_create_precond(
42 
43 template void solver::solver<matrix::CRS<double>, double>::set_create_precond(
45 template void solver::solver<matrix::CRS<float>, float>::set_create_precond(
47 
49 template <typename MATRIX, typename T>
50 template <class PRECOND>
52  Logger &logger = Logger::get_instance();
53  logger.util_in(monolish_func);
54  precond.apply_precond =
55  std::bind(&PRECOND::apply_precond, &p, std::placeholders::_1,
56  std::placeholders::_2);
57  logger.util_out();
58 }
59 // none
60 template void solver::solver<matrix::Dense<double>, double>::set_apply_precond(
62 template void solver::solver<matrix::Dense<float>, float>::set_apply_precond(
64 
65 template void solver::solver<matrix::CRS<double>, double>::set_apply_precond(
67 template void solver::solver<matrix::CRS<float>, float>::set_apply_precond(
69 
70 template void
71 solver::solver<matrix::LinearOperator<double>, double>::set_apply_precond(
73 template void
74 solver::solver<matrix::LinearOperator<float>, float>::set_apply_precond(
76 
77 // jacobi
78 template void solver::solver<matrix::Dense<double>, double>::set_apply_precond(
80 template void solver::solver<matrix::Dense<float>, float>::set_apply_precond(
82 
83 template void solver::solver<matrix::CRS<double>, double>::set_apply_precond(
85 template void solver::solver<matrix::CRS<float>, float>::set_apply_precond(
87 } // namespace monolish
monolish::matrix::LinearOperator
Linear Operator imitating Matrix.
Definition: monolish_coo.hpp:30
monolish_func
#define monolish_func
Definition: monolish_logger.hpp:9
monolish::solver::solver::set_apply_precond
void set_apply_precond(PRECOND &p)
set precondition apply fucntion
Definition: precond.cpp:51
monolish::Logger
logger class (singleton, for developper class)
Definition: monolish_logger.hpp:19
monolish::matrix::Dense
Dense format Matrix.
Definition: monolish_coo.hpp:28
monolish::Logger::util_out
void util_out()
Definition: logger_utils.cpp:123
monolish::solver::solver
solver base class
Definition: monolish_solver.hpp:33
monolish::Logger::util_in
void util_in(const std::string func_name)
Definition: logger_utils.cpp:113
monolish
Definition: monolish_matrix_blas.hpp:9
monolish::solver::solver::set_create_precond
void set_create_precond(PRECOND &p)
set precondition create fucntion
Definition: precond.cpp:11
monolish::equation::none
none solver class(nothing to do)
Definition: monolish_equation.hpp:31
monolish::equation::Jacobi
Jacobi solver class.
Definition: monolish_equation.hpp:159
monolish::Logger::get_instance
static Logger & get_instance()
Definition: monolish_logger.hpp:42
monolish::matrix::CRS
Compressed Row Storage (CRS) format Matrix.
Definition: monolish_coo.hpp:29