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;
49 template <
typename _MatrixType,
int _UpLo = Eigen::Lower>
51 :
public Eigen::CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT2<_MatrixType, _UpLo>> {
52 typedef Eigen::CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT2> Base;
53 using Base::m_cholmod;
57 typedef typename MatrixType::Index
Index;
64 this->compute(matrix);
70 Index
const size = Base::m_cholmodFactor->n;
71 EIGEN_UNUSED_VARIABLE(size);
72 eigen_assert(size == H.rows());
74 cholmod_sparse C_cs = viewAsCholmod(H);
78 cholmod_sparse *C_cs_perm =
79 cholmod_l_submatrix(&C_cs, (Eigen::Index*)Base::m_cholmodFactor->Perm,
80 Base::m_cholmodFactor->n,
nullptr, -1,
true,
true, &this->cholmod());
82 int isOk = cholmod_l_updown(UpOrDown, C_cs_perm, Base::m_cholmodFactor, &this->cholmod());
83 cholmod_l_free_sparse(&C_cs_perm, &this->cholmod());
91 m_cholmod.final_asis = 1;
92 m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
95 Base::m_shiftOffset[0] = Base::m_shiftOffset[1] =
RealScalar(0.0);
99 #endif // LSST_JOINTCAL_EIGENSTUFF_H
CholmodSimplicialLDLT2(MatrixType const &matrix)
void update(SparseMatrixD const &H, bool UpOrDown)
Eigen::SparseMatrix< double, 0, Eigen::Index > SparseMatrixD
std::vector< std::ptrdiff_t > IndexVector
MatrixType::RealScalar RealScalar
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Reports errors that are due to events beyond the control of the program.