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

◆ trace_gen_quad_form() [3/3]

template<typename Td , typename Ta , typename Tb , typename = require_any_var_t<value_type_t<Td>, value_type_t<Ta>, value_type_t<Tb>>, typename = require_all_eigen_t<Td, Ta, Tb>>
var stan::math::trace_gen_quad_form ( const Td &  D,
const Ta &  A,
const Tb &  B 
)
inline

Return the trace of D times the quadratic form of B and A.

That is, ‘trace_gen_quad_form(D, A, B) = trace(D * B’ * A * B).`

This overload requires one of D, A, or B to be a var_value<T> where T inherits from EigenBase

Template Parameters
TDtype of first matrix argument
TAtype of second matrix argument
TBtype of third matrix argument
Parameters
Dmultiplier
Aoutside term in quadratic form
Binner term in quadratic form
Returns
trace(D * B' * A * B)
Exceptions
std::domain_errorif A or D is not square
std::domain_errorif A cannot be multiplied by B or B cannot be multiplied by D.

Definition at line 92 of file trace_gen_quad_form.hpp.