2 #ifndef LSST_JOINTCAL_EIGENSTUFF_H 3 #define LSST_JOINTCAL_EIGENSTUFF_H 7 #include "Eigen/CholmodSupport" 10 typedef Eigen::Matrix<double, Eigen::Dynamic, 2>
MatrixX2d;
23 template <
typename _MatrixType,
int _UpLo = Eigen::Lower>
25 :
public Eigen::CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT2<_MatrixType, _UpLo>> {
26 typedef Eigen::CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT2> Base;
27 using Base::m_cholmod;
31 typedef typename MatrixType::Index
Index;
38 this->compute(matrix);
44 Index
const size = Base::m_cholmodFactor->n;
45 EIGEN_UNUSED_VARIABLE(size);
46 eigen_assert(size == H.rows());
48 cholmod_sparse C_cs = viewAsCholmod(H);
51 cholmod_sparse *C_cs_perm =
52 cholmod_submatrix(&C_cs, (
int *)Base::m_cholmodFactor->Perm, Base::m_cholmodFactor->n,
53 nullptr, -1,
true,
true, &this->cholmod());
55 int isOk = cholmod_updown(UpOrDown, C_cs_perm, Base::m_cholmodFactor, &this->cholmod());
56 cholmod_free_sparse(&C_cs_perm, &this->cholmod());
64 m_cholmod.final_asis = 1;
65 m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
68 Base::m_shiftOffset[0] = Base::m_shiftOffset[1] =
RealScalar(0.0);
72 #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,...)