LAPACK 3.3.0
|
00001 SUBROUTINE SCHKBK( 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 * SCHKBK tests SGEBAK, a routine for backward transformation of 00015 * the computed right or left eigenvectors if the orginal matrix 00016 * was preprocessed by balance subroutine SGEBAL. 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 REAL ZERO 00033 PARAMETER ( ZERO = 0.0E0 ) 00034 * .. 00035 * .. Local Scalars .. 00036 INTEGER I, IHI, ILO, INFO, J, KNT, N, NINFO 00037 REAL EPS, RMAX, SAFMIN, VMAX, X 00038 * .. 00039 * .. Local Arrays .. 00040 INTEGER LMAX( 2 ) 00041 REAL E( LDE, LDE ), EIN( LDE, LDE ), SCALE( LDE ) 00042 * .. 00043 * .. External Functions .. 00044 REAL SLAMCH 00045 EXTERNAL SLAMCH 00046 * .. 00047 * .. External Subroutines .. 00048 EXTERNAL SGEBAK 00049 * .. 00050 * .. Intrinsic Functions .. 00051 INTRINSIC ABS, MAX 00052 * .. 00053 * .. Executable Statements .. 00054 * 00055 LMAX( 1 ) = 0 00056 LMAX( 2 ) = 0 00057 NINFO = 0 00058 KNT = 0 00059 RMAX = ZERO 00060 EPS = SLAMCH( 'E' ) 00061 SAFMIN = SLAMCH( 'S' ) 00062 * 00063 10 CONTINUE 00064 * 00065 READ( NIN, FMT = * )N, ILO, IHI 00066 IF( N.EQ.0 ) 00067 $ GO TO 60 00068 * 00069 READ( NIN, FMT = * )( SCALE( I ), I = 1, N ) 00070 DO 20 I = 1, N 00071 READ( NIN, FMT = * )( E( I, J ), J = 1, N ) 00072 20 CONTINUE 00073 * 00074 DO 30 I = 1, N 00075 READ( NIN, FMT = * )( EIN( I, J ), J = 1, N ) 00076 30 CONTINUE 00077 * 00078 KNT = KNT + 1 00079 CALL SGEBAK( 'B', 'R', N, ILO, IHI, SCALE, N, E, LDE, INFO ) 00080 * 00081 IF( INFO.NE.0 ) THEN 00082 NINFO = NINFO + 1 00083 LMAX( 1 ) = KNT 00084 END IF 00085 * 00086 VMAX = ZERO 00087 DO 50 I = 1, N 00088 DO 40 J = 1, N 00089 X = ABS( E( I, J )-EIN( I, J ) ) / EPS 00090 IF( ABS( E( I, J ) ).GT.SAFMIN ) 00091 $ X = X / ABS( E( I, J ) ) 00092 VMAX = MAX( VMAX, X ) 00093 40 CONTINUE 00094 50 CONTINUE 00095 * 00096 IF( VMAX.GT.RMAX ) THEN 00097 LMAX( 2 ) = KNT 00098 RMAX = VMAX 00099 END IF 00100 * 00101 GO TO 10 00102 * 00103 60 CONTINUE 00104 * 00105 WRITE( NOUT, FMT = 9999 ) 00106 9999 FORMAT( 1X, '.. test output of SGEBAK .. ' ) 00107 * 00108 WRITE( NOUT, FMT = 9998 )RMAX 00109 9998 FORMAT( 1X, 'value of largest test error = ', E12.3 ) 00110 WRITE( NOUT, FMT = 9997 )LMAX( 1 ) 00111 9997 FORMAT( 1X, 'example number where info is not zero = ', I4 ) 00112 WRITE( NOUT, FMT = 9996 )LMAX( 2 ) 00113 9996 FORMAT( 1X, 'example number having largest error = ', I4 ) 00114 WRITE( NOUT, FMT = 9995 )NINFO 00115 9995 FORMAT( 1X, 'number of examples where info is not 0 = ', I4 ) 00116 WRITE( NOUT, FMT = 9994 )KNT 00117 9994 FORMAT( 1X, 'total number of examples tested = ', I4 ) 00118 * 00119 RETURN 00120 * 00121 * End of SCHKBK 00122 * 00123 END