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