LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ schksb2stg()

subroutine schksb2stg ( integer  nsizes,
integer, dimension( * )  nn,
integer  nwdths,
integer, dimension( * )  kk,
integer  ntypes,
logical, dimension( * )  dotype,
integer, dimension( 4 )  iseed,
real  thresh,
integer  nounit,
real, dimension( lda, * )  a,
integer  lda,
real, dimension( * )  sd,
real, dimension( * )  se,
real, dimension( * )  d1,
real, dimension( * )  d2,
real, dimension( * )  d3,
real, dimension( ldu, * )  u,
integer  ldu,
real, dimension( * )  work,
integer  lwork,
real, dimension( * )  result,
integer  info 
)

SCHKSB2STG

Purpose:
 SCHKSB2STG tests the reduction of a symmetric band matrix to tridiagonal
 form, used with the symmetric eigenvalue problem.

 SSBTRD factors a symmetric band matrix A as  U S U' , where ' means
 transpose, S is symmetric tridiagonal, and U is orthogonal.
 SSBTRD can use either just the lower or just the upper triangle
 of A; SCHKSB2STG checks both cases.

 SSYTRD_SB2ST factors a symmetric band matrix A as  U S U' ,
 where ' means transpose, S is symmetric tridiagonal, and U is
 orthogonal. SSYTRD_SB2ST can use either just the lower or just
 the upper triangle of A; SCHKSB2STG checks both cases.

 SSTEQR factors S as  Z D1 Z'.
 D1 is the matrix of eigenvalues computed when Z is not computed
 and from the S resulting of SSBTRD "U" (used as reference for SSYTRD_SB2ST)
 D2 is the matrix of eigenvalues computed when Z is not computed
 and from the S resulting of SSYTRD_SB2ST "U".
 D3 is the matrix of eigenvalues computed when Z is not computed
 and from the S resulting of SSYTRD_SB2ST "L".

 When SCHKSB2STG is called, a number of matrix "sizes" ("n's"), a number
 of bandwidths ("k's"), and a number of matrix "types" are
 specified.  For each size ("n"), each bandwidth ("k") less than or
 equal to "n", and each type of matrix, one matrix will be generated
 and used to test the symmetric banded reduction routine.  For each
 matrix, a number of tests will be performed:

 (1)     | A - V S V' | / ( |A| n ulp )  computed by SSBTRD with
                                         UPLO='U'

 (2)     | I - UU' | / ( n ulp )

 (3)     | A - V S V' | / ( |A| n ulp )  computed by SSBTRD with
                                         UPLO='L'

 (4)     | I - UU' | / ( n ulp )

 (5)     | D1 - D2 | / ( |D1| ulp )      where D1 is computed by
                                         SSBTRD with UPLO='U' and
                                         D2 is computed by
                                         SSYTRD_SB2ST with UPLO='U'

 (6)     | D1 - D3 | / ( |D1| ulp )      where D1 is computed by
                                         SSBTRD with UPLO='U' and
                                         D3 is computed by
                                         SSYTRD_SB2ST with UPLO='L'

 The "sizes" are specified by an array NN(1:NSIZES); the value of
 each element NN(j) specifies one size.
 The "types" are specified by a logical array DOTYPE( 1:NTYPES );
 if DOTYPE(j) is .TRUE., then matrix type "j" will be generated.
 Currently, the list of possible types is:

 (1)  The zero matrix.
 (2)  The identity matrix.

 (3)  A diagonal matrix with evenly spaced entries
      1, ..., ULP  and random signs.
      (ULP = (first number larger than 1) - 1 )
 (4)  A diagonal matrix with geometrically spaced entries
      1, ..., ULP  and random signs.
 (5)  A diagonal matrix with "clustered" entries 1, ULP, ..., ULP
      and random signs.

 (6)  Same as (4), but multiplied by SQRT( overflow threshold )
 (7)  Same as (4), but multiplied by SQRT( underflow threshold )

 (8)  A matrix of the form  U' D U, where U is orthogonal and
      D has evenly spaced entries 1, ..., ULP with random signs
      on the diagonal.

 (9)  A matrix of the form  U' D U, where U is orthogonal and
      D has geometrically spaced entries 1, ..., ULP with random
      signs on the diagonal.

 (10) A matrix of the form  U' D U, where U is orthogonal and
      D has "clustered" entries 1, ULP,..., ULP with random
      signs on the diagonal.

 (11) Same as (8), but multiplied by SQRT( overflow threshold )
 (12) Same as (8), but multiplied by SQRT( underflow threshold )

 (13) Symmetric matrix with random entries chosen from (-1,1).
 (14) Same as (13), but multiplied by SQRT( overflow threshold )
 (15) Same as (13), but multiplied by SQRT( underflow threshold )
