eigen.texi

来自「math library from gnu」· TEXI 代码 · 共 829 行 · 第 1/3 页

TEXI
829
字号
@cindex eigenvalues and eigenvectorsThis chapter describes functions for computing eigenvalues andeigenvectors of matrices.  There are routines for real symmetric,real nonsymmetric, complex hermitian, real generalized symmetric-definite,complex generalized hermitian-definite, and real generalized nonsymmetriceigensystems. Eigenvalues can be computed with or without eigenvectors.The hermitian and real symmetric matrix algorithms are symmetric bidiagonalizationfollowed by QR reduction. The nonsymmetric algorithm is the Francis QRdouble-shift.  The generalized nonsymmetric algorithm is the QZ method dueto Moler and Stewart.The functions described in this chapter are declared in the header file@file{gsl_eigen.h}.@menu* Real Symmetric Matrices::     * Complex Hermitian Matrices::  * Real Nonsymmetric Matrices::* Real Generalized Symmetric-Definite Eigensystems::* Complex Generalized Hermitian-Definite Eigensystems::* Real Generalized Nonsymmetric Eigensystems::* Sorting Eigenvalues and Eigenvectors::  * Eigenvalue and Eigenvector Examples::  * Eigenvalue and Eigenvector References::  @end menu@node Real Symmetric Matrices@section Real Symmetric Matrices@cindex symmetric matrix, real, eigensystem@cindex real symmetric matrix, eigensystemFor real symmetric matrices, the library uses the symmetricbidiagonalization and QR reduction method.  This is described in Golub& van Loan, section 8.3.  The computed eigenvalues are accurate to anabsolute accuracy of @math{\epsilon ||A||_2}, where @math{\epsilon} isthe machine precision.@deftypefun {gsl_eigen_symm_workspace *} gsl_eigen_symm_alloc (const size_t @var{n})This function allocates a workspace for computing eigenvalues of@var{n}-by-@var{n} real symmetric matrices.  The size of the workspaceis @math{O(2n)}.@end deftypefun@deftypefun void gsl_eigen_symm_free (gsl_eigen_symm_workspace * @var{w})This function frees the memory associated with the workspace @var{w}.@end deftypefun@deftypefun int gsl_eigen_symm (gsl_matrix * @var{A}, gsl_vector * @var{eval}, gsl_eigen_symm_workspace * @var{w})This function computes the eigenvalues of the real symmetric matrix@var{A}.  Additional workspace of the appropriate size must be providedin @var{w}.  The diagonal and lower triangular part of @var{A} aredestroyed during the computation, but the strict upper triangular partis not referenced.  The eigenvalues are stored in the vector @var{eval}and are unordered.@end deftypefun@deftypefun {gsl_eigen_symmv_workspace *} gsl_eigen_symmv_alloc (const size_t @var{n})This function allocates a workspace for computing eigenvalues andeigenvectors of @var{n}-by-@var{n} real symmetric matrices.  The size ofthe workspace is @math{O(4n)}.@end deftypefun@deftypefun void gsl_eigen_symmv_free (gsl_eigen_symmv_workspace * @var{w})This function frees the memory associated with the workspace @var{w}.@end deftypefun@deftypefun int gsl_eigen_symmv (gsl_matrix * @var{A}, gsl_vector * @var{eval}, gsl_matrix * @var{evec}, gsl_eigen_symmv_workspace * @var{w})This function computes the eigenvalues and eigenvectors of the realsymmetric matrix @var{A}.  Additional workspace of the appropriate sizemust be provided in @var{w}.  The diagonal and lower triangular part of@var{A} are destroyed during the computation, but the strict uppertriangular part is not referenced.  The eigenvalues are stored in thevector @var{eval} and are unordered.  The corresponding eigenvectors arestored in the columns of the matrix @var{evec}.  For example, theeigenvector in the first column corresponds to the first eigenvalue.The eigenvectors are guaranteed to be mutually orthogonal and normalisedto unit magnitude.@end deftypefun@node Complex Hermitian Matrices@section Complex Hermitian Matrices@cindex hermitian matrix, complex, eigensystem@cindex complex hermitian matrix, eigensystem@deftypefun {gsl_eigen_herm_workspace *} gsl_eigen_herm_alloc (const size_t @var{n})This function allocates a workspace for computing eigenvalues of@var{n}-by-@var{n} complex hermitian matrices.  The size of the workspaceis @math{O(3n)}.@end deftypefun@deftypefun void gsl_eigen_herm_free (gsl_eigen_herm_workspace * @var{w})This function frees the memory associated with the workspace @var{w}.@end deftypefun@deftypefun int gsl_eigen_herm (gsl_matrix_complex * @var{A}, gsl_vector * @var{eval}, gsl_eigen_herm_workspace * @var{w})This function computes the eigenvalues of the complex hermitian matrix@var{A}.  Additional workspace of the appropriate size must be providedin @var{w}.  The diagonal and lower triangular part of @var{A} aredestroyed during the computation, but the strict upper triangular partis not referenced.  The imaginary parts of the diagonal are assumed to bezero and are not referenced. The eigenvalues are stored in the vector@var{eval} and are unordered.@end deftypefun@deftypefun {gsl_eigen_hermv_workspace *} gsl_eigen_hermv_alloc (const size_t @var{n})This function allocates a workspace for computing eigenvalues andeigenvectors of @var{n}-by-@var{n} complex hermitian matrices.  The size ofthe workspace is @math{O(5n)}.@end deftypefun@deftypefun void gsl_eigen_hermv_free (gsl_eigen_hermv_workspace * @var{w})This function frees the memory associated with the workspace @var{w}.@end deftypefun@deftypefun int gsl_eigen_hermv (gsl_matrix_complex * @var{A}, gsl_vector * @var{eval}, gsl_matrix_complex * @var{evec}, gsl_eigen_hermv_workspace * @var{w})This function computes the eigenvalues and eigenvectors of the complexhermitian matrix @var{A}.  Additional workspace of the appropriate sizemust be provided in @var{w}.  The diagonal and lower triangular part of@var{A} are destroyed during the computation, but the strict uppertriangular part is not referenced. The imaginary parts of the diagonalare assumed to be zero and are not referenced.  The eigenvalues arestored in the vector @var{eval} and are unordered.  The correspondingcomplex eigenvectors are stored in the columns of the matrix @var{evec}.For example, the eigenvector in the first column corresponds to thefirst eigenvalue.  The eigenvectors are guaranteed to be mutuallyorthogonal and normalised to unit magnitude.@end deftypefun@node Real Nonsymmetric Matrices@section Real Nonsymmetric Matrices@cindex nonsymmetric matrix, real, eigensystem@cindex real nonsymmetric matrix, eigensystemThe solution of the real nonsymmetric eigensystem problem for amatrix @math{A} involves computing the Schur decomposition@tex\beforedisplay$$A = Z T Z^T$$\afterdisplay@end tex@ifinfo@exampleA = Z T Z^T@end example@end ifinfowhere @math{Z} is an orthogonal matrix of Schur vectors and @math{T},the Schur form, is quasi upper triangular with diagonal@math{1}-by-@math{1} blocks which are real eigenvalues of @math{A}, anddiagonal @math{2}-by-@math{2} blocks whose eigenvalues are complexconjugate eigenvalues of @math{A}. The algorithm used is the doubleshift Francis method.@deftypefun {gsl_eigen_nonsymm_workspace *} gsl_eigen_nonsymm_alloc (const size_t @var{n})This function allocates a workspace for computing eigenvalues of@var{n}-by-@var{n} real nonsymmetric matrices. The size of the workspaceis @math{O(2n)}.@end deftypefun@deftypefun void gsl_eigen_nonsymm_free (gsl_eigen_nonsymm_workspace * @var{w})This function frees the memory associated with the workspace @var{w}.@end deftypefun@deftypefun void gsl_eigen_nonsymm_params (const int @var{compute_t}, const int @var{balance}, gsl_eigen_nonsymm_workspace * @var{w})This function sets some parameters which determine how the eigenvalueproblem is solved in subsequent calls to @code{gsl_eigen_nonsymm}.If @var{compute_t} is set to 1, the full Schur form @math{T} will becomputed by @code{gsl_eigen_nonsymm}. If it is set to 0,@math{T} will not be computed (this is the default setting). Computingthe full Schur form @math{T} requires approximately 1.5-2 times thenumber of flops.If @var{balance} is set to 1, a balancing transformation is appliedto the matrix prior to computing eigenvalues. This transformation isdesigned to make the rows and columns of the matrix have comparablenorms, and can result in more accurate eigenvalues for matriceswhose entries vary widely in magnitude. See @ref{Balancing} for moreinformation. Note that the balancing transformation does not preservethe orthogonality of the Schur vectors, so if you wish to compute theSchur vectors with @code{gsl_eigen_nonsymm_Z} you will obtain the Schurvectors of the balanced matrix instead of the original matrix. Therelationship will be@tex\beforedisplay$$T = Q^t D^{-1} A D Q$$\afterdisplay@end tex@ifinfo@exampleT = Q^t D^(-1) A D Q@end example@end ifinfo@noindentwhere @var{Q} is the matrix of Schur vectors for the balanced matrix, and@var{D} is the balancing transformation. Then @code{gsl_eigen_nonsymm_Z}will compute a matrix @var{Z} which satisfies@tex\beforedisplay$$T = Z^{-1} A Z$$\afterdisplay@end tex@ifinfo@exampleT = Z^(-1) A Z@end example@end ifinfo@noindentwith @math{Z = D Q}. Note that @var{Z} will not be orthogonal. Forthis reason, balancing is not performed by default.@end deftypefun@deftypefun int gsl_eigen_nonsymm (gsl_matrix * @var{A}, gsl_vector_complex * @var{eval}, gsl_eigen_nonsymm_workspace * @var{w})This function computes the eigenvalues of the real nonsymmetric matrix@var{A} and stores them in the vector @var{eval}. If @math{T} isdesired, it is stored in the upper portion of @var{A} on output.Otherwise, on output, the diagonal of @var{A} will contain the@math{1}-by-@math{1} real eigenvalues and @math{2}-by-@math{2}complex conjugate eigenvalue systems, and the rest of @var{A} isdestroyed. In rare cases, this function may fail to find alleigenvalues. If this happens, an error code is returnedand the number of converged eigenvalues is stored in @code{w->n_evals}.The converged eigenvalues are stored in the beginning of @var{eval}.@end deftypefun@deftypefun int gsl_eigen_nonsymm_Z (gsl_matrix * @var{A}, gsl_vector_complex * @var{eval}, gsl_matrix * @var{Z}, gsl_eigen_nonsymm_workspace * @var{w})This function is identical to @code{gsl_eigen_nonsymm} except it alsocomputes the Schur vectors and stores them into @var{Z}.@end deftypefun@deftypefun {gsl_eigen_nonsymmv_workspace *} gsl_eigen_nonsymmv_alloc (const size_t @var{n})This function allocates a workspace for computing eigenvalues andeigenvectors of @var{n}-by-@var{n} real nonsymmetric matrices. Thesize of the workspace is @math{O(5n)}.@end deftypefun@deftypefun void gsl_eigen_nonsymmv_free (gsl_eigen_nonsymmv_workspace * @var{w})This function frees the memory associated with the workspace @var{w}.@end deftypefun@deftypefun int gsl_eigen_nonsymmv (gsl_matrix * @var{A}, gsl_vector_complex * @var{eval}, gsl_matrix_complex * @var{evec}, gsl_eigen_nonsymmv_workspace * @var{w})This function computes eigenvalues and right eigenvectors of the@var{n}-by-@var{n} real nonsymmetric matrix @var{A}. It first calls@code{gsl_eigen_nonsymm} to compute the eigenvalues, Schur form @math{T}, andSchur vectors. Then it finds eigenvectors of @math{T} and backtransformsthem using the Schur vectors. The Schur vectors are destroyed in theprocess, but can be saved by using @code{gsl_eigen_nonsymmv_Z}. Thecomputed eigenvectors are normalized to have unit magnitude. Onoutput, the upper portion of @var{A} contains the Schur form@math{T}. If @code{gsl_eigen_nonsymm} fails, no eigenvectors arecomputed, and an error code is returned.@end deftypefun@deftypefun int gsl_eigen_nonsymmv_Z (gsl_matrix * @var{A}, gsl_vector_complex * @var{eval}, gsl_matrix_complex * @var{evec}, gsl_matrix * @var{Z}, gsl_eigen_nonsymmv_workspace * @var{w})This function is identical to @code{gsl_eigen_nonsymmv} except it also savesthe Schur vectors into @var{Z}.@end deftypefun@node Real Generalized Symmetric-Definite Eigensystems@section Real Generalized Symmetric-Definite Eigensystems@cindex generalized symmetric eigensystemsThe real generalized symmetric-definite eigenvalue problem is to findeigenvalues @math{\lambda} and eigenvectors @math{x} such that@tex

⌨️ 快捷键说明

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