Compute the inverse of a matrix with LU decomposition and forward / backward substitutions. Parameters ---------- a : array_like Square matrix to be inverted. Returns ------- ainv : Array Inverse of the matrix `a`.
(a)
| 1265 | |
| 1266 | |
| 1267 | def inv(a): |
| 1268 | """ |
| 1269 | Compute the inverse of a matrix with LU decomposition and |
| 1270 | forward / backward substitutions. |
| 1271 | |
| 1272 | Parameters |
| 1273 | ---------- |
| 1274 | a : array_like |
| 1275 | Square matrix to be inverted. |
| 1276 | |
| 1277 | Returns |
| 1278 | ------- |
| 1279 | ainv : Array |
| 1280 | Inverse of the matrix `a`. |
| 1281 | """ |
| 1282 | return solve(a, eye(a.shape[0], chunks=a.chunks[0][0])) |
| 1283 | |
| 1284 | |
| 1285 | def _cholesky_lower(a): |