![]() |
Stan
2.5.0
probability, sampling & optimization
|
LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodiff of things like log determinants and solutions to linear systems. More...
#include <LDLT_factor.hpp>
Public Types | |
| typedef size_t | size_type |
| typedef double | value_type |
Public Member Functions | |
| LDLT_factor () | |
| LDLT_factor (const Eigen::Matrix< T, R, C > &A) | |
| void | compute (const Eigen::Matrix< T, R, C > &A) |
| bool | success () const |
| T | log_abs_det () const |
| void | inverse (Eigen::Matrix< T, R, C > &invA) const |
| template<typename Rhs > | |
| const Eigen::internal::solve_retval < Eigen::LDLT< Eigen::Matrix < T, R, C > >, Rhs > | solve (const Eigen::MatrixBase< Rhs > &b) const |
| Eigen::Matrix< T, R, C > | solveRight (const Eigen::Matrix< T, R, C > &B) const |
| Eigen::Matrix< T, Eigen::Dynamic, 1 > | vectorD () const |
| Eigen::LDLT< Eigen::Matrix< T, R, C > > | matrixLDLT () const |
| size_t | rows () const |
| size_t | cols () const |
Public Attributes | |
| size_t | N_ |
| boost::shared_ptr< Eigen::LDLT < Eigen::Matrix< T, R, C > > > | _ldltP |
LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodiff of things like log determinants and solutions to linear systems.
After the constructor and/or compute() is called users of LDLT_factor are responsible for calling success() to check whether the factorization has succeeded. Use of an LDLT_factor object (e.g., in mdivide_left_ldlt) is undefined if success() is false.
It's usage pattern is:
Now, the caller should check that ldlt_A1.success() and ldlt_A2.success() are true or abort accordingly. Alternatively, call check_ldlt_factor().
Note that ldlt_A1 and ldlt_A2 are completely equivalent. They simply demonstrate two different ways to construct the factorization.
Now, the caller can use the LDLT_factor objects as needed. For instance
Definition at line 56 of file LDLT_factor.hpp.
| typedef size_t stan::math::LDLT_factor< T, R, C >::size_type |
Definition at line 111 of file LDLT_factor.hpp.
| typedef double stan::math::LDLT_factor< T, R, C >::value_type |
Definition at line 112 of file LDLT_factor.hpp.
|
inline |
Definition at line 58 of file LDLT_factor.hpp.
|
inline |
Definition at line 61 of file LDLT_factor.hpp.
|
inline |
Definition at line 109 of file LDLT_factor.hpp.
|
inline |
Definition at line 67 of file LDLT_factor.hpp.
|
inline |
Definition at line 85 of file LDLT_factor.hpp.
|
inline |
Definition at line 81 of file LDLT_factor.hpp.
|
inline |
Definition at line 104 of file LDLT_factor.hpp.
|
inline |
Definition at line 108 of file LDLT_factor.hpp.
|
inline |
Definition at line 92 of file LDLT_factor.hpp.
|
inline |
Definition at line 96 of file LDLT_factor.hpp.
|
inline |
Definition at line 73 of file LDLT_factor.hpp.
|
inline |
Definition at line 100 of file LDLT_factor.hpp.
| boost::shared_ptr< Eigen::LDLT< Eigen::Matrix<T,R,C> > > stan::math::LDLT_factor< T, R, C >::_ldltP |
Definition at line 115 of file LDLT_factor.hpp.
| size_t stan::math::LDLT_factor< T, R, C >::N_ |
Definition at line 114 of file LDLT_factor.hpp.