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

◆ trace_gen_quad_form() [1/3]

template<typename TD , typename TA , typename TB , typename = require_all_eigen_t<TD, TA, TB>, typename = require_all_not_vt_var<TD, TA, TB>, typename = require_any_not_vt_arithmetic<TD, TA, TB>>
auto 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).`

Template Parameters
TDtype of the first matrix or expression
TAtype of the second matrix or expression
TBtype of the third matrix or expression
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 36 of file trace_gen_quad_form.hpp.