1 #ifndef STAN_MATH_REV_MAT_FUN_LDLT_ALLOC_HPP
2 #define STAN_MATH_REV_MAT_FUN_LDLT_ALLOC_HPP
19 template<
int R,
int C>
32 inline void compute(
const Eigen::Matrix<var, R, C> &A) {
33 Eigen::Matrix<double, R, C> Ad(A.rows(), A.cols());
36 variA_.resize(A.rows(), A.cols());
38 for (
size_t j = 0; j <
N_; j++) {
39 for (
size_t i = 0; i <
N_; i++) {
40 Ad(i, j) = A(i, j).val();
41 variA_(i, j) = A(i, j).vi_;
50 return ldlt_.vectorD().array().log().sum();
54 Eigen::LDLT<Eigen::Matrix<double, R, C> >
ldlt_;
Eigen::LDLT< Eigen::Matrix< double, R, C > > ldlt_
This object stores the actual (double typed) LDLT factorization of an Eigen::Matrix along with p...
LDLT_alloc(const Eigen::Matrix< var, R, C > &A)
A chainable_alloc is an object which is constructed and destructed normally but the memory lifespan i...
double log_abs_det() const
Eigen::Matrix< vari *, R, C > variA_
void compute(const Eigen::Matrix< var, R, C > &A)
Compute the LDLT factorization and store pointers to the vari's of the matrix entries to be used when...