3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE SSVDCH( N, S, E, SVD, TOL, INFO )
13 * .. Scalar Arguments ..
17 * .. Array Arguments ..
18 * REAL E( * ), S( * ), SVD( * )
27 *> SSVDCH checks to see if SVD(1) ,..., SVD(N) are accurate singular
28 *> values of the bidiagonal matrix B with diagonal entries
29 *> S(1) ,..., S(N) and superdiagonal entries E(1) ,..., E(N-1)).
30 *> It does this by expanding each SVD(I) into an interval
31 *> [SVD(I) * (1-EPS) , SVD(I) * (1+EPS)], merging overlapping intervals
32 *> if any, and using Sturm sequences to count and verify whether each
33 *> resulting interval has the correct number of singular values (using
34 *> SSVDCT). Here EPS=TOL*MAX(N/10,1)*MACHEP, where MACHEP is the
35 *> machine precision. The routine assumes the singular values are sorted
36 *> with SVD(1) the largest and SVD(N) smallest. If each interval
37 *> contains the correct number of singular values, INFO = 0 is returned,
38 *> otherwise INFO is the index of the first singular value in the first
48 *> The dimension of the bidiagonal matrix B.
53 *> S is REAL array, dimension (N)
54 *> The diagonal entries of the bidiagonal matrix B.
59 *> E is REAL array, dimension (N-1)
60 *> The superdiagonal entries of the bidiagonal matrix B.
65 *> SVD is REAL array, dimension (N)
66 *> The computed singular values to be checked.
72 *> Error tolerance for checking, a multiplier of the
79 *> =0 if the singular values are all correct (to within
81 *> >0 if the interval containing the INFO-th singular value
82 *> contains the incorrect number of singular values.
88 *> \author Univ. of Tennessee
89 *> \author Univ. of California Berkeley
90 *> \author Univ. of Colorado Denver
93 *> \date November 2011
95 *> \ingroup single_eig
97 * =====================================================================
98 SUBROUTINE SSVDCH( N, S, E, SVD, TOL, INFO )
100 * -- LAPACK test routine (version 3.4.0) --
101 * -- LAPACK is a software package provided by Univ. of Tennessee, --
102 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
105 * .. Scalar Arguments ..
109 * .. Array Arguments ..
110 REAL E( * ), S( * ), SVD( * )
113 * =====================================================================
117 PARAMETER ( ONE = 1.0E0 )
119 PARAMETER ( ZERO = 0.0E0 )
121 * .. Local Scalars ..
122 INTEGER BPNT, COUNT, NUML, NUMU, TPNT
123 REAL EPS, LOWER, OVFL, TUPPR, UNFL, UNFLEP, UPPER
125 * .. External Functions ..
129 * .. External Subroutines ..
132 * .. Intrinsic Functions ..
135 * .. Executable Statements ..
137 * Get machine constants
142 UNFL = SLAMCH( 'Safe minimum' )
143 OVFL = SLAMCH( 'Overflow' )
144 EPS = SLAMCH( 'Epsilon' )*SLAMCH( 'Base' )
146 * UNFLEP is chosen so that when an eigenvalue is multiplied by the
147 * scale factor sqrt(OVFL)*sqrt(sqrt(UNFL))/MX in SSVDCT, it exceeds
148 * sqrt(UNFL), which is the lower limit for SSVDCT.
150 UNFLEP = ( SQRT( SQRT( UNFL ) ) / SQRT( OVFL ) )*SVD( 1 ) +
153 * The value of EPS works best when TOL .GE. 10.
155 EPS = TOL*MAX( N / 10, 1 )*EPS
157 * TPNT points to singular value at right endpoint of interval
158 * BPNT points to singular value at left endpoint of interval
163 * Begin loop over all intervals
166 UPPER = ( ONE+EPS )*SVD( TPNT ) + UNFLEP
167 LOWER = ( ONE-EPS )*SVD( BPNT ) - UNFLEP
168 IF( LOWER.LE.UNFLEP )
171 * Begin loop merging overlapping intervals
176 TUPPR = ( ONE+EPS )*SVD( BPNT+1 ) + UNFLEP
183 LOWER = ( ONE-EPS )*SVD( BPNT ) - UNFLEP
184 IF( LOWER.LE.UNFLEP )
189 * Count singular values in interval [ LOWER, UPPER ]
191 CALL SSVDCT( N, S, E, LOWER, NUML )
192 CALL SSVDCT( N, S, E, UPPER, NUMU )
196 IF( COUNT.NE.BPNT-TPNT+1 ) THEN
198 * Wrong number of singular values in interval