1#ifndef STAN_MATH_REV_FUN_QUAD_FORM_SYM_HPP
2#define STAN_MATH_REV_FUN_QUAD_FORM_SYM_HPP
30template <
typename EigMat1,
typename EigMat2,
31 require_all_eigen_t<EigMat1, EigMat2>* =
nullptr,
32 require_any_vt_var<EigMat1, EigMat2>* =
nullptr>
35 const auto& A_ref =
to_ref(A);
void check_symmetric(const char *function, const char *name, const matrix_cl< T > &y)
Check if the matrix_cl is symmetric.
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.
promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > quad_form(const EigMat1 &A, const EigMat2 &B)
Return the quadratic form .
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > quad_form_sym(const EigMat1 &A, const EigMat2 &B)
Return the quadratic form of a symmetric matrix.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...