spsolve_triangular(A, b, lower=True, overwrite_A=False, overwrite_b=False, unit_diagonal=False)
A sparse square triangular matrix. Should be in CSR format.
Right-hand side matrix in A x = b
Whether A
is a lower or upper triangular matrix. Default is lower triangular matrix.
Allow changing A
. The indices of A
are going to be sorted and zero entries are going to be removed. Enabling gives a performance gain. Default is False.
Allow overwriting data in b
. Enabling gives a performance gain. Default is False. If :None:None:`overwrite_b`
is True, it should be ensured that b
has an appropriate dtype to be able to store the result.
If True, diagonal elements of a
are assumed to be 1 and will not be referenced.
If A
is singular or not triangular.
Solve the equation A x = b
for x
, assuming A is a triangular matrix.
>>> from scipy.sparse import csr_matrixSee :
... from scipy.sparse.linalg import spsolve_triangular
... A = csr_matrix([[3, 0, 0], [1, -1, 0], [2, 0, 1]], dtype=float)
... B = np.array([[2, 0], [-1, 0], [2, 0]], dtype=float)
... x = spsolve_triangular(A, B)
... np.allclose(A.dot(x), B) True
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.sparse.linalg._dsolve.linsolve.spsolve_triangular
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