25 #ifndef LSST_JOINTCAL_EIGENSTUFF_H 26 #define LSST_JOINTCAL_EIGENSTUFF_H 30 #include "Eigen/CholmodSupport" 33 typedef Eigen::Matrix<double, Eigen::Dynamic, 2>
MatrixX2d;
46 template <
typename _MatrixType,
int _UpLo = Eigen::Lower>
48 :
public Eigen::CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT2<_MatrixType, _UpLo>> {
49 typedef Eigen::CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT2> Base;
50 using Base::m_cholmod;
54 typedef typename MatrixType::Index
Index;
61 this->compute(matrix);
67 Index
const size = Base::m_cholmodFactor->n;
68 EIGEN_UNUSED_VARIABLE(size);
69 eigen_assert(size == H.rows());
71 cholmod_sparse C_cs = viewAsCholmod(H);
74 cholmod_sparse *C_cs_perm =
75 cholmod_submatrix(&C_cs, (
int *)Base::m_cholmodFactor->Perm, Base::m_cholmodFactor->n,
76 nullptr, -1,
true,
true, &this->cholmod());
78 int isOk = cholmod_updown(UpOrDown, C_cs_perm, Base::m_cholmodFactor, &this->cholmod());
79 cholmod_free_sparse(&C_cs_perm, &this->cholmod());
87 m_cholmod.final_asis = 1;
88 m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
91 Base::m_shiftOffset[0] = Base::m_shiftOffset[1] =
RealScalar(0.0);
95 #endif // LSST_JOINTCAL_EIGENSTUFF_H Eigen::SparseMatrix< double > SparseMatrixD
CholmodSimplicialLDLT2(MatrixType const &matrix)
void update(SparseMatrixD const &H, bool UpOrDown)
MatrixType::RealScalar RealScalar
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
#define LSST_EXCEPT(type,...)