1 #ifndef STAN_MATH_REV_MAT_FUN_LDLT_ALLOC_HPP 2 #define STAN_MATH_REV_MAT_FUN_LDLT_ALLOC_HPP 20 template <
int R,
int C>
31 inline void compute(
const Eigen::Matrix<var, R, C> &A) {
32 Eigen::Matrix<double, R, C> Ad(A.rows(), A.cols());
35 variA_.resize(A.rows(), A.cols());
37 for (
size_t j = 0; j <
N_; j++) {
38 for (
size_t i = 0; i <
N_; i++) {
39 Ad(i, j) = A(i, j).val();
40 variA_(i, j) = A(i, j).vi_;
49 return ldlt_.vectorD().array().log().sum();
53 Eigen::LDLT<Eigen::Matrix<double, R, C> >
ldlt_;
Eigen::LDLT< Eigen::Matrix< double, R, C > > ldlt_
Eigen::Matrix< vari *, R, C > variA_
This object stores the actual (double typed) LDLT factorization of an Eigen::Matrix<var> along with p...
LDLT_alloc(const Eigen::Matrix< var, R, C > &A)
double log_abs_det() const
A chainable_alloc is an object which is constructed and destructed normally but the memory lifespan i...
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...