1 #include "../../../include/monolish_blas.hpp"
2 #include "../../../include/monolish_equation.hpp"
3 #include "../../internal/lapack/monolish_lapack.hpp"
4 #include "../../internal/monolish_internal.hpp"
8 template <
typename MATRIX,
typename T>
16 #if MONOLISH_USE_GPU // gpu
18 ret = cusolver_Cholesky(A, x, b);
21 throw std::runtime_error(
"error solver.lib is not 1");
28 throw std::runtime_error(
"error Cholesky on CPU does not impl.");
34 template int equation::Cholesky<matrix::CRS<double>,
double>::solve(
35 matrix::CRS<double> &A, vector<double> &x, vector<double> &b);
36 template int equation::Cholesky<matrix::CRS<float>,
float>::solve(
37 matrix::CRS<float> &A, vector<float> &x, vector<float> &b);
46 throw std::runtime_error(
"error Dense Cholesky on GPU does not impl.");
54 if (internal::lapack::sytrf(A, ipiv) != 0) {
61 if (internal::lapack::sytrs(A, XB, ipiv) != 0) {
69 throw std::runtime_error(
"error solver.lib is not 1");
86 if (internal::lapack::sytrf(A, ipiv) != 0) {
93 if (internal::lapack::sytrs(A, XB, ipiv) != 0) {
101 throw std::runtime_error(
"error solver.lib is not 1");
120 if (internal::lapack::sytrf(A, ipiv) != 0) {
127 if (internal::lapack::sytrs(A, x, ipiv) != 0) {
135 throw std::runtime_error(
"error solver.lib is not 1");
154 if (internal::lapack::sytrf(A, ipiv) != 0) {
161 if (internal::lapack::sytrs(A, x, ipiv) != 0) {
169 throw std::runtime_error(
"error solver.lib is not 1");