Parameters
[in]NSIZES
          NSIZES is INTEGER
          The number of sizes of matrices to use.  If it is zero,
          SCHKSB2STG does nothing.  It must be at least zero.
[in]NN
          NN is INTEGER array, dimension (NSIZES)
          An array containing the sizes to be used for the matrices.
          Zero values will be skipped.  The values must be at least
          zero.
[in]NWDTHS
          NWDTHS is INTEGER
          The number of bandwidths to use.  If it is zero,
          SCHKSB2STG does nothing.  It must be at least zero.
[in]KK
          KK is INTEGER array, dimension (NWDTHS)
          An array containing the bandwidths to be used for the band
          matrices.  The values must be at least zero.
[in]NTYPES
          NTYPES is INTEGER
          The number of elements in DOTYPE.   If it is zero, SCHKSB2STG
          does nothing.  It must be at least zero.  If it is MAXTYP+1
          and NSIZES is 1, then an additional type, MAXTYP+1 is
          defined, which is to use whatever matrix is in A.  This
          is only useful if DOTYPE(1:MAXTYP) is .FALSE. and
          DOTYPE(MAXTYP+1) is .TRUE. .
[in]DOTYPE
          DOTYPE is LOGICAL array, dimension (NTYPES)
          If DOTYPE(j) is .TRUE., then for each size in NN a
          matrix of that size and of type j will be generated.
          If NTYPES is smaller than the maximum number of types
          defined (PARAMETER MAXTYP), then types NTYPES+1 through
          MAXTYP will not be generated.  If NTYPES is larger
          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES)
          will be ignored.
[in,out]ISEED
          ISEED is INTEGER array, dimension (4)
          On entry ISEED specifies the seed of the random number
          generator. The array elements should be between 0 and 4095;
          if not they will be reduced mod 4096.  Also, ISEED(4) must
          be odd.  The random number generator uses a linear
          congruential sequence limited to small integers, and so
          should produce machine independent random numbers. The
          values of ISEED are changed on exit, and can be used in the
          next call to SCHKSB2STG to continue the same random number
          sequence.
[in]THRESH
          THRESH is REAL
          A test will count as "failed" if the "error", computed as
          described above, exceeds THRESH.  Note that the error
          is scaled to be O(1), so THRESH should be a reasonably
          small multiple of 1, e.g., 10 or 100.  In particular,
          it should not depend on the precision (single vs. double)
          or the size of the matrix.  It must be at least zero.
[in]NOUNIT
          NOUNIT is INTEGER
          The FORTRAN unit number for printing out error messages
          (e.g., if a routine returns IINFO not equal to 0.)
[in,out]A
          A is REAL array, dimension
                            (LDA, max(NN))
          Used to hold the matrix whose eigenvalues are to be
          computed.
[in]LDA
          LDA is INTEGER
          The leading dimension of A.  It must be at least 2 (not 1!)
          and at least max( KK )+1.
[out]SD
          SD is REAL array, dimension (max(NN))
          Used to hold the diagonal of the tridiagonal matrix computed
          by SSBTRD.
[out]SE
          SE is REAL array, dimension (max(NN))
          Used to hold the off-diagonal of the tridiagonal matrix
          computed by SSBTRD.
[out]D1
          D1 is REAL array, dimension (max(NN))
[out]D2
          D2 is REAL array, dimension (max(NN))
[out]D3
          D3 is REAL array, dimension (max(NN))
