172 SUBROUTINE sstein( N, D, E, M, W, IBLOCK, ISPLIT, Z, LDZ, WORK,
173 $ IWORK, IFAIL, INFO )
180 INTEGER INFO, LDZ, M, N
183 INTEGER IBLOCK( * ), IFAIL( * ), ISPLIT( * ),
185 REAL D( * ), E( * ), W( * ), WORK( * ), Z( LDZ, * )
191 REAL ZERO, ONE, TEN, ODM3, ODM1
192 parameter( zero = 0.0e+0, one = 1.0e+0, ten = 1.0e+1,
193 $ odm3 = 1.0e-3, odm1 = 1.0e-1 )
194 INTEGER MAXITS, EXTRA
195 parameter( maxits = 5, extra = 2 )
198 INTEGER B1, BLKSIZ, BN, GPIND, I, IINFO, INDRV1,
199 $ indrv2, indrv3, indrv4, indrv5, its, j, j1,
200 $ jblk, jmax, nblk, nrmchk
201 REAL CTR, EPS, EPS1, NRM, ONENRM, ORTOL, PERTOL,
202 $ scl, sep, stpcrt, tol, xj, xjm
209 REAL SDOT, SLAMCH, SNRM2
210 EXTERNAL isamax, sdot, slamch, snrm2
217 INTRINSIC abs, max, sqrt
230 ELSE IF( m.LT.0 .OR. m.GT.n )
THEN
232 ELSE IF( ldz.LT.max( 1, n ) )
THEN
236 IF( iblock( j ).LT.iblock( j-1 ) )
THEN
240 IF( iblock( j ).EQ.iblock( j-1 ) .AND. w( j ).LT.w( j-1 ) )
250 CALL xerbla(
'SSTEIN', -info )
256 IF( n.EQ.0 .OR. m.EQ.0 )
THEN
258 ELSE IF( n.EQ.1 )
THEN
265 eps = slamch(
'Precision' )
284 DO 160 nblk = 1, iblock( m )
291 b1 = isplit( nblk-1 ) + 1
301 onenrm = abs( d( b1 ) ) + abs( e( b1 ) )
302 onenrm = max( onenrm, abs( d( bn ) )+abs( e( bn-1 ) ) )
303 DO 50 i = b1 + 1, bn - 1
304 onenrm = max( onenrm, abs( d( i ) )+abs( e( i-1 ) )+
309 stpcrt = sqrt( odm1 / blksiz )
316 IF( iblock( j ).NE.nblk )
THEN
325 IF( blksiz.EQ.1 )
THEN
326 work( indrv1+1 ) = one
346 CALL slarnv( 2, iseed, blksiz, work( indrv1+1 ) )
350 CALL scopy( blksiz, d( b1 ), 1, work( indrv4+1 ), 1 )
351 CALL scopy( blksiz-1, e( b1 ), 1, work( indrv2+2 ), 1 )
352 CALL scopy( blksiz-1, e( b1 ), 1, work( indrv3+1 ), 1 )
357 CALL slagtf( blksiz, work( indrv4+1 ), xj, work( indrv2+2 ),
358 $ work( indrv3+1 ), tol, work( indrv5+1 ), iwork,
370 jmax = isamax( blksiz, work( indrv1+1 ), 1 )
371 scl = blksiz*onenrm*max( eps,
372 $ abs( work( indrv4+blksiz ) ) ) /
373 $ abs( work( indrv1+jmax ) )
374 CALL sscal( blksiz, scl, work( indrv1+1 ), 1 )
378 CALL slagts( -1, blksiz, work( indrv4+1 ), work( indrv2+2 ),
379 $ work( indrv3+1 ), work( indrv5+1 ), iwork,
380 $ work( indrv1+1 ), tol, iinfo )
387 IF( abs( xj-xjm ).GT.ortol )
389 IF( gpind.NE.j )
THEN
390 DO 80 i = gpind, j - 1
391 ctr = -sdot( blksiz, work( indrv1+1 ), 1, z( b1, i ),
393 CALL saxpy( blksiz, ctr, z( b1, i ), 1,
394 $ work( indrv1+1 ), 1 )
401 jmax = isamax( blksiz, work( indrv1+1 ), 1 )
402 nrm = abs( work( indrv1+jmax ) )
410 IF( nrmchk.LT.extra+1 )
425 scl = one / snrm2( blksiz, work( indrv1+1 ), 1 )
426 jmax = isamax( blksiz, work( indrv1+1 ), 1 )
427 IF( work( indrv1+jmax ).LT.zero )
429 CALL sscal( blksiz, scl, work( indrv1+1 ), 1 )
435 z( b1+i-1, j ) = work( indrv1+i )
subroutine xerbla(srname, info)
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine slagtf(n, a, lambda, b, c, tol, d, in, info)
SLAGTF computes an LU factorization of a matrix T-λI, where T is a general tridiagonal matrix,...
subroutine slagts(job, n, a, b, c, d, in, y, tol, info)
SLAGTS solves the system of equations (T-λI)x = y or (T-λI)^Tx = y, where T is a general tridiagonal ...
subroutine slarnv(idist, iseed, n, x)
SLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
SSTEIN