Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.9/dist-packages/scipy/linalg/__init__.py: 100%
26 statements
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-23 06:43 +0000
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-23 06:43 +0000
1"""
2====================================
3Linear algebra (:mod:`scipy.linalg`)
4====================================
6.. currentmodule:: scipy.linalg
8.. toctree::
9 :hidden:
11 linalg.blas
12 linalg.cython_blas
13 linalg.cython_lapack
14 linalg.interpolative
15 linalg.lapack
17Linear algebra functions.
19.. eventually, we should replace the numpy.linalg HTML link with just `numpy.linalg`
21.. seealso::
23 `numpy.linalg <https://www.numpy.org/devdocs/reference/routines.linalg.html>`__
24 for more linear algebra functions. Note that
25 although `scipy.linalg` imports most of them, identically named
26 functions from `scipy.linalg` may offer more or slightly differing
27 functionality.
30Basics
31======
33.. autosummary::
34 :toctree: generated/
36 inv - Find the inverse of a square matrix
37 solve - Solve a linear system of equations
38 solve_banded - Solve a banded linear system
39 solveh_banded - Solve a Hermitian or symmetric banded system
40 solve_circulant - Solve a circulant system
41 solve_triangular - Solve a triangular matrix
42 solve_toeplitz - Solve a toeplitz matrix
43 matmul_toeplitz - Multiply a Toeplitz matrix with an array.
44 det - Find the determinant of a square matrix
45 norm - Matrix and vector norm
46 lstsq - Solve a linear least-squares problem
47 pinv - Pseudo-inverse (Moore-Penrose) using lstsq
48 pinvh - Pseudo-inverse of hermitian matrix
49 kron - Kronecker product of two arrays
50 khatri_rao - Khatri-Rao product of two arrays
51 tril - Construct a lower-triangular matrix from a given matrix
52 triu - Construct an upper-triangular matrix from a given matrix
53 orthogonal_procrustes - Solve an orthogonal Procrustes problem
54 matrix_balance - Balance matrix entries with a similarity transformation
55 subspace_angles - Compute the subspace angles between two matrices
56 bandwidth - Return the lower and upper bandwidth of an array
57 issymmetric - Check if a square 2D array is symmetric
58 ishermitian - Check if a square 2D array is Hermitian
59 LinAlgError
60 LinAlgWarning
62Eigenvalue Problems
63===================
65.. autosummary::
66 :toctree: generated/
68 eig - Find the eigenvalues and eigenvectors of a square matrix
69 eigvals - Find just the eigenvalues of a square matrix
70 eigh - Find the e-vals and e-vectors of a Hermitian or symmetric matrix
71 eigvalsh - Find just the eigenvalues of a Hermitian or symmetric matrix
72 eig_banded - Find the eigenvalues and eigenvectors of a banded matrix
73 eigvals_banded - Find just the eigenvalues of a banded matrix
74 eigh_tridiagonal - Find the eigenvalues and eigenvectors of a tridiagonal matrix
75 eigvalsh_tridiagonal - Find just the eigenvalues of a tridiagonal matrix
77Decompositions
78==============
80.. autosummary::
81 :toctree: generated/
83 lu - LU decomposition of a matrix
84 lu_factor - LU decomposition returning unordered matrix and pivots
85 lu_solve - Solve Ax=b using back substitution with output of lu_factor
86 svd - Singular value decomposition of a matrix
87 svdvals - Singular values of a matrix
88 diagsvd - Construct matrix of singular values from output of svd
89 orth - Construct orthonormal basis for the range of A using svd
90 null_space - Construct orthonormal basis for the null space of A using svd
91 ldl - LDL.T decomposition of a Hermitian or a symmetric matrix.
92 cholesky - Cholesky decomposition of a matrix
93 cholesky_banded - Cholesky decomp. of a sym. or Hermitian banded matrix
94 cho_factor - Cholesky decomposition for use in solving a linear system
95 cho_solve - Solve previously factored linear system
96 cho_solve_banded - Solve previously factored banded linear system
97 polar - Compute the polar decomposition.
98 qr - QR decomposition of a matrix
99 qr_multiply - QR decomposition and multiplication by Q
100 qr_update - Rank k QR update
101 qr_delete - QR downdate on row or column deletion
102 qr_insert - QR update on row or column insertion
103 rq - RQ decomposition of a matrix
104 qz - QZ decomposition of a pair of matrices
105 ordqz - QZ decomposition of a pair of matrices with reordering
106 schur - Schur decomposition of a matrix
107 rsf2csf - Real to complex Schur form
108 hessenberg - Hessenberg form of a matrix
109 cdf2rdf - Complex diagonal form to real diagonal block form
110 cossin - Cosine sine decomposition of a unitary or orthogonal matrix
112.. seealso::
114 `scipy.linalg.interpolative` -- Interpolative matrix decompositions
117Matrix Functions
118================
120.. autosummary::
121 :toctree: generated/
123 expm - Matrix exponential
124 logm - Matrix logarithm
125 cosm - Matrix cosine
126 sinm - Matrix sine
127 tanm - Matrix tangent
128 coshm - Matrix hyperbolic cosine
129 sinhm - Matrix hyperbolic sine
130 tanhm - Matrix hyperbolic tangent
131 signm - Matrix sign
132 sqrtm - Matrix square root
133 funm - Evaluating an arbitrary matrix function
134 expm_frechet - Frechet derivative of the matrix exponential
135 expm_cond - Relative condition number of expm in the Frobenius norm
136 fractional_matrix_power - Fractional matrix power
139Matrix Equation Solvers
140=======================
142.. autosummary::
143 :toctree: generated/
145 solve_sylvester - Solve the Sylvester matrix equation
146 solve_continuous_are - Solve the continuous-time algebraic Riccati equation
147 solve_discrete_are - Solve the discrete-time algebraic Riccati equation
148 solve_continuous_lyapunov - Solve the continuous-time Lyapunov equation
149 solve_discrete_lyapunov - Solve the discrete-time Lyapunov equation
152Sketches and Random Projections
153===============================
155.. autosummary::
156 :toctree: generated/
158 clarkson_woodruff_transform - Applies the Clarkson Woodruff Sketch (a.k.a CountMin Sketch)
160Special Matrices
161================
163.. autosummary::
164 :toctree: generated/
166 block_diag - Construct a block diagonal matrix from submatrices
167 circulant - Circulant matrix
168 companion - Companion matrix
169 convolution_matrix - Convolution matrix
170 dft - Discrete Fourier transform matrix
171 fiedler - Fiedler matrix
172 fiedler_companion - Fiedler companion matrix
173 hadamard - Hadamard matrix of order 2**n
174 hankel - Hankel matrix
175 helmert - Helmert matrix
176 hilbert - Hilbert matrix
177 invhilbert - Inverse Hilbert matrix
178 leslie - Leslie matrix
179 pascal - Pascal matrix
180 invpascal - Inverse Pascal matrix
181 toeplitz - Toeplitz matrix
182 tri - Construct a matrix filled with ones at and below a given diagonal
184Low-level routines
185==================
187.. autosummary::
188 :toctree: generated/
190 get_blas_funcs
191 get_lapack_funcs
192 find_best_blas_type
194.. seealso::
196 `scipy.linalg.blas` -- Low-level BLAS functions
198 `scipy.linalg.lapack` -- Low-level LAPACK functions
200 `scipy.linalg.cython_blas` -- Low-level BLAS functions for Cython
202 `scipy.linalg.cython_lapack` -- Low-level LAPACK functions for Cython
204""" # noqa: E501
206from ._misc import *
207from ._cythonized_array_utils import *
208from ._basic import *
209from ._decomp import *
210from ._decomp_lu import *
211from ._decomp_ldl import *
212from ._decomp_cholesky import *
213from ._decomp_qr import *
214from ._decomp_qz import *
215from ._decomp_svd import *
216from ._decomp_schur import *
217from ._decomp_polar import *
218from ._matfuncs import *
219from .blas import *
220from .lapack import *
221from ._special_matrices import *
222from ._solvers import *
223from ._procrustes import *
224from ._decomp_update import *
225from ._sketches import *
226from ._decomp_cossin import *
228# Deprecated namespaces, to be removed in v2.0.0
229from . import (
230 decomp, decomp_cholesky, decomp_lu, decomp_qr, decomp_svd, decomp_schur,
231 basic, misc, special_matrices, flinalg, matfuncs
232)
234__all__ = [s for s in dir() if not s.startswith('_')]
237from scipy._lib._testutils import PytestTester
238test = PytestTester(__name__)
239del PytestTester