[out]U
          U is REAL array, dimension (LDU, max(NN))
          Used to hold the orthogonal matrix computed by SSBTRD.
[in]LDU
          LDU is INTEGER
          The leading dimension of U.  It must be at least 1
          and at least max( NN ).
[out]WORK
          WORK is REAL array, dimension (LWORK)
[in]LWORK
          LWORK is INTEGER
          The number of entries in WORK.  This must be at least
          max( LDA+1, max(NN)+1 )*max(NN).
[out]RESULT
          RESULT is REAL array, dimension (4)
          The values computed by the tests described above.
          The values are currently limited to 1/ulp, to avoid
          overflow.
[out]INFO
          INFO is INTEGER
          If 0, then everything ran OK.

-----------------------------------------------------------------------

       Some Local Variables and Parameters:
       ---- ----- --------- --- ----------
       ZERO, ONE       Real 0 and 1.
       MAXTYP          The number of types defined.
       NTEST           The number of tests performed, or which can
                       be performed so far, for the current matrix.
       NTESTT          The total number of tests performed so far.
       NMAX            Largest value in NN.
       NMATS           The number of matrices generated so far.
       NERRS           The number of tests which have exceeded THRESH
                       so far.
       COND, IMODE     Values to be passed to the matrix generators.
       ANORM           Norm of A; passed to matrix generators.

       OVFL, UNFL      Overflow and underflow thresholds.
       ULP, ULPINV     Finest relative precision and its inverse.
       RTOVFL, RTUNFL  Square roots of the previous 2 values.
               The following four arrays decode JTYPE:
       KTYPE(j)        The general type (1-10) for type "j".
       KMODE(j)        The MODE value to be passed to the matrix
                       generator for type "j".
       KMAGN(j)        The order of magnitude ( O(1),
                       O(overflow^(1/2) ), O(underflow^(1/2) )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 329 of file schksb2stg.f.

332*
333* -- LAPACK test routine --
334* -- LAPACK is a software package provided by Univ. of Tennessee, --
335* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
336*
337* .. Scalar Arguments ..
338 INTEGER INFO, LDA, LDU, LWORK, NOUNIT, NSIZES, NTYPES,
339 $ NWDTHS
340 REAL THRESH
341* ..
342* .. Array Arguments ..
343 LOGICAL DOTYPE( * )
344 INTEGER ISEED( 4 ), KK( * ), NN( * )
345 REAL A( LDA, * ), RESULT( * ), SD( * ), SE( * ),
346 $ D1( * ), D2( * ), D3( * ),
347 $ U( LDU, * ), WORK( * )
348* ..
349*
350* =====================================================================
351*
352* .. Parameters ..
353 REAL ZERO, ONE, TWO, TEN
354 parameter( zero = 0.0e0, one = 1.0e0, two = 2.0e0,
355 $ ten = 10.0e0 )
356 REAL HALF
357 parameter( half = one / two )
358 INTEGER MAXTYP
359 parameter( maxtyp = 15 )
360* ..
361* .. Local Scalars ..
362 LOGICAL BADNN, BADNNB
363 INTEGER I, IINFO, IMODE, ITYPE, J, JC, JCOL, JR, JSIZE,
364 $ JTYPE, JWIDTH, K, KMAX, LH, LW, MTYPES, N,
365 $ NERRS, NMATS, NMAX, NTEST, NTESTT
366 REAL ANINV, ANORM, COND, OVFL, RTOVFL, RTUNFL,
367 $ TEMP1, TEMP2, TEMP3, TEMP4, ULP, ULPINV, UNFL
368* ..
369* .. Local Arrays ..
370 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KMAGN( MAXTYP ),
371 $ KMODE( MAXTYP ), KTYPE( MAXTYP )
372* ..
373* .. External Functions ..
374 REAL SLAMCH
375 EXTERNAL slamch
376* ..
377* .. External Subroutines ..
378 EXTERNAL slacpy, slaset, slasum, slatmr, slatms, ssbt21,
380* ..
381* .. Intrinsic Functions ..
382 INTRINSIC abs, real, max, min, sqrt
383* ..
384* .. Data statements ..
385 DATA ktype / 1, 2, 5*4, 5*5, 3*8 /
386 DATA kmagn / 2*1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
387 $ 2, 3 /
388 DATA kmode / 2*0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
389 $ 0, 0 /
390* ..
391* .. Executable Statements ..
392*
393* Check for errors
394*
395 ntestt = 0
396 info = 0
397*
398* Important constants
399*
400 badnn = .false.
401 nmax = 1
402 DO 10 j = 1, nsizes
403 nmax = max( nmax, nn( j ) )
404 IF( nn( j ).LT.0 )
405 $ badnn = .true.
406 10 CONTINUE
407*
408 badnnb = .false.
409 kmax = 0
410 DO 20 j = 1, nsizes
411 kmax = max( kmax, kk( j ) )
412 IF( kk( j ).LT.0 )
413 $ badnnb = .true.
414 20 CONTINUE
415 kmax = min( nmax-1, kmax )
416*
417* Check for errors
418*
419 IF( nsizes.LT.0 ) THEN
420 info = -1
421 ELSE IF( badnn ) THEN
422 info = -2
423 ELSE IF( nwdths.LT.0 ) THEN
424 info = -3
425 ELSE IF( badnnb ) THEN
426 info = -4
427 ELSE IF( ntypes.LT.0 ) THEN
428 info = -5
429 ELSE IF( lda.LT.kmax+1 ) THEN
430 info = -11
431 ELSE IF( ldu.LT.nmax ) THEN
432 info = -15
433 ELSE IF( ( max( lda, nmax )+1 )*nmax.GT.lwork ) THEN
434 info = -17
435 END IF
436*
437 IF( info.NE.0 ) THEN
438 CALL xerbla( 'SCHKSB2STG', -info )
439 RETURN
440 END IF
441*
442* Quick return if possible
443*
444 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 .OR. nwdths.EQ.0 )
445 $ RETURN
446*
447* More Important constants
448*
449 unfl = slamch( 'Safe minimum' )
450 ovfl = one / unfl
451 ulp = slamch( 'Epsilon' )*slamch( 'Base' )
452 ulpinv = one / ulp
453 rtunfl = sqrt( unfl )
454 rtovfl = sqrt( ovfl )
455*
456* Loop over sizes, types
457*
458 nerrs = 0
459 nmats = 0
460*
461 DO 190 jsize = 1, nsizes
462 n = nn( jsize )
463 aninv = one / real( max( 1, n ) )
464*
465 DO 180 jwidth = 1, nwdths
466 k = kk( jwidth )
467 IF( k.GT.n )
468 $ GO TO 180
469 k = max( 0, min( n-1, k ) )
470*
471 IF( nsizes.NE.1 ) THEN
472 mtypes = min( maxtyp, ntypes )
473 ELSE
474 mtypes = min( maxtyp+1, ntypes )
475 END IF
476*
477 DO 170 jtype = 1, mtypes
478 IF( .NOT.dotype( jtype ) )
479 $ GO TO 170
480 nmats = nmats + 1
481 ntest = 0
482*
483 DO 30 j = 1, 4
484 ioldsd( j ) = iseed( j )
485 30 CONTINUE
486*
487* Compute "A".
488* Store as "Upper"; later, we will copy to other format.
489*
490* Control parameters:
491*
492* KMAGN KMODE KTYPE
493* =1 O(1) clustered 1 zero
494* =2 large clustered 2 identity
495* =3 small exponential (none)
496* =4 arithmetic diagonal, (w/ eigenvalues)
497* =5 random log symmetric, w/ eigenvalues
498* =6 random (none)
499* =7 random diagonal
500* =8 random symmetric
501* =9 positive definite
502* =10 diagonally dominant tridiagonal
503*
504 IF( mtypes.GT.maxtyp )
505 $ GO TO 100
506*
507 itype = ktype( jtype )
508 imode = kmode( jtype )
509*
510* Compute norm
511*
512 GO TO ( 40, 50, 60 )kmagn( jtype )
513*
514 40 CONTINUE
515 anorm = one
516 GO TO 70
517*
518 50 CONTINUE
519 anorm = ( rtovfl*ulp )*aninv
520 GO TO 70
521*
522 60 CONTINUE
523 anorm = rtunfl*n*ulpinv
524 GO TO 70
525*
526 70 CONTINUE
527*
528 CALL slaset( 'Full', lda, n, zero, zero, a, lda )
529 iinfo = 0
530 IF( jtype.LE.15 ) THEN
531 cond = ulpinv
532 ELSE
533 cond = ulpinv*aninv / ten
534 END IF
535*
536* Special Matrices -- Identity & Jordan block
537*
538* Zero
539*
540 IF( itype.EQ.1 ) THEN
541 iinfo = 0
542*
543 ELSE IF( itype.EQ.2 ) THEN
544*
545* Identity
546*
547 DO 80 jcol = 1, n
548 a( k+1, jcol ) = anorm
549 80 CONTINUE
550*
551 ELSE IF( itype.EQ.4 ) THEN
552*
553* Diagonal Matrix, [Eigen]values Specified
554*
555 CALL slatms( n, n, 'S', iseed, 'S', work, imode, cond,
556 $ anorm, 0, 0, 'Q', a( k+1, 1 ), lda,
557 $ work( n+1 ), iinfo )
558*
559 ELSE IF( itype.EQ.5 ) THEN
560*
561* Symmetric, eigenvalues specified
562*
563 CALL slatms( n, n, 'S', iseed, 'S', work, imode, cond,
564 $ anorm, k, k, 'Q', a, lda, work( n+1 ),
565 $ iinfo )
566*
567 ELSE IF( itype.EQ.7 ) THEN
568*
569* Diagonal, random eigenvalues
570*
571 CALL slatmr( n, n, 'S', iseed, 'S', work, 6, one, one,
572 $ 'T', 'N', work( n+1 ), 1, one,
573 $ work( 2*n+1 ), 1, one, 'N', idumma, 0, 0,
574 $ zero, anorm, 'Q', a( k+1, 1 ), lda,
575 $ idumma, iinfo )
576*
577 ELSE IF( itype.EQ.8 ) THEN
578*
579* Symmetric, random eigenvalues
580*
581 CALL slatmr( n, n, 'S', iseed, 'S', work, 6, one, one,
582 $ 'T', 'N', work( n+1 ), 1, one,
583 $ work( 2*n+1 ), 1, one, 'N', idumma, k, k,
584 $ zero, anorm, 'Q', a, lda, idumma, iinfo )
585*
586 ELSE IF( itype.EQ.9 ) THEN
587*
588* Positive definite, eigenvalues specified.
589*
590 CALL slatms( n, n, 'S', iseed, 'P', work, imode, cond,
591 $ anorm, k, k, 'Q', a, lda, work( n+1 ),
592 $ iinfo )
593*
594 ELSE IF( itype.EQ.10 ) THEN
595*
596* Positive definite tridiagonal, eigenvalues specified.
597*
598 IF( n.GT.1 )
599 $ k = max( 1, k )
600 CALL slatms( n, n, 'S', iseed, 'P', work, imode, cond,
601 $ anorm, 1, 1, 'Q', a( k, 1 ), lda,
602 $ work( n+1 ), iinfo )
603 DO 90 i = 2, n
604 temp1 = abs( a( k, i ) ) /
605 $ sqrt( abs( a( k+1, i-1 )*a( k+1, i ) ) )
606 IF( temp1.GT.half ) THEN
607 a( k, i ) = half*sqrt( abs( a( k+1,
608 $ i-1 )*a( k+1, i ) ) )
609 END IF
610 90 CONTINUE
611*
612 ELSE
613*
614 iinfo = 1
615 END IF
616*
617 IF( iinfo.NE.0 ) THEN
618 WRITE( nounit, fmt = 9999 )'Generator', iinfo, n,
619 $ jtype, ioldsd
620 info = abs( iinfo )
621 RETURN
622 END IF
623*
624 100 CONTINUE
625*
626* Call SSBTRD to compute S and U from upper triangle.
627*
628 CALL slacpy( ' ', k+1, n, a, lda, work, lda )
629*
630 ntest = 1
631 CALL ssbtrd( 'V', 'U', n, k, work, lda, sd, se, u, ldu,
632 $ work( lda*n+1 ), iinfo )
633*
634 IF( iinfo.NE.0 ) THEN
635 WRITE( nounit, fmt = 9999 )'SSBTRD(U)', iinfo, n,
636 $ jtype, ioldsd
637 info = abs( iinfo )
638 IF( iinfo.LT.0 ) THEN
639 RETURN
640 ELSE
641 result( 1 ) = ulpinv
642 GO TO 150
643 END IF
644 END IF
645*
646* Do tests 1 and 2
647*
648 CALL ssbt21( 'Upper', n, k, 1, a, lda, sd, se, u, ldu,
649 $ work, result( 1 ) )
650*
651* Before converting A into lower for SSBTRD, run SSYTRD_SB2ST
652* otherwise matrix A will be converted to lower and then need
653* to be converted back to upper in order to run the upper case
654* ofSSYTRD_SB2ST
655*
656* Compute D1 the eigenvalues resulting from the tridiagonal
657* form using the SSBTRD and used as reference to compare
658* with the SSYTRD_SB2ST routine
659*
660* Compute D1 from the SSBTRD and used as reference for the
661* SSYTRD_SB2ST
662*
663 CALL scopy( n, sd, 1, d1, 1 )
664 IF( n.GT.0 )
665 $ CALL scopy( n-1, se, 1, work, 1 )
666*
667 CALL ssteqr( 'N', n, d1, work, work( n+1 ), ldu,
668 $ work( n+1 ), iinfo )
669 IF( iinfo.NE.0 ) THEN
670 WRITE( nounit, fmt = 9999 )'SSTEQR(N)', iinfo, n,
671 $ jtype, ioldsd
672 info = abs( iinfo )
673 IF( iinfo.LT.0 ) THEN
674 RETURN
675 ELSE
676 result( 5 ) = ulpinv
677 GO TO 150
678 END IF
679 END IF
680*
681* SSYTRD_SB2ST Upper case is used to compute D2.
682* Note to set SD and SE to zero to be sure not reusing
683* the one from above. Compare it with D1 computed
684* using the SSBTRD.
685*
686 CALL slaset( 'Full', n, 1, zero, zero, sd, n )
687 CALL slaset( 'Full', n, 1, zero, zero, se, n )
688 CALL slacpy( ' ', k+1, n, a, lda, u, ldu )
689 lh = max(1, 4*n)
690 lw = lwork - lh
691 CALL ssytrd_sb2st( 'N', 'N', "U", n, k, u, ldu, sd, se,
692 $ work, lh, work( lh+1 ), lw, iinfo )
693*
694* Compute D2 from the SSYTRD_SB2ST Upper case
695*
696 CALL scopy( n, sd, 1, d2, 1 )
697 IF( n.GT.0 )
698 $ CALL scopy( n-1, se, 1, work, 1 )
699*
700 CALL ssteqr( 'N', n, d2, work, work( n+1 ), ldu,
701 $ work( n+1 ), iinfo )
702 IF( iinfo.NE.0 ) THEN
703 WRITE( nounit, fmt = 9999 )'SSTEQR(N)', iinfo, n,
704 $ jtype, ioldsd
705 info = abs( iinfo )
706 IF( iinfo.LT.0 ) THEN
707 RETURN
708 ELSE
709 result( 5 ) = ulpinv
710 GO TO 150
711 END IF
712 END IF
713*
714* Convert A from Upper-Triangle-Only storage to
715* Lower-Triangle-Only storage.
716*
717 DO 120 jc = 1, n
718 DO 110 jr = 0, min( k, n-jc )
719 a( jr+1, jc ) = a( k+1-jr, jc+jr )
720 110 CONTINUE
721 120 CONTINUE
722 DO 140 jc = n + 1 - k, n
723 DO 130 jr = min( k, n-jc ) + 1, k
724 a( jr+1, jc ) = zero
725 130 CONTINUE
726 140 CONTINUE
727*
728* Call SSBTRD to compute S and U from lower triangle
729*
730 CALL slacpy( ' ', k+1, n, a, lda, work, lda )
731*
732 ntest = 3
733 CALL ssbtrd( 'V', 'L', n, k, work, lda, sd, se, u, ldu,
734 $ work( lda*n+1 ), iinfo )
735*
736 IF( iinfo.NE.0 ) THEN
737 WRITE( nounit, fmt = 9999 )'SSBTRD(L)', iinfo, n,
738 $ jtype, ioldsd
739 info = abs( iinfo )
740 IF( iinfo.LT.0 ) THEN
741 RETURN
742 ELSE
743 result( 3 ) = ulpinv
744 GO TO 150
745 END IF
746 END IF
747 ntest = 4
748*
749* Do tests 3 and 4
750*
751 CALL ssbt21( 'Lower', n, k, 1, a, lda, sd, se, u, ldu,
752 $ work, result( 3 ) )
753*
754* SSYTRD_SB2ST Lower case is used to compute D3.
755* Note to set SD and SE to zero to be sure not reusing
756* the one from above. Compare it with D1 computed
757* using the SSBTRD.
758*
759 CALL slaset( 'Full', n, 1, zero, zero, sd, n )
760 CALL slaset( 'Full', n, 1, zero, zero, se, n )
761 CALL slacpy( ' ', k+1, n, a, lda, u, ldu )
762 lh = max(1, 4*n)
763 lw = lwork - lh
764 CALL ssytrd_sb2st( 'N', 'N', "L", n, k, u, ldu, sd, se,
765 $ work, lh, work( lh+1 ), lw, iinfo )
766*
767* Compute D3 from the 2-stage Upper case
768*
769 CALL scopy( n, sd, 1, d3, 1 )
770 IF( n.GT.0 )
771 $ CALL scopy( n-1, se, 1, work, 1 )
772*
773 CALL ssteqr( 'N', n, d3, work, work( n+1 ), ldu,
774 $ work( n+1 ), iinfo )
775 IF( iinfo.NE.0 ) THEN
776 WRITE( nounit, fmt = 9999 )'SSTEQR(N)', iinfo, n,
777 $ jtype, ioldsd
778 info = abs( iinfo )
779 IF( iinfo.LT.0 ) THEN
780 RETURN
781 ELSE
782 result( 6 ) = ulpinv
783 GO TO 150
784 END IF
785 END IF
786*
787*
788* Do Tests 3 and 4 which are similar to 11 and 12 but with the
789* D1 computed using the standard 1-stage reduction as reference
790*
791 ntest = 6
792 temp1 = zero
793 temp2 = zero
794 temp3 = zero
795 temp4 = zero
796*
797 DO 151 j = 1, n
798 temp1 = max( temp1, abs( d1( j ) ), abs( d2( j ) ) )
799 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
800 temp3 = max( temp3, abs( d1( j ) ), abs( d3( j ) ) )
801 temp4 = max( temp4, abs( d1( j )-d3( j ) ) )
802 151 CONTINUE
803*
804 result(5) = temp2 / max( unfl, ulp*max( temp1, temp2 ) )
805 result(6) = temp4 / max( unfl, ulp*max( temp3, temp4 ) )
806*
807* End of Loop -- Check for RESULT(j) > THRESH
808*
809 150 CONTINUE
810 ntestt = ntestt + ntest
811*
812* Print out tests which fail.
813*
814 DO 160 jr = 1, ntest
815 IF( result( jr ).GE.thresh ) THEN
816*
817* If this is the first test to fail,
818* print a header to the data file.
819*
820 IF( nerrs.EQ.0 ) THEN
821 WRITE( nounit, fmt = 9998 )'SSB'
822 WRITE( nounit, fmt = 9997 )
823 WRITE( nounit, fmt = 9996 )
824 WRITE( nounit, fmt = 9995 )'Symmetric'
825 WRITE( nounit, fmt = 9994 )'orthogonal', '''',
826 $ 'transpose', ( '''', j = 1, 6 )
827 END IF
828 nerrs = nerrs + 1
829 WRITE( nounit, fmt = 9993 )n, k, ioldsd, jtype,
830 $ jr, result( jr )
831 END IF
832 160 CONTINUE
833*
834 170 CONTINUE
835 180 CONTINUE
836 190 CONTINUE
837*
838* Summary
839*
840 CALL slasum( 'SSB', nounit, nerrs, ntestt )
841 RETURN
842*
843 9999 FORMAT( ' SCHKSB2STG: ', a, ' returned INFO=', i6, '.', / 9x,
844 $ 'N=', i6, ', JTYPE=', i6, ', ISEED=(', 3( i5, ',' ), i5,
845 $ ')' )
846*
847 9998 FORMAT( / 1x, a3,
848 $ ' -- Real Symmetric Banded Tridiagonal Reduction Routines' )
849 9997 FORMAT( ' Matrix types (see SCHKSB2STG for details): ' )
850*
851 9996 FORMAT( / ' Special Matrices:',
852 $ / ' 1=Zero matrix. ',
853 $ ' 5=Diagonal: clustered entries.',
854 $ / ' 2=Identity matrix. ',
855 $ ' 6=Diagonal: large, evenly spaced.',
856 $ / ' 3=Diagonal: evenly spaced entries. ',
857 $ ' 7=Diagonal: small, evenly spaced.',
858 $ / ' 4=Diagonal: geometr. spaced entries.' )
859 9995 FORMAT( ' Dense ', a, ' Banded Matrices:',
860 $ / ' 8=Evenly spaced eigenvals. ',
861 $ ' 12=Small, evenly spaced eigenvals.',
862 $ / ' 9=Geometrically spaced eigenvals. ',
863 $ ' 13=Matrix with random O(1) entries.',
864 $ / ' 10=Clustered eigenvalues. ',
865 $ ' 14=Matrix with large random entries.',
866 $ / ' 11=Large, evenly spaced eigenvals. ',
867 $ ' 15=Matrix with small random entries.' )
868*
869 9994 FORMAT( / ' Tests performed: (S is Tridiag, U is ', a, ',',
870 $ / 20x, a, ' means ', a, '.', / ' UPLO=''U'':',
871 $ / ' 1= | A - U S U', a1, ' | / ( |A| n ulp ) ',
872 $ ' 2= | I - U U', a1, ' | / ( n ulp )', / ' UPLO=''L'':',
873 $ / ' 3= | A - U S U', a1, ' | / ( |A| n ulp ) ',
874 $ ' 4= | I - U U', a1, ' | / ( n ulp )' / ' Eig check:',
875 $ /' 5= | D1 - D2', '', ' | / ( |D1| ulp ) ',
876 $ ' 6= | D1 - D3', '', ' | / ( |D1| ulp ) ' )
877 9993 FORMAT( ' N=', i5, ', K=', i4, ', seed=', 4( i4, ',' ), ' type ',
878 $ i2, ', test(', i2, ')=', g10.3 )
879*
880* End of SCHKSB2STG
881*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
Definition scopy.f:82
subroutine ssbtrd(vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work, info)
SSBTRD
Definition ssbtrd.f:163
subroutine ssytrd_sb2st(stage1, vect, uplo, n, kd, ab, ldab, d, e, hous, lhous, work, lwork, info)
SSYTRD_SB2ST reduces a real symmetric band matrix A to real symmetric tridiagonal form T
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
Definition slacpy.f:103
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
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.
Definition slaset.f:110
subroutine ssteqr(compz, n, d, e, z, ldz, work, info)
SSTEQR
Definition ssteqr.f:131
subroutine slasum(type, iounit, ie, nrun)
SLASUM
Definition slasum.f:41
subroutine slatmr(m, n, dist, iseed, sym, d, mode, cond, dmax, rsign, grade, dl, model, condl, dr, moder, condr, pivtng, ipivot, kl, ku, sparse, anorm, pack, a, lda, iwork, info)
SLATMR
Definition slatmr.f:471
subroutine slatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
SLATMS
Definition slatms.f:321
subroutine ssbt21(uplo, n, ka, ks, a, lda, d, e, u, ldu, work, result)
SSBT21
Definition ssbt21.f:147
Here is the call graph for this function:
Here is the caller graph for this function: