monolish
0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
src
equation
qr
qr.cpp
Go to the documentation of this file.
1
#include "../../../include/monolish_equation.hpp"
2
#include "../../internal/monolish_internal.hpp"
3
4
namespace
monolish
{
5
template
<
typename
MATRIX,
typename
T>
6
int
equation::QR<MATRIX, T>::solve
(MATRIX &A,
vector<T>
&x,
vector<T>
&b) {
7
Logger
&logger =
Logger::get_instance
();
8
logger.
func_in
(
monolish_func
);
9
10
int
ret = -1;
11
12
#if MONOLISH_USE_GPU // gpu
13
if
(lib == 1) {
14
ret = cusolver_QR(A, x, b);
15
}
else
{
16
logger.
func_out
();
17
throw
std::runtime_error(
"error solver.lib is not 1"
);
18
}
19
logger.
func_out
();
20
#else
21
(void)(&A);
22
(void)(&x);
23
(void)(&b);
24
throw
std::runtime_error(
"error Cholesky on CPU does not impl."
);
25
#endif
26
27
logger.
func_out
();
28
return
ret;
29
}
30
template
int
equation::QR<matrix::CRS<double>
,
double
>::solve(
31
matrix::CRS<double>
&A,
vector<double>
&x,
vector<double>
&b);
32
template
int
equation::QR<matrix::CRS<float>
,
float
>::solve(
33
matrix::CRS<float>
&A,
vector<float>
&x,
vector<float>
&b);
34
}
// namespace monolish
monolish_func
#define monolish_func
Definition:
monolish_logger.hpp:9
monolish::Logger
logger class (singleton, for developper class)
Definition:
monolish_logger.hpp:19
monolish::Logger::func_out
void func_out()
Definition:
logger_utils.cpp:80
monolish
Definition:
monolish_matrix_blas.hpp:9
monolish::equation::QR::solve
int solve(MATRIX &A, vector< Float > &x, vector< Float > &b)
solve Ax=b
Definition:
qr.cpp:6
monolish::equation::QR
QR solver class (Dense, GPU only now). can use set_tol(), get_tol(), set_reorder(),...
Definition:
monolish_equation.hpp:248
monolish::vector
vector class
Definition:
monolish_coo.hpp:25
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
monolish::Logger::func_in
void func_in(const std::string func_name)
Definition:
logger_utils.cpp:69
Generated by
1.8.17