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
-
EigVec | type of the diagonal of first matrix |
T | type of matrix in the LDLT_factor |
EigMat | type of the B matrix |
- Parameters
-
D | diagonal of multiplier |
A | LDLT_factor |
B | inner term in quadratic form |
- Returns
- trace(diag(D) * B^T * A^-1 * B)
- Exceptions
-
std::domain_error | if 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.