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.4.4, created at 2024-03-22 06:44 +0000

1""" 

2==================================== 

3Linear algebra (:mod:`scipy.linalg`) 

4==================================== 

5 

6.. currentmodule:: scipy.linalg 

7 

8.. toctree:: 

9 :hidden: 

10 

11 linalg.blas 

12 linalg.cython_blas 

13 linalg.cython_lapack 

14 linalg.interpolative 

15 linalg.lapack 

16 

17Linear algebra functions. 

18 

19.. eventually, we should replace the numpy.linalg HTML link with just `numpy.linalg` 

20 

21.. seealso:: 

22 

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. 

28 

29 

30Basics 

31====== 

32 

33.. autosummary:: 

34 :toctree: generated/ 

35 

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 orthogonal_procrustes - Solve an orthogonal Procrustes problem 

52 matrix_balance - Balance matrix entries with a similarity transformation 

53 subspace_angles - Compute the subspace angles between two matrices 

54 bandwidth - Return the lower and upper bandwidth of an array 

55 issymmetric - Check if a square 2D array is symmetric 

56 ishermitian - Check if a square 2D array is Hermitian 

57 LinAlgError 

58 LinAlgWarning 

59 

60Eigenvalue Problems 

61=================== 

62 

63.. autosummary:: 

64 :toctree: generated/ 

65 

66 eig - Find the eigenvalues and eigenvectors of a square matrix 

67 eigvals - Find just the eigenvalues of a square matrix 

68 eigh - Find the e-vals and e-vectors of a Hermitian or symmetric matrix 

69 eigvalsh - Find just the eigenvalues of a Hermitian or symmetric matrix 

70 eig_banded - Find the eigenvalues and eigenvectors of a banded matrix 

71 eigvals_banded - Find just the eigenvalues of a banded matrix 

72 eigh_tridiagonal - Find the eigenvalues and eigenvectors of a tridiagonal matrix 

73 eigvalsh_tridiagonal - Find just the eigenvalues of a tridiagonal matrix 

74 

75Decompositions 

76============== 

77 

78.. autosummary:: 

79 :toctree: generated/ 

80 

81 lu - LU decomposition of a matrix 

82 lu_factor - LU decomposition returning unordered matrix and pivots 

83 lu_solve - Solve Ax=b using back substitution with output of lu_factor 

84 svd - Singular value decomposition of a matrix 

85 svdvals - Singular values of a matrix 

86 diagsvd - Construct matrix of singular values from output of svd 

87 orth - Construct orthonormal basis for the range of A using svd 

88 null_space - Construct orthonormal basis for the null space of A using svd 

89 ldl - LDL.T decomposition of a Hermitian or a symmetric matrix. 

90 cholesky - Cholesky decomposition of a matrix 

91 cholesky_banded - Cholesky decomp. of a sym. or Hermitian banded matrix 

92 cho_factor - Cholesky decomposition for use in solving a linear system 

93 cho_solve - Solve previously factored linear system 

94 cho_solve_banded - Solve previously factored banded linear system 

95 polar - Compute the polar decomposition. 

96 qr - QR decomposition of a matrix 

97 qr_multiply - QR decomposition and multiplication by Q 

98 qr_update - Rank k QR update 

99 qr_delete - QR downdate on row or column deletion 

100 qr_insert - QR update on row or column insertion 

101 rq - RQ decomposition of a matrix 

102 qz - QZ decomposition of a pair of matrices 

103 ordqz - QZ decomposition of a pair of matrices with reordering 

104 schur - Schur decomposition of a matrix 

105 rsf2csf - Real to complex Schur form 

106 hessenberg - Hessenberg form of a matrix 

107 cdf2rdf - Complex diagonal form to real diagonal block form 

108 cossin - Cosine sine decomposition of a unitary or orthogonal matrix 

109 

110.. seealso:: 

111 

112 `scipy.linalg.interpolative` -- Interpolative matrix decompositions 

113 

114 

115Matrix Functions 

116================ 

117 

118.. autosummary:: 

119 :toctree: generated/ 

120 

121 expm - Matrix exponential 

122 logm - Matrix logarithm 

123 cosm - Matrix cosine 

124 sinm - Matrix sine 

125 tanm - Matrix tangent 

126 coshm - Matrix hyperbolic cosine 

127 sinhm - Matrix hyperbolic sine 

128 tanhm - Matrix hyperbolic tangent 

129 signm - Matrix sign 

130 sqrtm - Matrix square root 

131 funm - Evaluating an arbitrary matrix function 

132 expm_frechet - Frechet derivative of the matrix exponential 

133 expm_cond - Relative condition number of expm in the Frobenius norm 

134 fractional_matrix_power - Fractional matrix power 

135 

136 

137Matrix Equation Solvers 

138======================= 

139 

140.. autosummary:: 

141 :toctree: generated/ 

142 

143 solve_sylvester - Solve the Sylvester matrix equation 

144 solve_continuous_are - Solve the continuous-time algebraic Riccati equation 

145 solve_discrete_are - Solve the discrete-time algebraic Riccati equation 

146 solve_continuous_lyapunov - Solve the continuous-time Lyapunov equation 

147 solve_discrete_lyapunov - Solve the discrete-time Lyapunov equation 

148 

149 

150Sketches and Random Projections 

151=============================== 

152 

153.. autosummary:: 

154 :toctree: generated/ 

155 

156 clarkson_woodruff_transform - Applies the Clarkson Woodruff Sketch (a.k.a CountMin Sketch) 

157 

158Special Matrices 

159================ 

160 

161.. autosummary:: 

162 :toctree: generated/ 

163 

164 block_diag - Construct a block diagonal matrix from submatrices 

165 circulant - Circulant matrix 

166 companion - Companion matrix 

167 convolution_matrix - Convolution matrix 

168 dft - Discrete Fourier transform matrix 

169 fiedler - Fiedler matrix 

170 fiedler_companion - Fiedler companion matrix 

171 hadamard - Hadamard matrix of order 2**n 

172 hankel - Hankel matrix 

173 helmert - Helmert matrix 

174 hilbert - Hilbert matrix 

175 invhilbert - Inverse Hilbert matrix 

176 leslie - Leslie matrix 

177 pascal - Pascal matrix 

178 invpascal - Inverse Pascal matrix 

179 toeplitz - Toeplitz matrix 

180 

181Low-level routines 

182================== 

183 

184.. autosummary:: 

185 :toctree: generated/ 

186 

187 get_blas_funcs 

188 get_lapack_funcs 

189 find_best_blas_type 

190 

191.. seealso:: 

192 

193 `scipy.linalg.blas` -- Low-level BLAS functions 

194 

195 `scipy.linalg.lapack` -- Low-level LAPACK functions 

196 

197 `scipy.linalg.cython_blas` -- Low-level BLAS functions for Cython 

198 

199 `scipy.linalg.cython_lapack` -- Low-level LAPACK functions for Cython 

200 

201""" # noqa: E501 

202 

203from ._misc import * 

204from ._cythonized_array_utils import * 

205from ._basic import * 

206from ._decomp import * 

207from ._decomp_lu import * 

208from ._decomp_ldl import * 

209from ._decomp_cholesky import * 

210from ._decomp_qr import * 

211from ._decomp_qz import * 

212from ._decomp_svd import * 

213from ._decomp_schur import * 

214from ._decomp_polar import * 

215from ._matfuncs import * 

216from .blas import * 

217from .lapack import * 

218from ._special_matrices import * 

219from ._solvers import * 

220from ._procrustes import * 

221from ._decomp_update import * 

222from ._sketches import * 

223from ._decomp_cossin import * 

224 

225# Deprecated namespaces, to be removed in v2.0.0 

226from . import ( 

227 decomp, decomp_cholesky, decomp_lu, decomp_qr, decomp_svd, decomp_schur, 

228 basic, misc, special_matrices, matfuncs, 

229) 

230 

231__all__ = [s for s in dir() if not s.startswith('_')] 

232 

233 

234from scipy._lib._testutils import PytestTester 

235test = PytestTester(__name__) 

236del PytestTester