Returns the Cholesky decomposition, :math:`A = L L^*` or :math:`A = U^* U` of a Hermitian positive-definite matrix A. Parameters ---------- a : (M, M) array_like Matrix to be decomposed lower : bool, optional Whether to compute the upper or lower triangular
(a, lower=False)
| 1293 | |
| 1294 | |
| 1295 | def cholesky(a, lower=False): |
| 1296 | """ |
| 1297 | Returns the Cholesky decomposition, :math:`A = L L^*` or |
| 1298 | :math:`A = U^* U` of a Hermitian positive-definite matrix A. |
| 1299 | |
| 1300 | Parameters |
| 1301 | ---------- |
| 1302 | a : (M, M) array_like |
| 1303 | Matrix to be decomposed |
| 1304 | lower : bool, optional |
| 1305 | Whether to compute the upper or lower triangular Cholesky |
| 1306 | factorization. Default is upper-triangular. |
| 1307 | |
| 1308 | Returns |
| 1309 | ------- |
| 1310 | c : (M, M) Array |
| 1311 | Upper- or lower-triangular Cholesky factor of `a`. |
| 1312 | """ |
| 1313 | |
| 1314 | l, u = _cholesky(a) |
| 1315 | if lower: |
| 1316 | return l |
| 1317 | else: |
| 1318 | return u |
| 1319 | |
| 1320 | |
| 1321 | def _cholesky(a): |
nothing calls this directly
no test coverage detected
searching dependent graphs…