295 SUBROUTINE cchkhb( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, ISEED,
296 $ THRESH, NOUNIT, A, LDA, SD, SE, U, LDU, WORK,
297 $ LWORK, RWORK, RESULT, INFO )
304 INTEGER INFO, LDA, LDU, LWORK, NOUNIT, NSIZES, NTYPES,
310 INTEGER ISEED( 4 ), KK( * ), NN( * )
311 REAL RESULT( * ), RWORK( * ), SD( * ), SE( * )
312 COMPLEX A( LDA, * ), U( LDU, * ), WORK( * )
319 PARAMETER ( CZERO = ( 0.0e+0, 0.0e+0 ),
320 $ cone = ( 1.0e+0, 0.0e+0 ) )
321 REAL ZERO, ONE, TWO, TEN
322 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0, two = 2.0e+0,
325 PARAMETER ( HALF = one / two )
327 parameter( maxtyp = 15 )
330 LOGICAL BADNN, BADNNB
331 INTEGER I, IINFO, IMODE, ITYPE, J, JC, JCOL, JR, JSIZE,
332 $ jtype, jwidth, k, kmax, mtypes, n, nerrs,
333 $ nmats, nmax, ntest, ntestt
334 REAL ANINV, ANORM, COND, OVFL, RTOVFL, RTUNFL,
335 $ TEMP1, ULP, ULPINV, UNFL
338 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KMAGN( MAXTYP ),
339 $ KMODE( MAXTYP ), KTYPE( MAXTYP )
350 INTRINSIC abs, conjg, max, min, real, sqrt
353 DATA ktype / 1, 2, 5*4, 5*5, 3*8 /
354 DATA kmagn / 2*1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
356 DATA kmode / 2*0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
371 nmax = max( nmax, nn( j ) )
379 kmax = max( kmax, kk( j ) )
383 kmax = min( nmax-1, kmax )
387 IF( nsizes.LT.0 )
THEN
389 ELSE IF( badnn )
THEN
391 ELSE IF( nwdths.LT.0 )
THEN
393 ELSE IF( badnnb )
THEN
395 ELSE IF( ntypes.LT.0 )
THEN
397 ELSE IF( lda.LT.kmax+1 )
THEN
399 ELSE IF( ldu.LT.nmax )
THEN
401 ELSE IF( ( max( lda, nmax )+1 )*nmax.GT.lwork )
THEN
406 CALL xerbla(
'CCHKHB', -info )
412 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 .OR. nwdths.EQ.0 )
417 unfl = slamch(
'Safe minimum' )
419 ulp = slamch(
'Epsilon' )*slamch(
'Base' )
421 rtunfl = sqrt( unfl )
422 rtovfl = sqrt( ovfl )
429 DO 190 jsize = 1, nsizes
431 aninv = one / real( max( 1, n ) )
433 DO 180 jwidth = 1, nwdths
437 k = max( 0, min( n-1, k ) )
439 IF( nsizes.NE.1 )
THEN
440 mtypes = min( maxtyp, ntypes )
442 mtypes = min( maxtyp+1, ntypes )
445 DO 170 jtype = 1, mtypes
446 IF( .NOT.dotype( jtype ) )
452 ioldsd( j ) = iseed( j )
472 IF( mtypes.GT.maxtyp )
475 itype = ktype( jtype )
476 imode = kmode( jtype )
480 GO TO ( 40, 50, 60 )kmagn( jtype )
487 anorm = ( rtovfl*ulp )*aninv
491 anorm = rtunfl*n*ulpinv
496 CALL claset(
'Full', lda, n, czero, czero, a, lda )
498 IF( jtype.LE.15 )
THEN
501 cond = ulpinv*aninv / ten
508 IF( itype.EQ.1 )
THEN
511 ELSE IF( itype.EQ.2 )
THEN
516 a( k+1, jcol ) = anorm
519 ELSE IF( itype.EQ.4 )
THEN
523 CALL clatms( n, n,
'S', iseed,
'H', rwork, imode,
524 $ cond, anorm, 0, 0,
'Q', a( k+1, 1 ), lda,
527 ELSE IF( itype.EQ.5 )
THEN
531 CALL clatms( n, n,
'S', iseed,
'H', rwork, imode,
532 $ cond, anorm, k, k,
'Q', a, lda, work,
535 ELSE IF( itype.EQ.7 )
THEN
539 CALL clatmr( n, n,
'S', iseed,
'H', work, 6, one,
540 $ cone,
'T',
'N', work( n+1 ), 1, one,
541 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
542 $ zero, anorm,
'Q', a( k+1, 1 ), lda,
545 ELSE IF( itype.EQ.8 )
THEN
549 CALL clatmr( n, n,
'S', iseed,
'H', work, 6, one,
550 $ cone,
'T',
'N', work( n+1 ), 1, one,
551 $ work( 2*n+1 ), 1, one,
'N', idumma, k, k,
552 $ zero, anorm,
'Q', a, lda, idumma, iinfo )
554 ELSE IF( itype.EQ.9 )
THEN
558 CALL clatms( n, n,
'S', iseed,
'P', rwork, imode,
559 $ cond, anorm, k, k,
'Q', a, lda,
560 $ work( n+1 ), iinfo )
562 ELSE IF( itype.EQ.10 )
THEN
568 CALL clatms( n, n,
'S', iseed,
'P', rwork, imode,
569 $ cond, anorm, 1, 1,
'Q', a( k, 1 ), lda,
572 temp1 = abs( a( k, i ) ) /
573 $ sqrt( abs( a( k+1, i-1 )*a( k+1, i ) ) )
574 IF( temp1.GT.half )
THEN
575 a( k, i ) = half*sqrt( abs( a( k+1,
576 $ i-1 )*a( k+1, i ) ) )
585 IF( iinfo.NE.0 )
THEN
586 WRITE( nounit, fmt = 9999 )
'Generator', iinfo, n,
596 CALL clacpy(
' ', k+1, n, a, lda, work, lda )
599 CALL chbtrd(
'V',
'U', n, k, work, lda, sd, se, u, ldu,
600 $ work( lda*n+1 ), iinfo )
602 IF( iinfo.NE.0 )
THEN
603 WRITE( nounit, fmt = 9999 )
'CHBTRD(U)', iinfo, n,
606 IF( iinfo.LT.0 )
THEN
616 CALL chbt21(
'Upper', n, k, 1, a, lda, sd, se, u, ldu,
617 $ work, rwork, result( 1 ) )
623 DO 110 jr = 0, min( k, n-jc )
624 a( jr+1, jc ) = conjg( a( k+1-jr, jc+jr ) )
627 DO 140 jc = n + 1 - k, n
628 DO 130 jr = min( k, n-jc ) + 1, k
635 CALL clacpy(
' ', k+1, n, a, lda, work, lda )
638 CALL chbtrd(
'V',
'L', n, k, work, lda, sd, se, u, ldu,
639 $ work( lda*n+1 ), iinfo )
641 IF( iinfo.NE.0 )
THEN
642 WRITE( nounit, fmt = 9999 )
'CHBTRD(L)', iinfo, n,
645 IF( iinfo.LT.0 )
THEN
656 CALL chbt21(
'Lower', n, k, 1, a, lda, sd, se, u, ldu,
657 $ work, rwork, result( 3 ) )
662 ntestt = ntestt + ntest
667 IF( result( jr ).GE.thresh )
THEN
672 IF( nerrs.EQ.0 )
THEN
673 WRITE( nounit, fmt = 9998 )
'CHB'
674 WRITE( nounit, fmt = 9997 )
675 WRITE( nounit, fmt = 9996 )
676 WRITE( nounit, fmt = 9995 )
'Hermitian'
677 WRITE( nounit, fmt = 9994 )
'unitary',
'*',
678 $
'conjugate transpose', (
'*', j = 1, 4 )
681 WRITE( nounit, fmt = 9993 )n, k, ioldsd, jtype,
692 CALL slasum(
'CHB', nounit, nerrs, ntestt )
695 9999
FORMAT(
' CCHKHB: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
696 $ i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
697 9998
FORMAT( / 1x, a3,
698 $
' -- Complex Hermitian Banded Tridiagonal Reduction Routines'
700 9997
FORMAT(
' Matrix types (see SCHK23 for details): ' )
702 9996
FORMAT( /
' Special Matrices:',
703 $ /
' 1=Zero matrix. ',
704 $
' 5=Diagonal: clustered entries.',
705 $ /
' 2=Identity matrix. ',
706 $
' 6=Diagonal: large, evenly spaced.',
707 $ /
' 3=Diagonal: evenly spaced entries. ',
708 $
' 7=Diagonal: small, evenly spaced.',
709 $ /
' 4=Diagonal: geometr. spaced entries.' )
710 9995
FORMAT(
' Dense ', a,
' Banded Matrices:',
711 $ /
' 8=Evenly spaced eigenvals. ',
712 $
' 12=Small, evenly spaced eigenvals.',
713 $ /
' 9=Geometrically spaced eigenvals. ',
714 $
' 13=Matrix with random O(1) entries.',
715 $ /
' 10=Clustered eigenvalues. ',
716 $
' 14=Matrix with large random entries.',
717 $ /
' 11=Large, evenly spaced eigenvals. ',
718 $
' 15=Matrix with small random entries.' )
720 9994
FORMAT( /
' Tests performed: (S is Tridiag, U is ', a,
',',
721 $ / 20x, a,
' means ', a,
'.', /
' UPLO=''U'':',
722 $ /
' 1= | A - U S U', a1,
' | / ( |A| n ulp ) ',
723 $
' 2= | I - U U', a1,
' | / ( n ulp )', /
' UPLO=''L'':',
724 $ /
' 3= | A - U S U', a1,
' | / ( |A| n ulp ) ',
725 $
' 4= | I - U U', a1,
' | / ( n ulp )' )
726 9993
FORMAT(
' N=', i5,
', K=', i4,
', seed=', 4( i4,
',' ),
' type ',
727 $ i2,
', test(', i2,
')=', g10.3 )