3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
19 *> DCHKAB is the test program for the DOUBLE PRECISION LAPACK
20 *> DSGESV/DSPOSV routine
22 *> The program must be driven by a short data file. The first 5 records
23 *> specify problem dimensions and program options using list-directed
24 *> input. The remaining lines specify the LAPACK test paths and the
25 *> number of matrix types to use in testing. An annotated example of a
26 *> data file can be obtained by deleting the first 3 characters from the
27 *> following 10 lines:
28 *> Data file for testing DOUBLE PRECISION LAPACK DSGESV
29 *> 7 Number of values of M
30 *> 0 1 2 3 5 10 16 Values of M (row dimension)
31 *> 1 Number of values of NRHS
32 *> 2 Values of NRHS (number of right hand sides)
33 *> 20.0 Threshold value of test ratio
34 *> T Put T to test the LAPACK routines
35 *> T Put T to test the error exits
36 *> DGE 11 List types on next line if 0 < NTYPES < 11
37 *> DPO 9 List types on next line if 0 < NTYPES < 9
45 *> The maximum allowable value for N
48 *> The number of different values that can be used for each of
49 *> M, N, NRHS, NB, and NX
52 *> The maximum number of right hand sides
55 *> The unit number for input
58 *> The unit number for output
64 *> \author Univ. of Tennessee
65 *> \author Univ. of California Berkeley
66 *> \author Univ. of Colorado Denver
71 *> \ingroup double_lin
73 * =====================================================================
76 * -- LAPACK test routine (version 3.4.1) --
77 * -- LAPACK is a software package provided by Univ. of Tennessee, --
78 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
81 * =====================================================================
85 PARAMETER ( NMAX = 132 )
87 PARAMETER ( MAXIN = 12 )
89 PARAMETER ( MAXRHS = 16 )
91 PARAMETER ( MATMAX = 30 )
93 PARAMETER ( NIN = 5, NOUT = 6 )
95 PARAMETER ( LDAMAX = NMAX )
98 LOGICAL FATAL, TSTDRV, TSTERR
104 INTEGER I, IC, K, LDA, NM, NMATS,
106 $ VERS_MAJOR, VERS_MINOR, VERS_PATCH
107 DOUBLE PRECISION EPS, S1, S2, THRESH
111 LOGICAL DOTYPE( MATMAX )
112 INTEGER IWORK( NMAX ), MVAL( MAXIN ), NSVAL( MAXIN )
113 DOUBLE PRECISION A( LDAMAX*NMAX, 2 ), B( NMAX*MAXRHS, 2 ),
114 $ RWORK( NMAX ), WORK( NMAX*MAXRHS*2 )
115 REAL SWORK(NMAX*(NMAX+MAXRHS))
117 * .. External Functions ..
118 DOUBLE PRECISION DLAMCH, DSECND
119 LOGICAL LSAME, LSAMEN
121 EXTERNAL LSAME, LSAMEN, DLAMCH, DSECND, SLAMCH
123 * .. External Subroutines ..
124 EXTERNAL ALAREQ, DDRVAB, DDRVAC, DERRAB, DERRAC,
127 * .. Scalars in Common ..
132 * .. Common blocks ..
133 COMMON / INFOC / INFOT, NUNIT, OK, LERR
134 COMMON / SRNAMC / SRNAMT
136 * .. Data statements ..
137 DATA INTSTR / '0123456789' /
139 * .. Executable Statements ..
149 * Report values of parameters.
151 CALL ILAVER( VERS_MAJOR, VERS_MINOR, VERS_PATCH )
152 WRITE( NOUT, FMT = 9994 ) VERS_MAJOR, VERS_MINOR, VERS_PATCH
154 * Read the values of M
156 READ( NIN, FMT = * )NM
158 WRITE( NOUT, FMT = 9996 )' NM ', NM, 1
161 ELSE IF( NM.GT.MAXIN ) THEN
162 WRITE( NOUT, FMT = 9995 )' NM ', NM, MAXIN
166 READ( NIN, FMT = * )( MVAL( I ), I = 1, NM )
168 IF( MVAL( I ).LT.0 ) THEN
169 WRITE( NOUT, FMT = 9996 )' M ', MVAL( I ), 0
171 ELSE IF( MVAL( I ).GT.NMAX ) THEN
172 WRITE( NOUT, FMT = 9995 )' M ', MVAL( I ), NMAX
177 $ WRITE( NOUT, FMT = 9993 )'M ', ( MVAL( I ), I = 1, NM )
179 * Read the values of NRHS
181 READ( NIN, FMT = * )NNS
183 WRITE( NOUT, FMT = 9996 )' NNS', NNS, 1
186 ELSE IF( NNS.GT.MAXIN ) THEN
187 WRITE( NOUT, FMT = 9995 )' NNS', NNS, MAXIN
191 READ( NIN, FMT = * )( NSVAL( I ), I = 1, NNS )
193 IF( NSVAL( I ).LT.0 ) THEN
194 WRITE( NOUT, FMT = 9996 )'NRHS', NSVAL( I ), 0
196 ELSE IF( NSVAL( I ).GT.MAXRHS ) THEN
197 WRITE( NOUT, FMT = 9995 )'NRHS', NSVAL( I ), MAXRHS
202 $ WRITE( NOUT, FMT = 9993 )'NRHS', ( NSVAL( I ), I = 1, NNS )
204 * Read the threshold value for the test ratios.
206 READ( NIN, FMT = * )THRESH
207 WRITE( NOUT, FMT = 9992 )THRESH
209 * Read the flag that indicates whether to test the driver routine.
211 READ( NIN, FMT = * )TSTDRV
213 * Read the flag that indicates whether to test the error exits.
215 READ( NIN, FMT = * )TSTERR
218 WRITE( NOUT, FMT = 9999 )
222 * Calculate and print the machine dependent constants.
224 SEPS = SLAMCH( 'Underflow threshold' )
225 WRITE( NOUT, FMT = 9991 )'(single precision) underflow', SEPS
226 SEPS = SLAMCH( 'Overflow threshold' )
227 WRITE( NOUT, FMT = 9991 )'(single precision) overflow ', SEPS
228 SEPS = SLAMCH( 'Epsilon' )
229 WRITE( NOUT, FMT = 9991 )'(single precision) precision', SEPS
230 WRITE( NOUT, FMT = * )
232 EPS = DLAMCH( 'Underflow threshold' )
233 WRITE( NOUT, FMT = 9991 )'(double precision) underflow', EPS
234 EPS = DLAMCH( 'Overflow threshold' )
235 WRITE( NOUT, FMT = 9991 )'(double precision) overflow ', EPS
236 EPS = DLAMCH( 'Epsilon' )
237 WRITE( NOUT, FMT = 9991 )'(double precision) precision', EPS
238 WRITE( NOUT, FMT = * )
242 * Read a test path and the number of matrix types to use.
244 READ( NIN, FMT = '(A72)', END = 140 )ALINE
254 IF( ALINE( I: I ).EQ.' ' )
260 IF( C1.EQ.INTSTR( K: K ) ) THEN
267 NMATS = NMATS*10 + IC
277 * Check first character for correct precision.
279 IF( .NOT.LSAME( C1, 'Double precision' ) ) THEN
280 WRITE( NOUT, FMT = 9990 )PATH
283 ELSE IF( NMATS.LE.0 ) THEN
285 * Check for a positive number of tests requested.
287 WRITE( NOUT, FMT = 9989 )PATH
290 ELSE IF( LSAMEN( 2, C2, 'GE' ) ) THEN
292 * GE: general matrices
295 CALL ALAREQ( 'DGE', NMATS, DOTYPE, NTYPES, NIN, NOUT )
297 * Test the error exits
300 $ CALL DERRAB( NOUT )
303 CALL DDRVAB( DOTYPE, NM, MVAL, NNS,
304 $ NSVAL, THRESH, LDA, A( 1, 1 ),
305 $ A( 1, 2 ), B( 1, 1 ), B( 1, 2 ),
306 $ WORK, RWORK, SWORK, IWORK, NOUT )
308 WRITE( NOUT, FMT = 9989 )'DSGESV'
311 ELSE IF( LSAMEN( 2, C2, 'PO' ) ) THEN
313 * PO: positive definite matrices
316 CALL ALAREQ( 'DPO', NMATS, DOTYPE, NTYPES, NIN, NOUT )
320 $ CALL DERRAC( NOUT )
324 CALL DDRVAC( DOTYPE, NM, MVAL, NNS, NSVAL,
325 $ THRESH, LDA, A( 1, 1 ), A( 1, 2 ),
326 $ B( 1, 1 ), B( 1, 2 ),
327 $ WORK, RWORK, SWORK, NOUT )
329 WRITE( NOUT, FMT = 9989 )PATH
335 * Go back to get another input line.
339 * Branch to this line when the last record is read.
344 WRITE( NOUT, FMT = 9998 )
345 WRITE( NOUT, FMT = 9997 )S2 - S1
347 9999 FORMAT( / ' Execution not attempted due to input errors' )
348 9998 FORMAT( / ' End of tests' )
349 9997 FORMAT( ' Total time used = ', F12.2, ' seconds', / )
350 9996 FORMAT( ' Invalid input value: ', A4, '=', I6, '; must be >=',
352 9995 FORMAT( ' Invalid input value: ', A4, '=', I6, '; must be <=',
354 9994 FORMAT( ' Tests of the DOUBLE PRECISION LAPACK DSGESV/DSPOSV',
356 $ / ' LAPACK VERSION ', I1, '.', I1, '.', I1,
357 $ / / ' The following parameter values will be used:' )
358 9993 FORMAT( 4X, A4, ': ', 10I6, / 11X, 10I6 )
359 9992 FORMAT( / ' Routines pass computational tests if test ratio is ',
360 $ 'less than', F8.2, / )
361 9991 FORMAT( ' Relative machine ', A, ' is taken to be', D16.6 )
362 9990 FORMAT( / 1X, A6, ' routines were not tested' )
363 9989 FORMAT( / 1X, A6, ' driver routines were not tested' )