23 #include "rheolef/mic.h"
25 #ifdef _RHEOLEF_HAVE_EIGEN
32 template<
class T,
class M>
36 using namespace Eigen;
37 Matrix<int,Dynamic,1> nnz_row (
a.nrow());
40 nnz_row[i] = ia[i+1] - ia[i];
42 SparseMatrix<T> a_tmp (
a.nrow(),
a.ncol());
44 a_tmp.reserve (nnz_row);
48 a_tmp.insert (i, (*p).first) = (*p).second;
51 a_tmp.makeCompressed();
53 _mic_a.setInitialShift (_shift);
54 _mic_a.compute (a_tmp);
55 check_macro (_mic_a.info() == Success,
"eigen MIC incomplete factorization failed");
58 template<
class T,
class M>
62 if (
b.dis_size() == 0)
return b;
64 using namespace Eigen;
65 Map<Matrix<T,Dynamic,1> > b_map ((
T*)(&(*
b.begin())),
b.size()),
66 x_map ( &(*x.begin()), x.size());
67 x_map = _mic_a.solve (b_map);
70 template<
class T,
class M>
82 #ifdef _RHEOLEF_HAVE_MPI
84 #endif // _RHEOLEF_HAVE_MPI