LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ sdrvev()

subroutine sdrvev ( integer  NSIZES,
integer, dimension( * )  NN,
integer  NTYPES,
logical, dimension( * )  DOTYPE,
integer, dimension( 4 )  ISEED,
real  THRESH,
integer  NOUNIT,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( lda, * )  H,
real, dimension( * )  WR,
real, dimension( * )  WI,
real, dimension( * )  WR1,
real, dimension( * )  WI1,
real, dimension( ldvl, * )  VL,
integer  LDVL,
real, dimension( ldvr, * )  VR,
integer  LDVR,
real, dimension( ldlre, * )  LRE,
integer  LDLRE,
real, dimension( 7 )  RESULT,
real, dimension( * )  WORK,
integer  NWORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

SDRVEV

Purpose:
    SDRVEV  checks the nonsymmetric eigenvalue problem driver SGEEV.

    When SDRVEV is called, a number of matrix "sizes" ("n's") and a
    number of matrix "types" are specified.  For each size ("n")
    and each type of matrix, one matrix will be generated and used
    to test the nonsymmetric eigenroutines.  For each matrix, 7
    tests will be performed:

    (1)     | A * VR - VR * W | / ( n |A| ulp )

      Here VR is the matrix of unit right eigenvectors.
      W is a block diagonal matrix, with a 1x1 block for each
      real eigenvalue and a 2x2 block for each complex conjugate
      pair.  If eigenvalues j and j+1 are a complex conjugate pair,
      so WR(j) = WR(j+1) = wr and WI(j) = - WI(j+1) = wi, then the
      2 x 2 block corresponding to the pair will be:

              (  wr  wi  )
              ( -wi  wr  )

      Such a block multiplying an n x 2 matrix  ( ur ui ) on the
      right will be the same as multiplying  ur + i*ui  by  wr + i*wi.

    (2)     | A**H * VL - VL * W**H | / ( n |A| ulp )

      Here VL is the matrix of unit left eigenvectors, A**H is the
      conjugate transpose of A, and W is as above.

    (3)     | |VR(i)| - 1 | / ulp and whether largest component real

      VR(i) denotes the i-th column of VR.

    (4)     | |VL(i)| - 1 | / ulp and whether largest component real

      VL(i) denotes the i-th column of VL.

    (5)     W(full) = W(partial)

      W(full) denotes the eigenvalues computed when both VR and VL
      are also computed, and W(partial) denotes the eigenvalues
      computed when only W, only W and VR, or only W and VL are
      computed.

    (6)     VR(full) = VR(partial)

      VR(full) denotes the right eigenvectors computed when both VR
      and VL are computed, and VR(partial) denotes the result
      when only VR is computed.

     (7)     VL(full) = VL(partial)

      VL(full) denotes the left eigenvectors computed when both VR
      and VL are also computed, and VL(partial) denotes the result
      when only VL is computed.

    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 (transposed) Jordan block, with 1's on the diagonal.

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

    (7)  Same as (4), but multiplied by a constant near
         the overflow threshold
    (8)  Same as (4), but multiplied by a constant near
         the underflow threshold

    (9)  A matrix of the form  U' T U, where U is orthogonal and
         T has evenly spaced entries 1, ..., ULP with random signs
         on the diagonal and random O(1) entries in the upper
         triangle.

    (10) A matrix of the form  U' T U, where U is orthogonal and
         T has geometrically spaced entries 1, ..., ULP with random
         signs on the diagonal and random O(1) entries in the upper
         triangle.

    (11) A matrix of the form  U' T U, where U is orthogonal and
         T has "clustered" entries 1, ULP,..., ULP with random
         signs on the diagonal and random O(1) entries in the upper
         triangle.

    (12) A matrix of the form  U' T U, where U is orthogonal and
         T has real or complex conjugate paired eigenvalues randomly
         chosen from ( ULP, 1 ) and random O(1) entries in the upper
         triangle.

    (13) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has evenly spaced entries 1, ..., ULP
         with random signs on the diagonal and random O(1) entries
         in the upper triangle.

    (14) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has geometrically spaced entries
         1, ..., ULP with random signs on the diagonal and random
         O(1) entries in the upper triangle.

    (15) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has "clustered" entries 1, ULP,..., ULP
         with random signs on the diagonal and random O(1) entries
         in the upper triangle.

    (16) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has real or complex conjugate paired
         eigenvalues randomly chosen from ( ULP, 1 ) and random
         O(1) entries in the upper triangle.

    (17) Same as (16), but multiplied by a constant
         near the overflow threshold
    (18) Same as (16), but multiplied by a constant
         near the underflow threshold

    (19) Nonsymmetric matrix with random entries chosen from (-1,1).
         If N is at least 4, all entries in first two rows and last
         row, and first column and last two columns are zero.
    (20) Same as (19), but multiplied by a constant
         near the overflow threshold
    (21) Same as (19), but multiplied by a constant
         near the underflow threshold
Parameters
[in]NSIZES
          NSIZES is INTEGER
          The number of sizes of matrices to use.  If it is zero,
          SDRVEV 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]NTYPES
          NTYPES is INTEGER
          The number of elements in DOTYPE.   If it is zero, SDRVEV
          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 SDRVEV 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 INFO not equal to 0.)
[out]A
          A is REAL array, dimension (LDA, max(NN))
          Used to hold the matrix whose eigenvalues are to be
          computed.  On exit, A contains the last matrix actually used.
[in]LDA
          LDA is INTEGER
          The leading dimension of A, and H. LDA must be at
          least 1 and at least max(NN).
[out]H
          H is REAL array, dimension (LDA, max(NN))
          Another copy of the test matrix A, modified by SGEEV.
[out]WR
          WR is REAL array, dimension (max(NN))
[out]WI
          WI is REAL array, dimension (max(NN))

          The real and imaginary parts of the eigenvalues of A.
          On exit, WR + WI*i are the eigenvalues of the matrix in A.
[out]WR1
          WR1 is REAL array, dimension (max(NN))
[out]WI1
          WI1 is REAL array, dimension (max(NN))

          Like WR, WI, these arrays contain the eigenvalues of A,
          but those computed when SGEEV only computes a partial
          eigendecomposition, i.e. not the eigenvalues and left
          and right eigenvectors.
[out]VL
          VL is REAL array, dimension (LDVL, max(NN))
          VL holds the computed left eigenvectors.
[in]LDVL
          LDVL is INTEGER
          Leading dimension of VL. Must be at least max(1,max(NN)).
[out]VR
          VR is REAL array, dimension (LDVR, max(NN))
          VR holds the computed right eigenvectors.
[in]LDVR
          LDVR is INTEGER
          Leading dimension of VR. Must be at least max(1,max(NN)).
[out]LRE
          LRE is REAL array, dimension (LDLRE,max(NN))
          LRE holds the computed right or left eigenvectors.
[in]LDLRE
          LDLRE is INTEGER
          Leading dimension of LRE. Must be at least max(1,max(NN)).
[out]RESULT
          RESULT is REAL array, dimension (7)
          The values computed by the seven tests described above.
          The values are currently limited to 1/ulp, to avoid overflow.
[out]WORK
          WORK is REAL array, dimension (NWORK)
[in]NWORK
          NWORK is INTEGER
          The number of entries in WORK.  This must be at least
          5*NN(j)+2*NN(j)**2 for all j.
[out]IWORK
          IWORK is INTEGER array, dimension (max(NN))
[out]INFO
          INFO is INTEGER
          If 0, then everything ran OK.
           -1: NSIZES < 0
           -2: Some NN(j) < 0
           -3: NTYPES < 0
           -6: THRESH < 0
           -9: LDA < 1 or LDA < NMAX, where NMAX is max( NN(j) ).
          -16: LDVL < 1 or LDVL < NMAX, where NMAX is max( NN(j) ).
          -18: LDVR < 1 or LDVR < NMAX, where NMAX is max( NN(j) ).
          -20: LDLRE < 1 or LDLRE < NMAX, where NMAX is max( NN(j) ).
          -23: NWORK too small.
          If  SLATMR, SLATMS, SLATME or SGEEV returns an error code,
              the absolute value of it is returned.

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

     Some Local Variables and Parameters:
     ---- ----- --------- --- ----------

     ZERO, ONE       Real 0 and 1.
     MAXTYP          The number of types defined.
     NMAX            Largest value in NN.
     NERRS           The number of tests which have exceeded THRESH
     COND, CONDS,
     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.
     RTULP, RTULPI   Square roots of the previous 4 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) )
     KCONDS(j)       Selectw whether CONDS is to be 1 or
                     1/sqrt(ulp).  (0 means irrelevant.)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 402 of file sdrvev.f.

