scipy.linalg — Linear algebra routines
The scipy.linalg submodule provides a small selection of linear
solvers that operate on numpy.ndarray objects.
Functions
- scipy.linalg.cho_solve(c: ndarray, b: ndarray) ndarray
Solve the linear system
A @ x = bgiven the Cholesky factorization ofA. Unlike CPython’sscipy.linalg.cho_solvethe function takes the Cholesky-factorised matrix directly rather than a(c, lower)tuple.- Parameters:
c – the Cholesky factor of
Aas a square two-dimensionalnumpy.ndarray.b – a one-dimensional
numpy.ndarraygiving the right-hand side.
- Returns:
the solution vector
xas a floatnumpy.ndarray.
- scipy.linalg.solve_triangular(a: ndarray, b: ndarray, lower: bool = False) ndarray
Solve the linear system
a @ x = bforxassuming thatais a triangular matrix.- Parameters:
a – a square two-dimensional
numpy.ndarray. Only the upper or lower triangle is read, depending on lower.b – a one-dimensional
numpy.ndarraygiving the right-hand side.lower – if
True, take the data from the lower triangle of a; otherwise from the upper triangle. DefaultFalse.
- Returns:
the solution vector
xas a floatnumpy.ndarray.
a itself need not be triangular: values outside the selected triangle are simply treated as zero. In that case
a @ xwill not reproduce b.