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

◆ trace_quad_form() [3/3]

template<typename Mat1 , typename Mat2 , require_all_matrix_t< Mat1, Mat2 > * = nullptr, require_any_var_matrix_t< Mat1, Mat2 > * = nullptr>
var stan::math::trace_quad_form ( const Mat1 &  A,
const Mat2 &  B 
)
inline

Compute trace(B^T A B).

This overload handles arguments where one of Mat1 or Mat2 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
Mat1type of the first matrix
Mat2type of the second matrix
Parameters
Amatrix
Bmatrix
Returns
The trace of B^T A B
Exceptions
std::domain_errorif A is not square
std::domain_errorif A cannot be multiplied by B

Definition at line 118 of file trace_quad_form.hpp.