⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linalg.texi

📁 开放gsl矩阵运算
💻 TEXI
📖 第 1 页 / 共 3 页
字号:
b} into the triangular system @math{R y = Q^T b, x = P y}, which can besolved by back-substitution and permutation.  We denote the @math{QR}decomposition with column pivoting by @math{QRP^T} since @math{A = Q RP^T}.@deftypefun int gsl_linalg_QRPT_decomp (gsl_matrix * @var{A}, gsl_vector * @var{tau}, gsl_permutation * @var{p}, int *@var{signum}, gsl_vector * @var{norm})This function factorizes the @math{M}-by-@math{N} matrix @var{A} intothe @math{QRP^T} decomposition @math{A = Q R P^T}.  On output thediagonal and upper triangular part of the input matrix contain thematrix @math{R}. The permutation matrix @math{P} is stored in thepermutation @var{p}.  The sign of the permutation is given by@var{signum}. It has the value @math{(-1)^n}, where @math{n} is thenumber of interchanges in the permutation. The vector @var{tau} and thecolumns of the lower triangular part of the matrix @var{A} contain theHouseholder coefficients and vectors which encode the orthogonal matrix@var{Q}.  The vector @var{tau} must be of length @math{k=\min(M,N)}. Thematrix @math{Q} is related to these components by, @math{Q = Q_k ... Q_2Q_1} where @math{Q_i = I - \tau_i v_i v_i^T} and @math{v_i} is theHouseholder vector @math{v_i =(0,...,1,A(i+1,i),A(i+2,i),...,A(m,i))}. This is the same storage schemeas used by @sc{lapack}.  On output the norms of each column of @var{R}are stored in the vector @var{norm}.The algorithm used to perform the decomposition is Householder QR withcolumn pivoting (Golub & Van Loan, @cite{Matrix Computations}, Algorithm5.4.1).@end deftypefun@deftypefun int gsl_linalg_QRPT_decomp2 (const gsl_matrix * @var{A}, gsl_matrix * @var{q}, gsl_matrix * @var{r}, gsl_vector * @var{tau}, gsl_permutation * @var{p}, int *@var{signum}, gsl_vector * @var{norm})This function factorizes the matrix @var{A} into the decomposition@math{A = Q R P^T} without modifying @var{A} itself and storing theoutput in the separate matrices @var{q} and @var{r}.@end deftypefun@deftypefun int gsl_linalg_QRPT_solve (const gsl_matrix * @var{QR}, const gsl_vector * @var{tau}, const gsl_permutation * @var{p}, const gsl_vector * @var{b}, gsl_vector * @var{x})This function solves the system @math{A x = b} using the @math{QRP^T}decomposition of @math{A} into (@var{QR}, @var{tau}, @var{p}) given by@code{gsl_linalg_QRPT_decomp}.@end deftypefun@deftypefun int gsl_linalg_QRPT_svx (const gsl_matrix * @var{QR}, const gsl_vector * @var{tau}, const gsl_permutation * @var{p}, gsl_vector * @var{x})This function solves the system @math{A x = b} in-place using the@math{QRP^T} decomposition of @math{A} into(@var{QR},@var{tau},@var{p}). On input @var{x} should contain theright-hand side @math{b}, which is replaced by the solution on output.@end deftypefun@deftypefun int gsl_linalg_QRPT_QRsolve (const gsl_matrix * @var{Q}, const gsl_matrix * @var{R}, const gsl_permutation * @var{p}, const gsl_vector * @var{b}, gsl_vector * @var{x})This function solves the system @math{R P^T x = Q^T b} for @var{x}. It canbe used when the @math{QR} decomposition of a matrix is available inunpacked form as (@var{Q},@var{R}).@end deftypefun@deftypefun int gsl_linalg_QRPT_update (gsl_matrix * @var{Q}, gsl_matrix * @var{R}, const gsl_permutation * @var{p}, gsl_vector * @var{u}, const gsl_vector * @var{v})This function performs a rank-1 update @math{w v^T} of the @math{QRP^T}decomposition (@var{Q}, @var{R},@var{p}). The update is given by@math{Q'R' = Q R + w v^T} where the output matrices @math{Q'} and@math{R'} are also orthogonal and right triangular. Note that @var{w} isdestroyed by the update. The permutation @var{p} is not changed.@end deftypefun@deftypefun int gsl_linalg_QRPT_Rsolve (const gsl_matrix * @var{QR}, const gsl_permutation * @var{p}, const gsl_vector * @var{b}, gsl_vector * @var{x})This function solves the triangular system @math{R P^T x = b} for the@math{N}-by-@math{N} matrix @math{R} contained in @var{QR}.@end deftypefun@deftypefun int gsl_linalg_QRPT_Rsvx (const gsl_matrix * @var{QR}, const gsl_permutation * @var{p}, gsl_vector * @var{x})This function solves the triangular system @math{R P^T x = b} in-placefor the @math{N}-by-@math{N} matrix @math{R} contained in @var{QR}. Oninput @var{x} should contain the right-hand side @math{b}, which isreplaced by the solution on output.@end deftypefun@node Singular Value Decomposition@section Singular Value Decomposition@cindex SVD@cindex singular value decompositionA general rectangular @math{M}-by-@math{N} matrix @math{A} has asingular value decomposition (@sc{svd}) into the product of an@math{M}-by-@math{N} orthogonal matrix @math{U}, an @math{N}-by-@math{N}diagonal matrix of singular values @math{S} and the transpose of an@math{M}-by-@math{M} orthogonal square matrix @math{V},@tex\beforedisplay$$A = U S V^T$$\afterdisplay@end tex@ifinfo@exampleA = U S V^T@end example@end ifinfo@noindentThe singular values@c{$\sigma_i = S_{ii}$}@math{\sigma_i = S_@{ii@}} are all non-negative and aregenerally chosen to form a non-increasing sequence @c{$\sigma_1 \ge \sigma_2 \ge ... \ge \sigma_N \ge 0$}@math{\sigma_1 >= \sigma_2 >= ... >= \sigma_N >= 0}.The singular value decomposition of a matrix has many practical uses.The condition number of the matrix is given by the ratio of the largestsingular value to the smallest singular value. The presence of a zerosingular value indicates that the matrix is singular. The number ofnon-zero singular values indicates the rank of the matrix.  In practicesingular value decomposition of a rank-deficient matrix will not produceexact zeroes for singular values, due to finite numericalprecision. Small singular values should be edited by choosing a suitabletolerance.@deftypefun int gsl_linalg_SV_decomp (gsl_matrix * @var{A}, gsl_matrix * @var{V}, gsl_vector * @var{S}, gsl_vector * @var{work})This function factorizes the @math{M}-by-@math{N} matrix @var{A} intothe singular value decomposition @math{A = U S V^T}. On output thematrix @var{A} is replaced by @math{U}. The diagonal elements of thesingular value matrix @math{S} are stored in the vector @var{S}. Thesingular values are non-negative and form a non-increasing sequence from@math{S_1} to @math{S_N}. The matrix @var{V} contains the elements of@math{V} in untransposed form. To form the product @math{U S V^T} it isnecessary to take the transpose of @var{V}.  A workspace of length@var{N} is required in @var{work}.This routine uses the Golub-Reinsch SVD algorithm.@end deftypefun@deftypefun int gsl_linalg_SV_decomp_mod (gsl_matrix * @var{A}, gsl_matrix * @var{X}, gsl_matrix * @var{V}, gsl_vector * @var{S}, gsl_vector * @var{work})This function computes the SVD using the modified Golub-Reinschalgorithm, which is faster for @math{M>>N}.  It requires the vector@var{work} and the @math{N}-by-@math{N} matrix @var{X} as additionalworking space.@end deftypefun@deftypefun int gsl_linalg_SV_decomp_jacobi (gsl_matrix * @var{A}, gsl_matrix * @var{V}, gsl_vector * @var{S})This function computes the SVD using one-sided Jacobi orthogonalization(see references for details).  The Jacobi method can compute singularvalues to higher relative accuracy than Golub-Reinsch algorithms.@end deftypefun@deftypefun int gsl_linalg_SV_solve (gsl_matrix * @var{U}, gsl_matrix * @var{V}, gsl_vector * @var{S}, const gsl_vector * @var{b}, gsl_vector * @var{x})This function solves the system @math{A x = b} using the singular valuedecomposition (@var{U}, @var{S}, @var{V}) of @math{A} given by@code{gsl_linalg_SV_decomp}.Only non-zero singular values are used in computing the solution. Theparts of the solution corresponding to singular values of zero areignored.  Other singular values can be edited out by setting them tozero before calling this function. In the over-determined case where @var{A} has more rows than columns thesystem is solved in the least squares sense, returning the solution@var{x} which minimizes @math{||A x - b||_2}.@end deftypefun@node Cholesky Decomposition@section Cholesky Decomposition@cindex Cholesky decomposition@cindex square root of a matrix, Cholesky decomposition@cindex matrix square root, Cholesky decompositionA symmetric, positive definite square matrix @math{A} has a Choleskydecomposition into a product of a lower triangular matrix @math{L} andits transpose @math{L^T},@tex\beforedisplay$$A = L L^T$$\afterdisplay@end tex@ifinfo@exampleA = L L^T@end example@end ifinfo@noindentThis is sometimes referred to as taking the square-root of a matrix. TheCholesky decomposition can only be carried out when all the eigenvaluesof the matrix are positive.  This decomposition can be used to convertthe linear system @math{A x = b} into a pair of triangular systems(@math{L y = b}, @math{L^T x = y}), which can be solved by forward andback-substitution.@deftypefun int gsl_linalg_cholesky_decomp (gsl_matrix * @var{A})This function factorizes the positive-definite square matrix @var{A}into the Cholesky decomposition @math{A = L L^T}. On output the diagonaland lower triangular part of the input matrix @var{A} contain the matrix@math{L}. The upper triangular part of the input matrix contains@math{L^T}, the diagonal terms being identical for both @math{L} and@math{L^T}.  If the matrix is not positive-definite then thedecomposition will fail, returning the error code @code{GSL_EDOM}.@end deftypefun@deftypefun int gsl_linalg_cholesky_solve (const gsl_matrix * @var{cholesky}, const gsl_vector * @var{b}, gsl_vector * @var{x})This function solves the system @math{A x = b} using the Choleskydecomposition of @math{A} into the matrix @var{cholesky} given by@code{gsl_linalg_cholesky_decomp}.@end deftypefun@deftypefun int gsl_linalg_cholesky_svx (const gsl_matrix * @var{cholesky}, gsl_vector * @var{x})This function solves the system @math{A x = b} in-place using theCholesky decomposition of @math{A} into the matrix @var{cholesky} givenby @code{gsl_linalg_cholesky_decomp}. On input @var{x} should containthe right-hand side @math{b}, which is replaced by the solution onoutput.@end deftypefun@node Tridiagonal Decomposition of Real Symmetric Matrices@section Tridiagonal Decomposition of Real Symmetric Matrices@cindex  tridiagonal decompositionA symmetric matrix @math{A} can be factorized by similaritytransformations into the form,@tex\beforedisplay$$A = Q T Q^T$$\afterdisplay@end tex@ifinfo@exampleA = Q T Q^T@end example@end ifinfo@noindentwhere @math{Q} is an orthogonal matrix and @math{T} is a symmetrictridiagonal matrix.@deftypefun int gsl_linalg_symmtd_decomp (gsl_matrix * @var{A}, gsl_vector * @var{tau})This function factorizes the symmetric square matrix @var{A} into thesymmetric tridiagonal decomposition @math{Q T Q^T}.  On output thediagonal and subdiagonal part of the input matrix @var{A} contain thetridiagonal matrix @math{T}.  The remaining lower triangular part of theinput matrix contains the Householder vectors which, together with theHouseholder coefficients @var{tau}, encode the orthogonal matrix@math{Q}. This storage scheme is the same as used by @sc{lapack}.  Theupper triangular part of @var{A} is not referenced.@end deftypefun@deftypefun int gsl_linalg_symmtd_unpack (const gsl_matrix * @var{A}, const gsl_vector * @var{tau}, gsl_matrix * @var{Q}, gsl_vector * @var{d}, gsl_vector * @var{sd})This function unpacks the encoded symmetric tridiagonal decomposition(@var{A}, @var{tau}) obtained from @code{gsl_linalg_symmtd_decomp} intothe orthogonal matrix @var{Q}, the vector of diagonal elements @var{d}and the vector of subdiagonal elements @var{sd}.  @end deftypefun@deftypefun int gsl_linalg_symmtd_unpack_dsd (const gsl_matrix * @var{A}, gsl_vector * @var{d}, gsl_vector * @var{sd})This function unpacks the diagonal and subdiagonal of the encodedsymmetric tridiagonal decomposition (@var{A}, @var{tau}) obtained from@code{gsl_linalg_symmtd_decomp} into the vectors @var{d} and @var{sd}.@end deftypefun@node Tridiagonal Decomposition of Hermitian Matrices@section Tridiagonal Decomposition of Hermitian Matrices@cindex tridiagonal decompositionA hermitian matrix @math{A} can be factorized by similaritytransformations into the form,@tex\beforedisplay$$A = U T U^T$$\afterdisplay@end tex@ifinfo@exampleA = U T U^T@end example@end ifinfo@noindentwhere @math{U} is an unitary matrix and @math{T} is a real symmetrictridiagonal matrix.@deftypefun int gsl_linalg_hermtd_decomp (gsl_matrix_complex * @var{A}, gsl_vector_complex * @var{tau})This function factorizes the hermitian matrix @var{A} into the symmetrictridiagonal decomposition @math{U T U^T}.  On output the real parts ofthe diagonal and subdiagonal part of the input matrix @var{A} containthe tridiagonal matrix @math{T}.  The remaining lower triangular part ofthe input matrix contains the Householder vectors which, together withthe Householder coefficients @var{tau}, encode the orthogonal matrix@math{Q}. This storage scheme is the same as used by @sc{lapack}.  Theupper triangular part of @var{A} and imaginary parts of the diagonal arenot referenced.@end deftypefun@deftypefun int gsl_linalg_hermtd_unpack (const gsl_matrix_complex * @var{A}, const gsl_vector_complex * @var{tau}, gsl_matrix_complex * @var{Q}, gsl_vector * @var{d}, gsl_vector * @var{sd})This function unpacks the encoded tridiagonal decomposition (@var{A},@var{tau}) obtained from @code{gsl_linalg_hermtd_decomp} into theunitary matrix @var{U}, the real vector of diagonal elements @var{d} andthe real vector of subdiagonal elements @var{sd}. @end deftypefun@deftypefun int gsl_linalg_hermtd_unpack_dsd (const gsl_matrix_complex * @var{A}, gsl_vector * @var{d}, gsl_vector * @var{sd})This function unpacks the diagonal and subdiagonal of the encoded

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -