219 SUBROUTINE sspt21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
220 $ TAU, WORK, RESULT )
228 INTEGER ITYPE, KBAND, LDU, N
231 REAL AP( * ), D( * ), E( * ), RESULT( 2 ), TAU( * ),
232 $ u( ldu, * ), vp( * ), work( * )
239 parameter( zero = 0.0e0, one = 1.0e0, ten = 10.0e0 )
241 parameter( half = 1.0e+0 / 2.0e+0 )
246 INTEGER IINFO, J, JP, JP1, JR, LAP
247 REAL ANORM, TEMP, ULP, UNFL, VSAVE, WNORM
251 REAL SDOT, SLAMCH, SLANGE, SLANSP
252 EXTERNAL lsame, sdot, slamch, slange, slansp
259 INTRINSIC max, min, real
271 lap = ( n*( n+1 ) ) / 2
273 IF( lsame( uplo,
'U' ) )
THEN
281 unfl = slamch(
'Safe minimum' )
282 ulp = slamch(
'Epsilon' )*slamch(
'Base' )
286 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
287 result( 1 ) = ten / ulp
295 IF( itype.EQ.3 )
THEN
298 anorm = max( slansp(
'1', cuplo, n, ap, work ), unfl )
303 IF( itype.EQ.1 )
THEN
307 CALL slaset(
'Full', n, n, zero, zero, work, n )
308 CALL scopy( lap, ap, 1, work, 1 )
311 CALL sspr( cuplo, n, -d( j ), u( 1, j ), 1, work )
314 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
316 CALL sspr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ),
320 wnorm = slansp(
'1', cuplo, n, work, work( n**2+1 ) )
322 ELSE IF( itype.EQ.2 )
THEN
326 CALL slaset(
'Full', n, n, zero, zero, work, n )
330 DO 40 j = n - 1, 1, -1
331 jp = ( ( 2*n-j )*( j-1 ) ) / 2
333 IF( kband.EQ.1 )
THEN
334 work( jp+j+1 ) = ( one-tau( j ) )*e( j )
336 work( jp+jr ) = -tau( j )*e( j )*vp( jp+jr )
340 IF( tau( j ).NE.zero )
THEN
343 CALL sspmv(
'L', n-j, one, work( jp1+j+1 ),
344 $ vp( jp+j+1 ), 1, zero, work( lap+1 ), 1 )
345 temp = -half*tau( j )*sdot( n-j, work( lap+1 ), 1,
347 CALL saxpy( n-j, temp, vp( jp+j+1 ), 1, work( lap+1 ),
349 CALL sspr2(
'L', n-j, -tau( j ), vp( jp+j+1 ), 1,
350 $ work( lap+1 ), 1, work( jp1+j+1 ) )
353 work( jp+j ) = d( j )
358 jp = ( j*( j-1 ) ) / 2
360 IF( kband.EQ.1 )
THEN
361 work( jp1+j ) = ( one-tau( j ) )*e( j )
363 work( jp1+jr ) = -tau( j )*e( j )*vp( jp1+jr )
367 IF( tau( j ).NE.zero )
THEN
370 CALL sspmv(
'U', j, one, work, vp( jp1+1 ), 1, zero,
372 temp = -half*tau( j )*sdot( j, work( lap+1 ), 1,
374 CALL saxpy( j, temp, vp( jp1+1 ), 1, work( lap+1 ),
376 CALL sspr2(
'U', j, -tau( j ), vp( jp1+1 ), 1,
377 $ work( lap+1 ), 1, work )
380 work( jp1+j+1 ) = d( j+1 )
385 work( j ) = work( j ) - ap( j )
387 wnorm = slansp(
'1', cuplo, n, work, work( lap+1 ) )
389 ELSE IF( itype.EQ.3 )
THEN
395 CALL slacpy(
' ', n, n, u, ldu, work, n )
396 CALL sopmtr(
'R', cuplo,
'T', n, n, vp, tau, work, n,
397 $ work( n**2+1 ), iinfo )
398 IF( iinfo.NE.0 )
THEN
399 result( 1 ) = ten / ulp
404 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
407 wnorm = slange(
'1', n, n, work, n, work( n**2+1 ) )
410 IF( anorm.GT.wnorm )
THEN
411 result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
413 IF( anorm.LT.one )
THEN
414 result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
416 result( 1 ) = min( wnorm / anorm, real( n ) ) / ( n*ulp )
424 IF( itype.EQ.1 )
THEN
425 CALL sgemm(
'N',
'C', n, n, n, one, u, ldu, u, ldu, zero, work,
429 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
432 result( 2 ) = min( slange(
'1', n, n, work, n,
433 $ work( n**2+1 ) ), real( n ) ) / ( n*ulp )
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
SSPMV
subroutine sspr2(uplo, n, alpha, x, incx, y, incy, ap)
SSPR2
subroutine sspr(uplo, n, alpha, x, incx, ap)
SSPR
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine sopmtr(side, uplo, trans, m, n, ap, tau, c, ldc, work, info)
SOPMTR
subroutine sspt21(itype, uplo, n, kband, ap, d, e, u, ldu, vp, tau, work, result)
SSPT21