1 #ifndef STAN__AGRAD__REV__MATRIX__TRACE_GEN_INV_QUAD_FORM_LDLT_HPP
2 #define STAN__AGRAD__REV__MATRIX__TRACE_GEN_INV_QUAD_FORM_LDLT_HPP
6 #include <boost/type_traits/is_same.hpp>
7 #include <boost/utility/enable_if.hpp>
20 template <
typename T1,
int R1,
int C1,
typename T2,
int R2,
int C2,
typename T3,
int R3,
int C3>
22 boost::enable_if_c<boost::is_same<T1,var>::value ||
23 boost::is_same<T2,var>::value ||
24 boost::is_same<T3,var>::value, var>::type
27 const Eigen::Matrix<T3,R3,C3> &B)
36 trace_inv_quad_form_ldlt_impl<T2,R2,C2,T3,R3,C3> *
_impl =
new trace_inv_quad_form_ldlt_impl<T2,R2,C2,T3,R3,C3>(D,A,B);
38 return var(
new trace_inv_quad_form_ldlt_vari<T2,R2,C2,T3,R3,C3>(_impl));
bool check_multiplicable(const char *function, const T1 &y1, const char *name1, const T2 &y2, const char *name2, T_result *result)
Independent (input) and dependent (output) variables for gradients.
boost::enable_if_c< boost::is_same< T1, var >::value||boost::is_same< T2, var >::value||boost::is_same< T3, var >::value, var >::type trace_gen_inv_quad_form_ldlt(const Eigen::Matrix< T1, R1, C1 > &D, const stan::math::LDLT_factor< T2, R2, C2 > &A, const Eigen::Matrix< T3, R3, C3 > &B)
Compute the trace of an inverse quadratic form.
bool check_square(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is square.