219 SUBROUTINE dspt21( ITYPE, UPLO, N, KBAND, AP, D, E, U, LDU, VP,
220 $ TAU, WORK, RESULT )
228 INTEGER ITYPE, KBAND, LDU, N
231 DOUBLE PRECISION AP( * ), D( * ), E( * ), RESULT( 2 ), TAU( * ),
232 $ u( ldu, * ), vp( * ), work( * )
238 DOUBLE PRECISION ZERO, ONE, TEN
239 parameter( zero = 0.0d0, one = 1.0d0, ten = 10.0d0 )
240 DOUBLE PRECISION HALF
241 parameter( half = 1.0d+0 / 2.0d+0 )
246 INTEGER IINFO, J, JP, JP1, JR, LAP
247 DOUBLE PRECISION ANORM, TEMP, ULP, UNFL, VSAVE, WNORM
251 DOUBLE PRECISION DDOT, DLAMCH, DLANGE, DLANSP
252 EXTERNAL lsame, ddot, dlamch, dlange, dlansp
259 INTRINSIC dble, max, min
271 lap = ( n*( n+1 ) ) / 2
273 IF( lsame( uplo,
'U' ) )
THEN
281 unfl = dlamch(
'Safe minimum' )
282 ulp = dlamch(
'Epsilon' )*dlamch(
'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( dlansp(
'1', cuplo, n, ap, work ), unfl )
303 IF( itype.EQ.1 )
THEN
307 CALL dlaset(
'Full', n, n, zero, zero, work, n )
308 CALL dcopy( lap, ap, 1, work, 1 )
311 CALL dspr( cuplo, n, -d( j ), u( 1, j ), 1, work )
314 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
316 CALL dspr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ),
320 wnorm = dlansp(
'1', cuplo, n, work, work( n**2+1 ) )
322 ELSE IF( itype.EQ.2 )
THEN
326 CALL dlaset(
'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 dspmv(
'L', n-j, one, work( jp1+j+1 ),
344 $ vp( jp+j+1 ), 1, zero, work( lap+1 ), 1 )
345 temp = -half*tau( j )*ddot( n-j, work( lap+1 ), 1,
347 CALL daxpy( n-j, temp, vp( jp+j+1 ), 1, work( lap+1 ),
349 CALL dspr2(
'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 dspmv(
'U', j, one, work, vp( jp1+1 ), 1, zero,
372 temp = -half*tau( j )*ddot( j, work( lap+1 ), 1,
374 CALL daxpy( j, temp, vp( jp1+1 ), 1, work( lap+1 ),
376 CALL dspr2(
'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 = dlansp(
'1', cuplo, n, work, work( lap+1 ) )
389 ELSE IF( itype.EQ.3 )
THEN
395 CALL dlacpy(
' ', n, n, u, ldu, work, n )
396 CALL dopmtr(
'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 = dlange(
'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, dble( n ) ) / ( n*ulp )
424 IF( itype.EQ.1 )
THEN
425 CALL dgemm(
'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( dlange(
'1', n, n, work, n,
433 $ work( n**2+1 ) ), dble( n ) ) / ( n*ulp )
subroutine dspt21(itype, uplo, n, kband, ap, d, e, u, ldu, vp, tau, work, result)
DSPT21
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
DSPMV
subroutine dspr2(uplo, n, alpha, x, incx, y, incy, ap)
DSPR2
subroutine dspr(uplo, n, alpha, x, incx, ap)
DSPR
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine dopmtr(side, uplo, trans, m, n, ap, tau, c, ldc, work, info)
DOPMTR