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,
89 CHARACTER*( * ) NAME, OPTS
90 INTEGER ISPEC, N1, N2, N3, N4
189 INTEGER I, IC, IZ, NB, NBMIN, NX
192 INTRINSIC char, ichar, int, min, real
200 GO TO ( 100, 100, 100, 400, 500, 600, 700, 800, 900, 1000,
214 ic = ichar( subnam( 1:1 ) )
216 IF( iz.EQ.90 .OR. iz.EQ.122 )
THEN
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
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
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
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
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.
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.
576 ilaenv = int(
REAL( MIN( N1, N2 ) )*1.6e0 )
608 ilaenv = ieeeck( 0, 0.0, 1.0 )
618 ilaenv = ieeeck( 1, 0.0, 1.0 )
625 INTEGER FUNCTION ieeeck( ISPEC, ZERO, ONE )
666 REAL POSINF, NEGINF, NAN1, NAN2, NAN3, NAN4, NAN5, NAN6, NEGZRO,
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
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
integer function ieeeck(ISPEC, ZERO, ONE)
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)