3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ILAENV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilaenv.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilaenv.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilaenv.f">
21 * INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
23 * .. Scalar Arguments ..
24 * CHARACTER*( * ) NAME, OPTS
25 * INTEGER ISPEC, N1, N2, N3, N4
34 *> ILAENV is called from the LAPACK routines to choose problem-dependent
35 *> parameters for the local environment. See ISPEC for a description of
38 *> ILAENV returns an INTEGER
39 *> if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC
40 *> if ILAENV < 0: if ILAENV = -k, the k-th argument had an illegal value.
42 *> This version provides a set of parameters which should give good,
43 *> but not optimal, performance on many of the currently available
44 *> computers. Users are encouraged to modify this subroutine to set
45 *> the tuning parameters for their particular machine using the option
46 *> and problem size information in the arguments.
48 *> This routine will not function correctly if it is converted to all
49 *> lower case. Converting it to all upper case is allowed.
58 *> Specifies the parameter to be returned as the value of
60 *> = 1: the optimal blocksize; if this value is 1, an unblocked
61 *> algorithm will give the best performance.
62 *> = 2: the minimum block size for which the block routine
63 *> should be used; if the usable block size is less than
64 *> this value, an unblocked routine should be used.
65 *> = 3: the crossover point (in a block routine, for N less
66 *> than this value, an unblocked routine should be used)
67 *> = 4: the number of shifts, used in the nonsymmetric
68 *> eigenvalue routines (DEPRECATED)
69 *> = 5: the minimum column dimension for blocking to be used;
70 *> rectangular blocks must have dimension at least k by m,
71 *> where k is given by ILAENV(2,...) and m by ILAENV(5,...)
72 *> = 6: the crossover point for the SVD (when reducing an m by n
73 *> matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
74 *> this value, a QR factorization is used first to reduce
75 *> the matrix to a triangular form.)
76 *> = 7: the number of processors
77 *> = 8: the crossover point for the multishift QR method
78 *> for nonsymmetric eigenvalue problems (DEPRECATED)
79 *> = 9: maximum size of the subproblems at the bottom of the
80 *> computation tree in the divide-and-conquer algorithm
81 *> (used by xGELSD and xGESDD)
82 *> =10: ieee NaN arithmetic can be trusted not to trap
83 *> =11: infinity arithmetic can be trusted not to trap
85 *> xHSEQR or related subroutines,
86 *> see IPARMQ for detailed explanation
91 *> NAME is CHARACTER*(*)
92 *> The name of the calling subroutine, in either upper case or
98 *> OPTS is CHARACTER*(*)
99 *> The character options to the subroutine NAME, concatenated
100 *> into a single character string. For example, UPLO = 'U',
101 *> TRANS = 'T', and DIAG = 'N' for a triangular routine would
102 *> be specified as OPTS = 'UTN'.
123 *> Problem dimensions for the subroutine NAME; these may not all
130 *> \author Univ. of Tennessee
131 *> \author Univ. of California Berkeley
132 *> \author Univ. of Colorado Denver
137 *> \ingroup auxOTHERauxiliary
139 *> \par Further Details:
140 * =====================
144 *> The following conventions have been used when calling ILAENV from the
146 *> 1) OPTS is a concatenation of all of the character options to
147 *> subroutine NAME, in the same order that they appear in the
148 *> argument list for NAME, even if they are not used in determining
149 *> the value of the parameter specified by ISPEC.
150 *> 2) The problem dimensions N1, N2, N3, N4 are specified in the order
151 *> that they appear in the argument list for NAME. N1 is used
152 *> first, N2 second, and so on, and unused problem dimensions are
153 *> passed a value of -1.
154 *> 3) The parameter value returned by ILAENV is checked for validity in
155 *> the calling subroutine. For example, ILAENV is used to retrieve
156 *> the optimal blocksize for STRTRI as follows:
158 *> NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
159 *> IF( NB.LE.1 ) NB = MAX( 1, N )
162 * =====================================================================
163 INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
165 * -- LAPACK auxiliary routine (version 3.6.1) --
166 * -- LAPACK is a software package provided by Univ. of Tennessee, --
167 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
170 * .. Scalar Arguments ..
171 CHARACTER*( * ) NAME, OPTS
172 INTEGER ISPEC, N1, N2, N3, N4
175 * =====================================================================
177 * .. Local Scalars ..
178 INTEGER I, IC, IZ, NB, NBMIN, NX
180 CHARACTER C1*1, C2*2, C4*2, C3*3, SUBNAM*6
182 * .. Intrinsic Functions ..
183 INTRINSIC CHAR, ICHAR, INT, MIN, REAL
185 * .. External Functions ..
186 INTEGER IEEECK, IPARMQ
187 EXTERNAL IEEECK, IPARMQ
189 * .. Executable Statements ..
191 GO TO ( 10, 10, 10, 80, 90, 100, 110, 120,
192 $ 130, 140, 150, 160, 160, 160, 160, 160 )ISPEC
194 * Invalid value for ISPEC
201 * Convert NAME to upper case if the first character is lower case.
205 IC = ICHAR( SUBNAM( 1: 1 ) )
207 IF( IZ.EQ.90 .OR. IZ.EQ.122 ) THEN
209 * ASCII character set
211 IF( IC.GE.97 .AND. IC.LE.122 ) THEN
212 SUBNAM( 1: 1 ) = CHAR( IC-32 )
214 IC = ICHAR( SUBNAM( I: I ) )
215 IF( IC.GE.97 .AND. IC.LE.122 )
216 $ SUBNAM( I: I ) = CHAR( IC-32 )
220 ELSE IF( IZ.EQ.233 .OR. IZ.EQ.169 ) THEN
222 * EBCDIC character set
224 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
225 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
226 $ ( IC.GE.162 .AND. IC.LE.169 ) ) THEN
227 SUBNAM( 1: 1 ) = CHAR( IC+64 )
229 IC = ICHAR( SUBNAM( I: I ) )
230 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
231 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
232 $ ( IC.GE.162 .AND. IC.LE.169 ) )SUBNAM( I:
233 $ I ) = CHAR( IC+64 )
237 ELSE IF( IZ.EQ.218 .OR. IZ.EQ.250 ) THEN
239 * Prime machines: ASCII+128
241 IF( IC.GE.225 .AND. IC.LE.250 ) THEN
242 SUBNAM( 1: 1 ) = CHAR( IC-32 )
244 IC = ICHAR( SUBNAM( I: I ) )
245 IF( IC.GE.225 .AND. IC.LE.250 )
246 $ SUBNAM( I: I ) = CHAR( IC-32 )
252 SNAME = C1.EQ.'S' .OR. C1.EQ.'D'
253 CNAME = C1.EQ.'C' .OR. C1.EQ.'Z'
254 IF( .NOT.( CNAME .OR. SNAME ) )
260 GO TO ( 50, 60, 70 )ISPEC
264 * ISPEC = 1: block size
266 * In these examples, separate code is provided for setting NB for
267 * real and complex. We assume that NB will take the same value in
268 * single or double precision.
272 IF( C2.EQ.'GE' ) THEN
273 IF( C3.EQ.'TRF' ) THEN
279 ELSE IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
286 ELSE IF( C3.EQ.'HRD' ) THEN
292 ELSE IF( C3.EQ.'BRD' ) THEN
298 ELSE IF( C3.EQ.'TRI' ) THEN
305 ELSE IF( C2.EQ.'PO' ) THEN
306 IF( C3.EQ.'TRF' ) THEN
313 ELSE IF( C2.EQ.'SY' ) THEN
314 IF( C3.EQ.'TRF' ) THEN
320 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
322 ELSE IF( SNAME .AND. C3.EQ.'GST' ) THEN
325 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
326 IF( C3.EQ.'TRF' ) THEN
328 ELSE IF( C3.EQ.'TRD' ) THEN
330 ELSE IF( C3.EQ.'GST' ) THEN
333 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
334 IF( C3( 1: 1 ).EQ.'G' ) THEN
335 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
336 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
340 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
341 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
342 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
347 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
348 IF( C3( 1: 1 ).EQ.'G' ) THEN
349 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
350 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
354 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
355 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
356 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
361 ELSE IF( C2.EQ.'GB' ) THEN
362 IF( C3.EQ.'TRF' ) THEN
377 ELSE IF( C2.EQ.'PB' ) THEN
378 IF( C3.EQ.'TRF' ) THEN
393 ELSE IF( C2.EQ.'TR' ) THEN
394 IF( C3.EQ.'TRI' ) THEN
400 ELSE IF ( C3.EQ.'EVC' ) THEN
407 ELSE IF( C2.EQ.'LA' ) THEN
408 IF( C3.EQ.'UUM' ) THEN
415 ELSE IF( SNAME .AND. C2.EQ.'ST' ) THEN
416 IF( C3.EQ.'EBZ' ) THEN
419 ELSE IF( C2.EQ.'GG' ) THEN
421 IF( C3.EQ.'HD3' ) THEN
434 * ISPEC = 2: minimum block size
437 IF( C2.EQ.'GE' ) THEN
438 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR. C3.EQ.
445 ELSE IF( C3.EQ.'HRD' ) THEN
451 ELSE IF( C3.EQ.'BRD' ) THEN
457 ELSE IF( C3.EQ.'TRI' ) THEN
464 ELSE IF( C2.EQ.'SY' ) THEN
465 IF( C3.EQ.'TRF' ) THEN
471 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
474 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
475 IF( C3.EQ.'TRD' ) THEN
478 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
479 IF( C3( 1: 1 ).EQ.'G' ) THEN
480 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
481 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
485 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
486 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
487 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
492 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
493 IF( C3( 1: 1 ).EQ.'G' ) THEN
494 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
495 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
499 ELSE IF( C3( 1: 1 ).EQ.'M' ) THEN
500 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
501 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
506 ELSE IF( C2.EQ.'GG' ) THEN
508 IF( C3.EQ.'HD3' ) THEN
517 * ISPEC = 3: crossover point
520 IF( C2.EQ.'GE' ) THEN
521 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR. C3.EQ.
528 ELSE IF( C3.EQ.'HRD' ) THEN
534 ELSE IF( C3.EQ.'BRD' ) THEN
541 ELSE IF( C2.EQ.'SY' ) THEN
542 IF( SNAME .AND. C3.EQ.'TRD' ) THEN
545 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
546 IF( C3.EQ.'TRD' ) THEN
549 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
550 IF( C3( 1: 1 ).EQ.'G' ) THEN
551 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
552 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
557 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
558 IF( C3( 1: 1 ).EQ.'G' ) THEN
559 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR. C4.EQ.
560 $ 'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR. C4.EQ.'BR' )
565 ELSE IF( C2.EQ.'GG' ) THEN
567 IF( C3.EQ.'HD3' ) THEN
576 * ISPEC = 4: number of shifts (used by xHSEQR)
583 * ISPEC = 5: minimum column dimension (not used)
590 * ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD)
592 ILAENV = INT( REAL( MIN( N1, N2 ) )*1.6E0 )
597 * ISPEC = 7: number of processors (not used)
604 * ISPEC = 8: crossover point for multishift (used by xHSEQR)
611 * ISPEC = 9: maximum size of the subproblems at the bottom of the
612 * computation tree in the divide-and-conquer algorithm
613 * (used by xGELSD and xGESDD)
620 * ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
624 IF( ILAENV.EQ.1 ) THEN
625 ILAENV = IEEECK( 1, 0.0, 1.0 )
631 * ISPEC = 11: infinity arithmetic can be trusted not to trap
635 IF( ILAENV.EQ.1 ) THEN
636 ILAENV = IEEECK( 0, 0.0, 1.0 )
642 * 12 <= ISPEC <= 16: xHSEQR or related subroutines.
644 ILAENV = IPARMQ( ISPEC, NAME, OPTS, N1, N2, N3, N4 )