LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
schkrfp.f
Go to the documentation of this file.
1 *> \brief \b SCHKRFP
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 * Definition:
9 * ===========
10 *
11 * PROGRAM SCHKRFP
12 *
13 *
14 *> \par Purpose:
15 * =============
16 *>
17 *> \verbatim
18 *>
19 *> SCHKRFP is the main test program for the REAL linear
20 *> equation routines with RFP storage format
21 *>
22 *> \endverbatim
23 *
24 * Arguments:
25 * ==========
26 *
27 *> \verbatim
28 *> MAXIN INTEGER
29 *> The number of different values that can be used for each of
30 *> M, N, or NB
31 *>
32 *> MAXRHS INTEGER
33 *> The maximum number of right hand sides
34 *>
35 *> NTYPES INTEGER
36 *>
37 *> NMAX INTEGER
38 *> The maximum allowable value for N.
39 *>
40 *> NIN INTEGER
41 *> The unit number for input
42 *>
43 *> NOUT INTEGER
44 *> The unit number for output
45 *> \endverbatim
46 *
47 * Authors:
48 * ========
49 *
50 *> \author Univ. of Tennessee
51 *> \author Univ. of California Berkeley
52 *> \author Univ. of Colorado Denver
53 *> \author NAG Ltd.
54 *
55 *> \date April 2012
56 *
57 *> \ingroup single_lin
58 *
59 * =====================================================================
60  PROGRAM schkrfp
61 *
62 * -- LAPACK test routine (version 3.4.1) --
63 * -- LAPACK is a software package provided by Univ. of Tennessee, --
64 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
65 * April 2012
66 *
67 * =====================================================================
68 *
69 * .. Parameters ..
70  INTEGER maxin
71  parameter( maxin = 12 )
72  INTEGER nmax
73  parameter( nmax = 50 )
74  INTEGER maxrhs
75  parameter( maxrhs = 16 )
76  INTEGER ntypes
77  parameter( ntypes = 9 )
78  INTEGER nin, nout
79  parameter( nin = 5, nout = 6 )
80 * ..
81 * .. Local Scalars ..
82  LOGICAL fatal, tsterr
83  INTEGER vers_major, vers_minor, vers_patch
84  INTEGER i, nn, nns, nnt
85  REAL eps, s1, s2, thresh
86 * ..
87 * .. Local Arrays ..
88  INTEGER nval( maxin ), nsval( maxin ), ntval( ntypes )
89  REAL worka( nmax, nmax )
90  REAL workasav( nmax, nmax )
91  REAL workb( nmax, maxrhs )
92  REAL workxact( nmax, maxrhs )
93  REAL workbsav( nmax, maxrhs )
94  REAL workx( nmax, maxrhs )
95  REAL workafac( nmax, nmax )
96  REAL workainv( nmax, nmax )
97  REAL workarf( (nmax*(nmax+1))/2 )
98  REAL workap( (nmax*(nmax+1))/2 )
99  REAL workarfinv( (nmax*(nmax+1))/2 )
100  REAL s_work_slatms( 3 * nmax )
101  REAL s_work_spot01( nmax )
102  REAL s_temp_spot02( nmax, maxrhs )
103  REAL s_temp_spot03( nmax, nmax )
104  REAL s_work_slansy( nmax )
105  REAL s_work_spot02( nmax )
106  REAL s_work_spot03( nmax )
107 * ..
108 * .. External Functions ..
109  REAL slamch, second
110  EXTERNAL slamch, second
111 * ..
112 * .. External Subroutines ..
113  EXTERNAL ilaver, sdrvrfp, sdrvrf1, sdrvrf2, sdrvrf3,
114  + sdrvrf4
115 * ..
116 * .. Executable Statements ..
117 *
118  s1 = second( )
119  fatal = .false.
120 *
121 * Read a dummy line.
122 *
123  READ( nin, fmt = * )
124 *
125 * Report LAPACK version tag (e.g. LAPACK-3.2.0)
126 *
127  CALL ilaver( vers_major, vers_minor, vers_patch )
128  WRITE( nout, fmt = 9994 ) vers_major, vers_minor, vers_patch
129 *
130 * Read the values of N
131 *
132  READ( nin, fmt = * )nn
133  IF( nn.LT.1 ) THEN
134  WRITE( nout, fmt = 9996 )' NN ', nn, 1
135  nn = 0
136  fatal = .true.
137  ELSE IF( nn.GT.maxin ) THEN
138  WRITE( nout, fmt = 9995 )' NN ', nn, maxin
139  nn = 0
140  fatal = .true.
141  END IF
142  READ( nin, fmt = * )( nval( i ), i = 1, nn )
143  DO 10 i = 1, nn
144  IF( nval( i ).LT.0 ) THEN
145  WRITE( nout, fmt = 9996 )' M ', nval( i ), 0
146  fatal = .true.
147  ELSE IF( nval( i ).GT.nmax ) THEN
148  WRITE( nout, fmt = 9995 )' M ', nval( i ), nmax
149  fatal = .true.
150  END IF
151  10 continue
152  IF( nn.GT.0 )
153  $ WRITE( nout, fmt = 9993 )'N ', ( nval( i ), i = 1, nn )
154 *
155 * Read the values of NRHS
156 *
157  READ( nin, fmt = * )nns
158  IF( nns.LT.1 ) THEN
159  WRITE( nout, fmt = 9996 )' NNS', nns, 1
160  nns = 0
161  fatal = .true.
162  ELSE IF( nns.GT.maxin ) THEN
163  WRITE( nout, fmt = 9995 )' NNS', nns, maxin
164  nns = 0
165  fatal = .true.
166  END IF
167  READ( nin, fmt = * )( nsval( i ), i = 1, nns )
168  DO 30 i = 1, nns
169  IF( nsval( i ).LT.0 ) THEN
170  WRITE( nout, fmt = 9996 )'NRHS', nsval( i ), 0
171  fatal = .true.
172  ELSE IF( nsval( i ).GT.maxrhs ) THEN
173  WRITE( nout, fmt = 9995 )'NRHS', nsval( i ), maxrhs
174  fatal = .true.
175  END IF
176  30 continue
177  IF( nns.GT.0 )
178  $ WRITE( nout, fmt = 9993 )'NRHS', ( nsval( i ), i = 1, nns )
179 *
180 * Read the matrix types
181 *
182  READ( nin, fmt = * )nnt
183  IF( nnt.LT.1 ) THEN
184  WRITE( nout, fmt = 9996 )' NMA', nnt, 1
185  nnt = 0
186  fatal = .true.
187  ELSE IF( nnt.GT.ntypes ) THEN
188  WRITE( nout, fmt = 9995 )' NMA', nnt, ntypes
189  nnt = 0
190  fatal = .true.
191  END IF
192  READ( nin, fmt = * )( ntval( i ), i = 1, nnt )
193  DO 320 i = 1, nnt
194  IF( ntval( i ).LT.0 ) THEN
195  WRITE( nout, fmt = 9996 )'TYPE', ntval( i ), 0
196  fatal = .true.
197  ELSE IF( ntval( i ).GT.ntypes ) THEN
198  WRITE( nout, fmt = 9995 )'TYPE', ntval( i ), ntypes
199  fatal = .true.
200  END IF
201  320 continue
202  IF( nnt.GT.0 )
203  $ WRITE( nout, fmt = 9993 )'TYPE', ( ntval( i ), i = 1, nnt )
204 *
205 * Read the threshold value for the test ratios.
206 *
207  READ( nin, fmt = * )thresh
208  WRITE( nout, fmt = 9992 )thresh
209 *
210 * Read the flag that indicates whether to test the error exits.
211 *
212  READ( nin, fmt = * )tsterr
213 *
214  IF( fatal ) THEN
215  WRITE( nout, fmt = 9999 )
216  stop
217  END IF
218 *
219  IF( fatal ) THEN
220  WRITE( nout, fmt = 9999 )
221  stop
222  END IF
223 *
224 * Calculate and print the machine dependent constants.
225 *
226  eps = slamch( 'Underflow threshold' )
227  WRITE( nout, fmt = 9991 )'underflow', eps
228  eps = slamch( 'Overflow threshold' )
229  WRITE( nout, fmt = 9991 )'overflow ', eps
230  eps = slamch( 'Epsilon' )
231  WRITE( nout, fmt = 9991 )'precision', eps
232  WRITE( nout, fmt = * )
233 *
234 * Test the error exit of:
235 *
236  IF( tsterr )
237  $ CALL serrrfp( nout )
238 *
239 * Test the routines: spftrf, spftri, spftrs (as in SDRVPO).
240 * This also tests the routines: stfsm, stftri, stfttr, strttf.
241 *
242  CALL sdrvrfp( nout, nn, nval, nns, nsval, nnt, ntval, thresh,
243  $ worka, workasav, workafac, workainv, workb,
244  $ workbsav, workxact, workx, workarf, workarfinv,
245  $ s_work_slatms, s_work_spot01, s_temp_spot02,
246  $ s_temp_spot03, s_work_slansy, s_work_spot02,
247  $ s_work_spot03 )
248 *
249 * Test the routine: slansf
250 *
251  CALL sdrvrf1( nout, nn, nval, thresh, worka, nmax, workarf,
252  + s_work_slansy )
253 *
254 * Test the convertion routines:
255 * stfttp, stpttf, stfttr, strttf, strttp and stpttr.
256 *
257  CALL sdrvrf2( nout, nn, nval, worka, nmax, workarf,
258  + workap, workasav )
259 *
260 * Test the routine: stfsm
261 *
262  CALL sdrvrf3( nout, nn, nval, thresh, worka, nmax, workarf,
263  + workainv, workafac, s_work_slansy,
264  + s_work_spot03, s_work_spot01 )
265 *
266 *
267 * Test the routine: ssfrk
268 *
269  CALL sdrvrf4( nout, nn, nval, thresh, worka, workafac, nmax,
270  + workarf, workainv, nmax, s_work_slansy)
271 *
272  CLOSE ( nin )
273  s2 = second( )
274  WRITE( nout, fmt = 9998 )
275  WRITE( nout, fmt = 9997 )s2 - s1
276 *
277  9999 format( / ' Execution not attempted due to input errors' )
278  9998 format( / ' End of tests' )
279  9997 format( ' Total time used = ', f12.2, ' seconds', / )
280  9996 format( ' !! Invalid input value: ', a4, '=', i6, '; must be >=',
281  $ i6 )
282  9995 format( ' !! Invalid input value: ', a4, '=', i6, '; must be <=',
283  $ i6 )
284  9994 format( / ' Tests of the REAL LAPACK RFP routines ',
285  $ / ' LAPACK VERSION ', i1, '.', i1, '.', i1,
286  $ / / ' The following parameter values will be used:' )
287  9993 format( 4x, a4, ': ', 10i6, / 11x, 10i6 )
288  9992 format( / ' Routines pass computational tests if test ratio is ',
289  $ 'less than', f8.2, / )
290  9991 format( ' Relative machine ', a, ' is taken to be', d16.6 )
291 *
292 * End of SCHKRFP
293 *
294  END