LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ 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 
)

SCHKSBSTG

Purpose:
 SCHKSBSTG 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; SCHKSBSTG 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; SCHKSBSTG 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 SCHKSBSTG 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,
          SCHKSBSTG 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,
          SCHKSBSTG 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, SCHKSBSTG
          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 SCHKSBSTG 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]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.
Date
June 2017

Definition at line 318 of file schksb2stg.f.

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