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

◆ trace_gen_inv_quad_form_ldlt() [2/4]

template<typename EigVec , typename T , typename EigMat , require_col_vector_t< EigVec > * = nullptr, require_all_not_st_var< EigVec, T, EigMat > * = nullptr>
return_type_t< EigVec, T, EigMat > stan::math::trace_gen_inv_quad_form_ldlt ( const EigVec &  D,
LDLT_factor< T > &  A,
const EigMat &  B 
)
inline

Compute the trace of an inverse quadratic form.

I.E., this computes trace(diag(D) B^T A^-1 B) where D is the diagonal of a diagonal matrix (diag(D) is the diagonal matrix itself) and the LDLT_factor of A is provided.

Template Parameters
EigVectype of the diagonal of first matrix
Ttype of matrix in the LDLT_factor
EigMattype of the B matrix
Parameters
Ddiagonal of multiplier
ALDLT_factor
Binner term in quadratic form
Returns
trace(diag(D) * B^T * A^-1 * B)
Exceptions
std::domain_errorif A cannot be multiplied by B or B cannot be multiplied by diag(D).

Definition at line 69 of file trace_gen_inv_quad_form_ldlt.hpp.