406 *
407 * -- LAPACK test routine --
408 * -- LAPACK is a software package provided by Univ. of Tennessee, --
409 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
410 *
411 * .. Scalar Arguments ..
412  INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NOUNIT, NSIZES,
413  $ NTYPES, NWORK
414  REAL THRESH
415 * ..
416 * .. Array Arguments ..
417  LOGICAL DOTYPE( * )
418  INTEGER ISEED( 4 ), IWORK( * ), NN( * )
419  REAL A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),
420  $ RESULT( 7 ), VL( LDVL, * ), VR( LDVR, * ),
421  $ WI( * ), WI1( * ), WORK( * ), WR( * ), WR1( * )
422 * ..
423 *
424 * =====================================================================
425 *
426 * .. Parameters ..
427  REAL ZERO, ONE
428  parameter( zero = 0.0e0, one = 1.0e0 )
429  REAL TWO
430  parameter( two = 2.0e0 )
431  INTEGER MAXTYP
432  parameter( maxtyp = 21 )
433 * ..
434 * .. Local Scalars ..
435  LOGICAL BADNN
436  CHARACTER*3 PATH
437  INTEGER IINFO, IMODE, ITYPE, IWK, J, JCOL, JJ, JSIZE,
438  $ JTYPE, MTYPES, N, NERRS, NFAIL, NMAX,
439  $ NNWORK, NTEST, NTESTF, NTESTT
440  REAL ANORM, COND, CONDS, OVFL, RTULP, RTULPI, TNRM,
441  $ ULP, ULPINV, UNFL, VMX, VRMX, VTST
442 * ..
443 * .. Local Arrays ..
444  CHARACTER ADUMMA( 1 )
445  INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),
446  $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
447  $ KTYPE( MAXTYP )
448  REAL DUM( 1 ), RES( 2 )
449 * ..
450 * .. External Functions ..
451  REAL SLAMCH, SLAPY2, SNRM2
452  EXTERNAL slamch, slapy2, snrm2
453 * ..
454 * .. External Subroutines ..
455  EXTERNAL sgeev, sget22, slabad, slacpy, slasum, slatme,
457 * ..
458 * .. Intrinsic Functions ..
459  INTRINSIC abs, max, min, sqrt
460 * ..
461 * .. Data statements ..
462  DATA ktype / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
463  DATA kmagn / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
464  $ 3, 1, 2, 3 /
465  DATA kmode / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
466  $ 1, 5, 5, 5, 4, 3, 1 /
467  DATA kconds / 3*0, 5*0, 4*1, 6*2, 3*0 /
468 * ..
469 * .. Executable Statements ..
470 *
471  path( 1: 1 ) = 'Single precision'
472  path( 2: 3 ) = 'EV'
473 *
474 * Check for errors
475 *
476  ntestt = 0
477  ntestf = 0
478  info = 0
479 *
480 * Important constants
481 *
482  badnn = .false.
483  nmax = 0
484  DO 10 j = 1, nsizes
485  nmax = max( nmax, nn( j ) )
486  IF( nn( j ).LT.0 )
487  $ badnn = .true.
488  10 CONTINUE
489 *
490 * Check for errors
491 *
492  IF( nsizes.LT.0 ) THEN
493  info = -1
494  ELSE IF( badnn ) THEN
495  info = -2
496  ELSE IF( ntypes.LT.0 ) THEN
497  info = -3
498  ELSE IF( thresh.LT.zero ) THEN
499  info = -6
500  ELSE IF( nounit.LE.0 ) THEN
501  info = -7
502  ELSE IF( lda.LT.1 .OR. lda.LT.nmax ) THEN
503  info = -9
504  ELSE IF( ldvl.LT.1 .OR. ldvl.LT.nmax ) THEN
505  info = -16
506  ELSE IF( ldvr.LT.1 .OR. ldvr.LT.nmax ) THEN
507  info = -18
508  ELSE IF( ldlre.LT.1 .OR. ldlre.LT.nmax ) THEN
509  info = -20
510  ELSE IF( 5*nmax+2*nmax**2.GT.nwork ) THEN
511  info = -23
512  END IF
513 *
514  IF( info.NE.0 ) THEN
515  CALL xerbla( 'SDRVEV', -info )
516  RETURN
517  END IF
518 *
519 * Quick return if nothing to do
520 *
521  IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
522  $ RETURN
523 *
524 * More Important constants
525 *
526  unfl = slamch( 'Safe minimum' )
527  ovfl = one / unfl
528  CALL slabad( unfl, ovfl )
529  ulp = slamch( 'Precision' )
530  ulpinv = one / ulp
531  rtulp = sqrt( ulp )
532  rtulpi = one / rtulp
533 *
534 * Loop over sizes, types
535 *
536  nerrs = 0
537 *
538  DO 270 jsize = 1, nsizes
539  n = nn( jsize )
540  IF( nsizes.NE.1 ) THEN
541  mtypes = min( maxtyp, ntypes )
542  ELSE
543  mtypes = min( maxtyp+1, ntypes )
544  END IF
545 *
546  DO 260 jtype = 1, mtypes
547  IF( .NOT.dotype( jtype ) )
548  $ GO TO 260
549 *
550 * Save ISEED in case of an error.
551 *
552  DO 20 j = 1, 4
553  ioldsd( j ) = iseed( j )
554  20 CONTINUE
555 *
556 * Compute "A"
557 *
558 * Control parameters:
559 *
560 * KMAGN KCONDS KMODE KTYPE
561 * =1 O(1) 1 clustered 1 zero
562 * =2 large large clustered 2 identity
563 * =3 small exponential Jordan
564 * =4 arithmetic diagonal, (w/ eigenvalues)
565 * =5 random log symmetric, w/ eigenvalues
566 * =6 random general, w/ eigenvalues
567 * =7 random diagonal
568 * =8 random symmetric
569 * =9 random general
570 * =10 random triangular
571 *
572  IF( mtypes.GT.maxtyp )
573  $ GO TO 90
574 *
575  itype = ktype( jtype )
576  imode = kmode( jtype )
577 *
578 * Compute norm
579 *
580  GO TO ( 30, 40, 50 )kmagn( jtype )
581 *
582  30 CONTINUE
583  anorm = one
584  GO TO 60
585 *
586  40 CONTINUE
587  anorm = ovfl*ulp
588  GO TO 60
589 *
590  50 CONTINUE
591  anorm = unfl*ulpinv
592  GO TO 60
593 *
594  60 CONTINUE
595 *
596  CALL slaset( 'Full', lda, n, zero, zero, a, lda )
597  iinfo = 0
598  cond = ulpinv
599 *
600 * Special Matrices -- Identity & Jordan block
601 *
602 * Zero
603 *
604  IF( itype.EQ.1 ) THEN
605  iinfo = 0
606 *
607  ELSE IF( itype.EQ.2 ) THEN
608 *
609 * Identity
610 *
611  DO 70 jcol = 1, n
612  a( jcol, jcol ) = anorm
613  70 CONTINUE
614 *
615  ELSE IF( itype.EQ.3 ) THEN
616 *
617 * Jordan Block
618 *
619  DO 80 jcol = 1, n
620  a( jcol, jcol ) = anorm
621  IF( jcol.GT.1 )
622  $ a( jcol, jcol-1 ) = one
623  80 CONTINUE
624 *
625  ELSE IF( itype.EQ.4 ) THEN
626 *
627 * Diagonal Matrix, [Eigen]values Specified
628 *
629  CALL slatms( n, n, 'S', iseed, 'S', work, imode, cond,
630  $ anorm, 0, 0, 'N', a, lda, work( n+1 ),
631  $ iinfo )
632 *
633  ELSE IF( itype.EQ.5 ) THEN
634 *
635 * Symmetric, eigenvalues specified
636 *
637  CALL slatms( n, n, 'S', iseed, 'S', work, imode, cond,
638  $ anorm, n, n, 'N', a, lda, work( n+1 ),
639  $ iinfo )
640 *
641  ELSE IF( itype.EQ.6 ) THEN
642 *
643 * General, eigenvalues specified
644 *
645  IF( kconds( jtype ).EQ.1 ) THEN
646  conds = one
647  ELSE IF( kconds( jtype ).EQ.2 ) THEN
648  conds = rtulpi
649  ELSE
650  conds = zero
651  END IF
652 *
653  adumma( 1 ) = ' '
654  CALL slatme( n, 'S', iseed, work, imode, cond, one,
655  $ adumma, 'T', 'T', 'T', work( n+1 ), 4,
656  $ conds, n, n, anorm, a, lda, work( 2*n+1 ),
657  $ iinfo )
658 *
659  ELSE IF( itype.EQ.7 ) THEN
660 *
661 * Diagonal, random eigenvalues
662 *
663  CALL slatmr( n, n, 'S', iseed, 'S', work, 6, one, one,
664  $ 'T', 'N', work( n+1 ), 1, one,
665  $ work( 2*n+1 ), 1, one, 'N', idumma, 0, 0,
666  $ zero, anorm, 'NO', a, lda, iwork, iinfo )
667 *
668  ELSE IF( itype.EQ.8 ) THEN
669 *
670 * Symmetric, random eigenvalues
671 *
672  CALL slatmr( n, n, 'S', iseed, 'S', work, 6, one, one,
673  $ 'T', 'N', work( n+1 ), 1, one,
674  $ work( 2*n+1 ), 1, one, 'N', idumma, n, n,
675  $ zero, anorm, 'NO', a, lda, iwork, iinfo )
676 *
677  ELSE IF( itype.EQ.9 ) THEN
678 *
679 * General, random eigenvalues
680 *
681  CALL slatmr( n, n, 'S', iseed, 'N', work, 6, one, one,
682  $ 'T', 'N', work( n+1 ), 1, one,
683  $ work( 2*n+1 ), 1, one, 'N', idumma, n, n,
684  $ zero, anorm, 'NO', a, lda, iwork, iinfo )
685  IF( n.GE.4 ) THEN
686  CALL slaset( 'Full', 2, n, zero, zero, a, lda )
687  CALL slaset( 'Full', n-3, 1, zero, zero, a( 3, 1 ),
688  $ lda )
689  CALL slaset( 'Full', n-3, 2, zero, zero, a( 3, n-1 ),
690  $ lda )
691  CALL slaset( 'Full', 1, n, zero, zero, a( n, 1 ),
692  $ lda )
693  END IF
694 *
695  ELSE IF( itype.EQ.10 ) THEN
696 *
697 * Triangular, random eigenvalues
698 *
699  CALL slatmr( n, n, 'S', iseed, 'N', work, 6, one, one,
700  $ 'T', 'N', work( n+1 ), 1, one,
701  $ work( 2*n+1 ), 1, one, 'N', idumma, n, 0,
702  $ zero, anorm, 'NO', a, lda, iwork, iinfo )
703 *
704  ELSE
705 *
706  iinfo = 1
707  END IF
708 *
709  IF( iinfo.NE.0 ) THEN
710  WRITE( nounit, fmt = 9993 )'Generator', iinfo, n, jtype,
711  $ ioldsd
712  info = abs( iinfo )
713  RETURN
714  END IF
715 *
716  90 CONTINUE
717 *
718 * Test for minimal and generous workspace
719 *
720  DO 250 iwk = 1, 2
721  IF( iwk.EQ.1 ) THEN
722  nnwork = 4*n
723  ELSE
724  nnwork = 5*n + 2*n**2
725  END IF
726  nnwork = max( nnwork, 1 )
727 *
728 * Initialize RESULT
729 *
730  DO 100 j = 1, 7
731  result( j ) = -one
732  100 CONTINUE
733 *
734 * Compute eigenvalues and eigenvectors, and test them
735 *
736  CALL slacpy( 'F', n, n, a, lda, h, lda )
737  CALL sgeev( 'V', 'V', n, h, lda, wr, wi, vl, ldvl, vr,
738  $ ldvr, work, nnwork, iinfo )
739  IF( iinfo.NE.0 ) THEN
740  result( 1 ) = ulpinv
741  WRITE( nounit, fmt = 9993 )'SGEEV1', iinfo, n, jtype,
742  $ ioldsd
743  info = abs( iinfo )
744  GO TO 220
745  END IF
746 *
747 * Do Test (1)
748 *
749  CALL sget22( 'N', 'N', 'N', n, a, lda, vr, ldvr, wr, wi,
750  $ work, res )
751  result( 1 ) = res( 1 )
752 *
753 * Do Test (2)
754 *
755  CALL sget22( 'T', 'N', 'T', n, a, lda, vl, ldvl, wr, wi,
756  $ work, res )
757  result( 2 ) = res( 1 )
758 *
759 * Do Test (3)
760 *
761  DO 120 j = 1, n
762  tnrm = one
763  IF( wi( j ).EQ.zero ) THEN
764  tnrm = snrm2( n, vr( 1, j ), 1 )
765  ELSE IF( wi( j ).GT.zero ) THEN
766  tnrm = slapy2( snrm2( n, vr( 1, j ), 1 ),
767  $ snrm2( n, vr( 1, j+1 ), 1 ) )
768  END IF
769  result( 3 ) = max( result( 3 ),
770  $ min( ulpinv, abs( tnrm-one ) / ulp ) )
771  IF( wi( j ).GT.zero ) THEN
772  vmx = zero
773  vrmx = zero
774  DO 110 jj = 1, n
775  vtst = slapy2( vr( jj, j ), vr( jj, j+1 ) )
776  IF( vtst.GT.vmx )
777  $ vmx = vtst
778  IF( vr( jj, j+1 ).EQ.zero .AND.
779  $ abs( vr( jj, j ) ).GT.vrmx )
780  $ vrmx = abs( vr( jj, j ) )
781  110 CONTINUE
782  IF( vrmx / vmx.LT.one-two*ulp )
783  $ result( 3 ) = ulpinv
784  END IF
785  120 CONTINUE
786 *
787 * Do Test (4)
788 *
789  DO 140 j = 1, n
790  tnrm = one
791  IF( wi( j ).EQ.zero ) THEN
792  tnrm = snrm2( n, vl( 1, j ), 1 )
793  ELSE IF( wi( j ).GT.zero ) THEN
794  tnrm = slapy2( snrm2( n, vl( 1, j ), 1 ),
795  $ snrm2( n, vl( 1, j+1 ), 1 ) )
796  END IF
797  result( 4 ) = max( result( 4 ),
798  $ min( ulpinv, abs( tnrm-one ) / ulp ) )
799  IF( wi( j ).GT.zero ) THEN
800  vmx = zero
801  vrmx = zero
802  DO 130 jj = 1, n
803  vtst = slapy2( vl( jj, j ), vl( jj, j+1 ) )
804  IF( vtst.GT.vmx )
805  $ vmx = vtst
806  IF( vl( jj, j+1 ).EQ.zero .AND.
807  $ abs( vl( jj, j ) ).GT.vrmx )
808  $ vrmx = abs( vl( jj, j ) )
809  130 CONTINUE
810  IF( vrmx / vmx.LT.one-two*ulp )
811  $ result( 4 ) = ulpinv
812  END IF
813  140 CONTINUE
814 *
815 * Compute eigenvalues only, and test them
816 *
817  CALL slacpy( 'F', n, n, a, lda, h, lda )
818  CALL sgeev( 'N', 'N', n, h, lda, wr1, wi1, dum, 1, dum,
819  $ 1, work, nnwork, iinfo )
820  IF( iinfo.NE.0 ) THEN
821  result( 1 ) = ulpinv
822  WRITE( nounit, fmt = 9993 )'SGEEV2', iinfo, n, jtype,
823  $ ioldsd
824  info = abs( iinfo )
825  GO TO 220
826  END IF
827 *
828 * Do Test (5)
829 *
830  DO 150 j = 1, n
831  IF( wr( j ).NE.wr1( j ) .OR. wi( j ).NE.wi1( j ) )
832  $ result( 5 ) = ulpinv
833  150 CONTINUE
834 *
835 * Compute eigenvalues and right eigenvectors, and test them
836 *
837  CALL slacpy( 'F', n, n, a, lda, h, lda )
838  CALL sgeev( 'N', 'V', n, h, lda, wr1, wi1, dum, 1, lre,
839  $ ldlre, work, nnwork, iinfo )
840  IF( iinfo.NE.0 ) THEN
841  result( 1 ) = ulpinv
842  WRITE( nounit, fmt = 9993 )'SGEEV3', iinfo, n, jtype,
843  $ ioldsd
844  info = abs( iinfo )
845  GO TO 220
846  END IF
847 *
848 * Do Test (5) again
849 *
850  DO 160 j = 1, n
851  IF( wr( j ).NE.wr1( j ) .OR. wi( j ).NE.wi1( j ) )
852  $ result( 5 ) = ulpinv
853  160 CONTINUE
854 *
855 * Do Test (6)
856 *
857  DO 180 j = 1, n
858  DO 170 jj = 1, n
859  IF( vr( j, jj ).NE.lre( j, jj ) )
860  $ result( 6 ) = ulpinv
861  170 CONTINUE
862  180 CONTINUE
863 *
864 * Compute eigenvalues and left eigenvectors, and test them
865 *
866  CALL slacpy( 'F', n, n, a, lda, h, lda )
867  CALL sgeev( 'V', 'N', n, h, lda, wr1, wi1, lre, ldlre,
868  $ dum, 1, work, nnwork, iinfo )
869  IF( iinfo.NE.0 ) THEN
870  result( 1 ) = ulpinv
871  WRITE( nounit, fmt = 9993 )'SGEEV4', iinfo, n, jtype,
872  $ ioldsd
873  info = abs( iinfo )
874  GO TO 220
875  END IF
876 *
877 * Do Test (5) again
878 *
879  DO 190 j = 1, n
880  IF( wr( j ).NE.wr1( j ) .OR. wi( j ).NE.wi1( j ) )
881  $ result( 5 ) = ulpinv
882  190 CONTINUE
883 *
884 * Do Test (7)
885 *
886  DO 210 j = 1, n
887  DO 200 jj = 1, n
888  IF( vl( j, jj ).NE.lre( j, jj ) )
889  $ result( 7 ) = ulpinv
890  200 CONTINUE
891  210 CONTINUE
892 *
893 * End of Loop -- Check for RESULT(j) > THRESH
894 *
895  220 CONTINUE
896 *
897  ntest = 0
898  nfail = 0
899  DO 230 j = 1, 7
900  IF( result( j ).GE.zero )
901  $ ntest = ntest + 1
902  IF( result( j ).GE.thresh )
903  $ nfail = nfail + 1
904  230 CONTINUE
905 *
906  IF( nfail.GT.0 )
907  $ ntestf = ntestf + 1
908  IF( ntestf.EQ.1 ) THEN
909  WRITE( nounit, fmt = 9999 )path
910  WRITE( nounit, fmt = 9998 )
911  WRITE( nounit, fmt = 9997 )
912  WRITE( nounit, fmt = 9996 )
913  WRITE( nounit, fmt = 9995 )thresh
914  ntestf = 2
915  END IF
916 *
917  DO 240 j = 1, 7
918  IF( result( j ).GE.thresh ) THEN
919  WRITE( nounit, fmt = 9994 )n, iwk, ioldsd, jtype,
920  $ j, result( j )
921  END IF
922  240 CONTINUE
923 *
924  nerrs = nerrs + nfail
925  ntestt = ntestt + ntest
926 *
927  250 CONTINUE
928  260 CONTINUE
929  270 CONTINUE
930 *
931 * Summary
932 *
933  CALL slasum( path, nounit, nerrs, ntestt )
934 *
935  9999 FORMAT( / 1x, a3, ' -- Real Eigenvalue-Eigenvector Decomposition',
936  $ ' Driver', / ' Matrix types (see SDRVEV for details): ' )
937 *
938  9998 FORMAT( / ' Special Matrices:', / ' 1=Zero matrix. ',
939  $ ' ', ' 5=Diagonal: geometr. spaced entries.',
940  $ / ' 2=Identity matrix. ', ' 6=Diagona',
941  $ 'l: clustered entries.', / ' 3=Transposed Jordan block. ',
942  $ ' ', ' 7=Diagonal: large, evenly spaced.', / ' ',
943  $ '4=Diagonal: evenly spaced entries. ', ' 8=Diagonal: s',
944  $ 'mall, evenly spaced.' )
945  9997 FORMAT( ' Dense, Non-Symmetric Matrices:', / ' 9=Well-cond., ev',
946  $ 'enly spaced eigenvals.', ' 14=Ill-cond., geomet. spaced e',
947  $ 'igenals.', / ' 10=Well-cond., geom. spaced eigenvals. ',
948  $ ' 15=Ill-conditioned, clustered e.vals.', / ' 11=Well-cond',
949  $ 'itioned, clustered e.vals. ', ' 16=Ill-cond., random comp',
950  $ 'lex ', / ' 12=Well-cond., random complex ', 6x, ' ',
951  $ ' 17=Ill-cond., large rand. complx ', / ' 13=Ill-condi',
952  $ 'tioned, evenly spaced. ', ' 18=Ill-cond., small rand.',
953  $ ' complx ' )
954  9996 FORMAT( ' 19=Matrix with random O(1) entries. ', ' 21=Matrix ',
955  $ 'with small random entries.', / ' 20=Matrix with large ran',
956  $ 'dom entries. ', / )
957  9995 FORMAT( ' Tests performed with test threshold =', f8.2,
958  $ / / ' 1 = | A VR - VR W | / ( n |A| ulp ) ',
959  $ / ' 2 = | transpose(A) VL - VL W | / ( n |A| ulp ) ',
960  $ / ' 3 = | |VR(i)| - 1 | / ulp ',
961  $ / ' 4 = | |VL(i)| - 1 | / ulp ',
962  $ / ' 5 = 0 if W same no matter if VR or VL computed,',
963  $ ' 1/ulp otherwise', /
964  $ ' 6 = 0 if VR same no matter if VL computed,',
965  $ ' 1/ulp otherwise', /
966  $ ' 7 = 0 if VL same no matter if VR computed,',
967  $ ' 1/ulp otherwise', / )
968  9994 FORMAT( ' N=', i5, ', IWK=', i2, ', seed=', 4( i4, ',' ),
969  $ ' type ', i2, ', test(', i2, ')=', g10.3 )
970  9993 FORMAT( ' SDRVEV: ', a, ' returned INFO=', i6, '.', / 9x, 'N=',
971  $ i6, ', JTYPE=', i6, ', ISEED=(', 3( i5, ',' ), i5, ')' )
972 *
973  RETURN
974 *
975 * End of SDRVEV
976 *
subroutine slabad(SMALL, LARGE)
SLABAD
Definition: slabad.f:74
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 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 slapy2(X, Y)
SLAPY2 returns sqrt(x2+y2).
Definition: slapy2.f:63
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
subroutine slatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
SLATMS
Definition: slatms.f:321
subroutine slatme(N, DIST, ISEED, D, MODE, COND, DMAX, EI, RSIGN, UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM, A, LDA, WORK, INFO)
SLATME
Definition: slatme.f:332
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 sgeev(JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
SGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices
Definition: sgeev.f:192
real(wp) function snrm2(n, x, incx)
SNRM2
Definition: snrm2.f90:89
subroutine sget22(TRANSA, TRANSE, TRANSW, N, A, LDA, E, LDE, WR, WI, WORK, RESULT)
SGET22
Definition: sget22.f:168
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
subroutine slasum(TYPE, IOUNIT, IE, NRUN)
SLASUM
Definition: slasum.f:41
Here is the call graph for this function:
Here is the caller graph for this function: