inv¶
- CholeskyFactor.inv()[source]¶
Compute the inverse of the matrix from its Cholesky factorization.
Warning
For most purposes, it is better to use
solve()instead of computing the inverse explicitly. The following two lines of code are mathematically equivalent:x = f.solve(b) x = f.inv() @ b # DO NOT USE
but the first line is both faster and more numerically stable.
- Returns:
Ainv (csc_array) – The inverse of the matrix A that was factorized.
See also
Notes
This function computes the inverse of the matrix A from its Cholesky factorization. If the factorization is in \(LL^T\) form, the inverse is computed as:
\[A^{-1} = P^{\top} L^{-\top} L^{-1} P,\]where P is the permutation matrix corresponding to the permutation vector returned by
get_perm(). If the factorization is in \(LDL^{\top}\) form, the inverse is computed as:\[A^{-1} = P^{\top} L^{-\top} D^{-1} L^{-1} P.\]Added in version 0.2.