LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
ilaenv.f
Go to the documentation of this file.
1 *> \brief \b ILAENV
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
9 *> Download ILAENV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilaenv.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilaenv.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilaenv.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
22 *
23 * .. Scalar Arguments ..
24 * CHARACTER*( * ) NAME, OPTS
25 * INTEGER ISPEC, N1, N2, N3, N4
26 * ..
27 *
28 *
29 *> \par Purpose:
30 * =============
31 *>
32 *> \verbatim
33 *>
34 *> ILAENV is called from the LAPACK routines to choose problem-dependent
35 *> parameters for the local environment. See ISPEC for a description of
36 *> the parameters.
37 *>
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.
41 *>
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.
47 *>
48 *> This routine will not function correctly if it is converted to all
49 *> lower case. Converting it to all upper case is allowed.
50 *> \endverbatim
51 *
52 * Arguments:
53 * ==========
54 *
55 *> \param[in] ISPEC
56 *> \verbatim
57 *> ISPEC is INTEGER
58 *> Specifies the parameter to be returned as the value of
59 *> ILAENV.
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
84 *> 12 <= ISPEC <= 16:
85 *> xHSEQR or one of its subroutines,
86 *> see IPARMQ for detailed explanation
87 *> \endverbatim
88 *>
89 *> \param[in] NAME
90 *> \verbatim
91 *> NAME is CHARACTER*(*)
92 *> The name of the calling subroutine, in either upper case or
93 *> lower case.
94 *> \endverbatim
95 *>
96 *> \param[in] OPTS
97 *> \verbatim
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'.
103 *> \endverbatim
104 *>
105 *> \param[in] N1
106 *> \verbatim
107 *> N1 is INTEGER
108 *> \endverbatim
109 *>
110 *> \param[in] N2
111 *> \verbatim
112 *> N2 is INTEGER
113 *> \endverbatim
114 *>
115 *> \param[in] N3
116 *> \verbatim
117 *> N3 is INTEGER
118 *> \endverbatim
119 *>
120 *> \param[in] N4
121 *> \verbatim
122 *> N4 is INTEGER
123 *> Problem dimensions for the subroutine NAME; these may not all
124 *> be required.
125 *> \endverbatim
126 *
127 * Authors:
128 * ========
129 *
130 *> \author Univ. of Tennessee
131 *> \author Univ. of California Berkeley
132 *> \author Univ. of Colorado Denver
133 *> \author NAG Ltd.
134 *
135 *> \date November 2011
136 *
137 *> \ingroup auxOTHERauxiliary
138 *
139 *> \par Further Details:
140 * =====================
141 *>
142 *> \verbatim
143 *>
144 *> The following conventions have been used when calling ILAENV from the
145 *> LAPACK routines:
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:
157 *>
158 *> NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
159 *> IF( NB.LE.1 ) NB = MAX( 1, N )
160 *> \endverbatim
161 *>
162 * =====================================================================
163  INTEGER FUNCTION ilaenv( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
164 *
165 * -- LAPACK auxiliary routine (version 3.4.0) --
166 * -- LAPACK is a software package provided by Univ. of Tennessee, --
167 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
168 * November 2011
169 *
170 * .. Scalar Arguments ..
171  CHARACTER*( * ) name, opts
172  INTEGER ispec, n1, n2, n3, n4
173 * ..
174 *
175 * =====================================================================
176 *
177 * .. Local Scalars ..
178  INTEGER i, ic, iz, nb, nbmin, nx
179  LOGICAL cname, sname
180  CHARACTER c1*1, c2*2, c4*2, c3*3, subnam*6
181 * ..
182 * .. Intrinsic Functions ..
183  INTRINSIC char, ichar, int, min, real
184 * ..
185 * .. External Functions ..
186  INTEGER ieeeck, iparmq
187  EXTERNAL ieeeck, iparmq
188 * ..
189 * .. Executable Statements ..
190 *
191  go to( 10, 10, 10, 80, 90, 100, 110, 120,
192  $ 130, 140, 150, 160, 160, 160, 160, 160 )ispec
193 *
194 * Invalid value for ISPEC
195 *
196  ilaenv = -1
197  return
198 *
199  10 continue
200 *
201 * Convert NAME to upper case if the first character is lower case.
202 *
203  ilaenv = 1
204  subnam = name
205  ic = ichar( subnam( 1: 1 ) )
206  iz = ichar( 'Z' )
207  IF( iz.EQ.90 .OR. iz.EQ.122 ) THEN
208 *
209 * ASCII character set
210 *
211  IF( ic.GE.97 .AND. ic.LE.122 ) THEN
212  subnam( 1: 1 ) = char( ic-32 )
213  DO 20 i = 2, 6
214  ic = ichar( subnam( i: i ) )
215  IF( ic.GE.97 .AND. ic.LE.122 )
216  $ subnam( i: i ) = char( ic-32 )
217  20 continue
218  END IF
219 *
220  ELSE IF( iz.EQ.233 .OR. iz.EQ.169 ) THEN
221 *
222 * EBCDIC character set
223 *
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 )
228  DO 30 i = 2, 6
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 )
234  30 continue
235  END IF
236 *
237  ELSE IF( iz.EQ.218 .OR. iz.EQ.250 ) THEN
238 *
239 * Prime machines: ASCII+128
240 *
241  IF( ic.GE.225 .AND. ic.LE.250 ) THEN
242  subnam( 1: 1 ) = char( ic-32 )
243  DO 40 i = 2, 6
244  ic = ichar( subnam( i: i ) )
245  IF( ic.GE.225 .AND. ic.LE.250 )
246  $ subnam( i: i ) = char( ic-32 )
247  40 continue
248  END IF
249  END IF
250 *
251  c1 = subnam( 1: 1 )
252  sname = c1.EQ.'S' .OR. c1.EQ.'D'
253  cname = c1.EQ.'C' .OR. c1.EQ.'Z'
254  IF( .NOT.( cname .OR. sname ) )
255  $ return
256  c2 = subnam( 2: 3 )
257  c3 = subnam( 4: 6 )
258  c4 = c3( 2: 3 )
259 *
260  go to( 50, 60, 70 )ispec
261 *
262  50 continue
263 *
264 * ISPEC = 1: block size
265 *
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.
269 *
270  nb = 1
271 *
272  IF( c2.EQ.'GE' ) THEN
273  IF( c3.EQ.'TRF' ) THEN
274  IF( sname ) THEN
275  nb = 64
276  ELSE
277  nb = 64
278  END IF
279  ELSE IF( c3.EQ.'QRF' .OR. c3.EQ.'RQF' .OR. c3.EQ.'LQF' .OR.
280  $ c3.EQ.'QLF' ) THEN
281  IF( sname ) THEN
282  nb = 32
283  ELSE
284  nb = 32
285  END IF
286  ELSE IF( c3.EQ.'HRD' ) THEN
287  IF( sname ) THEN
288  nb = 32
289  ELSE
290  nb = 32
291  END IF
292  ELSE IF( c3.EQ.'BRD' ) THEN
293  IF( sname ) THEN
294  nb = 32
295  ELSE
296  nb = 32
297  END IF
298  ELSE IF( c3.EQ.'TRI' ) THEN
299  IF( sname ) THEN
300  nb = 64
301  ELSE
302  nb = 64
303  END IF
304  END IF
305  ELSE IF( c2.EQ.'PO' ) THEN
306  IF( c3.EQ.'TRF' ) THEN
307  IF( sname ) THEN
308  nb = 64
309  ELSE
310  nb = 64
311  END IF
312  END IF
313  ELSE IF( c2.EQ.'SY' ) THEN
314  IF( c3.EQ.'TRF' ) THEN
315  IF( sname ) THEN
316  nb = 64
317  ELSE
318  nb = 64
319  END IF
320  ELSE IF( sname .AND. c3.EQ.'TRD' ) THEN
321  nb = 32
322  ELSE IF( sname .AND. c3.EQ.'GST' ) THEN
323  nb = 64
324  END IF
325  ELSE IF( cname .AND. c2.EQ.'HE' ) THEN
326  IF( c3.EQ.'TRF' ) THEN
327  nb = 64
328  ELSE IF( c3.EQ.'TRD' ) THEN
329  nb = 32
330  ELSE IF( c3.EQ.'GST' ) THEN
331  nb = 64
332  END IF
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' )
337  $ THEN
338  nb = 32
339  END IF
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' )
343  $ THEN
344  nb = 32
345  END IF
346  END IF
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' )
351  $ THEN
352  nb = 32
353  END IF
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' )
357  $ THEN
358  nb = 32
359  END IF
360  END IF
361  ELSE IF( c2.EQ.'GB' ) THEN
362  IF( c3.EQ.'TRF' ) THEN
363  IF( sname ) THEN
364  IF( n4.LE.64 ) THEN
365  nb = 1
366  ELSE
367  nb = 32
368  END IF
369  ELSE
370  IF( n4.LE.64 ) THEN
371  nb = 1
372  ELSE
373  nb = 32
374  END IF
375  END IF
376  END IF
377  ELSE IF( c2.EQ.'PB' ) THEN
378  IF( c3.EQ.'TRF' ) THEN
379  IF( sname ) THEN
380  IF( n2.LE.64 ) THEN
381  nb = 1
382  ELSE
383  nb = 32
384  END IF
385  ELSE
386  IF( n2.LE.64 ) THEN
387  nb = 1
388  ELSE
389  nb = 32
390  END IF
391  END IF
392  END IF
393  ELSE IF( c2.EQ.'TR' ) THEN
394  IF( c3.EQ.'TRI' ) THEN
395  IF( sname ) THEN
396  nb = 64
397  ELSE
398  nb = 64
399  END IF
400  END IF
401  ELSE IF( c2.EQ.'LA' ) THEN
402  IF( c3.EQ.'UUM' ) THEN
403  IF( sname ) THEN
404  nb = 64
405  ELSE
406  nb = 64
407  END IF
408  END IF
409  ELSE IF( sname .AND. c2.EQ.'ST' ) THEN
410  IF( c3.EQ.'EBZ' ) THEN
411  nb = 1
412  END IF
413  END IF
414  ilaenv = nb
415  return
416 *
417  60 continue
418 *
419 * ISPEC = 2: minimum block size
420 *
421  nbmin = 2
422  IF( c2.EQ.'GE' ) THEN
423  IF( c3.EQ.'QRF' .OR. c3.EQ.'RQF' .OR. c3.EQ.'LQF' .OR. c3.EQ.
424  $ 'QLF' ) THEN
425  IF( sname ) THEN
426  nbmin = 2
427  ELSE
428  nbmin = 2
429  END IF
430  ELSE IF( c3.EQ.'HRD' ) THEN
431  IF( sname ) THEN
432  nbmin = 2
433  ELSE
434  nbmin = 2
435  END IF
436  ELSE IF( c3.EQ.'BRD' ) THEN
437  IF( sname ) THEN
438  nbmin = 2
439  ELSE
440  nbmin = 2
441  END IF
442  ELSE IF( c3.EQ.'TRI' ) THEN
443  IF( sname ) THEN
444  nbmin = 2
445  ELSE
446  nbmin = 2
447  END IF
448  END IF
449  ELSE IF( c2.EQ.'SY' ) THEN
450  IF( c3.EQ.'TRF' ) THEN
451  IF( sname ) THEN
452  nbmin = 8
453  ELSE
454  nbmin = 8
455  END IF
456  ELSE IF( sname .AND. c3.EQ.'TRD' ) THEN
457  nbmin = 2
458  END IF
459  ELSE IF( cname .AND. c2.EQ.'HE' ) THEN
460  IF( c3.EQ.'TRD' ) THEN
461  nbmin = 2
462  END IF
463  ELSE IF( sname .AND. c2.EQ.'OR' ) THEN
464  IF( c3( 1: 1 ).EQ.'G' ) THEN
465  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
466  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
467  $ THEN
468  nbmin = 2
469  END IF
470  ELSE IF( c3( 1: 1 ).EQ.'M' ) THEN
471  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
472  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
473  $ THEN
474  nbmin = 2
475  END IF
476  END IF
477  ELSE IF( cname .AND. c2.EQ.'UN' ) THEN
478  IF( c3( 1: 1 ).EQ.'G' ) THEN
479  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
480  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
481  $ THEN
482  nbmin = 2
483  END IF
484  ELSE IF( c3( 1: 1 ).EQ.'M' ) THEN
485  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
486  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
487  $ THEN
488  nbmin = 2
489  END IF
490  END IF
491  END IF
492  ilaenv = nbmin
493  return
494 *
495  70 continue
496 *
497 * ISPEC = 3: crossover point
498 *
499  nx = 0
500  IF( c2.EQ.'GE' ) THEN
501  IF( c3.EQ.'QRF' .OR. c3.EQ.'RQF' .OR. c3.EQ.'LQF' .OR. c3.EQ.
502  $ 'QLF' ) THEN
503  IF( sname ) THEN
504  nx = 128
505  ELSE
506  nx = 128
507  END IF
508  ELSE IF( c3.EQ.'HRD' ) THEN
509  IF( sname ) THEN
510  nx = 128
511  ELSE
512  nx = 128
513  END IF
514  ELSE IF( c3.EQ.'BRD' ) THEN
515  IF( sname ) THEN
516  nx = 128
517  ELSE
518  nx = 128
519  END IF
520  END IF
521  ELSE IF( c2.EQ.'SY' ) THEN
522  IF( sname .AND. c3.EQ.'TRD' ) THEN
523  nx = 32
524  END IF
525  ELSE IF( cname .AND. c2.EQ.'HE' ) THEN
526  IF( c3.EQ.'TRD' ) THEN
527  nx = 32
528  END IF
529  ELSE IF( sname .AND. c2.EQ.'OR' ) THEN
530  IF( c3( 1: 1 ).EQ.'G' ) THEN
531  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
532  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
533  $ THEN
534  nx = 128
535  END IF
536  END IF
537  ELSE IF( cname .AND. c2.EQ.'UN' ) THEN
538  IF( c3( 1: 1 ).EQ.'G' ) THEN
539  IF( c4.EQ.'QR' .OR. c4.EQ.'RQ' .OR. c4.EQ.'LQ' .OR. c4.EQ.
540  $ 'QL' .OR. c4.EQ.'HR' .OR. c4.EQ.'TR' .OR. c4.EQ.'BR' )
541  $ THEN
542  nx = 128
543  END IF
544  END IF
545  END IF
546  ilaenv = nx
547  return
548 *
549  80 continue
550 *
551 * ISPEC = 4: number of shifts (used by xHSEQR)
552 *
553  ilaenv = 6
554  return
555 *
556  90 continue
557 *
558 * ISPEC = 5: minimum column dimension (not used)
559 *
560  ilaenv = 2
561  return
562 *
563  100 continue
564 *
565 * ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD)
566 *
567  ilaenv = int( REAL( MIN( N1, N2 ) )*1.6e0 )
568  return
569 *
570  110 continue
571 *
572 * ISPEC = 7: number of processors (not used)
573 *
574  ilaenv = 1
575  return
576 *
577  120 continue
578 *
579 * ISPEC = 8: crossover point for multishift (used by xHSEQR)
580 *
581  ilaenv = 50
582  return
583 *
584  130 continue
585 *
586 * ISPEC = 9: maximum size of the subproblems at the bottom of the
587 * computation tree in the divide-and-conquer algorithm
588 * (used by xGELSD and xGESDD)
589 *
590  ilaenv = 25
591  return
592 *
593  140 continue
594 *
595 * ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
596 *
597 * ILAENV = 0
598  ilaenv = 1
599  IF( ilaenv.EQ.1 ) THEN
600  ilaenv = ieeeck( 1, 0.0, 1.0 )
601  END IF
602  return
603 *
604  150 continue
605 *
606 * ISPEC = 11: infinity arithmetic can be trusted not to trap
607 *
608 * ILAENV = 0
609  ilaenv = 1
610  IF( ilaenv.EQ.1 ) THEN
611  ilaenv = ieeeck( 0, 0.0, 1.0 )
612  END IF
613  return
614 *
615  160 continue
616 *
617 * 12 <= ISPEC <= 16: xHSEQR or one of its subroutines.
618 *
619  ilaenv = iparmq( ispec, name, opts, n1, n2, n3, n4 )
620  return
621 *
622 * End of ILAENV
623 *
624  END