1 #ifndef STAN_MATH_REV_MAT_FUN_LDLT_FACTOR_HPP 2 #define STAN_MATH_REV_MAT_FUN_LDLT_FACTOR_HPP 45 template <
int R,
int C>
68 inline void compute(
const Eigen::Matrix<var, R, C> &A) {
84 #if EIGEN_VERSION_AT_LEAST(3, 3, 0) 85 template <
typename Rhs>
87 Eigen::Solve<Eigen::LDLT<Eigen::Matrix<double, R, C> >, Rhs>
88 solve(
const Eigen::MatrixBase<Rhs>& b)
const {
89 return alloc_->ldlt_.solve(b);
92 template <
typename Rhs>
94 Eigen::internal::solve_retval<Eigen::LDLT<Eigen::Matrix<double, R, C> >,
96 solve(
const Eigen::MatrixBase<Rhs>& b)
const {
97 return alloc_->ldlt_.solve(b);
109 ret = ret &&
alloc_->ldlt_.info() == Eigen::Success;
110 ret = ret &&
alloc_->ldlt_.isPositive();
111 ret = ret && (
alloc_->ldlt_.vectorD().array() > 0).all();
123 return alloc_->ldlt_.vectorD();
LDLT_factor(const Eigen::Matrix< var, R, C > &A)
void compute(const Eigen::Matrix< var, R, C > &A)
Use the LDLT_factor object to factorize a new matrix.
This object stores the actual (double typed) LDLT factorization of an Eigen::Matrix<var> along with p...
const Eigen::internal::solve_retval< ldlt_t, Rhs > solve(const Eigen::MatrixBase< Rhs > &b) const
Independent (input) and dependent (output) variables for gradients.
void compute(const matrix_t &A)
bool success() const
Determine whether the most recent factorization succeeded.
LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodi...
mdivide_left_ldlt_alloc< R1, C1, R2, C2 > * alloc_
void check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is square.
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.
LDLT_alloc< R, C > * alloc_
The LDLT_alloc object actually contains the factorization but is derived from the chainable_alloc cla...
Eigen::VectorXd vectorD() const
The entries of the diagonal matrix D.
LDLT_factor()
Default constructor.