1 *> \brief <b> DSTEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices</b>
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DSTEV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dstev.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dstev.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dstev.f">
21 * SUBROUTINE DSTEV( JOBZ, N, D, E, Z, LDZ, WORK, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDZ, N
27 * .. Array Arguments ..
28 * DOUBLE PRECISION D( * ), E( * ), WORK( * ), Z( LDZ, * )
37 *> DSTEV computes all eigenvalues and, optionally, eigenvectors of a
38 *> real symmetric tridiagonal matrix A.
46 *> JOBZ is CHARACTER*1
47 *> = 'N': Compute eigenvalues only;
48 *> = 'V': Compute eigenvalues and eigenvectors.
54 *> The order of the matrix. N >= 0.
59 *> D is DOUBLE PRECISION array, dimension (N)
60 *> On entry, the n diagonal elements of the tridiagonal matrix
62 *> On exit, if INFO = 0, the eigenvalues in ascending order.
67 *> E is DOUBLE PRECISION array, dimension (N-1)
68 *> On entry, the (n-1) subdiagonal elements of the tridiagonal
69 *> matrix A, stored in elements 1 to N-1 of E.
70 *> On exit, the contents of E are destroyed.
75 *> Z is DOUBLE PRECISION array, dimension (LDZ, N)
76 *> If JOBZ = 'V', then if INFO = 0, Z contains the orthonormal
77 *> eigenvectors of the matrix A, with the i-th column of Z
78 *> holding the eigenvector associated with D(i).
79 *> If JOBZ = 'N', then Z is not referenced.
85 *> The leading dimension of the array Z. LDZ >= 1, and if
86 *> JOBZ = 'V', LDZ >= max(1,N).
91 *> WORK is DOUBLE PRECISION array, dimension (max(1,2*N-2))
92 *> If JOBZ = 'N', WORK is not referenced.
98 *> = 0: successful exit
99 *> < 0: if INFO = -i, the i-th argument had an illegal value
100 *> > 0: if INFO = i, the algorithm failed to converge; i
101 *> off-diagonal elements of E did not converge to zero.
107 *> \author Univ. of Tennessee
108 *> \author Univ. of California Berkeley
109 *> \author Univ. of Colorado Denver
112 *> \date November 2011
114 *> \ingroup doubleOTHEReigen
116 * =====================================================================
117 SUBROUTINE DSTEV( JOBZ, N, D, E, Z, LDZ, WORK, INFO )
119 * -- LAPACK driver routine (version 3.4.0) --
120 * -- LAPACK is a software package provided by Univ. of Tennessee, --
121 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
124 * .. Scalar Arguments ..
128 * .. Array Arguments ..
129 DOUBLE PRECISION D( * ), E( * ), WORK( * ), Z( LDZ, * )
132 * =====================================================================
135 DOUBLE PRECISION ZERO, ONE
136 PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 )
138 * .. Local Scalars ..
141 DOUBLE PRECISION BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA, SMLNUM,
144 * .. External Functions ..
146 DOUBLE PRECISION DLAMCH, DLANST
147 EXTERNAL LSAME, DLAMCH, DLANST
149 * .. External Subroutines ..
150 EXTERNAL DSCAL, DSTEQR, DSTERF, XERBLA
152 * .. Intrinsic Functions ..
155 * .. Executable Statements ..
157 * Test the input parameters.
159 WANTZ = LSAME( JOBZ, 'V' )
162 IF( .NOT.( WANTZ .OR. LSAME( JOBZ, 'N' ) ) ) THEN
164 ELSE IF( N.LT.0 ) THEN
166 ELSE IF( LDZ.LT.1 .OR. ( WANTZ .AND. LDZ.LT.N ) ) THEN
171 CALL XERBLA( 'DSTEV ', -INFO )
175 * Quick return if possible
186 * Get machine constants.
188 SAFMIN = DLAMCH( 'Safe minimum' )
189 EPS = DLAMCH( 'Precision' )
190 SMLNUM = SAFMIN / EPS
191 BIGNUM = ONE / SMLNUM
192 RMIN = SQRT( SMLNUM )
193 RMAX = SQRT( BIGNUM )
195 * Scale matrix to allowable range, if necessary.
198 TNRM = DLANST( 'M', N, D, E )
199 IF( TNRM.GT.ZERO .AND. TNRM.LT.RMIN ) THEN
202 ELSE IF( TNRM.GT.RMAX ) THEN
206 IF( ISCALE.EQ.1 ) THEN
207 CALL DSCAL( N, SIGMA, D, 1 )
208 CALL DSCAL( N-1, SIGMA, E( 1 ), 1 )
211 * For eigenvalues only, call DSTERF. For eigenvalues and
212 * eigenvectors, call DSTEQR.
214 IF( .NOT.WANTZ ) THEN
215 CALL DSTERF( N, D, E, INFO )
217 CALL DSTEQR( 'I', N, D, E, Z, LDZ, WORK, INFO )
220 * If matrix was scaled, then rescale eigenvalues appropriately.
222 IF( ISCALE.EQ.1 ) THEN
228 CALL DSCAL( IMAX, ONE / SIGMA, D, 1 )