Python scipy linalg norm

scipy.linalg.norm#

This function is able to return one of eight different matrix norms, or one of an infinite number of vector norms (described below), depending on the value of the ord parameter. For tensors with rank different from 1 or 2, only ord=None is supported.

Parameters : a array_like

Input array. If axis is None, a must be 1-D or 2-D, unless ord is None. If both axis and ord are None, the 2-norm of a.ravel will be returned.

Order of the norm (see table under Notes ). inf means NumPy’s inf object.

If axis is an integer, it specifies the axis of a along which to compute the vector norms. If axis is a 2-tuple, it specifies the axes that hold 2-D matrices, and the matrix norms of these matrices are computed. If axis is None then either a vector norm (when a is 1-D) or a matrix norm (when a is 2-D) is returned.

keepdims bool, optional

If this is set to True, the axes which are normed over are left in the result as dimensions with size one. With this option the result will broadcast correctly against the original a.

check_finite bool, optional

Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.

Returns : n float or ndarray

Norm of the matrix or vector(s).

The following norms can be calculated:

Источник

scipy.linalg.norm#

This function is able to return one of eight different matrix norms, or one of an infinite number of vector norms (described below), depending on the value of the ord parameter. For tensors with rank different from 1 or 2, only ord=None is supported.

Parameters : a array_like

Input array. If axis is None, a must be 1-D or 2-D, unless ord is None. If both axis and ord are None, the 2-norm of a.ravel will be returned.

Order of the norm (see table under Notes ). inf means NumPy’s inf object.

If axis is an integer, it specifies the axis of a along which to compute the vector norms. If axis is a 2-tuple, it specifies the axes that hold 2-D matrices, and the matrix norms of these matrices are computed. If axis is None then either a vector norm (when a is 1-D) or a matrix norm (when a is 2-D) is returned.

keepdims bool, optional

If this is set to True, the axes which are normed over are left in the result as dimensions with size one. With this option the result will broadcast correctly against the original a.

check_finite bool, optional

Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.

Returns : n float or ndarray

Norm of the matrix or vector(s).

The following norms can be calculated:

Источник

Linear algebra ( scipy.linalg )#

numpy.linalg for more linear algebra functions. Note that although scipy.linalg imports most of them, identically named functions from scipy.linalg may offer more or slightly differing functionality.

Basics#

inv (a[, overwrite_a, check_finite])

Compute the inverse of a matrix.

Solves the linear equation set a @ x == b for the unknown x for square a matrix.

solve_banded (l_and_u, ab, b[, overwrite_ab, . ])

Solve the equation a x = b for x, assuming a is banded matrix.

Solve C x = b for x, where C is a circulant matrix.

Solve the equation a x = b for x, assuming a is a triangular matrix.

Solve a Toeplitz system using Levinson Recursion

Efficient Toeplitz Matrix-Matrix Multiplication using FFT

det (a[, overwrite_a, check_finite])

Compute the determinant of a matrix

norm (a[, ord, axis, keepdims, check_finite])

Compute least-squares solution to equation Ax = b.

Compute the (Moore-Penrose) pseudo-inverse of a matrix.

pinvh (a[, atol, rtol, lower, return_rank, . ])

Compute the (Moore-Penrose) pseudo-inverse of a Hermitian matrix.

Deprecated since version 1.11.0.

Deprecated since version 1.11.0.

Compute the matrix solution of the orthogonal Procrustes problem.

Compute a diagonal similarity transformation for row/column balancing.

Compute the subspace angles between two matrices.

Return the lower and upper bandwidth of a 2D numeric array.

Check if a square 2D array is symmetric.

Check if a square 2D array is Hermitian.

Generic Python-exception-derived object raised by linalg functions.

The warning emitted when a linear algebra related operation is close to fail conditions of the algorithm or loss of accuracy is expected.

Eigenvalue Problems#

eig (a[, b, left, right, overwrite_a, . ])

Solve an ordinary or generalized eigenvalue problem of a square matrix.

eigvals (a[, b, overwrite_a, check_finite, . ])

Compute eigenvalues from an ordinary or generalized eigenvalue problem.

Solve a standard or generalized eigenvalue problem for a complex Hermitian or real symmetric matrix.

Solves a standard or generalized eigenvalue problem for a complex Hermitian or real symmetric matrix.

eig_banded (a_band[, lower, eigvals_only, . ])

Solve real symmetric or complex Hermitian band matrix eigenvalue problem.

Solve real symmetric or complex Hermitian band matrix eigenvalue problem.

Solve eigenvalue problem for a real symmetric tridiagonal matrix.

