MCPcopy Create free account
hub / github.com/numpy/numpy / LinAlgError

Class LinAlgError

numpy/linalg/linalg.py:68–94  ·  view source on GitHub ↗

Generic Python-exception-derived object raised by linalg functions. General purpose exception class, derived from Python's ValueError class, programmatically raised in linalg functions when a Linear Algebra-related condition would prevent further correct execution of the functi

Source from the content-addressed store, hash-verified

66
67@set_module('numpy.linalg')
68class LinAlgError(ValueError):
69 """
70 Generic Python-exception-derived object raised by linalg functions.
71
72 General purpose exception class, derived from Python's ValueError
73 class, programmatically raised in linalg functions when a Linear
74 Algebra-related condition would prevent further correct execution of the
75 function.
76
77 Parameters
78 ----------
79 None
80
81 Examples
82 --------
83 >>> from numpy import linalg as LA
84 >>> LA.inv(np.zeros((2,2)))
85 Traceback (most recent call last):
86 File "<stdin>", line 1, in <module>
87 File "...linalg.py", line 350,
88 in inv return wrap(solve(a, identity(a.shape[0], dtype=a.dtype)))
89 File "...linalg.py", line 249,
90 in solve
91 raise LinAlgError('Singular matrix')
92 numpy.linalg.LinAlgError: Singular matrix
93
94 """
95
96
97def _determine_error_states():

Callers 13

_raise_linalgerror_lstsqFunction · 0.85
_raise_linalgerror_qrFunction · 0.85
_assert_2dFunction · 0.85
_assert_stacked_2dFunction · 0.85
_assert_stacked_squareFunction · 0.85
_assert_finiteFunction · 0.85
tensorsolveFunction · 0.85
condFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected