1#ifndef STAN_MATH_FWD_FUN_QUAD_FORM_HPP
2#define STAN_MATH_FWD_FUN_QUAD_FORM_HPP
27template <
typename EigMat1,
typename EigMat2,
28 require_all_eigen_t<EigMat1, EigMat2>* =
nullptr,
29 require_not_eigen_col_vector_t<EigMat2>* =
nullptr,
30 require_any_vt_fvar<EigMat1, EigMat2>* =
nullptr>
32 const EigMat1& A,
const EigMat2& B) {
35 const auto& B_ref =
to_ref(B);
51template <
typename EigMat,
typename ColVec, require_eigen_t<EigMat>* =
nullptr,
52 require_eigen_col_vector_t<ColVec>* =
nullptr,
53 require_any_vt_fvar<EigMat, ColVec>* =
nullptr>
58 const auto& B_ref =
to_ref(B);
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix 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.
typename promote_scalar_type< std::decay_t< T >, std::decay_t< S > >::type promote_scalar_t
auto multiply(const Mat1 &m1, const Mat2 &m2)
Return the product of the specified matrices.
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.
auto dot_product(const T_a &a, const T_b &b)
Returns the dot product of the specified vectors.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...