1 #ifndef STAN_MATH_REV_MAT_FUN_TRACE_GEN_INV_QUAD_FORM_LDLT_HPP 2 #define STAN_MATH_REV_MAT_FUN_TRACE_GEN_INV_QUAD_FORM_LDLT_HPP 8 #include <boost/utility/enable_if.hpp> 21 template <
typename T1,
int R1,
int C1,
typename T2,
int R2,
int C2,
22 typename T3,
int R3,
int C3>
24 boost::enable_if_c<stan::is_var<T1>::value ||
29 const Eigen::Matrix<T3, R3, C3> &B) {
38 trace_inv_quad_form_ldlt_impl<T2, R2, C2, T3, R3, C3> *_impl
39 =
new trace_inv_quad_form_ldlt_impl<T2, R2, C2, T3, R3, C3>(D, A, B);
41 return var(
new trace_inv_quad_form_ldlt_vari<T2, R2, C2, T3, R3, C3>
Independent (input) and dependent (output) variables for gradients.
LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodi...
void check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Check if the matrices can be multiplied.
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.
boost::enable_if_c<!stan::is_var< T1 >::value &&!stan::is_var< T2 >::value &&!stan::is_var< T3 >::value, typename boost::math::tools::promote_args< T1, T2, T3 >::type >::type trace_gen_inv_quad_form_ldlt(const Eigen::Matrix< T1, R1, C1 > &D, const LDLT_factor< T2, R2, C2 > &A, const Eigen::Matrix< T3, R3, C3 > &B)