205 SUBROUTINE dsyt21( ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V,
206 $ ldv, tau, work, result )
215 INTEGER ITYPE, KBAND, LDA, LDU, LDV, N
218 DOUBLE PRECISION A( lda, * ), D( * ), E( * ), RESULT( 2 ),
219 $ tau( * ), u( ldu, * ), v( ldv, * ), work( * )
225 DOUBLE PRECISION ZERO, ONE, TEN
226 parameter ( zero = 0.0d0, one = 1.0d0, ten = 10.0d0 )
231 INTEGER IINFO, J, JCOL, JR, JROW
232 DOUBLE PRECISION ANORM, ULP, UNFL, VSAVE, WNORM
236 DOUBLE PRECISION DLAMCH, DLANGE, DLANSY
237 EXTERNAL lsame, dlamch, dlange, dlansy
244 INTRINSIC dble, max, min
254 IF( lsame( uplo,
'U' ) )
THEN
262 unfl = dlamch(
'Safe minimum' )
263 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
267 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
268 result( 1 ) = ten / ulp
276 IF( itype.EQ.3 )
THEN
279 anorm = max( dlansy(
'1', cuplo, n, a, lda, work ), unfl )
284 IF( itype.EQ.1 )
THEN
288 CALL dlaset(
'Full', n, n, zero, zero, work, n )
289 CALL dlacpy( cuplo, n, n, a, lda, work, n )
292 CALL dsyr( cuplo, n, -d( j ), u( 1, j ), 1, work, n )
295 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
297 CALL dsyr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ),
301 wnorm = dlansy(
'1', cuplo, n, work, n, work( n**2+1 ) )
303 ELSE IF( itype.EQ.2 )
THEN
307 CALL dlaset(
'Full', n, n, zero, zero, work, n )
310 work( n**2 ) = d( n )
311 DO 40 j = n - 1, 1, -1
312 IF( kband.EQ.1 )
THEN
313 work( ( n+1 )*( j-1 )+2 ) = ( one-tau( j ) )*e( j )
315 work( ( j-1 )*n+jr ) = -tau( j )*e( j )*v( jr, j )
321 CALL dlarfy(
'L', n-j, v( j+1, j ), 1, tau( j ),
322 $ work( ( n+1 )*j+1 ), n, work( n**2+1 ) )
324 work( ( n+1 )*( j-1 )+1 ) = d( j )
329 IF( kband.EQ.1 )
THEN
330 work( ( n+1 )*j ) = ( one-tau( j ) )*e( j )
332 work( j*n+jr ) = -tau( j )*e( j )*v( jr, j+1 )
338 CALL dlarfy(
'U', j, v( 1, j+1 ), 1, tau( j ), work, n,
341 work( ( n+1 )*j+1 ) = d( j+1 )
348 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
353 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
358 wnorm = dlansy(
'1', cuplo, n, work, n, work( n**2+1 ) )
360 ELSE IF( itype.EQ.3 )
THEN
366 CALL dlacpy(
' ', n, n, u, ldu, work, n )
368 CALL dorm2r(
'R',
'T', n, n-1, n-1, v( 2, 1 ), ldv, tau,
369 $ work( n+1 ), n, work( n**2+1 ), iinfo )
371 CALL dorm2l(
'R',
'T', n, n-1, n-1, v( 1, 2 ), ldv, tau,
372 $ work, n, work( n**2+1 ), iinfo )
374 IF( iinfo.NE.0 )
THEN
375 result( 1 ) = ten / ulp
380 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
383 wnorm = dlange(
'1', n, n, work, n, work( n**2+1 ) )
386 IF( anorm.GT.wnorm )
THEN
387 result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
389 IF( anorm.LT.one )
THEN
390 result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
392 result( 1 ) = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
400 IF( itype.EQ.1 )
THEN
401 CALL dgemm(
'N',
'C', n, n, n, one, u, ldu, u, ldu, zero, work,
405 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
408 result( 2 ) = min( dlange(
'1', n, n, work, n,
409 $ work( n**2+1 ) ), dble( n ) ) / ( n*ulp )
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 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 dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
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...
subroutine dsyt21(ITYPE, UPLO, N, KBAND, A, LDA, D, E, U, LDU, V, LDV, TAU, WORK, RESULT)
DSYT21
subroutine dsyr2(UPLO, N, ALPHA, X, INCX, Y, INCY, A, LDA)
DSYR2
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 dlarfy(UPLO, N, V, INCV, TAU, C, LDC, WORK)
DLARFY