OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
clatb4.f
Go to the documentation of this file.
1*> \brief \b CLATB4
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 CLATB4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
12* CNDNUM, DIST )
13*
14* .. Scalar Arguments ..
15* CHARACTER DIST, TYPE
16* CHARACTER*3 PATH
17* INTEGER IMAT, KL, KU, M, MODE, N
18* REAL ANORM, CNDNUM
19* ..
20*
21*
22*> \par Purpose:
23* =============
24*>
25*> \verbatim
26*>
27*> CLATB4 sets parameters for the matrix generator based on the type of
28*> matrix to be generated.
29*> \endverbatim
30*
31* Arguments:
32* ==========
33*
34*> \param[in] PATH
35*> \verbatim
36*> PATH is CHARACTER*3
37*> The LAPACK path name.
38*> \endverbatim
39*>
40*> \param[in] IMAT
41*> \verbatim
42*> IMAT is INTEGER
43*> An integer key describing which matrix to generate for this
44*> path.
45*> \endverbatim
46*>
47*> \param[in] M
48*> \verbatim
49*> M is INTEGER
50*> The number of rows in the matrix to be generated.
51*> \endverbatim
52*>
53*> \param[in] N
54*> \verbatim
55*> N is INTEGER
56*> The number of columns in the matrix to be generated.
57*> \endverbatim
58*>
59*> \param[out] TYPE
60*> \verbatim
61*> TYPE is CHARACTER*1
62*> The type of the matrix to be generated:
63*> = 'S': symmetric matrix
64*> = 'H': Hermitian matrix
65*> = 'P': Hermitian positive (semi)definite matrix
66*> = 'N': nonsymmetric matrix
67*> \endverbatim
68*>
69*> \param[out] KL
70*> \verbatim
71*> KL is INTEGER
72*> The lower band width of the matrix to be generated.
73*> \endverbatim
74*>
75*> \param[out] KU
76*> \verbatim
77*> KU is INTEGER
78*> The upper band width of the matrix to be generated.
79*> \endverbatim
80*>
81*> \param[out] ANORM
82*> \verbatim
83*> ANORM is REAL
84*> The desired norm of the matrix to be generated. The diagonal
85*> matrix of singular values or eigenvalues is scaled by this
86*> value.
87*> \endverbatim
88*>
89*> \param[out] MODE
90*> \verbatim
91*> MODE is INTEGER
92*> A key indicating how to choose the vector of eigenvalues.
93*> \endverbatim
94*>
95*> \param[out] CNDNUM
96*> \verbatim
97*> CNDNUM is REAL
98*> The desired condition number.
99*> \endverbatim
100*>
101*> \param[out] DIST
102*> \verbatim
103*> DIST is CHARACTER*1
104*> The type of distribution to be used by the random number
105*> generator.
106*> \endverbatim
107*
108* Authors:
109* ========
110*
111*> \author Univ. of Tennessee
112*> \author Univ. of California Berkeley
113*> \author Univ. of Colorado Denver
114*> \author NAG Ltd.
115*
116*> \ingroup complex_lin
117*
118* =====================================================================
119 SUBROUTINE clatb4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
120 $ CNDNUM, DIST )
121*
122* -- LAPACK test routine --
123* -- LAPACK is a software package provided by Univ. of Tennessee, --
124* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
125*
126* .. Scalar Arguments ..
127 CHARACTER DIST, TYPE
128 CHARACTER*3 PATH
129 INTEGER IMAT, KL, KU, M, MODE, N
130 REAL ANORM, CNDNUM
131* ..
132*
133* =====================================================================
134*
135* .. Parameters ..
136 REAL SHRINK, TENTH
137 parameter( shrink = 0.25e0, tenth = 0.1e+0 )
138 REAL ONE
139 parameter( one = 1.0e+0 )
140 REAL TWO
141 parameter( two = 2.0e+0 )
142* ..
143* .. Local Scalars ..
144 LOGICAL FIRST
145 CHARACTER*2 C2
146 INTEGER MAT
147 REAL BADC1, BADC2, EPS, LARGE, SMALL
148* ..
149* .. External Functions ..
150 LOGICAL LSAMEN
151 REAL SLAMCH
152 EXTERNAL lsamen, slamch
153* ..
154* .. Intrinsic Functions ..
155 INTRINSIC abs, max, sqrt
156* ..
157* .. External Subroutines ..
158 EXTERNAL slabad
159* ..
160* .. Save statement ..
161 SAVE eps, small, large, badc1, badc2, first
162* ..
163* .. Data statements ..
164 DATA first / .true. /
165* ..
166* .. Executable Statements ..
167*
168* Set some constants for use in the subroutine.
169*
170 IF( first ) THEN
171 first = .false.
172 eps = slamch( 'Precision' )
173 badc2 = tenth / eps
174 badc1 = sqrt( badc2 )
175 small = slamch( 'Safe minimum' )
176 large = one / small
177*
178* If it looks like we're on a Cray, take the square root of
179* SMALL and LARGE to avoid overflow and underflow problems.
180*
181 CALL slabad( small, large )
182 small = shrink*( small / eps )
183 large = one / small
184 END IF
185*
186 c2 = path( 2: 3 )
187*
188* Set some parameters we don't plan to change.
189*
190 dist = 's'
191 MODE = 3
192*
193* xQR, xLQ, xQL, xRQ: Set parameters to generate a general
194* M x N matrix.
195*
196 IF( LSAMEN( 2, C2, 'qr.OR.' ) LSAMEN( 2, C2, 'lq.OR.' )
197 $ LSAMEN( 2, C2, 'ql.OR.' ) LSAMEN( 2, C2, 'rq' ) ) THEN
198*
199* Set TYPE, the type of matrix to be generated.
200*
201 TYPE = 'N'
202*
203* Set the lower and upper bandwidths.
204*
205 IF( imat.EQ.1 ) THEN
206 kl = 0
207 ku = 0
208 ELSE IF( imat.EQ.2 ) THEN
209 kl = 0
210 ku = max( n-1, 0 )
211 ELSE IF( imat.EQ.3 ) THEN
212 kl = max( m-1, 0 )
213 ku = 0
214 ELSE
215 kl = max( m-1, 0 )
216 ku = max( n-1, 0 )
217 END IF
218*
219* Set the condition number and norm.
220*
221 IF( imat.EQ.5 ) THEN
222 cndnum = badc1
223 ELSE IF( imat.EQ.6 ) THEN
224 cndnum = badc2
225 ELSE
226 cndnum = two
227 END IF
228*
229 IF( imat.EQ.7 ) THEN
230 anorm = small
231 ELSE IF( imat.EQ.8 ) THEN
232 anorm = large
233 ELSE
234 anorm = one
235 END IF
236*
237 ELSE IF( lsamen( 2, c2, 'GE' ) ) THEN
238*
239* xGE: Set parameters to generate a general M x N matrix.
240*
241* Set TYPE, the type of matrix to be generated.
242*
243 TYPE = 'n'
244*
245* Set the lower and upper bandwidths.
246*
247.EQ. IF( IMAT1 ) THEN
248 KL = 0
249 KU = 0
250.EQ. ELSE IF( IMAT2 ) THEN
251 KL = 0
252 KU = MAX( N-1, 0 )
253.EQ. ELSE IF( IMAT3 ) THEN
254 KL = MAX( M-1, 0 )
255 KU = 0
256 ELSE
257 KL = MAX( M-1, 0 )
258 KU = MAX( N-1, 0 )
259 END IF
260*
261* Set the condition number and norm.
262*
263.EQ. IF( IMAT8 ) THEN
264 CNDNUM = BADC1
265.EQ. ELSE IF( IMAT9 ) THEN
266 CNDNUM = BADC2
267 ELSE
268 CNDNUM = TWO
269 END IF
270*
271.EQ. IF( IMAT10 ) THEN
272 ANORM = SMALL
273.EQ. ELSE IF( IMAT11 ) THEN
274 ANORM = LARGE
275 ELSE
276 ANORM = ONE
277 END IF
278*
279 ELSE IF( LSAMEN( 2, C2, 'gb' ) ) THEN
280*
281* xGB: Set parameters to generate a general banded matrix.
282*
283* Set TYPE, the type of matrix to be generated.
284*
285 TYPE = 'n'
286*
287* Set the condition number and norm.
288*
289.EQ. IF( IMAT5 ) THEN
290 CNDNUM = BADC1
291.EQ. ELSE IF( IMAT6 ) THEN
292 CNDNUM = TENTH*BADC2
293 ELSE
294 CNDNUM = TWO
295 END IF
296*
297.EQ. IF( IMAT7 ) THEN
298 ANORM = SMALL
299.EQ. ELSE IF( IMAT8 ) THEN
300 ANORM = LARGE
301 ELSE
302 ANORM = ONE
303 END IF
304*
305 ELSE IF( LSAMEN( 2, C2, 'gt' ) ) THEN
306*
307* xGT: Set parameters to generate a general tridiagonal matrix.
308*
309* Set TYPE, the type of matrix to be generated.
310*
311 TYPE = 'n'
312*
313* Set the lower and upper bandwidths.
314*
315.EQ. IF( IMAT1 ) THEN
316 KL = 0
317 ELSE
318 KL = 1
319 END IF
320 KU = KL
321*
322* Set the condition number and norm.
323*
324.EQ. IF( IMAT3 ) THEN
325 CNDNUM = BADC1
326.EQ. ELSE IF( IMAT4 ) THEN
327 CNDNUM = BADC2
328 ELSE
329 CNDNUM = TWO
330 END IF
331*
332.EQ..OR..EQ. IF( IMAT5 IMAT11 ) THEN
333 ANORM = SMALL
334.EQ..OR..EQ. ELSE IF( IMAT6 IMAT12 ) THEN
335 ANORM = LARGE
336 ELSE
337 ANORM = ONE
338 END IF
339*
340 ELSE IF( LSAMEN( 2, C2, 'po.OR.' ) LSAMEN( 2, C2, 'pp' ) ) THEN
341*
342* xPO, xPP: Set parameters to generate a
343* symmetric or Hermitian positive definite matrix.
344*
345* Set TYPE, the type of matrix to be generated.
346*
347 TYPE = C2( 1: 1 )
348*
349* Set the lower and upper bandwidths.
350*
351.EQ. IF( IMAT1 ) THEN
352 KL = 0
353 ELSE
354 KL = MAX( N-1, 0 )
355 END IF
356 KU = KL
357*
358* Set the condition number and norm.
359*
360.EQ. IF( IMAT6 ) THEN
361 CNDNUM = BADC1
362.EQ. ELSE IF( IMAT7 ) THEN
363 CNDNUM = BADC2
364 ELSE
365 CNDNUM = TWO
366 END IF
367*
368.EQ. IF( IMAT8 ) THEN
369 ANORM = SMALL
370.EQ. ELSE IF( IMAT9 ) THEN
371 ANORM = LARGE
372 ELSE
373 ANORM = ONE
374 END IF
375*
376 ELSE IF( LSAMEN( 2, C2, 'he.OR.' ) LSAMEN( 2, C2, 'hp.OR.' )
377 $ LSAMEN( 2, C2, 'sy.OR.' ) LSAMEN( 2, C2, 'sp' ) ) THEN
378*
379* xHE, xHP, xSY, xSP: Set parameters to generate a
380* symmetric or Hermitian matrix.
381*
382* Set TYPE, the type of matrix to be generated.
383*
384 TYPE = C2( 1: 1 )
385*
386* Set the lower and upper bandwidths.
387*
388.EQ. IF( IMAT1 ) THEN
389 KL = 0
390 ELSE
391 KL = MAX( N-1, 0 )
392 END IF
393 KU = KL
394*
395* Set the condition number and norm.
396*
397.EQ. IF( IMAT7 ) THEN
398 CNDNUM = BADC1
399.EQ. ELSE IF( IMAT8 ) THEN
400 CNDNUM = BADC2
401 ELSE
402 CNDNUM = TWO
403 END IF
404*
405.EQ. IF( IMAT9 ) THEN
406 ANORM = SMALL
407.EQ. ELSE IF( IMAT10 ) THEN
408 ANORM = LARGE
409 ELSE
410 ANORM = ONE
411 END IF
412*
413 ELSE IF( LSAMEN( 2, C2, 'pb' ) ) THEN
414*
415* xPB: Set parameters to generate a symmetric band matrix.
416*
417* Set TYPE, the type of matrix to be generated.
418*
419 TYPE = 'p'
420*
421* Set the norm and condition number.
422*
423.EQ. IF( IMAT5 ) THEN
424 CNDNUM = BADC1
425.EQ. ELSE IF( IMAT6 ) THEN
426 CNDNUM = BADC2
427 ELSE
428 CNDNUM = TWO
429 END IF
430*
431.EQ. IF( IMAT7 ) THEN
432 ANORM = SMALL
433.EQ. ELSE IF( IMAT8 ) THEN
434 ANORM = LARGE
435 ELSE
436 ANORM = ONE
437 END IF
438*
439 ELSE IF( LSAMEN( 2, C2, 'pt' ) ) THEN
440*
441* xPT: Set parameters to generate a symmetric positive definite
442* tridiagonal matrix.
443*
444 TYPE = 'p'
445.EQ. IF( IMAT1 ) THEN
446 KL = 0
447 ELSE
448 KL = 1
449 END IF
450 KU = KL
451*
452* Set the condition number and norm.
453*
454.EQ. IF( IMAT3 ) THEN
455 CNDNUM = BADC1
456.EQ. ELSE IF( IMAT4 ) THEN
457 CNDNUM = BADC2
458 ELSE
459 CNDNUM = TWO
460 END IF
461*
462.EQ..OR..EQ. IF( IMAT5 IMAT11 ) THEN
463 ANORM = SMALL
464.EQ..OR..EQ. ELSE IF( IMAT6 IMAT12 ) THEN
465 ANORM = LARGE
466 ELSE
467 ANORM = ONE
468 END IF
469*
470 ELSE IF( LSAMEN( 2, C2, 'tr.OR.' ) LSAMEN( 2, C2, 'tp' ) ) THEN
471*
472* xTR, xTP: Set parameters to generate a triangular matrix
473*
474* Set TYPE, the type of matrix to be generated.
475*
476 TYPE = 'n'
477*
478* Set the lower and upper bandwidths.
479*
480 MAT = ABS( IMAT )
481.EQ..OR..EQ. IF( MAT1 MAT7 ) THEN
482 KL = 0
483 KU = 0
484.LT. ELSE IF( IMAT0 ) THEN
485 KL = MAX( N-1, 0 )
486 KU = 0
487 ELSE
488 KL = 0
489 KU = MAX( N-1, 0 )
490 END IF
491*
492* Set the condition number and norm.
493*
494.EQ..OR..EQ. IF( MAT3 MAT9 ) THEN
495 CNDNUM = BADC1
496.EQ..OR..EQ. ELSE IF( MAT4 MAT10 ) THEN
497 CNDNUM = BADC2
498 ELSE
499 CNDNUM = TWO
500 END IF
501*
502.EQ. IF( MAT5 ) THEN
503 ANORM = SMALL
504.EQ. ELSE IF( MAT6 ) THEN
505 ANORM = LARGE
506 ELSE
507 ANORM = ONE
508 END IF
509*
510 ELSE IF( LSAMEN( 2, C2, 'tb' ) ) THEN
511*
512* xTB: Set parameters to generate a triangular band matrix.
513*
514* Set TYPE, the type of matrix to be generated.
515*
516 TYPE = 'n'
517*
518* Set the norm and condition number.
519*
520.EQ..OR..EQ. IF( IMAT2 IMAT8 ) THEN
521 CNDNUM = BADC1
522.EQ..OR..EQ. ELSE IF( IMAT3 IMAT9 ) THEN
523 CNDNUM = BADC2
524 ELSE
525 CNDNUM = TWO
526 END IF
527*
528.EQ. IF( IMAT4 ) THEN
529 ANORM = SMALL
530.EQ. ELSE IF( IMAT5 ) THEN
531 ANORM = LARGE
532 ELSE
533 ANORM = ONE
534 END IF
535 END IF
536.LE. IF( N1 )
537 $ CNDNUM = ONE
538*
539 RETURN
540*
541* End of CLATB4
542*
543 END
subroutine slabad(small, large)
SLABAD
Definition slabad.f:74
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
Definition clatb4.f:121
#define max(a, b)
Definition macros.h:21