LAPACK 3.3.1
Linear Algebra PACKage

zchkbk.f

Go to the documentation of this file.
00001       SUBROUTINE ZCHKBK( NIN, NOUT )
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       INTEGER            NIN, NOUT
00009 *     ..
00010 *
00011 *  Purpose
00012 *  =======
00013 *
00014 *  ZCHKBK tests ZGEBAK, a routine for backward transformation of
00015 *  the computed right or left eigenvectors if the orginal matrix
00016 *  was preprocessed by balance subroutine ZGEBAL.
00017 *
00018 *  Arguments
00019 *  =========
00020 *
00021 *  NIN     (input) INTEGER
00022 *          The logical unit number for input.  NIN > 0.
00023 *
00024 *  NOUT    (input) INTEGER
00025 *          The logical unit number for output.  NOUT > 0.
00026 *
00027 * ======================================================================
00028 *
00029 *     .. Parameters ..
00030       INTEGER            LDE
00031       PARAMETER          ( LDE = 20 )
00032       DOUBLE PRECISION   ZERO
00033       PARAMETER          ( ZERO = 0.0D0 )
00034 *     ..
00035 *     .. Local Scalars ..
00036       INTEGER            I, IHI, ILO, INFO, J, KNT, N, NINFO
00037       DOUBLE PRECISION   EPS, RMAX, SAFMIN, VMAX, X
00038       COMPLEX*16         CDUM
00039 *     ..
00040 *     .. Local Arrays ..
00041       INTEGER            LMAX( 2 )
00042       DOUBLE PRECISION   SCALE( LDE )
00043       COMPLEX*16         E( LDE, LDE ), EIN( LDE, LDE )
00044 *     ..
00045 *     .. External Functions ..
00046       DOUBLE PRECISION   DLAMCH
00047       EXTERNAL           DLAMCH
00048 *     ..
00049 *     .. External Subroutines ..
00050       EXTERNAL           ZGEBAK
00051 *     ..
00052 *     .. Intrinsic Functions ..
00053       INTRINSIC          ABS, DBLE, DIMAG, MAX
00054 *     ..
00055 *     .. Statement Functions ..
00056       DOUBLE PRECISION   CABS1
00057 *     ..
00058 *     .. Statement Function definitions ..
00059       CABS1( CDUM ) = ABS( DBLE( CDUM ) ) + ABS( DIMAG( CDUM ) )
00060 *     ..
00061 *     .. Executable Statements ..
00062 *
00063       LMAX( 1 ) = 0
00064       LMAX( 2 ) = 0
00065       NINFO = 0
00066       KNT = 0
00067       RMAX = ZERO
00068       EPS = DLAMCH( 'E' )
00069       SAFMIN = DLAMCH( 'S' )
00070 *
00071    10 CONTINUE
00072 *
00073       READ( NIN, FMT = * )N, ILO, IHI
00074       IF( N.EQ.0 )
00075      $   GO TO 60
00076 *
00077       READ( NIN, FMT = * )( SCALE( I ), I = 1, N )
00078       DO 20 I = 1, N
00079          READ( NIN, FMT = * )( E( I, J ), J = 1, N )
00080    20 CONTINUE
00081 *
00082       DO 30 I = 1, N
00083          READ( NIN, FMT = * )( EIN( I, J ), J = 1, N )
00084    30 CONTINUE
00085 *
00086       KNT = KNT + 1
00087       CALL ZGEBAK( 'B', 'R', N, ILO, IHI, SCALE, N, E, LDE, INFO )
00088 *
00089       IF( INFO.NE.0 ) THEN
00090          NINFO = NINFO + 1
00091          LMAX( 1 ) = KNT
00092       END IF
00093 *
00094       VMAX = ZERO
00095       DO 50 I = 1, N
00096          DO 40 J = 1, N
00097             X = CABS1( E( I, J )-EIN( I, J ) ) / EPS
00098             IF( CABS1( E( I, J ) ).GT.SAFMIN )
00099      $         X = X / CABS1( E( I, J ) )
00100             VMAX = MAX( VMAX, X )
00101    40    CONTINUE
00102    50 CONTINUE
00103 *
00104       IF( VMAX.GT.RMAX ) THEN
00105          LMAX( 2 ) = KNT
00106          RMAX = VMAX
00107       END IF
00108 *
00109       GO TO 10
00110 *
00111    60 CONTINUE
00112 *
00113       WRITE( NOUT, FMT = 9999 )
00114  9999 FORMAT( 1X, '.. test output of ZGEBAK .. ' )
00115 *
00116       WRITE( NOUT, FMT = 9998 )RMAX
00117  9998 FORMAT( 1X, 'value of largest test error             = ', D12.3 )
00118       WRITE( NOUT, FMT = 9997 )LMAX( 1 )
00119  9997 FORMAT( 1X, 'example number where info is not zero   = ', I4 )
00120       WRITE( NOUT, FMT = 9996 )LMAX( 2 )
00121  9996 FORMAT( 1X, 'example number having largest error     = ', I4 )
00122       WRITE( NOUT, FMT = 9995 )NINFO
00123  9995 FORMAT( 1X, 'number of examples where info is not 0  = ', I4 )
00124       WRITE( NOUT, FMT = 9994 )KNT
00125  9994 FORMAT( 1X, 'total number of examples tested         = ', I4 )
00126 *
00127       RETURN
00128 *
00129 *     End of ZCHKBK
00130 *
00131       END
 All Files Functions