cheevr.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 613 行 · 第 1/4 页
HTML
613 行
</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.148"></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"> furutre 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) COMPLEX 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">
</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) COMPLEX 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 length of the array WORK. LWORK >= max(1,2*N).
</span><span class="comment">*</span><span class="comment"> For optimal efficiency, LWORK >= (NB+1)*N,
</span><span class="comment">*</span><span class="comment"> where NB is the max of the blocksize for <a name="CHETRD.193"></a><a href="chetrd.f.html#CHETRD.1">CHETRD</a> and for
</span><span class="comment">*</span><span class="comment"> <a name="CUNMTR.194"></a><a href="cunmtr.f.html#CUNMTR.1">CUNMTR</a> as returned by <a name="ILAENV.194"></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, RWORK 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, RWORK and IWORK arrays, and no error message
</span><span class="comment">*</span><span class="comment"> related to LWORK or LRWORK or LIWORK is issued by <a name="XERBLA.200"></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"> RWORK (workspace/output) REAL array, dimension (MAX(1,LRWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, RWORK(1) returns the optimal
</span><span class="comment">*</span><span class="comment"> (and minimal) LRWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LRWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The length of the array RWORK. LRWORK >= max(1,24*N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LRWORK = -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, RWORK
</span><span class="comment">*</span><span class="comment"> and IWORK arrays, returns these values as the first entries
</span><span class="comment">*</span><span class="comment"> of the WORK, RWORK and IWORK arrays, and no error message
</span><span class="comment">*</span><span class="comment"> related to LWORK or LRWORK or LIWORK is issued by <a name="XERBLA.213"></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
</span><span class="comment">*</span><span class="comment"> (and minimal) LIWORK.
</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, RWORK
</span><span class="comment">*</span><span class="comment"> and IWORK arrays, returns these values as the first entries
</span><span class="comment">*</span><span class="comment"> of the WORK, RWORK and IWORK arrays, and no error message
</span><span class="comment">*</span><span class="comment"> related to LWORK or LRWORK or LIWORK is issued by <a name="XERBLA.226"></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 = 1.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, INDIBL, INDIFL, INDISP,
$ INDIWO, INDRD, INDRDD, INDRE, INDREE, INDRWK,
$ INDTAU, INDWK, INDWKN, ISCALE, ITMP1, J, JJ,
$ LIWMIN, LLWORK, LLRWORK, LLWRKN, LRWMIN,
$ 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.263"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER <a name="ILAENV.264"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
REAL <a name="CLANSY.265"></a><a href="clansy.f.html#CLANSY.1">CLANSY</a>, <a name="SLAMCH.265"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
EXTERNAL <a name="LSAME.266"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.266"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="CLANSY.266"></a><a href="clansy.f.html#CLANSY.1">CLANSY</a>, <a name="SLAMCH.266"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="CHETRD.269"></a><a href="chetrd.f.html#CHETRD.1">CHETRD</a>, CSSCAL, <a name="CSTEMR.269"></a><a href="cstemr.f.html#CSTEMR.1">CSTEMR</a>, <a name="CSTEIN.269"></a><a href="cstein.f.html#CSTEIN.1">CSTEIN</a>, CSWAP, <a name="CUNMTR.269"></a><a href="cunmtr.f.html#CUNMTR.1">CUNMTR</a>,
$ SCOPY, SSCAL, <a name="SSTEBZ.270"></a><a href="sstebz.f.html#SSTEBZ.1">SSTEBZ</a>, <a name="SSTERF.270"></a><a href="ssterf.f.html#SSTERF.1">SSTERF</a>, <a name="XERBLA.270"></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, REAL, 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.279"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 10, <span class="string">'<a name="CHEEVR.279"></a><a href="cheevr.f.html#CHEEVR.1">CHEEVR</a>'</span>, <span class="string">'N'</span>, 1, 2, 3, 4 )
<span class="comment">*</span><span class="comment">
</span> LOWER = <a name="LSAME.281"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'L'</span> )
WANTZ = <a name="LSAME.282"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'V'</span> )
ALLEIG = <a name="LSAME.283"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'A'</span> )
VALEIG = <a name="LSAME.284"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'V'</span> )
INDEIG = <a name="LSAME.285"></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. ( LRWORK.EQ.-1 ) .OR.
$ ( LIWORK.EQ.-1 ) )
<span class="comment">*</span><span class="comment">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?