1 INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
3 ! -- LAPACK auxiliary routine (version 3.1.1) --
4 ! Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
7 ! .. Scalar Arguments ..
8 CHARACTER*( * ) NAME, OPTS
9 INTEGER ISPEC, N1, N2, N3, N4
15 ! ILAENV is called from the LAPACK routines to choose problem-dependent
16 ! parameters for the local environment. See ISPEC for a description of
19 ! ILAENV returns an INTEGER
20 ! if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC
21 ! if ILAENV < 0: if ILAENV = -k, the k-th argument had an illegal value.
23 ! This version provides a set of parameters which should give good,
24 ! but not optimal, performance on many of the currently available
25 ! computers. Users are encouraged to modify this subroutine to set
26 ! the tuning parameters for their particular machine using the option
27 ! and problem size information in the arguments.
29 ! This routine will not function correctly if it is converted to all
30 ! lower case. Converting it to all upper case is allowed.
35 ! ISPEC (input) INTEGER
36 ! Specifies the parameter to be returned as the value of
38 ! = 1: the optimal blocksize; if this value is 1, an unblocked
39 ! algorithm will give the best performance.
40 ! = 2: the minimum block size for which the block routine
41 ! should be used; if the usable block size is less than
42 ! this value, an unblocked routine should be used.
43 ! = 3: the crossover point (in a block routine, for N less
44 ! than this value, an unblocked routine should be used)
45 ! = 4: the number of shifts, used in the nonsymmetric
46 ! eigenvalue routines (DEPRECATED)
47 ! = 5: the minimum column dimension for blocking to be used;
48 ! rectangular blocks must have dimension at least k by m,
49 ! where k is given by ILAENV(2,...) and m by ILAENV(5,...)
50 ! = 6: the crossover point for the SVD (when reducing an m by n
51 ! matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
52 ! this value, a QR factorization is used first to reduce
53 ! the matrix to a triangular form.)
54 ! = 7: the number of processors
55 ! = 8: the crossover point for the multishift QR method
56 ! for nonsymmetric eigenvalue problems (DEPRECATED)
57 ! = 9: maximum size of the subproblems at the bottom of the
58 ! computation tree in the divide-and-conquer algorithm
59 ! (used by xGELSD and xGESDD)
60 ! =10: ieee NaN arithmetic can be trusted not to trap
61 ! =11: infinity arithmetic can be trusted not to trap
63 ! xHSEQR or one of its subroutines,
64 ! see IPARMQ for detailed explanation
66 ! NAME (input) CHARACTER*(*)
67 ! The name of the calling subroutine, in either upper case or
70 ! OPTS (input) CHARACTER*(*)
71 ! The character options to the subroutine NAME, concatenated
72 ! into a single character string. For example, UPLO = 'U',
73 ! TRANS = 'T', and DIAG = 'N' for a triangular routine would
74 ! be specified as OPTS = 'UTN'.
80 ! Problem dimensions for the subroutine NAME; these may not all
86 ! The following conventions have been used when calling ILAENV from the
88 ! 1) OPTS is a concatenation of all of the character options to
89 ! subroutine NAME, in the same order that they appear in the
90 ! argument list for NAME, even if they are not used in determining
91 ! the value of the parameter specified by ISPEC.
92 ! 2) The problem dimensions N1, N2, N3, N4 are specified in the order
93 ! that they appear in the argument list for NAME. N1 is used
94 ! first, N2 second, and so on, and unused problem dimensions are
95 ! passed a value of -1.
96 ! 3) The parameter value returned by ILAENV is checked for validity in
97 ! the calling subroutine. For example, ILAENV is used to retrieve
98 ! the optimal blocksize for STRTRI as follows:
100 ! NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
101 ! IF( NB.LE.1 ) NB = MAX( 1, N )
103 ! =====================================================================
105 ! .. Local Scalars ..
106 INTEGER I, IC, IZ, NB, NBMIN, NX
108 CHARACTER C1*1, C2*2, C4*2, C3*3, SUBNAM*6
110 ! .. Intrinsic Functions ..
111 INTRINSIC CHAR, ICHAR, INT, MIN, REAL
113 ! .. External Functions ..
114 ! INTEGER IEEECK, IPARMQ
115 ! EXTERNAL IEEECK, IPARMQ
117 ! .. Executable Statements ..
119 GO TO ( 10, 10, 10, 80, 90, 100, 110, 120, &
120 130, 140, 150, 160, 160, 160, 160, 160 )ISPEC
122 ! Invalid value for ISPEC
129 ! Convert NAME to upper case if the first character is lower case.
133 IC = ICHAR( SUBNAM( 1: 1 ) )
135 IF( IZ.EQ.90 .OR. IZ.EQ.122 ) THEN
137 ! ASCII character set
139 IF( IC.GE.97 .AND. IC.LE.122 ) THEN
140 SUBNAM( 1: 1 ) = CHAR( IC-32 )
142 IC = ICHAR( SUBNAM( I: I ) )
143 IF( IC.GE.97 .AND. IC.LE.122 ) &
144 SUBNAM( I: I ) = CHAR( IC-32 )
148 ELSE IF( IZ.EQ.233 .OR. IZ.EQ.169 ) THEN
150 ! EBCDIC character set
152 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR. &
153 ( IC.GE.145 .AND. IC.LE.153 ) .OR. &
154 ( IC.GE.162 .AND. IC.LE.169 ) ) THEN
155 SUBNAM( 1: 1 ) = CHAR( IC+64 )
157 IC = ICHAR( SUBNAM( I: I ) )
158 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR. &
159 ( IC.GE.145 .AND. IC.LE.153 ) .OR. &
160 ( IC.GE.162 .AND. IC.LE.169 ) )SUBNAM( I: &
165 ELSE IF( IZ.EQ.218 .OR. IZ.EQ.250 ) THEN
167 ! Prime machines: ASCII+128
169 IF( IC.GE.225 .AND. IC.LE.250 ) THEN
170 SUBNAM( 1: 1 ) = CHAR( IC-32 )
172 IC = ICHAR( SUBNAM( I: I ) )
173 IF( IC.GE.225 .AND. IC.LE.250 ) &
174 SUBNAM( I: I ) = CHAR( IC-32 )
180 SNAME = C1.EQ.'S' .OR. C1.EQ.'D'
181 CNAME = C1.EQ.'C' .OR. C1.EQ.'Z'
182 IF( .NOT.( CNAME .OR. SNAME ) ) &
188 GO TO ( 50, 60, 70 )ISPEC
192 ! ISPEC = 1: block size
194 ! In these examples, separate code is provided for setting NB for
195 ! real and complex. We assume that NB will take the same value in
196 ! single or double precision.
200 IF( C2.EQ.'GE' ) THEN
201 IF( C3.EQ.'TRF' ) THEN
207 ELSE IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR. &
214 ELSE IF( C3.EQ.'HRD' ) THEN
220 ELSE IF( C3.EQ.'BRD' ) THEN
226 ELSE IF( C3.EQ.'TRI' ) THEN
233 ELSE IF( C2.EQ.'PO' ) THEN
234 IF( C3.EQ.'TRF' ) THEN
241 ELSE IF( C2.EQ.'SY' ) THEN
242 IF( C3.EQ.'TRF' ) THEN
248 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
250 ELSE IF( SNAME .AND. C3.EQ.'GST' ) THEN
253 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
254 IF( C3.EQ.'TRF' ) THEN
256 ELSE IF( C3.EQ.'TRD' ) THEN
258 ELSE IF( C3.EQ.'GST' ) THEN
261 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
262 IF( C3( 1: 1 ).EQ.'G' ) THEN
263 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
264 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
268 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
269 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
270 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
275 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
276 IF( C3( 1: 1 ).EQ.'G' ) THEN
277 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
278 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
282 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
283 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
284 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
289 ELSE IF( C2.EQ.'GB' ) THEN
290 IF( C3.EQ.'TRF' ) THEN
305 ELSE IF( C2.EQ.'PB' ) THEN
306 IF( C3.EQ.'TRF' ) THEN
321 ELSE IF( C2.EQ.'TR' ) THEN
322 IF( C3.EQ.'TRI' ) THEN
329 ELSE IF( C2.EQ.'LA' ) THEN
330 IF( C3.EQ.'UUM' ) THEN
337 ELSE IF( SNAME .AND. C2.EQ.'ST' ) THEN
338 IF( C3.EQ.'EBZ' ) THEN
347 ! ISPEC = 2: minimum block size
350 IF( C2.EQ.'GE' ) THEN
351 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR. C3.EQ. &
358 ELSE IF( C3.EQ.'HRD' ) THEN
364 ELSE IF( C3.EQ.'BRD' ) THEN
370 ELSE IF( C3.EQ.'TRI' ) THEN
377 ELSE IF( C2.EQ.'SY' ) THEN
378 IF( C3.EQ.'TRF' ) THEN
384 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
387 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
388 IF( C3.EQ.'TRD' ) THEN
391 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
392 IF( C3( 1: 1 ).EQ.'G' ) THEN
393 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
394 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
398 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
399 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
400 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
405 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
406 IF( C3( 1: 1 ).EQ.'G' ) THEN
407 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
408 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
412 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
413 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
414 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
425 ! ISPEC = 3: crossover point
428 IF( C2.EQ.'GE' ) THEN
429 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR. C3.EQ. &
436 ELSE IF( C3.EQ.'HRD' ) THEN
442 ELSE IF( C3.EQ.'BRD' ) THEN
449 ELSE IF( C2.EQ.'SY' ) THEN
450 IF( SNAME .AND. C3.EQ.'TRD' ) THEN
453 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
454 IF( C3.EQ.'TRD' ) THEN
457 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
458 IF( C3( 1: 1 ).EQ.'G' ) THEN
459 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
460 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
465 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
466 IF( C3( 1: 1 ).EQ.'G' ) THEN
467 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ. &
468 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' ) &
479 ! ISPEC = 4: number of shifts (used by xHSEQR)
486 ! ISPEC = 5: minimum column dimension (not used)
493 ! ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD)
495 ILAENV = INT( REAL( MIN( N1, N2 ) )*1.6E0 )
500 ! ISPEC = 7: number of processors (not used)
507 ! ISPEC = 8: crossover point for multishift (used by xHSEQR)
514 ! ISPEC = 9: maximum size of the subproblems at the bottom of the
515 ! computation tree in the divide-and-conquer algorithm
516 ! (used by xGELSD and xGESDD)
523 ! ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
527 IF( ILAENV.EQ.1 ) THEN
528 ILAENV = IEEECK( 0, 0.0, 1.0 )
534 ! ISPEC = 11: infinity arithmetic can be trusted not to trap
538 IF( ILAENV.EQ.1 ) THEN
539 ILAENV = IEEECK( 1, 0.0, 1.0 )
545 ! 12 <= ISPEC <= 16: xHSEQR or one of its subroutines.
547 ILAENV = IPARMQ( ISPEC, NAME, OPTS, N1, N2, N3, N4 )