205 SUBROUTINE dsyt21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
206 $ LDV, TAU, WORK, RESULT )
214 INTEGER ITYPE, KBAND, LDA, LDU, LDV, N
217 DOUBLE PRECISION A( LDA, * ), D( * ), E( * ), RESULT( 2 ),
218 $ tau( * ), u( ldu, * ), v( ldv, * ), work( * )
224 DOUBLE PRECISION ZERO, ONE, TEN
225 parameter( zero = 0.0d0, one = 1.0d0, ten = 10.0d0 )
230 INTEGER IINFO, J, JCOL, JR, JROW
231 DOUBLE PRECISION ANORM, ULP, UNFL, VSAVE, WNORM
235 DOUBLE PRECISION DLAMCH, DLANGE, DLANSY
236 EXTERNAL lsame, dlamch, dlange, dlansy
243 INTRINSIC dble, max, min
253 IF( lsame( uplo,
'U' ) )
THEN
261 unfl = dlamch(
'Safe minimum' )
262 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
266 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
267 result( 1 ) = ten / ulp
275 IF( itype.EQ.3 )
THEN
278 anorm = max( dlansy(
'1', cuplo, n, a, lda, work ), unfl )
283 IF( itype.EQ.1 )
THEN
287 CALL dlaset(
'Full', n, n, zero, zero, work, n )
288 CALL dlacpy( cuplo, n, n, a, lda, work, n )
291 CALL dsyr( cuplo, n, -d( j ), u( 1, j ), 1, work, n )
294 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
296 CALL dsyr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ),
300 wnorm = dlansy(
'1', cuplo, n, work, n, work( n**2+1 ) )
302 ELSE IF( itype.EQ.2 )
THEN
306 CALL dlaset(
'Full', n, n, zero, zero, work, n )
309 work( n**2 ) = d( n )
310 DO 40 j = n - 1, 1, -1
311 IF( kband.EQ.1 )
THEN
312 work( ( n+1 )*( j-1 )+2 ) = ( one-tau( j ) )*e( j )
314 work( ( j-1 )*n+jr ) = -tau( j )*e( j )*v( jr, j )
320 CALL dlarfy(
'L', n-j, v( j+1, j ), 1, tau( j ),
321 $ work( ( n+1 )*j+1 ), n, work( n**2+1 ) )
323 work( ( n+1 )*( j-1 )+1 ) = d( j )
328 IF( kband.EQ.1 )
THEN
329 work( ( n+1 )*j ) = ( one-tau( j ) )*e( j )
331 work( j*n+jr ) = -tau( j )*e( j )*v( jr, j+1 )
337 CALL dlarfy(
'U', j, v( 1, j+1 ), 1, tau( j ), work, n,
340 work( ( n+1 )*j+1 ) = d( j+1 )
347 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
352 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
357 wnorm = dlansy(
'1', cuplo, n, work, n, work( n**2+1 ) )
359 ELSE IF( itype.EQ.3 )
THEN
365 CALL dlacpy(
' ', n, n, u, ldu, work, n )
367 CALL dorm2r(
'R',
'T', n, n-1, n-1, v( 2, 1 ), ldv, tau,
368 $ work( n+1 ), n, work( n**2+1 ), iinfo )
370 CALL dorm2l(
'R',
'T', n, n-1, n-1, v( 1, 2 ), ldv, tau,
371 $ work, n, work( n**2+1 ), iinfo )
373 IF( iinfo.NE.0 )
THEN
374 result( 1 ) = ten / ulp
379 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
382 wnorm = dlange(
'1', n, n, work, n, work( n**2+1 ) )
385 IF( anorm.GT.wnorm )
THEN
386 result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
388 IF( anorm.LT.one )
THEN
389 result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
391 result( 1 ) = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
399 IF( itype.EQ.1 )
THEN
400 CALL dgemm(
'N',
'C', n, n, n, one, u, ldu, u, ldu, zero, work,
404 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
407 result( 2 ) = min( dlange(
'1', n, n, work, n,
408 $ work( n**2+1 ) ), dble( n ) ) / ( n*ulp )
subroutine dsyt21(itype, uplo, n, kband, a, lda, d, e, u, ldu, v, ldv, tau, work, result)
DSYT21
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dsyr2(uplo, n, alpha, x, incx, y, incy, a, lda)
DSYR2
subroutine dsyr(uplo, n, alpha, x, incx, a, lda)
DSYR
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlarfy(uplo, n, v, incv, tau, c, ldc, work)
DLARFY
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 dorm2l(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
DORM2L multiplies a general matrix by the orthogonal matrix from a QL factorization determined by sge...
subroutine dorm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
DORM2R multiplies a general matrix by the orthogonal matrix from a QR factorization determined by sge...