205 SUBROUTINE ssyt21( 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 REAL A( LDA, * ), D( * ), E( * ), RESULT( 2 ),
218 $ tau( * ), u( ldu, * ), v( ldv, * ), work( * )
225 parameter( zero = 0.0e0, one = 1.0e0, ten = 10.0e0 )
230 INTEGER IINFO, J, JCOL, JR, JROW
231 REAL ANORM, ULP, UNFL, VSAVE, WNORM
235 REAL SLAMCH, SLANGE, SLANSY
236 EXTERNAL lsame, slamch, slange, slansy
243 INTRINSIC max, min, real
253 IF( lsame( uplo,
'U' ) )
THEN
261 unfl = slamch(
'Safe minimum' )
262 ulp = slamch(
'Epsilon' )*slamch(
'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( slansy(
'1', cuplo, n, a, lda, work ), unfl )
283 IF( itype.EQ.1 )
THEN
287 CALL slaset(
'Full', n, n, zero, zero, work, n )
288 CALL slacpy( cuplo, n, n, a, lda, work, n )
291 CALL ssyr( cuplo, n, -d( j ), u( 1, j ), 1, work, n )
294 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
296 CALL ssyr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ),
300 wnorm = slansy(
'1', cuplo, n, work, n, work( n**2+1 ) )
302 ELSE IF( itype.EQ.2 )
THEN
306 CALL slaset(
'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 slarfy(
'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 slarfy(
'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 = slansy(
'1', cuplo, n, work, n, work( n**2+1 ) )
359 ELSE IF( itype.EQ.3 )
THEN
365 CALL slacpy(
' ', n, n, u, ldu, work, n )
367 CALL sorm2r(
'R',
'T', n, n-1, n-1, v( 2, 1 ), ldv, tau,
368 $ work( n+1 ), n, work( n**2+1 ), iinfo )
370 CALL sorm2l(
'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 = slange(
'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, real( n ) ) / ( n*ulp )
399 IF( itype.EQ.1 )
THEN
400 CALL sgemm(
'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( slange(
'1', n, n, work, n,
408 $ work( n**2+1 ) ), real( n ) ) / ( n*ulp )
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine ssyr2(uplo, n, alpha, x, incx, y, incy, a, lda)
SSYR2
subroutine ssyr(uplo, n, alpha, x, incx, a, lda)
SSYR
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slarfy(uplo, n, v, incv, tau, c, ldc, work)
SLARFY
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 sorm2l(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
SORM2L multiplies a general matrix by the orthogonal matrix from a QL factorization determined by sge...
subroutine sorm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
SORM2R multiplies a general matrix by the orthogonal matrix from a QR factorization determined by sge...
subroutine ssyt21(itype, uplo, n, kband, a, lda, d, e, u, ldu, v, ldv, tau, work, result)
SSYT21