Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/scipy/linalg/__init__.py: 100%

26 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-12-12 06:31 +0000

1""" 

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

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

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

5 

6.. currentmodule:: scipy.linalg 

7 

8Linear algebra functions. 

9 

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

11 

12.. seealso:: 

13 

14 `numpy.linalg <https://www.numpy.org/devdocs/reference/routines.linalg.html>`__ 

15 for more linear algebra functions. Note that 

16 although `scipy.linalg` imports most of them, identically named 

17 functions from `scipy.linalg` may offer more or slightly differing 

18 functionality. 

19 

20 

21Basics 

22====== 

23 

24.. autosummary:: 

25 :toctree: generated/ 

26 

27 inv - Find the inverse of a square matrix 

28 solve - Solve a linear system of equations 

29 solve_banded - Solve a banded linear system 

30 solveh_banded - Solve a Hermitian or symmetric banded system 

31 solve_circulant - Solve a circulant system 

32 solve_triangular - Solve a triangular matrix 

33 solve_toeplitz - Solve a toeplitz matrix 

34 matmul_toeplitz - Multiply a Toeplitz matrix with an array. 

35 det - Find the determinant of a square matrix 

36 norm - Matrix and vector norm 

37 lstsq - Solve a linear least-squares problem 

38 pinv - Pseudo-inverse (Moore-Penrose) using lstsq 

39 pinvh - Pseudo-inverse of hermitian matrix 

40 kron - Kronecker product of two arrays 

41 khatri_rao - Khatri-Rao product of two arrays 

42 tril - Construct a lower-triangular matrix from a given matrix 

43 triu - Construct an upper-triangular matrix from a given matrix 

44 orthogonal_procrustes - Solve an orthogonal Procrustes problem 

45 matrix_balance - Balance matrix entries with a similarity transformation 

46 subspace_angles - Compute the subspace angles between two matrices 

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

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

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

50 LinAlgError 

51 LinAlgWarning 

52 

53Eigenvalue Problems 

54=================== 

55 

56.. autosummary:: 

57 :toctree: generated/ 

58 

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

60 eigvals - Find just the eigenvalues of a square matrix 

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

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

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

64 eigvals_banded - Find just the eigenvalues of a banded matrix 

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

66 eigvalsh_tridiagonal - Find just the eigenvalues of a tridiagonal matrix 

67 

68Decompositions 

69============== 

70 

71.. autosummary:: 

72 :toctree: generated/ 

73 

74 lu - LU decomposition of a matrix 

75 lu_factor - LU decomposition returning unordered matrix and pivots 

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

77 svd - Singular value decomposition of a matrix 

78 svdvals - Singular values of a matrix 

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

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

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

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

83 cholesky - Cholesky decomposition of a matrix 

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

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

86 cho_solve - Solve previously factored linear system 

87 cho_solve_banded - Solve previously factored banded linear system 

88 polar - Compute the polar decomposition. 

89 qr - QR decomposition of a matrix 

90 qr_multiply - QR decomposition and multiplication by Q 

91 qr_update - Rank k QR update 

92 qr_delete - QR downdate on row or column deletion 

93 qr_insert - QR update on row or column insertion 

94 rq - RQ decomposition of a matrix 

95 qz - QZ decomposition of a pair of matrices 

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

97 schur - Schur decomposition of a matrix 

98 rsf2csf - Real to complex Schur form 

99 hessenberg - Hessenberg form of a matrix 

100 cdf2rdf - Complex diagonal form to real diagonal block form 

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

102 

103.. seealso:: 

104 

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

106 

107 

108Matrix Functions 

109================ 

110 

111.. autosummary:: 

112 :toctree: generated/ 

113 

114 expm - Matrix exponential 

115 logm - Matrix logarithm 

116 cosm - Matrix cosine 

117 sinm - Matrix sine 

118 tanm - Matrix tangent 

119 coshm - Matrix hyperbolic cosine 

120 sinhm - Matrix hyperbolic sine 

121 tanhm - Matrix hyperbolic tangent 

122 signm - Matrix sign 

123 sqrtm - Matrix square root 

124 funm - Evaluating an arbitrary matrix function 

125 expm_frechet - Frechet derivative of the matrix exponential 

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

127 fractional_matrix_power - Fractional matrix power 

128 

129 

130Matrix Equation Solvers 

131======================= 

132 

133.. autosummary:: 

134 :toctree: generated/ 

135 

136 solve_sylvester - Solve the Sylvester matrix equation 

137 solve_continuous_are - Solve the continuous-time algebraic Riccati equation 

138 solve_discrete_are - Solve the discrete-time algebraic Riccati equation 

139 solve_continuous_lyapunov - Solve the continuous-time Lyapunov equation 

140 solve_discrete_lyapunov - Solve the discrete-time Lyapunov equation 

141 

142 

143Sketches and Random Projections 

144=============================== 

145 

146.. autosummary:: 

147 :toctree: generated/ 

148 

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

150 

151Special Matrices 

152================ 

153 

154.. autosummary:: 

155 :toctree: generated/ 

156 

157 block_diag - Construct a block diagonal matrix from submatrices 

158 circulant - Circulant matrix 

159 companion - Companion matrix 

160 convolution_matrix - Convolution matrix 

161 dft - Discrete Fourier transform matrix 

162 fiedler - Fiedler matrix 

163 fiedler_companion - Fiedler companion matrix 

164 hadamard - Hadamard matrix of order 2**n 

165 hankel - Hankel matrix 

166 helmert - Helmert matrix 

167 hilbert - Hilbert matrix 

168 invhilbert - Inverse Hilbert matrix 

169 leslie - Leslie matrix 

170 pascal - Pascal matrix 

171 invpascal - Inverse Pascal matrix 

172 toeplitz - Toeplitz matrix 

173 tri - Construct a matrix filled with ones at and below a given diagonal 

174 

175Low-level routines 

176================== 

177 

178.. autosummary:: 

179 :toctree: generated/ 

180 

181 get_blas_funcs 

182 get_lapack_funcs 

183 find_best_blas_type 

184 

185.. seealso:: 

186 

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

188 

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

190 

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

192 

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

194 

195""" # noqa: E501 

196 

197from ._misc import * 

198from ._cythonized_array_utils import * 

199from ._basic import * 

200from ._decomp import * 

201from ._decomp_lu import * 

202from ._decomp_ldl import * 

203from ._decomp_cholesky import * 

204from ._decomp_qr import * 

205from ._decomp_qz import * 

206from ._decomp_svd import * 

207from ._decomp_schur import * 

208from ._decomp_polar import * 

209from ._matfuncs import * 

210from .blas import * 

211from .lapack import * 

212from ._special_matrices import * 

213from ._solvers import * 

214from ._procrustes import * 

215from ._decomp_update import * 

216from ._sketches import * 

217from ._decomp_cossin import * 

218 

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

220from . import ( 

221 decomp, decomp_cholesky, decomp_lu, decomp_qr, decomp_svd, decomp_schur, 

222 basic, misc, special_matrices, flinalg, matfuncs 

223) 

224 

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

226 

227 

228from scipy._lib._testutils import PytestTester 

229test = PytestTester(__name__) 

230del PytestTester