MCPcopy
hub / github.com/numpy/numpy / LinAlgError

Class LinAlgError

numpy/linalg/_linalg.py:114–140  ·  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

112
113@set_module('numpy.linalg')
114class LinAlgError(ValueError):
115 """
116 Generic Python-exception-derived object raised by linalg functions.
117
118 General purpose exception class, derived from Python's ValueError
119 class, programmatically raised in linalg functions when a Linear
120 Algebra-related condition would prevent further correct execution of the
121 function.
122
123 Parameters
124 ----------
125 None
126
127 Examples
128 --------
129 >>> from numpy import linalg as LA
130 >>> LA.inv(np.zeros((2,2)))
131 Traceback (most recent call last):
132 File "<stdin>", line 1, in <module>
133 File "...linalg.py", line 350,
134 in inv return wrap(solve(a, identity(a.shape[0], dtype=a.dtype)))
135 File "...linalg.py", line 249,
136 in solve
137 raise LinAlgError('Singular matrix')
138 numpy.linalg.LinAlgError: Singular matrix
139
140 """
141
142
143def _raise_linalgerror_singular(err, flag):

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…