3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 *> \author Univ. of Tennessee
12 *> \author Univ. of California Berkeley
13 *> \author Univ. of Colorado Denver
16 *> \date December 2016
18 *> \ingroup auxOTHERauxiliary
20 * =====================================================================
23 * -- LAPACK test routine (version 3.7.0) --
24 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
27 * .. External Functions ..
34 * .. Executable Statements ..
37 $ 'We are about to check whether infinity arithmetic'
38 WRITE( 6, FMT = * )'can be trusted. If this test hangs, set'
40 $ 'ILAENV = 0 for ISPEC = 10 in LAPACK/SRC/ilaenv.f'
42 IEEEOK = ILAENV( 10, 'ILAENV', 'N', 1, 2, 3, 4 )
45 IF( IEEEOK.EQ.0 ) THEN
47 $ 'Infinity arithmetic did not perform per the ieee spec'
50 $ 'Infinity arithmetic performed as per the ieee spec.'
52 $ 'However, this is not an exhaustive test and does not'
54 $ 'guarantee that infinity arithmetic meets the',
60 $ 'We are about to check whether NaN arithmetic'
61 WRITE( 6, FMT = * )'can be trusted. If this test hangs, set'
63 $ 'ILAENV = 0 for ISPEC = 11 in LAPACK/SRC/ilaenv.f'
64 IEEEOK = ILAENV( 11, 'ILAENV', 'N', 1, 2, 3, 4 )
67 IF( IEEEOK.EQ.0 ) THEN
69 $ 'NaN arithmetic did not perform per the ieee spec'
71 WRITE( 6, FMT = * )'NaN arithmetic performed as per the ieee',
74 $ 'However, this is not an exhaustive test and does not'
75 WRITE( 6, FMT = * )'guarantee that NaN arithmetic meets the',
81 INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3,
84 * -- LAPACK auxiliary routine (version 3.7.0) --
85 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
88 * .. Scalar Arguments ..
89 CHARACTER*( * ) NAME, OPTS
90 INTEGER ISPEC, N1, N2, N3, N4
96 * ILAENV is called from the LAPACK routines to choose problem-dependent
97 * parameters for the local environment. See ISPEC for a description of
100 * This version provides a set of parameters which should give good,
101 * but not optimal, performance on many of the currently available
102 * computers. Users are encouraged to modify this subroutine to set
103 * the tuning parameters for their particular machine using the option
104 * and problem size information in the arguments.
106 * This routine will not function correctly if it is converted to all
107 * lower case. Converting it to all upper case is allowed.
112 * ISPEC (input) INTEGER
113 * Specifies the parameter to be returned as the value of
115 * = 1: the optimal blocksize; if this value is 1, an unblocked
116 * algorithm will give the best performance.
117 * = 2: the minimum block size for which the block routine
118 * should be used; if the usable block size is less than
119 * this value, an unblocked routine should be used.
120 * = 3: the crossover point (in a block routine, for N less
121 * than this value, an unblocked routine should be used)
122 * = 4: the number of shifts, used in the nonsymmetric
123 * eigenvalue routines
124 * = 5: the minimum column dimension for blocking to be used;
125 * rectangular blocks must have dimension at least k by m,
126 * where k is given by ILAENV(2,...) and m by ILAENV(5,...)
127 * = 6: the crossover point for the SVD (when reducing an m by n
128 * matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
129 * this value, a QR factorization is used first to reduce
130 * the matrix to a triangular form.)
131 * = 7: the number of processors
132 * = 8: the crossover point for the multishift QR and QZ methods
133 * for nonsymmetric eigenvalue problems.
134 * = 9: maximum size of the subproblems at the bottom of the
135 * computation tree in the divide-and-conquer algorithm
136 * (used by xGELSD and xGESDD)
137 * =10: ieee NaN arithmetic can be trusted not to trap
138 * =11: infinity arithmetic can be trusted not to trap
140 * NAME (input) CHARACTER*(*)
141 * The name of the calling subroutine, in either upper case or
144 * OPTS (input) CHARACTER*(*)
145 * The character options to the subroutine NAME, concatenated
146 * into a single character string. For example, UPLO = 'U',
147 * TRANS = 'T', and DIAG = 'N' for a triangular routine would
148 * be specified as OPTS = 'UTN'.
154 * Problem dimensions for the subroutine NAME; these may not all
157 * (ILAENV) (output) INTEGER
158 * >= 0: the value of the parameter specified by ISPEC
159 * < 0: if ILAENV = -k, the k-th argument had an illegal value.
164 * The following conventions have been used when calling ILAENV from the
166 * 1) OPTS is a concatenation of all of the character options to
167 * subroutine NAME, in the same order that they appear in the
168 * argument list for NAME, even if they are not used in determining
169 * the value of the parameter specified by ISPEC.
170 * 2) The problem dimensions N1, N2, N3, N4 are specified in the order
171 * that they appear in the argument list for NAME. N1 is used
172 * first, N2 second, and so on, and unused problem dimensions are
173 * passed a value of -1.
174 * 3) The parameter value returned by ILAENV is checked for validity in
175 * the calling subroutine. For example, ILAENV is used to retrieve
176 * the optimal blocksize for STRTRI as follows:
178 * NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
179 * IF( NB.LE.1 ) NB = MAX( 1, N )
181 * =====================================================================
183 * .. Local Scalars ..
189 INTEGER I, IC, IZ, NB, NBMIN, NX
191 * .. Intrinsic Functions ..
192 INTRINSIC CHAR, ICHAR, INT, MIN, REAL
194 * .. External Functions ..
198 * .. Executable Statements ..
200 GO TO ( 100, 100, 100, 400, 500, 600, 700, 800, 900, 1000,
203 * Invalid value for ISPEC
210 * Convert NAME to upper case if the first character is lower case.
214 IC = ICHAR( SUBNAM( 1:1 ) )
216 IF( IZ.EQ.90 .OR. IZ.EQ.122 ) THEN
218 * ASCII character set
220 IF( IC.GE.97 .AND. IC.LE.122 ) THEN
221 SUBNAM( 1:1 ) = CHAR( IC-32 )
223 IC = ICHAR( SUBNAM( I:I ) )
224 IF( IC.GE.97 .AND. IC.LE.122 )
225 $ SUBNAM( I:I ) = CHAR( IC-32 )
229 ELSE IF( IZ.EQ.233 .OR. IZ.EQ.169 ) THEN
231 * EBCDIC character set
233 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
234 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
235 $ ( IC.GE.162 .AND. IC.LE.169 ) ) THEN
236 SUBNAM( 1:1 ) = CHAR( IC+64 )
238 IC = ICHAR( SUBNAM( I:I ) )
239 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
240 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
241 $ ( IC.GE.162 .AND. IC.LE.169 ) )
242 $ SUBNAM( I:I ) = CHAR( IC+64 )
246 ELSE IF( IZ.EQ.218 .OR. IZ.EQ.250 ) THEN
248 * Prime machines: ASCII+128
250 IF( IC.GE.225 .AND. IC.LE.250 ) THEN
251 SUBNAM( 1:1 ) = CHAR( IC-32 )
253 IC = ICHAR( SUBNAM( I:I ) )
254 IF( IC.GE.225 .AND. IC.LE.250 )
255 $ SUBNAM( I:I ) = CHAR( IC-32 )
261 SNAME = C1.EQ.'S' .OR. C1.EQ.'D'
262 CNAME = C1.EQ.'C' .OR. C1.EQ.'Z'
263 IF( .NOT.( CNAME .OR. SNAME ) )
269 GO TO ( 110, 200, 300 ) ISPEC
273 * ISPEC = 1: block size
275 * In these examples, separate code is provided for setting NB for
276 * real and complex. We assume that NB will take the same value in
277 * single or double precision.
281 IF( C2.EQ.'GE' ) THEN
282 IF( C3.EQ.'TRF' ) THEN
288 ELSE IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
295 ELSE IF( C3.EQ.'HRD' ) THEN
301 ELSE IF( C3.EQ.'BRD' ) THEN
307 ELSE IF( C3.EQ.'TRI' ) THEN
314 ELSE IF( C2.EQ.'PO' ) THEN
315 IF( C3.EQ.'TRF' ) THEN
322 ELSE IF( C2.EQ.'SY' ) THEN
323 IF( C3.EQ.'TRF' ) THEN
329 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
331 ELSE IF( SNAME .AND. C3.EQ.'GST' ) THEN
334 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
335 IF( C3.EQ.'TRF' ) THEN
337 ELSE IF( C3.EQ.'TRD' ) THEN
339 ELSE IF( C3.EQ.'GST' ) THEN
342 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
343 IF( C3( 1:1 ).EQ.'G' ) THEN
344 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
345 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
349 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
350 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
351 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
356 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
357 IF( C3( 1:1 ).EQ.'G' ) THEN
358 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
359 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
363 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
364 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
365 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
370 ELSE IF( C2.EQ.'GB' ) THEN
371 IF( C3.EQ.'TRF' ) THEN
386 ELSE IF( C2.EQ.'PB' ) THEN
387 IF( C3.EQ.'TRF' ) THEN
402 ELSE IF( C2.EQ.'TR' ) THEN
403 IF( C3.EQ.'TRI' ) THEN
410 ELSE IF( C2.EQ.'LA' ) THEN
411 IF( C3.EQ.'UUM' ) THEN
418 ELSE IF( SNAME .AND. C2.EQ.'ST' ) THEN
419 IF( C3.EQ.'EBZ' ) THEN
428 * ISPEC = 2: minimum block size
431 IF( C2.EQ.'GE' ) THEN
432 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
439 ELSE IF( C3.EQ.'HRD' ) THEN
445 ELSE IF( C3.EQ.'BRD' ) THEN
451 ELSE IF( C3.EQ.'TRI' ) THEN
458 ELSE IF( C2.EQ.'SY' ) THEN
459 IF( C3.EQ.'TRF' ) THEN
465 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
468 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
469 IF( C3.EQ.'TRD' ) THEN
472 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
473 IF( C3( 1:1 ).EQ.'G' ) THEN
474 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
475 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
479 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
480 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
481 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
486 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
487 IF( C3( 1:1 ).EQ.'G' ) THEN
488 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
489 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
493 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
494 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
495 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
506 * ISPEC = 3: crossover point
509 IF( C2.EQ.'GE' ) THEN
510 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
517 ELSE IF( C3.EQ.'HRD' ) THEN
523 ELSE IF( C3.EQ.'BRD' ) THEN
530 ELSE IF( C2.EQ.'SY' ) THEN
531 IF( SNAME .AND. C3.EQ.'TRD' ) THEN
534 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
535 IF( C3.EQ.'TRD' ) THEN
538 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
539 IF( C3( 1:1 ).EQ.'G' ) THEN
540 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
541 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
546 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
547 IF( C3( 1:1 ).EQ.'G' ) THEN
548 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
549 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
560 * ISPEC = 4: number of shifts (used by xHSEQR)
567 * ISPEC = 5: minimum column dimension (not used)
574 * ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD)
576 ILAENV = INT( REAL( MIN( N1, N2 ) )*1.6E0 )
581 * ISPEC = 7: number of processors (not used)
588 * ISPEC = 8: crossover point for multishift (used by xHSEQR)
595 * ISPEC = 9: maximum size of the subproblems at the bottom of the
596 * computation tree in the divide-and-conquer algorithm
597 * (used by xGELSD and xGESDD)
604 * ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
607 IF (ILAENV .EQ. 1) THEN
608 ILAENV = IEEECK( 0, 0.0, 1.0 )
614 * ISPEC = 11: infinity arithmetic can be trusted not to trap
617 IF (ILAENV .EQ. 1) THEN
618 ILAENV = IEEECK( 1, 0.0, 1.0 )
625 INTEGER FUNCTION IEEECK( ISPEC, ZERO, ONE )
627 * -- LAPACK auxiliary routine (version 3.7.0) --
628 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
631 * .. Scalar Arguments ..
639 * IEEECK is called from the ILAENV to verify that Inifinity and
640 * possibly NaN arithmetic is safe (i.e. will not trap).
645 * ISPEC (input) INTEGER
646 * Specifies whether to test just for inifinity arithmetic
647 * or whether to test for infinity and NaN arithmetic.
648 * = 0: Verify infinity arithmetic only.
649 * = 1: Verify infinity and NaN arithmetic.
652 * Must contain the value 0.0
653 * This is passed to prevent the compiler from optimizing
657 * Must contain the value 1.0
658 * This is passed to prevent the compiler from optimizing
661 * RETURN VALUE: INTEGER
662 * = 0: Arithmetic failed to produce the correct answers
663 * = 1: Arithmetic produced the correct answers
665 * .. Local Scalars ..
666 REAL POSINF, NEGINF, NAN1, NAN2, NAN3, NAN4, NAN5, NAN6, NEGZRO,
669 * .. Executable Statements ..
673 IF ( POSINF .LE. ONE ) THEN
679 IF ( NEGINF .GE. ZERO ) THEN
684 NEGZRO = ONE / ( NEGINF + ONE )
685 IF ( NEGZRO .NE. ZERO ) THEN
690 NEGINF = ONE / NEGZRO
691 IF ( NEGINF .GE. ZERO ) THEN
696 NEWZRO = NEGZRO + ZERO
697 IF ( NEWZRO .NE. ZERO ) THEN
702 POSINF = ONE / NEWZRO
703 IF ( POSINF .LE. ONE ) THEN
708 NEGINF = NEGINF * POSINF
709 IF ( NEGINF .GE. ZERO ) THEN
714 POSINF = POSINF * POSINF
715 IF ( POSINF .LE. ONE ) THEN
723 * Return if we were only asked to check infinity arithmetic
725 IF (ISPEC .EQ. 0 ) RETURN
727 NAN1 = POSINF + NEGINF
729 NAN2 = POSINF / NEGINF
731 NAN3 = POSINF / POSINF
735 NAN5 = NEGINF * NEGZRO
739 IF ( NAN1 .EQ. NAN1 ) THEN
744 IF ( NAN2 .EQ. NAN2 ) THEN
749 IF ( NAN3 .EQ. NAN3 ) THEN
754 IF ( NAN4 .EQ. NAN4 ) THEN
759 IF ( NAN5 .EQ. NAN5 ) THEN
764 IF ( NAN6 .EQ. NAN6 ) THEN