solve(a, b, sym_pos=False, lower=False, overwrite_a=False, overwrite_b=False, debug=None, check_finite=True, assume_a='gen', transposed=False)
If the data matrix is known to be a particular type then supplying the corresponding string to assume_a
key chooses the dedicated solver. The available options are
If the input b matrix is a 1-D array with N elements, when supplied together with an NxN input a, it is assumed as a valid column vector despite the apparent size mismatch. This is compatible with the numpy.dot() behavior and the returned result is still 1-D array.
The generic, symmetric, Hermitian and positive definite solutions are obtained via calling ?GESV, ?SYSV, ?HESV, and ?POSV routines of LAPACK respectively.
Square input data
Input data for the right hand side.
Assume a
is symmetric and positive definite. This key is deprecated and assume_a = 'pos' keyword is recommended instead. The functionality is the same. It will be removed in the future.
If True, only the data contained in the lower triangle of a
. Default is to use upper triangle. (ignored for 'gen'
)
Allow overwriting data in a
(may enhance performance). Default is False.
Allow overwriting data in b
(may enhance performance). Default is False.
Whether to check that the input matrices contain only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
Valid entries are explained above.
If True, a^T x = b
for real matrices, raises :None:None:`NotImplementedError`
for complex matrices (only for True).
If size mismatches detected or input a is not square.
If the matrix is singular.
If an ill-conditioned input a is detected.
If transposed is True and input a is a complex matrix.
The solution array.
Solves the linear equation set a * x = b
for the unknown x
for square a
matrix.
>>> a = np.array([[3, 2, 0], [1, -1, 0], [0, 5, 1]])
... b = np.array([2, 4, -1])
... from scipy import linalg
... x = linalg.solve(a, b)
... x array([ 2., -2., 9.])
>>> np.dot(a, x) == b array([ True, True, True], dtype=bool)See :
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.linalg._basic.solve
scipy.linalg._solvers.solve_discrete_are
scipy.linalg._basic.solve_circulant
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them