8000 DOC: Added notes on error handling. · numpy/numpy@6e352ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e352ad

Browse files
ovillellaspv
ovillellas
authored andcommitted
DOC: Added notes on error handling.
1 parent bca1bbe commit 6e352ad

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

numpy/core/src/umath/gufuncs_linalg.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
appropriate kernel depending on the parameters. All wrappers forward the keyword
1414
parameters to the underlying generalized ufunc (the kernel).
1515
16+
The functions are intended to be used on arrays of functions. For those
17+
functions where a result may not be possible to obtain (like the inverse of
18+
a matrix that is not invertible) no exception is raised, but the results for
19+
the elements involved are set to NaN.
20+
1621
Additional functions some fused arithmetic, useful for efficient operation over
1722
"""
1823

@@ -283,7 +288,7 @@ def inv(a, **kwargs):
283288
Implemented for types single, double, csingle and cdouble. Numpy conversion
284289
rules apply.
285290
286-
Singular matrices and thus, not invertible, result in an array of NANs.
291+
Singular matrices and thus, not invertible, result in an array of NaNs.
287292
288293
See Also
289294
--------
@@ -328,6 +333,7 @@ def cholesky(a, UPLO='L', **kwargs):
328333
See Also
329334
--------
330335
chosolve : solve a system using cholesky decomposition
336+
poinv : compute the inverse of a matrix using cholesky decomposition
331337
332338
Notes
333339
-----
@@ -336,6 +342,10 @@ def cholesky(a, UPLO='L', **kwargs):
336342
Implemented for types single, double, csingle and cdouble. Numpy conversion
337343
rules apply.
338344
345+
Decomposition is performed using LAPACK routine _potrf.
346+
347+
For elements where the LAPACK routine fails, the result will be set to NaNs.
348+
339349
If an element of the source array is not a positive-definite matrix the
340350
result for that element is undefined.
341351
@@ -404,6 +414,9 @@ def eig(a, **kwargs):
404414
This is implemented using the _geev LAPACK routines which compute
405415
the eigenvalues and eigenvectors of general square arrays.
406416
417+
For elements where the LAPACK routine fails, the result will be set
418+
to NaNs.
419+
407420
Examples
408421
--------
409422
@@ -481,6 +494,9 @@ def eigvals(a, **kwargs):
481494
This is implemented using the _geev LAPACK routines which compute
482495
the eigenvalues and eigenvectors of general square arrays.
483496
497+
For elements where the LAPACK routine fails, the result will be set
498+
to NaNs.
499+
484500
Examples
485501
--------
486502
@@ -846,6 +862,9 @@ def eigh(A, UPLO='L', **kw_args):
846862
The eigenvalues/eigenvectors are computed using LAPACK routines _ssyevd,
847863
_heevd
848864
865+
For elements where the LAPACK routine fails, the result will be set
866+
to NaNs.
867+
849868
Implemented for single, double, csingle and cdouble. Numpy conversion
850869
rules apply.
851870
@@ -893,6 +912,9 @@ def eigvalsh(A, UPLO='L', **kw_args):
893912
894913
The eigenvalues are computed using LAPACK routines _ssyevd, _heevd
895914
915+
For elements where the LAPACK routine fails, the result will be set
916+
to NaNs.
917+
896918
Implemented for single, double, csingle and cdouble. Numpy conversion
897919
rules apply.
898920
@@ -939,6 +961,9 @@ def solve(A,B,**kw_args):
939961
940962
The solutions are computed using LAPACK routine _gesv
941963
964+
For elements where the LAPACK routine fails, the result will be set
965+
to NaNs.
966+
942967
Implemented for single, double, csingle and cdouble. Numpy conversion
943968
rules apply.
944969
@@ -996,6 +1021,9 @@ def svd(a, full_matrices=1, compute_uv=1 ,**kw_args):
9961021
9971022
Singular Value Decomposition is performed using LAPACK routine _gesdd
9981023
1024+
For elements where the LAPACK routine fails, the result will be set
1025+
to NaNs.
1026+
9991027
Implemented for types single, double, csingle and cdouble. Numpy conversion
10001028
rules apply.
10011029
@@ -1055,6 +1083,9 @@ def chosolve(A, B, UPLO='L', **kw_args):
10551083
10561084
The solutions are computed using LAPACK routines _potrf, _potrs
10571085
1086+
For elements where the LAPACK routine fails, the result will be set
1087+
to NaNs.
1088+
10581089
Implemented for single, double, csingle and cdouble. Numpy conversion
10591090
rules apply.
10601091
@@ -1106,6 +1137,9 @@ def poinv(A, UPLO='L', **kw_args):
11061137
11071138
The inverse is computed using LAPACK routines _potrf, _potri
11081139
1140+
For elements where the LAPACK routine fails, the result will be set
1141+
to NaNs.
1142+
11091143
Implemented for types single, double, csingle and cdouble. Numpy conversion
11101144
rules apply.
11111145

0 commit comments

Comments
 (0)
0