1#ifndef STAN_MATH_PRIM_FUN_QUAD_FORM_DIAG_HPP
2#define STAN_MATH_PRIM_FUN_QUAD_FORM_DIAG_HPP
11template <
typename EigMat,
typename EigVec, require_eigen_t<EigMat>* =
nullptr,
12 require_eigen_vector_t<EigVec>* =
nullptr>
18 [](
const auto& v,
const auto& x) {
19 return v.asDiagonal() * x * v.asDiagonal();
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
auto quad_form_diag(const EigMat &mat, const EigVec &vec)
auto make_holder(const F &func, Args &&... args)
Constructs an expression from given arguments using given functor.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...