LAPACK 3.3.1
Linear Algebra PACKage

zerred.f

Go to the documentation of this file.
00001       SUBROUTINE ZERRED( PATH, NUNIT )
00002 *
00003 *  -- LAPACK test routine (version 3.1) --
00004 *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
00005 *     November 2006
00006 *
00007 *     .. Scalar Arguments ..
00008       CHARACTER*3        PATH
00009       INTEGER            NUNIT
00010 *     ..
00011 *
00012 *  Purpose
00013 *  =======
00014 *
00015 *  ZERRED tests the error exits for the eigenvalue driver routines for
00016 *  DOUBLE PRECISION matrices:
00017 *
00018 *  PATH  driver   description
00019 *  ----  ------   -----------
00020 *  ZEV   ZGEEV    find eigenvalues/eigenvectors for nonsymmetric A
00021 *  ZES   ZGEES    find eigenvalues/Schur form for nonsymmetric A
00022 *  ZVX   ZGEEVX   ZGEEV + balancing and condition estimation
00023 *  ZSX   ZGEESX   ZGEES + balancing and condition estimation
00024 *  ZBD   ZGESVD   compute SVD of an M-by-N matrix A
00025 *        ZGESDD   compute SVD of an M-by-N matrix A(by divide and
00026 *                 conquer)
00027 *
00028 *  Arguments
00029 *  =========
00030 *
00031 *  PATH    (input) CHARACTER*3
00032 *          The LAPACK path name for the routines to be tested.
00033 *
00034 *  NUNIT   (input) INTEGER
00035 *          The unit number for output.
00036 *
00037 *  =====================================================================
00038 *
00039 *     .. Parameters ..
00040       INTEGER            NMAX, LW
00041       PARAMETER          ( NMAX = 4, LW = 5*NMAX )
00042       DOUBLE PRECISION   ONE, ZERO
00043       PARAMETER          ( ONE = 1.0D0, ZERO = 0.0D0 )
00044 *     ..
00045 *     .. Local Scalars ..
00046       CHARACTER*2        C2
00047       INTEGER            I, IHI, ILO, INFO, J, NT, SDIM
00048       DOUBLE PRECISION   ABNRM
00049 *     ..
00050 *     .. Local Arrays ..
00051       LOGICAL            B( NMAX )
00052       INTEGER            IW( 4*NMAX )
00053       DOUBLE PRECISION   R1( NMAX ), R2( NMAX ), RW( LW ), S( NMAX )
00054       COMPLEX*16         A( NMAX, NMAX ), U( NMAX, NMAX ),
00055      $                   VL( NMAX, NMAX ), VR( NMAX, NMAX ),
00056      $                   VT( NMAX, NMAX ), W( 4*NMAX ), X( NMAX )
00057 *     ..
00058 *     .. External Subroutines ..
00059       EXTERNAL           CHKXER, ZGEES, ZGEESX, ZGEEV, ZGEEVX, ZGESDD,
00060      $                   ZGESVD
00061 *     ..
00062 *     .. External Functions ..
00063       LOGICAL            LSAMEN, ZSLECT
00064       EXTERNAL           LSAMEN, ZSLECT
00065 *     ..
00066 *     .. Intrinsic Functions ..
00067       INTRINSIC          LEN_TRIM
00068 *     ..
00069 *     .. Arrays in Common ..
00070       LOGICAL            SELVAL( 20 )
00071       DOUBLE PRECISION   SELWI( 20 ), SELWR( 20 )
00072 *     ..
00073 *     .. Scalars in Common ..
00074       LOGICAL            LERR, OK
00075       CHARACTER*32       SRNAMT
00076       INTEGER            INFOT, NOUT, SELDIM, SELOPT
00077 *     ..
00078 *     .. Common blocks ..
00079       COMMON             / INFOC / INFOT, NOUT, OK, LERR
00080       COMMON             / SRNAMC / SRNAMT
00081       COMMON             / SSLCT / SELOPT, SELDIM, SELVAL, SELWR, SELWI
00082 *     ..
00083 *     .. Executable Statements ..
00084 *
00085       NOUT = NUNIT
00086       WRITE( NOUT, FMT = * )
00087       C2 = PATH( 2: 3 )
00088 *
00089 *     Initialize A
00090 *
00091       DO 20 J = 1, NMAX
00092          DO 10 I = 1, NMAX
00093             A( I, J ) = ZERO
00094    10    CONTINUE
00095    20 CONTINUE
00096       DO 30 I = 1, NMAX
00097          A( I, I ) = ONE
00098    30 CONTINUE
00099       OK = .TRUE.
00100       NT = 0
00101 *
00102       IF( LSAMEN( 2, C2, 'EV' ) ) THEN
00103 *
00104 *        Test ZGEEV
00105 *
00106          SRNAMT = 'ZGEEV '
00107          INFOT = 1
00108          CALL ZGEEV( 'X', 'N', 0, A, 1, X, VL, 1, VR, 1, W, 1, RW,
00109      $               INFO )
00110          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00111          INFOT = 2
00112          CALL ZGEEV( 'N', 'X', 0, A, 1, X, VL, 1, VR, 1, W, 1, RW,
00113      $               INFO )
00114          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00115          INFOT = 3
00116          CALL ZGEEV( 'N', 'N', -1, A, 1, X, VL, 1, VR, 1, W, 1, RW,
00117      $               INFO )
00118          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00119          INFOT = 5
00120          CALL ZGEEV( 'N', 'N', 2, A, 1, X, VL, 1, VR, 1, W, 4, RW,
00121      $               INFO )
00122          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00123          INFOT = 8
00124          CALL ZGEEV( 'V', 'N', 2, A, 2, X, VL, 1, VR, 1, W, 4, RW,
00125      $               INFO )
00126          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00127          INFOT = 10
00128          CALL ZGEEV( 'N', 'V', 2, A, 2, X, VL, 1, VR, 1, W, 4, RW,
00129      $               INFO )
00130          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00131          INFOT = 12
00132          CALL ZGEEV( 'V', 'V', 1, A, 1, X, VL, 1, VR, 1, W, 1, RW,
00133      $               INFO )
00134          CALL CHKXER( 'ZGEEV ', INFOT, NOUT, LERR, OK )
00135          NT = NT + 7
00136 *
00137       ELSE IF( LSAMEN( 2, C2, 'ES' ) ) THEN
00138 *
00139 *        Test ZGEES
00140 *
00141          SRNAMT = 'ZGEES '
00142          INFOT = 1
00143          CALL ZGEES( 'X', 'N', ZSLECT, 0, A, 1, SDIM, X, VL, 1, W, 1,
00144      $               RW, B, INFO )
00145          CALL CHKXER( 'ZGEES ', INFOT, NOUT, LERR, OK )
00146          INFOT = 2
00147          CALL ZGEES( 'N', 'X', ZSLECT, 0, A, 1, SDIM, X, VL, 1, W, 1,
00148      $               RW, B, INFO )
00149          CALL CHKXER( 'ZGEES ', INFOT, NOUT, LERR, OK )
00150          INFOT = 4
00151          CALL ZGEES( 'N', 'S', ZSLECT, -1, A, 1, SDIM, X, VL, 1, W, 1,
00152      $               RW, B, INFO )
00153          CALL CHKXER( 'ZGEES ', INFOT, NOUT, LERR, OK )
00154          INFOT = 6
00155          CALL ZGEES( 'N', 'S', ZSLECT, 2, A, 1, SDIM, X, VL, 1, W, 4,
00156      $               RW, B, INFO )
00157          CALL CHKXER( 'ZGEES ', INFOT, NOUT, LERR, OK )
00158          INFOT = 10
00159          CALL ZGEES( 'V', 'S', ZSLECT, 2, A, 2, SDIM, X, VL, 1, W, 4,
00160      $               RW, B, INFO )
00161          CALL CHKXER( 'ZGEES ', INFOT, NOUT, LERR, OK )
00162          INFOT = 12
00163          CALL ZGEES( 'N', 'S', ZSLECT, 1, A, 1, SDIM, X, VL, 1, W, 1,
00164      $               RW, B, INFO )
00165          CALL CHKXER( 'ZGEES ', INFOT, NOUT, LERR, OK )
00166          NT = NT + 6
00167 *
00168       ELSE IF( LSAMEN( 2, C2, 'VX' ) ) THEN
00169 *
00170 *        Test ZGEEVX
00171 *
00172          SRNAMT = 'ZGEEVX'
00173          INFOT = 1
00174          CALL ZGEEVX( 'X', 'N', 'N', 'N', 0, A, 1, X, VL, 1, VR, 1, ILO,
00175      $                IHI, S, ABNRM, R1, R2, W, 1, RW, INFO )
00176          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00177          INFOT = 2
00178          CALL ZGEEVX( 'N', 'X', 'N', 'N', 0, A, 1, X, VL, 1, VR, 1, ILO,
00179      $                IHI, S, ABNRM, R1, R2, W, 1, RW, INFO )
00180          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00181          INFOT = 3
00182          CALL ZGEEVX( 'N', 'N', 'X', 'N', 0, A, 1, X, VL, 1, VR, 1, ILO,
00183      $                IHI, S, ABNRM, R1, R2, W, 1, RW, INFO )
00184          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00185          INFOT = 4
00186          CALL ZGEEVX( 'N', 'N', 'N', 'X', 0, A, 1, X, VL, 1, VR, 1, ILO,
00187      $                IHI, S, ABNRM, R1, R2, W, 1, RW, INFO )
00188          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00189          INFOT = 5
00190          CALL ZGEEVX( 'N', 'N', 'N', 'N', -1, A, 1, X, VL, 1, VR, 1,
00191      $                ILO, IHI, S, ABNRM, R1, R2, W, 1, RW, INFO )
00192          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00193          INFOT = 7
00194          CALL ZGEEVX( 'N', 'N', 'N', 'N', 2, A, 1, X, VL, 1, VR, 1, ILO,
00195      $                IHI, S, ABNRM, R1, R2, W, 4, RW, INFO )
00196          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00197          INFOT = 10
00198          CALL ZGEEVX( 'N', 'V', 'N', 'N', 2, A, 2, X, VL, 1, VR, 1, ILO,
00199      $                IHI, S, ABNRM, R1, R2, W, 4, RW, INFO )
00200          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00201          INFOT = 12
00202          CALL ZGEEVX( 'N', 'N', 'V', 'N', 2, A, 2, X, VL, 1, VR, 1, ILO,
00203      $                IHI, S, ABNRM, R1, R2, W, 4, RW, INFO )
00204          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00205          INFOT = 20
00206          CALL ZGEEVX( 'N', 'N', 'N', 'N', 1, A, 1, X, VL, 1, VR, 1, ILO,
00207      $                IHI, S, ABNRM, R1, R2, W, 1, RW, INFO )
00208          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00209          INFOT = 20
00210          CALL ZGEEVX( 'N', 'N', 'V', 'V', 1, A, 1, X, VL, 1, VR, 1, ILO,
00211      $                IHI, S, ABNRM, R1, R2, W, 2, RW, INFO )
00212          CALL CHKXER( 'ZGEEVX', INFOT, NOUT, LERR, OK )
00213          NT = NT + 10
00214 *
00215       ELSE IF( LSAMEN( 2, C2, 'SX' ) ) THEN
00216 *
00217 *        Test ZGEESX
00218 *
00219          SRNAMT = 'ZGEESX'
00220          INFOT = 1
00221          CALL ZGEESX( 'X', 'N', ZSLECT, 'N', 0, A, 1, SDIM, X, VL, 1,
00222      $                R1( 1 ), R2( 1 ), W, 1, RW, B, INFO )
00223          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00224          INFOT = 2
00225          CALL ZGEESX( 'N', 'X', ZSLECT, 'N', 0, A, 1, SDIM, X, VL, 1,
00226      $                R1( 1 ), R2( 1 ), W, 1, RW, B, INFO )
00227          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00228          INFOT = 4
00229          CALL ZGEESX( 'N', 'N', ZSLECT, 'X', 0, A, 1, SDIM, X, VL, 1,
00230      $                R1( 1 ), R2( 1 ), W, 1, RW, B, INFO )
00231          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00232          INFOT = 5
00233          CALL ZGEESX( 'N', 'N', ZSLECT, 'N', -1, A, 1, SDIM, X, VL, 1,
00234      $                R1( 1 ), R2( 1 ), W, 1, RW, B, INFO )
00235          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00236          INFOT = 7
00237          CALL ZGEESX( 'N', 'N', ZSLECT, 'N', 2, A, 1, SDIM, X, VL, 1,
00238      $                R1( 1 ), R2( 1 ), W, 4, RW, B, INFO )
00239          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00240          INFOT = 11
00241          CALL ZGEESX( 'V', 'N', ZSLECT, 'N', 2, A, 2, SDIM, X, VL, 1,
00242      $                R1( 1 ), R2( 1 ), W, 4, RW, B, INFO )
00243          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00244          INFOT = 15
00245          CALL ZGEESX( 'N', 'N', ZSLECT, 'N', 1, A, 1, SDIM, X, VL, 1,
00246      $                R1( 1 ), R2( 1 ), W, 1, RW, B, INFO )
00247          CALL CHKXER( 'ZGEESX', INFOT, NOUT, LERR, OK )
00248          NT = NT + 7
00249 *
00250       ELSE IF( LSAMEN( 2, C2, 'BD' ) ) THEN
00251 *
00252 *        Test ZGESVD
00253 *
00254          SRNAMT = 'ZGESVD'
00255          INFOT = 1
00256          CALL ZGESVD( 'X', 'N', 0, 0, A, 1, S, U, 1, VT, 1, W, 1, RW,
00257      $                INFO )
00258          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00259          INFOT = 2
00260          CALL ZGESVD( 'N', 'X', 0, 0, A, 1, S, U, 1, VT, 1, W, 1, RW,
00261      $                INFO )
00262          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00263          INFOT = 2
00264          CALL ZGESVD( 'O', 'O', 0, 0, A, 1, S, U, 1, VT, 1, W, 1, RW,
00265      $                INFO )
00266          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00267          INFOT = 3
00268          CALL ZGESVD( 'N', 'N', -1, 0, A, 1, S, U, 1, VT, 1, W, 1, RW,
00269      $                INFO )
00270          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00271          INFOT = 4
00272          CALL ZGESVD( 'N', 'N', 0, -1, A, 1, S, U, 1, VT, 1, W, 1, RW,
00273      $                INFO )
00274          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00275          INFOT = 6
00276          CALL ZGESVD( 'N', 'N', 2, 1, A, 1, S, U, 1, VT, 1, W, 5, RW,
00277      $                INFO )
00278          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00279          INFOT = 9
00280          CALL ZGESVD( 'A', 'N', 2, 1, A, 2, S, U, 1, VT, 1, W, 5, RW,
00281      $                INFO )
00282          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00283          INFOT = 11
00284          CALL ZGESVD( 'N', 'A', 1, 2, A, 1, S, U, 1, VT, 1, W, 5, RW,
00285      $                INFO )
00286          CALL CHKXER( 'ZGESVD', INFOT, NOUT, LERR, OK )
00287          NT = NT + 8
00288          IF( OK ) THEN
00289             WRITE( NOUT, FMT = 9999 )SRNAMT( 1:LEN_TRIM( SRNAMT ) ),
00290      $           NT
00291          ELSE
00292             WRITE( NOUT, FMT = 9998 )
00293          END IF
00294 *
00295 *        Test ZGESDD
00296 *
00297          SRNAMT = 'ZGESDD'
00298          INFOT = 1
00299          CALL ZGESDD( 'X', 0, 0, A, 1, S, U, 1, VT, 1, W, 1, RW, IW,
00300      $                INFO )
00301          CALL CHKXER( 'ZGESDD', INFOT, NOUT, LERR, OK )
00302          INFOT = 2
00303          CALL ZGESDD( 'N', -1, 0, A, 1, S, U, 1, VT, 1, W, 1, RW, IW,
00304      $                INFO )
00305          CALL CHKXER( 'ZGESDD', INFOT, NOUT, LERR, OK )
00306          INFOT = 3
00307          CALL ZGESDD( 'N', 0, -1, A, 1, S, U, 1, VT, 1, W, 1, RW, IW,
00308      $                INFO )
00309          CALL CHKXER( 'ZGESDD', INFOT, NOUT, LERR, OK )
00310          INFOT = 5
00311          CALL ZGESDD( 'N', 2, 1, A, 1, S, U, 1, VT, 1, W, 5, RW, IW,
00312      $                INFO )
00313          CALL CHKXER( 'ZGESDD', INFOT, NOUT, LERR, OK )
00314          INFOT = 8
00315          CALL ZGESDD( 'A', 2, 1, A, 2, S, U, 1, VT, 1, W, 5, RW, IW,
00316      $                INFO )
00317          CALL CHKXER( 'ZGESDD', INFOT, NOUT, LERR, OK )
00318          INFOT = 10
00319          CALL ZGESDD( 'A', 1, 2, A, 1, S, U, 1, VT, 1, W, 5, RW, IW,
00320      $                INFO )
00321          CALL CHKXER( 'ZGESDD', INFOT, NOUT, LERR, OK )
00322          NT = NT - 2
00323          IF( OK ) THEN
00324             WRITE( NOUT, FMT = 9999 )SRNAMT( 1:LEN_TRIM( SRNAMT ) ),
00325      $           NT
00326          ELSE
00327             WRITE( NOUT, FMT = 9998 )
00328          END IF
00329       END IF
00330 *
00331 *     Print a summary line.
00332 *
00333       IF( .NOT.LSAMEN( 2, C2, 'BD' ) ) THEN
00334          IF( OK ) THEN
00335             WRITE( NOUT, FMT = 9999 )SRNAMT( 1:LEN_TRIM( SRNAMT ) ),
00336      $           NT
00337          ELSE
00338             WRITE( NOUT, FMT = 9998 )
00339          END IF
00340       END IF
00341 *
00342  9999 FORMAT( 1X, A, ' passed the tests of the error exits (', I3,
00343      $      ' tests done)' )
00344  9998 FORMAT( ' *** ', A, ' failed the tests of the error exits ***' )
00345       RETURN
00346 *
00347 *     End of ZERRED
00348 *
00349       END
 All Files Functions