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

◆ trace_gen_inv_quad_form_ldlt() [4/4]

template<typename Td , typename Ta , typename Tb , require_col_vector_t< Td > * = nullptr, require_all_matrix_t< Ta, Tb > * = nullptr, require_any_st_var< Td, Ta, Tb > * = nullptr>
var stan::math::trace_gen_inv_quad_form_ldlt ( const Td &  D,
const LDLT_factor< Ta > &  A,
const Tb &  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
Tdtype of the diagonal of first matrix
Tatype of matrix in the LDLT_factor
Tbtype 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 190 of file trace_gen_inv_quad_form_ldlt.hpp.