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

◆ quad_form_sym() [1/5]

template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr>
promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > 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.
Exceptions
std::invalid_argumentif A is not symmetric, or if A cannot be multiplied by B

Definition at line 30 of file quad_form_sym.hpp.