34 static_assert(EigenMatrix::RawMatrixType::IsRowMajor,
35 "Sparse matrix is required to be in row major storage.");
40 if (!A.isCompressed())
44 int nnz = A.nonZeros();
45 int* ptr = A.outerIndexPtr();
46 int* col = A.innerIndexPtr();
47 double* data = A.valuePtr();
52 bool const status =
solve(lisA, lisb, lisx);
54 for (std::size_t i = 0; i < lisx.
size(); i++)
66 INFO(
"------------------------------------------------------------------");
67 INFO(
"*** LIS solver computation");
71 int ierr = lis_solver_create(&solver);
76 lis_solver_set_option(
const_cast<char*
>(
lis_options_.c_str()), solver);
78 INFO(
"-> number of threads: {:d}", (
int)omp_get_max_threads());
82 ierr = lis_solver_get_precon(solver, &precon);
87 INFO(
"-> precon: {:d}", precon);
91 ierr = lis_solver_get_solver(solver, &slv);
96 INFO(
"-> solver: {:d}", slv);
108 LIS_INT linear_solver_status;
109 ierr = lis_solver_get_status(solver, &linear_solver_status);
115 INFO(
"-> status: {:d}", linear_solver_status);
119 ierr = lis_solver_get_iter(solver, &iter);
125 INFO(
"-> iteration: {:d}", iter);
129 ierr = lis_solver_get_residualnorm(solver, &resid);
134 INFO(
"-> residual: {:g}", resid);
137 double time, itime, ptime, p_ctime, p_itime;
138 ierr = lis_solver_get_timeex(solver, &time, &itime, &ptime, &p_ctime,
144 INFO(
"-> time total (s): {:g}", time);
145 INFO(
"-> time iterations (s): {:g}", itime);
146 INFO(
"-> time preconditioning (s): {:g}", ptime);
147 INFO(
"-> time precond. create (s): {:g}", p_ctime);
148 INFO(
"-> time precond. iter (s): {:g}", p_itime);
152 ierr = lis_solver_destroy(solver);
157 INFO(
"------------------------------------------------------------------");
159 return linear_solver_status == LIS_SUCCESS;