00001 SUBROUTINE CCKLSE( NN, MVAL, PVAL, NVAL, NMATS, ISEED, THRESH,
00002 $ NMAX, A, AF, B, BF, X, WORK, RWORK, NIN, NOUT,
00003 $ INFO )
00004
00005
00006
00007
00008
00009
00010 INTEGER INFO, NIN, NMATS, NMAX, NN, NOUT
00011 REAL THRESH
00012
00013
00014 INTEGER ISEED( 4 ), MVAL( * ), NVAL( * ), PVAL( * )
00015 REAL RWORK( * )
00016 COMPLEX A( * ), AF( * ), B( * ), BF( * ), WORK( * ),
00017 $ X( * )
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 INTEGER NTESTS
00094 PARAMETER ( NTESTS = 7 )
00095 INTEGER NTYPES
00096 PARAMETER ( NTYPES = 8 )
00097
00098
00099 LOGICAL FIRSTT
00100 CHARACTER DISTA, DISTB, TYPE
00101 CHARACTER*3 PATH
00102 INTEGER I, IINFO, IK, IMAT, KLA, KLB, KUA, KUB, LDA,
00103 $ LDB, LWORK, M, MODEA, MODEB, N, NFAIL, NRUN,
00104 $ NT, P
00105 REAL ANORM, BNORM, CNDNMA, CNDNMB
00106
00107
00108 LOGICAL DOTYPE( NTYPES )
00109 REAL RESULT( NTESTS )
00110
00111
00112 EXTERNAL ALAHDG, ALAREQ, ALASUM, CLARHS, CLATMS, CLSETS,
00113 $ SLATB9
00114
00115
00116 INTRINSIC ABS, MAX
00117
00118
00119
00120
00121
00122 PATH( 1: 3 ) = 'LSE'
00123 INFO = 0
00124 NRUN = 0
00125 NFAIL = 0
00126 FIRSTT = .TRUE.
00127 CALL ALAREQ( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT )
00128 LDA = NMAX
00129 LDB = NMAX
00130 LWORK = NMAX*NMAX
00131
00132
00133
00134 DO 10 IK = 1, NN
00135 M = MVAL( IK )
00136 P = PVAL( IK )
00137 N = NVAL( IK )
00138 IF( P.GT.N .OR. N.GT.M+P ) THEN
00139 IF( FIRSTT ) THEN
00140 WRITE( NOUT, FMT = * )
00141 FIRSTT = .FALSE.
00142 END IF
00143 WRITE( NOUT, FMT = 9997 )M, P, N
00144 END IF
00145 10 CONTINUE
00146 FIRSTT = .TRUE.
00147
00148
00149
00150 DO 40 IK = 1, NN
00151 M = MVAL( IK )
00152 P = PVAL( IK )
00153 N = NVAL( IK )
00154 IF( P.GT.N .OR. N.GT.M+P )
00155 $ GO TO 40
00156
00157 DO 30 IMAT = 1, NTYPES
00158
00159
00160
00161 IF( .NOT.DOTYPE( IMAT ) )
00162 $ GO TO 30
00163
00164
00165
00166
00167 CALL SLATB9( PATH, IMAT, M, P, N, TYPE, KLA, KUA, KLB, KUB,
00168 $ ANORM, BNORM, MODEA, MODEB, CNDNMA, CNDNMB,
00169 $ DISTA, DISTB )
00170
00171 CALL CLATMS( M, N, DISTA, ISEED, TYPE, RWORK, MODEA, CNDNMA,
00172 $ ANORM, KLA, KUA, 'No packing', A, LDA, WORK,
00173 $ IINFO )
00174 IF( IINFO.NE.0 ) THEN
00175 WRITE( NOUT, FMT = 9999 )IINFO
00176 INFO = ABS( IINFO )
00177 GO TO 30
00178 END IF
00179
00180 CALL CLATMS( P, N, DISTB, ISEED, TYPE, RWORK, MODEB, CNDNMB,
00181 $ BNORM, KLB, KUB, 'No packing', B, LDB, WORK,
00182 $ IINFO )
00183 IF( IINFO.NE.0 ) THEN
00184 WRITE( NOUT, FMT = 9999 )IINFO
00185 INFO = ABS( IINFO )
00186 GO TO 30
00187 END IF
00188
00189
00190
00191 CALL CLARHS( 'CGE', 'New solution', 'Upper', 'N', M, N,
00192 $ MAX( M-1, 0 ), MAX( N-1, 0 ), 1, A, LDA,
00193 $ X( 4*NMAX+1 ), MAX( N, 1 ), X, MAX( M, 1 ),
00194 $ ISEED, IINFO )
00195
00196 CALL CLARHS( 'CGE', 'Computed', 'Upper', 'N', P, N,
00197 $ MAX( P-1, 0 ), MAX( N-1, 0 ), 1, B, LDB,
00198 $ X( 4*NMAX+1 ), MAX( N, 1 ), X( 2*NMAX+1 ),
00199 $ MAX( P, 1 ), ISEED, IINFO )
00200
00201 NT = 2
00202
00203 CALL CLSETS( M, P, N, A, AF, LDA, B, BF, LDB, X,
00204 $ X( NMAX+1 ), X( 2*NMAX+1 ), X( 3*NMAX+1 ),
00205 $ X( 4*NMAX+1 ), WORK, LWORK, RWORK,
00206 $ RESULT( 1 ) )
00207
00208
00209
00210
00211 DO 20 I = 1, NT
00212 IF( RESULT( I ).GE.THRESH ) THEN
00213 IF( NFAIL.EQ.0 .AND. FIRSTT ) THEN
00214 FIRSTT = .FALSE.
00215 CALL ALAHDG( NOUT, PATH )
00216 END IF
00217 WRITE( NOUT, FMT = 9998 )M, P, N, IMAT, I,
00218 $ RESULT( I )
00219 NFAIL = NFAIL + 1
00220 END IF
00221 20 CONTINUE
00222 NRUN = NRUN + NT
00223
00224 30 CONTINUE
00225 40 CONTINUE
00226
00227
00228
00229 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, 0 )
00230
00231 9999 FORMAT( ' CLATMS in CCKLSE INFO = ', I5 )
00232 9998 FORMAT( ' M=', I4, ' P=', I4, ', N=', I4, ', type ', I2,
00233 $ ', test ', I2, ', ratio=', G13.6 )
00234 9997 FORMAT( ' *** Invalid input for LSE: M = ', I6, ', P = ', I6,
00235 $ ', N = ', I6, ';', / ' must satisfy P <= N <= P+M ',
00236 $ '(this set of values will be skipped)' )
00237 RETURN
00238
00239
00240
00241 END