LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
sckglm.f
Go to the documentation of this file.
1 *> \brief \b SCKGLM
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 * Definition:
9 * ===========
10 *
11 * SUBROUTINE SCKGLM( NN, MVAL, PVAL, NVAL, NMATS, ISEED, THRESH,
12 * NMAX, A, AF, B, BF, X, WORK, RWORK, NIN, NOUT,
13 * INFO )
14 *
15 * .. Scalar Arguments ..
16 * INTEGER INFO, NIN, NMATS, NMAX, NN, NOUT
17 * REAL THRESH
18 * ..
19 * .. Array Arguments ..
20 * INTEGER ISEED( 4 ), MVAL( * ), NVAL( * ), PVAL( * )
21 * REAL A( * ), AF( * ), B( * ), BF( * ), RWORK( * ),
22 * $ WORK( * ), X( * )
23 * ..
24 *
25 *
26 *> \par Purpose:
27 * =============
28 *>
29 *> \verbatim
30 *>
31 *> SCKGLM tests SGGGLM - subroutine for solving generalized linear
32 *> model problem.
33 *> \endverbatim
34 *
35 * Arguments:
36 * ==========
37 *
38 *> \param[in] NN
39 *> \verbatim
40 *> NN is INTEGER
41 *> The number of values of N, M and P contained in the vectors
42 *> NVAL, MVAL and PVAL.
43 *> \endverbatim
44 *>
45 *> \param[in] MVAL
46 *> \verbatim
47 *> MVAL is INTEGER array, dimension (NN)
48 *> The values of the matrix column dimension M.
49 *> \endverbatim
50 *>
51 *> \param[in] PVAL
52 *> \verbatim
53 *> PVAL is INTEGER array, dimension (NN)
54 *> The values of the matrix column dimension P.
55 *> \endverbatim
56 *>
57 *> \param[in] NVAL
58 *> \verbatim
59 *> NVAL is INTEGER array, dimension (NN)
60 *> The values of the matrix row dimension N.
61 *> \endverbatim
62 *>
63 *> \param[in] NMATS
64 *> \verbatim
65 *> NMATS is INTEGER
66 *> The number of matrix types to be tested for each combination
67 *> of matrix dimensions. If NMATS >= NTYPES (the maximum
68 *> number of matrix types), then all the different types are
69 *> generated for testing. If NMATS < NTYPES, another input line
70 *> is read to get the numbers of the matrix types to be used.
71 *> \endverbatim
72 *>
73 *> \param[in,out] ISEED
74 *> \verbatim
75 *> ISEED is INTEGER array, dimension (4)
76 *> On entry, the seed of the random number generator. The array
77 *> elements should be between 0 and 4095, otherwise they will be
78 *> reduced mod 4096, and ISEED(4) must be odd.
79 *> On exit, the next seed in the random number sequence after
80 *> all the test matrices have been generated.
81 *> \endverbatim
82 *>
83 *> \param[in] THRESH
84 *> \verbatim
85 *> THRESH is REAL
86 *> The threshold value for the test ratios. A result is
87 *> included in the output file if RESID >= THRESH. To have
88 *> every test ratio printed, use THRESH = 0.
89 *> \endverbatim
90 *>
91 *> \param[in] NMAX
92 *> \verbatim
93 *> NMAX is INTEGER
94 *> The maximum value permitted for M or N, used in dimensioning
95 *> the work arrays.
96 *> \endverbatim
97 *>
98 *> \param[out] A
99 *> \verbatim
100 *> A is REAL array, dimension (NMAX*NMAX)
101 *> \endverbatim
102 *>
103 *> \param[out] AF
104 *> \verbatim
105 *> AF is REAL array, dimension (NMAX*NMAX)
106 *> \endverbatim
107 *>
108 *> \param[out] B
109 *> \verbatim
110 *> B is REAL array, dimension (NMAX*NMAX)
111 *> \endverbatim
112 *>
113 *> \param[out] BF
114 *> \verbatim
115 *> BF is REAL array, dimension (NMAX*NMAX)
116 *> \endverbatim
117 *>
118 *> \param[out] X
119 *> \verbatim
120 *> X is REAL array, dimension (4*NMAX)
121 *> \endverbatim
122 *>
123 *> \param[out] RWORK
124 *> \verbatim
125 *> RWORK is REAL array, dimension (NMAX)
126 *> \endverbatim
127 *>
128 *> \param[out] WORK
129 *> \verbatim
130 *> WORK is REAL array, dimension (NMAX*NMAX)
131 *> \endverbatim
132 *>
133 *> \param[in] NIN
134 *> \verbatim
135 *> NIN is INTEGER
136 *> The unit number for input.
137 *> \endverbatim
138 *>
139 *> \param[in] NOUT
140 *> \verbatim
141 *> NOUT is INTEGER
142 *> The unit number for output.
143 *> \endverbatim
144 *>
145 *> \param[out] INFO
146 *> \verbatim
147 *> INFO is INTEGER
148 *> = 0 : successful exit
149 *> > 0 : If SLATMS returns an error code, the absolute value
150 *> of it is returned.
151 *> \endverbatim
152 *
153 * Authors:
154 * ========
155 *
156 *> \author Univ. of Tennessee
157 *> \author Univ. of California Berkeley
158 *> \author Univ. of Colorado Denver
159 *> \author NAG Ltd.
160 *
161 *> \date November 2011
162 *
163 *> \ingroup single_eig
164 *
165 * =====================================================================
166  SUBROUTINE sckglm( NN, MVAL, PVAL, NVAL, NMATS, ISEED, THRESH,
167  $ nmax, a, af, b, bf, x, work, rwork, nin, nout,
168  $ info )
169 *
170 * -- LAPACK test routine (version 3.4.0) --
171 * -- LAPACK is a software package provided by Univ. of Tennessee, --
172 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
173 * November 2011
174 *
175 * .. Scalar Arguments ..
176  INTEGER info, nin, nmats, nmax, nn, nout
177  REAL thresh
178 * ..
179 * .. Array Arguments ..
180  INTEGER iseed( 4 ), mval( * ), nval( * ), pval( * )
181  REAL a( * ), af( * ), b( * ), bf( * ), rwork( * ),
182  $ work( * ), x( * )
183 * ..
184 *
185 * =====================================================================
186 *
187 * .. Parameters ..
188  INTEGER ntypes
189  parameter( ntypes = 8 )
190 * ..
191 * .. Local Scalars ..
192  LOGICAL firstt
193  CHARACTER dista, distb, type
194  CHARACTER*3 path
195  INTEGER i, iinfo, ik, imat, kla, klb, kua, kub, lda,
196  $ ldb, lwork, m, modea, modeb, n, nfail, nrun, p
197  REAL anorm, bnorm, cndnma, cndnmb, resid
198 * ..
199 * .. Local Arrays ..
200  LOGICAL dotype( ntypes )
201 * ..
202 * .. External Functions ..
203  REAL slarnd
204  EXTERNAL slarnd
205 * ..
206 * .. External Subroutines ..
207  EXTERNAL alahdg, alareq, alasum, sglmts, slatb9, slatms
208 * ..
209 * .. Intrinsic Functions ..
210  INTRINSIC abs
211 * ..
212 * .. Executable Statements ..
213 *
214 * Initialize constants.
215 *
216  path( 1: 3 ) = 'GLM'
217  info = 0
218  nrun = 0
219  nfail = 0
220  firstt = .true.
221  CALL alareq( path, nmats, dotype, ntypes, nin, nout )
222  lda = nmax
223  ldb = nmax
224  lwork = nmax*nmax
225 *
226 * Check for valid input values.
227 *
228  DO 10 ik = 1, nn
229  m = mval( ik )
230  p = pval( ik )
231  n = nval( ik )
232  IF( m.GT.n .OR. n.GT.m+p ) THEN
233  IF( firstt ) THEN
234  WRITE( nout, fmt = * )
235  firstt = .false.
236  END IF
237  WRITE( nout, fmt = 9997 )m, p, n
238  END IF
239  10 continue
240  firstt = .true.
241 *
242 * Do for each value of M in MVAL.
243 *
244  DO 40 ik = 1, nn
245  m = mval( ik )
246  p = pval( ik )
247  n = nval( ik )
248  IF( m.GT.n .OR. n.GT.m+p )
249  $ go to 40
250 *
251  DO 30 imat = 1, ntypes
252 *
253 * Do the tests only if DOTYPE( IMAT ) is true.
254 *
255  IF( .NOT.dotype( imat ) )
256  $ go to 30
257 *
258 * Set up parameters with SLATB9 and generate test
259 * matrices A and B with SLATMS.
260 *
261  CALL slatb9( path, imat, m, p, n, type, kla, kua, klb, kub,
262  $ anorm, bnorm, modea, modeb, cndnma, cndnmb,
263  $ dista, distb )
264 *
265  CALL slatms( n, m, dista, iseed, type, rwork, modea, cndnma,
266  $ anorm, kla, kua, 'No packing', a, lda, work,
267  $ iinfo )
268  IF( iinfo.NE.0 ) THEN
269  WRITE( nout, fmt = 9999 )iinfo
270  info = abs( iinfo )
271  go to 30
272  END IF
273 *
274  CALL slatms( n, p, distb, iseed, type, rwork, modeb, cndnmb,
275  $ bnorm, klb, kub, 'No packing', b, ldb, work,
276  $ iinfo )
277  IF( iinfo.NE.0 ) THEN
278  WRITE( nout, fmt = 9999 )iinfo
279  info = abs( iinfo )
280  go to 30
281  END IF
282 *
283 * Generate random left hand side vector of GLM
284 *
285  DO 20 i = 1, n
286  x( i ) = slarnd( 2, iseed )
287  20 continue
288 *
289  CALL sglmts( n, m, p, a, af, lda, b, bf, ldb, x,
290  $ x( nmax+1 ), x( 2*nmax+1 ), x( 3*nmax+1 ),
291  $ work, lwork, rwork, resid )
292 *
293 * Print information about the tests that did not
294 * pass the threshold.
295 *
296  IF( resid.GE.thresh ) THEN
297  IF( nfail.EQ.0 .AND. firstt ) THEN
298  firstt = .false.
299  CALL alahdg( nout, path )
300  END IF
301  WRITE( nout, fmt = 9998 )n, m, p, imat, 1, resid
302  nfail = nfail + 1
303  END IF
304  nrun = nrun + 1
305 *
306  30 continue
307  40 continue
308 *
309 * Print a summary of the results.
310 *
311  CALL alasum( path, nout, nfail, nrun, 0 )
312 *
313  9999 format( ' SLATMS in SCKGLM INFO = ', i5 )
314  9998 format( ' N=', i4, ' M=', i4, ', P=', i4, ', type ', i2,
315  $ ', test ', i2, ', ratio=', g13.6 )
316  9997 format( ' *** Invalid input for GLM: M = ', i6, ', P = ', i6,
317  $ ', N = ', i6, ';', / ' must satisfy M <= N <= M+P ',
318  $ '(this set of values will be skipped)' )
319  return
320 *
321 * End of SCKGLM
322 *
323  END