1 #ifndef STAN_MATH_PRIM_MAT_FUN_QUAD_FORM_SYM_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_QUAD_FORM_SYM_HPP 12 template <
int RA,
int CA,
int RB,
int CB,
typename T>
14 const Eigen::Matrix<T, RA, CA>& A,
const Eigen::Matrix<T, RB, CB>& B) {
18 Eigen::Matrix<T, CB, CB> ret(B.transpose() * A * B);
19 return T(0.5) * (ret + ret.transpose());
22 template <
int RA,
int CA,
int RB,
typename T>
24 const Eigen::Matrix<T, RB, 1>& B) {
void check_square(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is square.
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.
Eigen::Matrix< fvar< T >, CB, CB > quad_form_sym(const Eigen::Matrix< fvar< T >, RA, CA > &A, const Eigen::Matrix< double, RB, CB > &B)
void check_symmetric(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is symmetric.