ssyevr.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 587 行 · 第 1/4 页
HTML
587 行
</span><span class="comment">*</span><span class="comment"> The absolute error tolerance for the eigenvalues.
</span><span class="comment">*</span><span class="comment"> An approximate eigenvalue is accepted as converged
</span><span class="comment">*</span><span class="comment"> when it is determined to lie in an interval [a,b]
</span><span class="comment">*</span><span class="comment"> of width less than or equal to
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ABSTOL + EPS * max( |a|,|b| ) ,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where EPS is the machine precision. If ABSTOL is less than
</span><span class="comment">*</span><span class="comment"> or equal to zero, then EPS*|T| will be used in its place,
</span><span class="comment">*</span><span class="comment"> where |T| is the 1-norm of the tridiagonal matrix obtained
</span><span class="comment">*</span><span class="comment"> by reducing A to tridiagonal form.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> See "Computing Small Singular Values of Bidiagonal Matrices
</span><span class="comment">*</span><span class="comment"> with Guaranteed High Relative Accuracy," by Demmel and
</span><span class="comment">*</span><span class="comment"> Kahan, LAPACK Working Note #3.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If high relative accuracy is important, set ABSTOL to
</span><span class="comment">*</span><span class="comment"> <a name="SLAMCH.146"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( 'Safe minimum' ). Doing so will guarantee that
</span><span class="comment">*</span><span class="comment"> eigenvalues are computed to high relative accuracy when
</span><span class="comment">*</span><span class="comment"> possible in future releases. The current code does not
</span><span class="comment">*</span><span class="comment"> make any guarantees about high relative accuracy, but
</span><span class="comment">*</span><span class="comment"> future releases will. See J. Barlow and J. Demmel,
</span><span class="comment">*</span><span class="comment"> "Computing Accurate Eigensystems of Scaled Diagonally
</span><span class="comment">*</span><span class="comment"> Dominant Matrices", LAPACK Working Note #7, for a discussion
</span><span class="comment">*</span><span class="comment"> of which matrices define their eigenvalues to high relative
</span><span class="comment">*</span><span class="comment"> accuracy.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> M (output) INTEGER
</span><span class="comment">*</span><span class="comment"> The total number of eigenvalues found. 0 <= M <= N.
</span><span class="comment">*</span><span class="comment"> If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The first M elements contain the selected eigenvalues in
</span><span class="comment">*</span><span class="comment"> ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (output) REAL array, dimension (LDZ, max(1,M))
</span><span class="comment">*</span><span class="comment"> If JOBZ = 'V', then if INFO = 0, the first M columns of Z
</span><span class="comment">*</span><span class="comment"> contain the orthonormal eigenvectors of the matrix A
</span><span class="comment">*</span><span class="comment"> corresponding to the selected eigenvalues, with the i-th
</span><span class="comment">*</span><span class="comment"> column of Z holding the eigenvector associated with W(i).
</span><span class="comment">*</span><span class="comment"> If JOBZ = 'N', then Z is not referenced.
</span><span class="comment">*</span><span class="comment"> Note: the user must ensure that at least max(1,M) columns are
</span><span class="comment">*</span><span class="comment"> supplied in the array Z; if RANGE = 'V', the exact value of M
</span><span class="comment">*</span><span class="comment"> is not known in advance and an upper bound must be used.
</span><span class="comment">*</span><span class="comment"> Supplying N columns is always safe.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDZ (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array Z. LDZ >= 1, and if
</span><span class="comment">*</span><span class="comment"> JOBZ = 'V', LDZ >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ISUPPZ (output) INTEGER array, dimension ( 2*max(1,M) )
</span><span class="comment">*</span><span class="comment"> The support of the eigenvectors in Z, i.e., the indices
</span><span class="comment">*</span><span class="comment"> indicating the nonzero elements in Z. The i-th eigenvector
</span><span class="comment">*</span><span class="comment"> is nonzero only in elements ISUPPZ( 2*i-1 ) through
</span><span class="comment">*</span><span class="comment"> ISUPPZ( 2*i ).
</span><span class="comment">*</span><span class="comment">********* Implemented only for RANGE = 'A' or 'I' and IU - IL = N - 1
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) REAL array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The dimension of the array WORK. LWORK >= max(1,26*N).
</span><span class="comment">*</span><span class="comment"> For optimal efficiency, LWORK >= (NB+6)*N,
</span><span class="comment">*</span><span class="comment"> where NB is the max of the blocksize for <a name="SSYTRD.192"></a><a href="ssytrd.f.html#SSYTRD.1">SSYTRD</a> and <a name="SORMTR.192"></a><a href="sormtr.f.html#SORMTR.1">SORMTR</a>
</span><span class="comment">*</span><span class="comment"> returned by <a name="ILAENV.193"></a><a href="hfy-index.html#ILAENV">ILAENV</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LWORK = -1, then a workspace query is assumed; the routine
</span><span class="comment">*</span><span class="comment"> only calculates the optimal sizes of the WORK and IWORK
</span><span class="comment">*</span><span class="comment"> arrays, returns these values as the first entries of the WORK
</span><span class="comment">*</span><span class="comment"> and IWORK arrays, and no error message related to LWORK or
</span><span class="comment">*</span><span class="comment"> LIWORK is issued by <a name="XERBLA.199"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IWORK (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, IWORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LIWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The dimension of the array IWORK. LIWORK >= max(1,10*N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LIWORK = -1, then a workspace query is assumed; the
</span><span class="comment">*</span><span class="comment"> routine only calculates the optimal sizes of the WORK and
</span><span class="comment">*</span><span class="comment"> IWORK arrays, returns these values as the first entries of
</span><span class="comment">*</span><span class="comment"> the WORK and IWORK arrays, and no error message related to
</span><span class="comment">*</span><span class="comment"> LWORK or LIWORK is issued by <a name="XERBLA.211"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INFO (output) INTEGER
</span><span class="comment">*</span><span class="comment"> = 0: successful exit
</span><span class="comment">*</span><span class="comment"> < 0: if INFO = -i, the i-th argument had an illegal value
</span><span class="comment">*</span><span class="comment"> > 0: Internal error
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Further Details
</span><span class="comment">*</span><span class="comment"> ===============
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Based on contributions by
</span><span class="comment">*</span><span class="comment"> Inderjit Dhillon, IBM Almaden, USA
</span><span class="comment">*</span><span class="comment"> Osni Marques, LBNL/NERSC, USA
</span><span class="comment">*</span><span class="comment"> Ken Stanley, Computer Science Division, University of
</span><span class="comment">*</span><span class="comment"> California at Berkeley, USA
</span><span class="comment">*</span><span class="comment"> Jason Riedy, Computer Science Division, University of
</span><span class="comment">*</span><span class="comment"> California at Berkeley, USA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Parameters ..
</span> REAL ZERO, ONE, TWO
PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0, TWO = 2.0E+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL ALLEIG, INDEIG, LOWER, LQUERY, TEST, VALEIG,
$ WANTZ, TRYRAC
CHARACTER ORDER
INTEGER I, IEEEOK, IINFO, IMAX, INDD, INDDD, INDE,
$ INDEE, INDIBL, INDIFL, INDISP, INDIWO, INDTAU,
$ INDWK, INDWKN, ISCALE, J, JJ, LIWMIN,
$ LLWORK, LLWRKN, LWKOPT, LWMIN, NB, NSPLIT
REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
$ SIGMA, SMLNUM, TMP1, VLL, VUU
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.247"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER <a name="ILAENV.248"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
REAL <a name="SLAMCH.249"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANSY.249"></a><a href="slansy.f.html#SLANSY.1">SLANSY</a>
EXTERNAL <a name="LSAME.250"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.250"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="SLAMCH.250"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANSY.250"></a><a href="slansy.f.html#SLANSY.1">SLANSY</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL SCOPY, <a name="SORMTR.253"></a><a href="sormtr.f.html#SORMTR.1">SORMTR</a>, SSCAL, <a name="SSTEBZ.253"></a><a href="sstebz.f.html#SSTEBZ.1">SSTEBZ</a>, <a name="SSTEMR.253"></a><a href="sstemr.f.html#SSTEMR.1">SSTEMR</a>, <a name="SSTEIN.253"></a><a href="sstein.f.html#SSTEIN.1">SSTEIN</a>,
$ <a name="SSTERF.254"></a><a href="ssterf.f.html#SSTERF.1">SSTERF</a>, SSWAP, <a name="SSYTRD.254"></a><a href="ssytrd.f.html#SSYTRD.1">SSYTRD</a>, <a name="XERBLA.254"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC MAX, MIN, SQRT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> IEEEOK = <a name="ILAENV.263"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 10, <span class="string">'<a name="SSYEVR.263"></a><a href="ssyevr.f.html#SSYEVR.1">SSYEVR</a>'</span>, <span class="string">'N'</span>, 1, 2, 3, 4 )
<span class="comment">*</span><span class="comment">
</span> LOWER = <a name="LSAME.265"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'L'</span> )
WANTZ = <a name="LSAME.266"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'V'</span> )
ALLEIG = <a name="LSAME.267"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'A'</span> )
VALEIG = <a name="LSAME.268"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'V'</span> )
INDEIG = <a name="LSAME.269"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'I'</span> )
<span class="comment">*</span><span class="comment">
</span> LQUERY = ( ( LWORK.EQ.-1 ) .OR. ( LIWORK.EQ.-1 ) )
<span class="comment">*</span><span class="comment">
</span> LWMIN = MAX( 1, 26*N )
LIWMIN = MAX( 1, 10*N )
<span class="comment">*</span><span class="comment">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?