Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ quad_form_sym() [5/5]

template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_any_vt_var< EigMat1, EigMat2 > * = nullptr>
auto stan::math::quad_form_sym ( const EigMat1 &  A,
const EigMat2 &  B 
)
inline

Return the quadratic form \( B^T A B \) of a symmetric matrix.

Symmetry of the resulting matrix is guaranteed.

Template Parameters
EigMat1type of the first (symmetric) matrix
EigMat2type of the second matrix
Parameters
Asymmetric matrix
Bsecond matrix
Returns
The quadratic form, which is a symmetric matrix of size Cb. If B is a column vector returns a scalar.
Exceptions
std::invalid_argumentif A is not symmetric, or if A cannot be multiplied by B

Definition at line 33 of file quad_form_sym.hpp.