sparsax.selinv¶
- sparsax.selinv(Ai, Aj, Ax, n)[source]¶
Selected inverse: entries of
A^{-1}atA’s sparsity pattern.Returns
zwithz[k] == (A^{-1})[Ai[k], Aj[k]], computed by Takahashi’s recurrence on the Cholesky factor without ever forming the dense inverse: one dense block at a time on a supernodal factor, one column at a time on a simplicial one. Shares the factorization cache withsolve()/logdet().This is the quantity
logdet()’s reverse-mode rule uses (d log|A| / dA = A^{-1}), exposed directly because the selected inverse is useful on its own — e.g. posterior marginal variancesdiag(A^{-1})of a Gaussian with precisionA, read off theAi == Ajentries.