29#if defined(_RHEOLEF_HAVE_CHOLMOD)
33template<
class T,
class M>
42 using namespace Eigen;
43 Matrix<int,Dynamic,1> nnz_row (a.nrow());
45 for (
size_type i = 0, q = 0, n = a.nrow(); i < n; ++i) {
46 nnz_row[i] = ia[i+1] - ia[i];
48 SparseMatrix<T> a_tmp (a.nrow(),a.ncol());
49 a_tmp.reserve (nnz_row);
50 for (
size_type i = 0, n = a.nrow(); i < n; ++i) {
52 a_tmp.insert (i, (*p).first) = (*p).second;
55 a_tmp.makeCompressed();
57 check_macro (
_llt_a.info() == Success,
"cholmod LLt factorization failed: non-positive definite matrix");
63 _det.exponant =
_llt_a.logDeterminant() / log(
T(10));
67template<
class T,
class M>
72 if (
_a.nnz() == 0)
return x;
73 using namespace Eigen;
74 Map<Matrix<T,Dynamic,1> > b_map ((
T*)(&(*b.begin())), b.size()),
75 x_map ( &(*x.begin()), x.size());
76 x_map =
_llt_a.solve (b_map);
79template<
class T,
class M>
91#ifdef _RHEOLEF_HAVE_MPI
see the csr page for the full documentation
const solver_option & option() const
Eigen::CholmodDecomposition< Eigen::SparseMatrix< double > > _llt_a
void update_values(const csr< T, M > &a)
base::size_type size_type
vec< T, M > trans_solve(const vec< T, M > &rhs) const
vec< T, M > solve(const vec< T, M > &rhs) const
see the vec page for the full documentation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
void solve(tiny_matrix< T > &a, tiny_vector< size_t > &piv, const tiny_vector< T > &b, tiny_vector< T > &x)