Solve eigenvalue problem for a real symmetric tridiagonal matrix.

Decompositions#

Compute LU decomposition of a matrix with partial pivoting.

lu_factor (a[, overwrite_a, check_finite])

Compute pivoted LU decomposition of a matrix.

Solve an equation system, a x = b, given the LU factorization of a

svd (a[, full_matrices, compute_uv, . ])

Singular Value Decomposition.

svdvals (a[, overwrite_a, check_finite])

Compute singular values of a matrix.

Construct the sigma matrix in SVD from singular values and size M, N.

Construct an orthonormal basis for the range of A using SVD

Construct an orthonormal basis for the null space of A using SVD

ldl (A[, lower, hermitian, overwrite_a, . ])

Computes the LDLt or Bunch-Kaufman factorization of a symmetric/ hermitian matrix.

cholesky (a[, lower, overwrite_a, check_finite])

Compute the Cholesky decomposition of a matrix.

Cholesky decompose a banded Hermitian positive-definite matrix

cho_factor (a[, lower, overwrite_a, check_finite])

Compute the Cholesky decomposition of a matrix, to use in cho_solve

cho_solve (c_and_lower, b[, overwrite_b, . ])

Solve the linear equations A x = b, given the Cholesky factorization of A.

Solve the linear equations A x = b , given the Cholesky factorization of the banded Hermitian A .

Compute the polar decomposition.

qr (a[, overwrite_a, lwork, mode, pivoting, . ])

Compute QR decomposition of a matrix.

Calculate the QR decomposition and multiply Q with a matrix.

QR downdate on row or column deletions

QR update on row or column insertions

rq (a[, overwrite_a, lwork, mode, check_finite])

Compute RQ decomposition of a matrix.

qz (A, B[, output, lwork, sort, overwrite_a, . ])

QZ decomposition for generalized eigenvalues of a pair of matrices.

ordqz (A, B[, sort, output, overwrite_a, . ])

QZ decomposition for a pair of matrices with reordering.

schur (a[, output, lwork, overwrite_a, sort, . ])

Compute Schur decomposition of a matrix.

Convert real Schur form to complex Schur form.

Compute Hessenberg form of a matrix.

Converts complex eigenvalues w and eigenvectors v to real eigenvalues in a block diagonal form wr and the associated real eigenvectors vr , such that.

Compute the cosine-sine (CS) decomposition of an orthogonal/unitary matrix.

scipy.linalg.interpolative – Interpolative matrix decompositions

Matrix Functions#

Compute the matrix exponential of an array.

Compute the matrix cosine.

Compute the matrix tangent.

Compute the hyperbolic matrix cosine.

Compute the hyperbolic matrix sine.

Compute the hyperbolic matrix tangent.

Evaluate a matrix function specified by a callable.

Frechet derivative of the matrix exponential of A in the direction E.

Relative condition number of the matrix exponential in the Frobenius norm.

Compute the fractional power of a matrix.

Matrix Equation Solvers#

Computes a solution (X) to the Sylvester equation \(AX + XB = Q\) .

Solves the continuous-time algebraic Riccati equation (CARE).

Solves the discrete-time algebraic Riccati equation (DARE).

Solves the continuous Lyapunov equation \(AX + XA^H = Q\) .

Solves the discrete Lyapunov equation \(AXA^H — X + Q = 0\) .

Sketches and Random Projections#

Applies a Clarkson-Woodruff Transform/sketch to the input matrix.

Special Matrices#

Create a block diagonal matrix from provided arrays.

Construct a circulant matrix.

Create a companion matrix.

Construct a convolution matrix.

Discrete Fourier transform matrix.

Returns a symmetric Fiedler matrix

Returns a Fiedler companion matrix

Construct an Hadamard matrix.

Construct a Hankel matrix.

Create an Helmert matrix of order n.

Create a Hilbert matrix of order n.

Compute the inverse of the Hilbert matrix of order n.

Returns the n x n Pascal matrix.

Returns the inverse of the n x n Pascal matrix.

Construct a Toeplitz matrix.

Deprecated since version 1.11.0.

Low-level routines#

Return available BLAS function objects from names.

Return available LAPACK function objects from names.

Find best-matching BLAS/LAPACK type.

scipy.linalg.cython_blas – Low-level BLAS functions for Cython

scipy.linalg.cython_lapack – Low-level LAPACK functions for Cython

Low-level BLAS functions ( scipy.linalg.blas )

© Copyright 2008-2023, The SciPy community.

Источник

Читайте также:  Php 5 полная версия
Оцените статью