sstevx.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 375 行 · 第 1/2 页
HTML
375 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>sstevx.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
SUBROUTINE <a name="SSTEVX.1"></a><a href="sstevx.f.html#SSTEVX.1">SSTEVX</a>( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
$ M, W, Z, LDZ, WORK, IWORK, IFAIL, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK driver routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> CHARACTER JOBZ, RANGE
INTEGER IL, INFO, IU, LDZ, M, N
REAL ABSTOL, VL, VU
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> INTEGER IFAIL( * ), IWORK( * )
REAL D( * ), E( * ), W( * ), WORK( * ), Z( LDZ, * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="SSTEVX.21"></a><a href="sstevx.f.html#SSTEVX.1">SSTEVX</a> computes selected eigenvalues and, optionally, eigenvectors
</span><span class="comment">*</span><span class="comment"> of a real symmetric tridiagonal matrix A. Eigenvalues and
</span><span class="comment">*</span><span class="comment"> eigenvectors can be selected by specifying either a range of values
</span><span class="comment">*</span><span class="comment"> or a range of indices for the desired eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> JOBZ (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': Compute eigenvalues only;
</span><span class="comment">*</span><span class="comment"> = 'V': Compute eigenvalues and eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RANGE (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'A': all eigenvalues will be found.
</span><span class="comment">*</span><span class="comment"> = 'V': all eigenvalues in the half-open interval (VL,VU]
</span><span class="comment">*</span><span class="comment"> will be found.
</span><span class="comment">*</span><span class="comment"> = 'I': the IL-th through IU-th eigenvalues will be found.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The order of the matrix. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> D (input/output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> On entry, the n diagonal elements of the tridiagonal matrix
</span><span class="comment">*</span><span class="comment"> A.
</span><span class="comment">*</span><span class="comment"> On exit, D may be multiplied by a constant factor chosen
</span><span class="comment">*</span><span class="comment"> to avoid over/underflow in computing the eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> E (input/output) REAL array, dimension (max(1,N-1))
</span><span class="comment">*</span><span class="comment"> On entry, the (n-1) subdiagonal elements of the tridiagonal
</span><span class="comment">*</span><span class="comment"> matrix A in elements 1 to N-1 of E.
</span><span class="comment">*</span><span class="comment"> On exit, E may be multiplied by a constant factor chosen
</span><span class="comment">*</span><span class="comment"> to avoid over/underflow in computing the eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VL (input) REAL
</span><span class="comment">*</span><span class="comment"> VU (input) REAL
</span><span class="comment">*</span><span class="comment"> If RANGE='V', the lower and upper bounds of the interval to
</span><span class="comment">*</span><span class="comment"> be searched for eigenvalues. VL < VU.
</span><span class="comment">*</span><span class="comment"> Not referenced if RANGE = 'A' or 'I'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IL (input) INTEGER
</span><span class="comment">*</span><span class="comment"> IU (input) INTEGER
</span><span class="comment">*</span><span class="comment"> If RANGE='I', the indices (in ascending order) of the
</span><span class="comment">*</span><span class="comment"> smallest and largest eigenvalues to be returned.
</span><span class="comment">*</span><span class="comment"> 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0.
</span><span class="comment">*</span><span class="comment"> Not referenced if RANGE = 'A' or 'V'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ABSTOL (input) REAL
</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
</span><span class="comment">*</span><span class="comment"> than or equal to zero, then EPS*|T| will be used in
</span><span class="comment">*</span><span class="comment"> its place, where |T| is the 1-norm of the tridiagonal
</span><span class="comment">*</span><span class="comment"> matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Eigenvalues will be computed most accurately when ABSTOL is
</span><span class="comment">*</span><span class="comment"> set to twice the underflow threshold 2*<a name="SLAMCH.81"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>('S'), not zero.
</span><span class="comment">*</span><span class="comment"> If this routine returns with INFO>0, indicating that some
</span><span class="comment">*</span><span class="comment"> eigenvectors did not converge, try setting ABSTOL to
</span><span class="comment">*</span><span class="comment"> 2*<a name="SLAMCH.84"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>('S').
</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"> 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 an eigenvector fails to converge (INFO > 0), then that
</span><span class="comment">*</span><span class="comment"> column of Z contains the latest approximation to the
</span><span class="comment">*</span><span class="comment"> eigenvector, and the index of the eigenvector is returned
</span><span class="comment">*</span><span class="comment"> in IFAIL. 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"> WORK (workspace) REAL array, dimension (5*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IWORK (workspace) INTEGER array, dimension (5*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IFAIL (output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment"> If JOBZ = 'V', then if INFO = 0, the first M elements of
</span><span class="comment">*</span><span class="comment"> IFAIL are zero. If INFO > 0, then IFAIL contains the
</span><span class="comment">*</span><span class="comment"> indices of the eigenvectors that failed to converge.
</span><span class="comment">*</span><span class="comment"> If JOBZ = 'N', then IFAIL is not referenced.
</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: if INFO = i, then i eigenvectors failed to converge.
</span><span class="comment">*</span><span class="comment"> Their indices are stored in array IFAIL.
</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
PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
CHARACTER ORDER
INTEGER I, IMAX, INDIBL, INDISP, INDIWO, INDWRK,
$ ISCALE, ITMP1, J, JJ, NSPLIT
REAL BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA, SMLNUM,
$ TMP1, TNRM, VLL, VUU
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.146"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
REAL <a name="SLAMCH.147"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANST.147"></a><a href="slanst.f.html#SLANST.1">SLANST</a>
EXTERNAL <a name="LSAME.148"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="SLAMCH.148"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANST.148"></a><a href="slanst.f.html#SLANST.1">SLANST</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL SCOPY, SSCAL, <a name="SSTEBZ.151"></a><a href="sstebz.f.html#SSTEBZ.1">SSTEBZ</a>, <a name="SSTEIN.151"></a><a href="sstein.f.html#SSTEIN.1">SSTEIN</a>, <a name="SSTEQR.151"></a><a href="ssteqr.f.html#SSTEQR.1">SSTEQR</a>, <a name="SSTERF.151"></a><a href="ssterf.f.html#SSTERF.1">SSTERF</a>,
$ SSWAP, <a name="XERBLA.152"></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> WANTZ = <a name="LSAME.161"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'V'</span> )
ALLEIG = <a name="LSAME.162"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'A'</span> )
VALEIG = <a name="LSAME.163"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'V'</span> )
INDEIG = <a name="LSAME.164"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'I'</span> )
<span class="comment">*</span><span class="comment">
</span> INFO = 0
IF( .NOT.( WANTZ .OR. <a name="LSAME.167"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'N'</span> ) ) ) THEN
INFO = -1
ELSE IF( .NOT.( ALLEIG .OR. VALEIG .OR. INDEIG ) ) THEN
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?