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

◆ quad_form() [8/8]

template<typename Mat , typename Vec , require_matrix_t< Mat > * = nullptr, require_col_vector_t< Vec > * = nullptr, require_any_var_matrix_t< Mat, Vec > * = nullptr>
var stan::math::quad_form ( const Mat &  A,
const Vec &  B,
bool  symmetric = false 
)
inline

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

This overload handles arguments where one of Mat or Vec are var_value<T> where T is an Eigen type. The other type can also be a var_value, or it can be a type that inherits from EigenBase

Template Parameters
Mattype of the matrix
Vectype of the vector
Parameters
Asquare matrix
Bvector
symmetricindicates whether the output should be made symmetric
Returns
The quadratic form (a scalar).
Exceptions
std::invalid_argumentif A is not square, or if A cannot be multiplied by B

Definition at line 336 of file quad_form.hpp.