LSST Applications g180d380827+770a9040cc,g2079a07aa2+86d27d4dc4,g2305ad1205+09cfdadad9,g2bbee38e9b+c6a8a0fb72,g337abbeb29+c6a8a0fb72,g33d1c0ed96+c6a8a0fb72,g3a166c0a6a+c6a8a0fb72,g3ddfee87b4+1ea5e09c42,g48712c4677+7e2ea9cd42,g487adcacf7+301d09421d,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+96fcb956a6,g64a986408d+23540ee355,g858d7b2824+23540ee355,g864b0138d7+aa38e45daa,g95921f966b+d83dc58ecd,g991b906543+23540ee355,g99cad8db69+7f13b58a93,g9c22b2923f+e2510deafe,g9ddcbc5298+9a081db1e4,ga1e77700b3+03d07e1c1f,gb0e22166c9+60f28cb32d,gb23b769143+23540ee355,gba4ed39666+c2a2e4ac27,gbb8dafda3b+49e7449578,gbd998247f1+585e252eca,gc120e1dc64+1bbfa184e1,gc28159a63d+c6a8a0fb72,gc3e9b769f7+385ea95214,gcf0d15dbbd+1ea5e09c42,gdaeeff99f8+f9a426f77a,ge6526c86ff+1bccc98490,ge79ae78c31+c6a8a0fb72,gee10cc3b42+585e252eca,w.2024.18
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
CholmodSimplicialLDLT2< _MatrixType, _UpLo > Class Template Reference

#include <Eigenstuff.h>

Inheritance diagram for CholmodSimplicialLDLT2< _MatrixType, _UpLo >:

Public Types

using MatrixType = _MatrixType
 
using Index = typename MatrixType::Index
 
using RealScalar = typename MatrixType::RealScalar
 

Public Member Functions

 CholmodSimplicialLDLT2 ()
 
 CholmodSimplicialLDLT2 (MatrixType const &matrix)
 
void update (SparseMatrixD const &H, bool UpOrDown)
 

Protected Member Functions

void init ()
 

Detailed Description

template<typename _MatrixType, int _UpLo = Eigen::Lower>
class CholmodSimplicialLDLT2< _MatrixType, _UpLo >

Definition at line 50 of file Eigenstuff.h.

Member Typedef Documentation

◆ Index

template<typename _MatrixType , int _UpLo = Eigen::Lower>
using CholmodSimplicialLDLT2< _MatrixType, _UpLo >::Index = typename MatrixType::Index

Definition at line 57 of file Eigenstuff.h.

◆ MatrixType

template<typename _MatrixType , int _UpLo = Eigen::Lower>
using CholmodSimplicialLDLT2< _MatrixType, _UpLo >::MatrixType = _MatrixType

Definition at line 56 of file Eigenstuff.h.

◆ RealScalar

template<typename _MatrixType , int _UpLo = Eigen::Lower>
using CholmodSimplicialLDLT2< _MatrixType, _UpLo >::RealScalar = typename MatrixType::RealScalar

Definition at line 58 of file Eigenstuff.h.

Constructor & Destructor Documentation

◆ CholmodSimplicialLDLT2() [1/2]

template<typename _MatrixType , int _UpLo = Eigen::Lower>
CholmodSimplicialLDLT2< _MatrixType, _UpLo >::CholmodSimplicialLDLT2 ( )
inline

Definition at line 60 of file Eigenstuff.h.

60: Base() { init(); }

◆ CholmodSimplicialLDLT2() [2/2]

template<typename _MatrixType , int _UpLo = Eigen::Lower>
CholmodSimplicialLDLT2< _MatrixType, _UpLo >::CholmodSimplicialLDLT2 ( MatrixType const & matrix)
inline

Definition at line 62 of file Eigenstuff.h.

62 : Base() {
63 init();
64 this->compute(matrix);
65 }

Member Function Documentation

◆ init()

template<typename _MatrixType , int _UpLo = Eigen::Lower>
void CholmodSimplicialLDLT2< _MatrixType, _UpLo >::init ( )
inlineprotected

Definition at line 90 of file Eigenstuff.h.

90 {
91 m_cholmod.final_asis = 1;
92 m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
93 // In CholmodBase::CholmodBase(), the following statement is missing in
94 // SuiteSparse 3.2.0.8. Fixed in 3.2.7
95 Base::m_shiftOffset[0] = Base::m_shiftOffset[1] = RealScalar(0.0);
96 }
typename MatrixType::RealScalar RealScalar
Definition Eigenstuff.h:58

◆ update()

template<typename _MatrixType , int _UpLo = Eigen::Lower>
void CholmodSimplicialLDLT2< _MatrixType, _UpLo >::update ( SparseMatrixD const & H,
bool UpOrDown )
inline

Definition at line 68 of file Eigenstuff.h.

68 {
69 // check size
70 Index const size = Base::m_cholmodFactor->n;
71 EIGEN_UNUSED_VARIABLE(size);
72 eigen_assert(size == H.rows());
73
74 cholmod_sparse C_cs = viewAsCholmod(H);
75 /* We have to apply the magic permutation to the update matrix,
76 read page 117 of Cholmod UserGuide.pdf */
77 // Using cholmod_l_* functions instead of cholmod_* because index is Eigen::Index instead of int.
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());
81 assert(C_cs_perm);
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());
84 if (!isOk) {
85 throw(LSST_EXCEPT(lsst::pex::exceptions::RuntimeError, "cholmod_update failed!"));
86 }
87 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
typename MatrixType::Index Index
Definition Eigenstuff.h:57
Reports errors that are due to events beyond the control of the program.
Definition Runtime.h:104

The documentation for this class was generated from the following file: