1 #ifndef STAN_MATH_REV_MAT_FUN_LOG_DETERMINANT_LDLT_HPP
2 #define STAN_MATH_REV_MAT_FUN_LOG_DETERMINANT_LDLT_HPP
22 template<
int R,
int C>
23 class log_det_ldlt_vari :
public vari {
25 explicit log_det_ldlt_vari(
const LDLT_factor<var, R, C> &A)
29 virtual void chain() {
30 Eigen::Matrix<double, R, C> invA;
38 alloc_ldlt_->variA_(i, j)->adj_ += adj_ * invA(i, j);
47 template<
int R,
int C>
49 return var(
new log_det_ldlt_vari<R, C>(A));
A template specialization of src/stan/math/matrix/LDLT_factor.hpp for var which can be used with all ...
Independent (input) and dependent (output) variables for gradients.
mdivide_left_ldlt_alloc< R1, C1, R2, C2 > * alloc_
const LDLT_alloc< R, C > * alloc_ldlt_
T log_determinant_ldlt(LDLT_factor< T, R, C > &A)