1 #ifndef STAN_MATH_REV_MAT_FUN_LDLT_FACTOR_HPP
2 #define STAN_MATH_REV_MAT_FUN_LDLT_FACTOR_HPP
44 template<
int R,
int C>
54 explicit LDLT_factor(
const Eigen::Matrix<stan::math::var, R, C> &A)
67 inline void compute(
const Eigen::Matrix<stan::math::var, R, C> &A) {
83 template<
typename Rhs>
85 Eigen::internal::solve_retval<Eigen::LDLT<Eigen::Matrix<double, R, C> >,
87 solve(
const Eigen::MatrixBase<Rhs>& b)
const {
88 return _alloc->_ldlt.solve(b);
99 ret = ret &&
_alloc->_ldlt.info() == Eigen::Success;
100 ret = ret &&
_alloc->_ldlt.isPositive();
101 ret = ret && (
_alloc->_ldlt.vectorD().array() > 0).all();
113 return _alloc->_ldlt.vectorD();
LDLT_factor(const Eigen::Matrix< stan::math::var, R, C > &A)
void compute(const Eigen::Matrix< stan::math::var, R, C > &A)
Use the LDLT_factor object to factorize a new matrix.
stan::math::LDLT_alloc< R, C > * _alloc
The LDLT_alloc object actually contains the factorization but is derived from the chainable_alloc cla...
This object stores the actual (double typed) LDLT factorization of an Eigen::Matrix along with p...
Independent (input) and dependent (output) variables for gradients.
mdivide_left_ldlt_alloc< R1, C1, R2, C2 > * _alloc
stan::math::var value_type
Eigen::VectorXd vectorD() const
The entries of the diagonal matrix D.
LDLT_factor()
Default constructor.
const Eigen::internal::solve_retval< Eigen::LDLT< Eigen::Matrix< double, R, C > >, Rhs > solve(const Eigen::MatrixBase< Rhs > &b) const
Compute the actual numerical result of inv(A)*b.
bool success() const
Determine whether the most recent factorization succeeded.
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.