3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DSTECH( N, A, B, EIG, TOL, WORK, INFO )
13 * .. Scalar Arguments ..
15 * DOUBLE PRECISION TOL
17 * .. Array Arguments ..
18 * DOUBLE PRECISION A( * ), B( * ), EIG( * ), WORK( * )
27 *> Let T be the tridiagonal matrix with diagonal entries A(1) ,...,
28 *> A(N) and offdiagonal entries B(1) ,..., B(N-1)). DSTECH checks to
29 *> see if EIG(1) ,..., EIG(N) are indeed accurate eigenvalues of T.
30 *> It does this by expanding each EIG(I) into an interval
31 *> [SVD(I) - EPS, SVD(I) + EPS], merging overlapping intervals if
32 *> any, and using Sturm sequences to count and verify whether each
33 *> resulting interval has the correct number of eigenvalues (using
34 *> DSTECT). Here EPS = TOL*MAZHEPS*MAXEIG, where MACHEPS is the
35 *> machine precision and MAXEIG is the absolute value of the largest
36 *> eigenvalue. If each interval contains the correct number of
37 *> eigenvalues, INFO = 0 is returned, otherwise INFO is the index of
38 *> the first eigenvalue in the first bad interval.
47 *> The dimension of the tridiagonal matrix T.
52 *> A is DOUBLE PRECISION array, dimension (N)
53 *> The diagonal entries of the tridiagonal matrix T.
58 *> B is DOUBLE PRECISION array, dimension (N-1)
59 *> The offdiagonal entries of the tridiagonal matrix T.
64 *> EIG is DOUBLE PRECISION array, dimension (N)
65 *> The purported eigenvalues to be checked.
70 *> TOL is DOUBLE PRECISION
71 *> Error tolerance for checking, a multiple of the
77 *> WORK is DOUBLE PRECISION array, dimension (N)
83 *> 0 if the eigenvalues are all correct (to within
84 *> 1 +- TOL*MAZHEPS*MAXEIG)
85 *> >0 if the interval containing the INFO-th eigenvalue
86 *> contains the incorrect number of eigenvalues.
92 *> \author Univ. of Tennessee
93 *> \author Univ. of California Berkeley
94 *> \author Univ. of Colorado Denver
97 *> \date November 2011
99 *> \ingroup double_eig
101 * =====================================================================
102 SUBROUTINE DSTECH( N, A, B, EIG, TOL, WORK, INFO )
104 * -- LAPACK test routine (version 3.4.0) --
105 * -- LAPACK is a software package provided by Univ. of Tennessee, --
106 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
109 * .. Scalar Arguments ..
113 * .. Array Arguments ..
114 DOUBLE PRECISION A( * ), B( * ), EIG( * ), WORK( * )
117 * =====================================================================
120 DOUBLE PRECISION ZERO
121 PARAMETER ( ZERO = 0.0D0 )
123 * .. Local Scalars ..
124 INTEGER BPNT, COUNT, I, ISUB, J, NUML, NUMU, TPNT
125 DOUBLE PRECISION EMIN, EPS, LOWER, MX, TUPPR, UNFLEP, UPPER
127 * .. External Functions ..
128 DOUBLE PRECISION DLAMCH
131 * .. External Subroutines ..
134 * .. Intrinsic Functions ..
137 * .. Executable Statements ..
139 * Check input parameters
148 IF( TOL.LT.ZERO ) THEN
153 * Get machine constants
155 EPS = DLAMCH( 'Epsilon' )*DLAMCH( 'Base' )
156 UNFLEP = DLAMCH( 'Safe minimum' ) / EPS
159 * Compute maximum absolute eigenvalue, error tolerance
163 MX = MAX( MX, ABS( EIG( I ) ) )
165 EPS = MAX( EPS*MX, UNFLEP )
167 * Sort eigenvalues from EIG into WORK
175 DO 30 J = 2, N + 1 - I
176 IF( WORK( J ).LT.EMIN ) THEN
181 IF( ISUB.NE.N+1-I ) THEN
182 WORK( ISUB ) = WORK( N+1-I )
187 * TPNT points to singular value at right endpoint of interval
188 * BPNT points to singular value at left endpoint of interval
193 * Begin loop over all intervals
196 UPPER = WORK( TPNT ) + EPS
197 LOWER = WORK( BPNT ) - EPS
199 * Begin loop merging overlapping intervals
204 TUPPR = WORK( BPNT+1 ) + EPS
211 LOWER = WORK( BPNT ) - EPS
215 * Count singular values in interval [ LOWER, UPPER ]
217 CALL DSTECT( N, A, B, LOWER, NUML )
218 CALL DSTECT( N, A, B, UPPER, NUMU )
220 IF( COUNT.NE.BPNT-TPNT+1 ) THEN
222 * Wrong number of singular values in interval