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

◆ quad_form() [3/8]

template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr, require_all_vt_arithmetic< EigMat1, EigMat2 > * = nullptr>
auto stan::math::quad_form ( const EigMat1 &  A,
const EigMat2 &  B 
)
inline

Return the quadratic form \( B^T A B \).

Symmetry of the resulting matrix is not guaranteed due to numerical precision.

Template Parameters
EigMat1type of the first (square) matrix
EigMat2type of the second matrix
Parameters
Asquare matrix
Bsecond matrix
Returns
The quadratic form, which is a symmetric matrix.
Exceptions
std::invalid_argumentif A is not square, or if A cannot be multiplied by B

Definition at line 31 of file quad_form.hpp.