00001 PROGRAM MAIN
00002
00003
00004
00005
00006
00007
00008 INTEGER ILAENV
00009 EXTERNAL ILAENV
00010
00011
00012 INTEGER IEEEOK
00013
00014
00015
00016 WRITE( 6, FMT = * )
00017 $ 'We are about to check whether infinity arithmetic'
00018 WRITE( 6, FMT = * )'can be trusted. If this test hangs, set'
00019 WRITE( 6, FMT = * )
00020 $ 'ILAENV = 0 for ISPEC = 10 in LAPACK/SRC/ilaenv.f'
00021
00022 IEEEOK = ILAENV( 10, 'ILAENV', 'N', 1, 2, 3, 4 )
00023 WRITE( 6, FMT = * )
00024
00025 IF( IEEEOK.EQ.0 ) THEN
00026 WRITE( 6, FMT = * )
00027 $ 'Infinity arithmetic did not perform per the ieee spec'
00028 ELSE
00029 WRITE( 6, FMT = * )
00030 $ 'Infinity arithmetic performed as per the ieee spec.'
00031 WRITE( 6, FMT = * )
00032 $ 'However, this is not an exhaustive test and does not'
00033 WRITE( 6, FMT = * )
00034 $ 'guarantee that infinity arithmetic meets the',
00035 $ ' ieee spec.'
00036 END IF
00037
00038 WRITE( 6, FMT = * )
00039 WRITE( 6, FMT = * )
00040 $ 'We are about to check whether NaN arithmetic'
00041 WRITE( 6, FMT = * )'can be trusted. If this test hangs, set'
00042 WRITE( 6, FMT = * )
00043 $ 'ILAENV = 0 for ISPEC = 11 in LAPACK/SRC/ilaenv.f'
00044 IEEEOK = ILAENV( 11, 'ILAENV', 'N', 1, 2, 3, 4 )
00045
00046 WRITE( 6, FMT = * )
00047 IF( IEEEOK.EQ.0 ) THEN
00048 WRITE( 6, FMT = * )
00049 $ 'NaN arithmetic did not perform per the ieee spec'
00050 ELSE
00051 WRITE( 6, FMT = * )'NaN arithmetic performed as per the ieee',
00052 $ ' spec.'
00053 WRITE( 6, FMT = * )
00054 $ 'However, this is not an exhaustive test and does not'
00055 WRITE( 6, FMT = * )'guarantee that NaN arithmetic meets the',
00056 $ ' ieee spec.'
00057 END IF
00058 WRITE( 6, FMT = * )
00059
00060 END
00061 INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3,
00062 $ N4 )
00063
00064
00065
00066
00067
00068
00069 CHARACTER*( * ) NAME, OPTS
00070 INTEGER ISPEC, N1, N2, N3, N4
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 LOGICAL CNAME, SNAME
00165 CHARACTER*1 C1
00166 CHARACTER*2 C2, C4
00167 CHARACTER*3 C3
00168 CHARACTER*6 SUBNAM
00169 INTEGER I, IC, IZ, NB, NBMIN, NX
00170
00171
00172 INTRINSIC CHAR, ICHAR, INT, MIN, REAL
00173
00174
00175 INTEGER IEEECK
00176 EXTERNAL IEEECK
00177
00178
00179
00180 GO TO ( 100, 100, 100, 400, 500, 600, 700, 800, 900, 1000,
00181 $ 1100 ) ISPEC
00182
00183
00184
00185 ILAENV = -1
00186 RETURN
00187
00188 100 CONTINUE
00189
00190
00191
00192 ILAENV = 1
00193 SUBNAM = NAME
00194 IC = ICHAR( SUBNAM( 1:1 ) )
00195 IZ = ICHAR( 'Z' )
00196 IF( IZ.EQ.90 .OR. IZ.EQ.122 ) THEN
00197
00198
00199
00200 IF( IC.GE.97 .AND. IC.LE.122 ) THEN
00201 SUBNAM( 1:1 ) = CHAR( IC-32 )
00202 DO 10 I = 2, 6
00203 IC = ICHAR( SUBNAM( I:I ) )
00204 IF( IC.GE.97 .AND. IC.LE.122 )
00205 $ SUBNAM( I:I ) = CHAR( IC-32 )
00206 10 CONTINUE
00207 END IF
00208
00209 ELSE IF( IZ.EQ.233 .OR. IZ.EQ.169 ) THEN
00210
00211
00212
00213 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
00214 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
00215 $ ( IC.GE.162 .AND. IC.LE.169 ) ) THEN
00216 SUBNAM( 1:1 ) = CHAR( IC+64 )
00217 DO 20 I = 2, 6
00218 IC = ICHAR( SUBNAM( I:I ) )
00219 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
00220 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
00221 $ ( IC.GE.162 .AND. IC.LE.169 ) )
00222 $ SUBNAM( I:I ) = CHAR( IC+64 )
00223 20 CONTINUE
00224 END IF
00225
00226 ELSE IF( IZ.EQ.218 .OR. IZ.EQ.250 ) THEN
00227
00228
00229
00230 IF( IC.GE.225 .AND. IC.LE.250 ) THEN
00231 SUBNAM( 1:1 ) = CHAR( IC-32 )
00232 DO 30 I = 2, 6
00233 IC = ICHAR( SUBNAM( I:I ) )
00234 IF( IC.GE.225 .AND. IC.LE.250 )
00235 $ SUBNAM( I:I ) = CHAR( IC-32 )
00236 30 CONTINUE
00237 END IF
00238 END IF
00239
00240 C1 = SUBNAM( 1:1 )
00241 SNAME = C1.EQ.'S' .OR. C1.EQ.'D'
00242 CNAME = C1.EQ.'C' .OR. C1.EQ.'Z'
00243 IF( .NOT.( CNAME .OR. SNAME ) )
00244 $ RETURN
00245 C2 = SUBNAM( 2:3 )
00246 C3 = SUBNAM( 4:6 )
00247 C4 = C3( 2:3 )
00248
00249 GO TO ( 110, 200, 300 ) ISPEC
00250
00251 110 CONTINUE
00252
00253
00254
00255
00256
00257
00258
00259 NB = 1
00260
00261 IF( C2.EQ.'GE' ) THEN
00262 IF( C3.EQ.'TRF' ) THEN
00263 IF( SNAME ) THEN
00264 NB = 64
00265 ELSE
00266 NB = 64
00267 END IF
00268 ELSE IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
00269 $ C3.EQ.'QLF' ) THEN
00270 IF( SNAME ) THEN
00271 NB = 32
00272 ELSE
00273 NB = 32
00274 END IF
00275 ELSE IF( C3.EQ.'HRD' ) THEN
00276 IF( SNAME ) THEN
00277 NB = 32
00278 ELSE
00279 NB = 32
00280 END IF
00281 ELSE IF( C3.EQ.'BRD' ) THEN
00282 IF( SNAME ) THEN
00283 NB = 32
00284 ELSE
00285 NB = 32
00286 END IF
00287 ELSE IF( C3.EQ.'TRI' ) THEN
00288 IF( SNAME ) THEN
00289 NB = 64
00290 ELSE
00291 NB = 64
00292 END IF
00293 END IF
00294 ELSE IF( C2.EQ.'PO' ) THEN
00295 IF( C3.EQ.'TRF' ) THEN
00296 IF( SNAME ) THEN
00297 NB = 64
00298 ELSE
00299 NB = 64
00300 END IF
00301 END IF
00302 ELSE IF( C2.EQ.'SY' ) THEN
00303 IF( C3.EQ.'TRF' ) THEN
00304 IF( SNAME ) THEN
00305 NB = 64
00306 ELSE
00307 NB = 64
00308 END IF
00309 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
00310 NB = 32
00311 ELSE IF( SNAME .AND. C3.EQ.'GST' ) THEN
00312 NB = 64
00313 END IF
00314 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
00315 IF( C3.EQ.'TRF' ) THEN
00316 NB = 64
00317 ELSE IF( C3.EQ.'TRD' ) THEN
00318 NB = 32
00319 ELSE IF( C3.EQ.'GST' ) THEN
00320 NB = 64
00321 END IF
00322 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
00323 IF( C3( 1:1 ).EQ.'G' ) THEN
00324 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00325 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00326 $ C4.EQ.'BR' ) THEN
00327 NB = 32
00328 END IF
00329 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
00330 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00331 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00332 $ C4.EQ.'BR' ) THEN
00333 NB = 32
00334 END IF
00335 END IF
00336 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
00337 IF( C3( 1:1 ).EQ.'G' ) THEN
00338 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00339 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00340 $ C4.EQ.'BR' ) THEN
00341 NB = 32
00342 END IF
00343 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
00344 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00345 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00346 $ C4.EQ.'BR' ) THEN
00347 NB = 32
00348 END IF
00349 END IF
00350 ELSE IF( C2.EQ.'GB' ) THEN
00351 IF( C3.EQ.'TRF' ) THEN
00352 IF( SNAME ) THEN
00353 IF( N4.LE.64 ) THEN
00354 NB = 1
00355 ELSE
00356 NB = 32
00357 END IF
00358 ELSE
00359 IF( N4.LE.64 ) THEN
00360 NB = 1
00361 ELSE
00362 NB = 32
00363 END IF
00364 END IF
00365 END IF
00366 ELSE IF( C2.EQ.'PB' ) THEN
00367 IF( C3.EQ.'TRF' ) THEN
00368 IF( SNAME ) THEN
00369 IF( N2.LE.64 ) THEN
00370 NB = 1
00371 ELSE
00372 NB = 32
00373 END IF
00374 ELSE
00375 IF( N2.LE.64 ) THEN
00376 NB = 1
00377 ELSE
00378 NB = 32
00379 END IF
00380 END IF
00381 END IF
00382 ELSE IF( C2.EQ.'TR' ) THEN
00383 IF( C3.EQ.'TRI' ) THEN
00384 IF( SNAME ) THEN
00385 NB = 64
00386 ELSE
00387 NB = 64
00388 END IF
00389 END IF
00390 ELSE IF( C2.EQ.'LA' ) THEN
00391 IF( C3.EQ.'UUM' ) THEN
00392 IF( SNAME ) THEN
00393 NB = 64
00394 ELSE
00395 NB = 64
00396 END IF
00397 END IF
00398 ELSE IF( SNAME .AND. C2.EQ.'ST' ) THEN
00399 IF( C3.EQ.'EBZ' ) THEN
00400 NB = 1
00401 END IF
00402 END IF
00403 ILAENV = NB
00404 RETURN
00405
00406 200 CONTINUE
00407
00408
00409
00410 NBMIN = 2
00411 IF( C2.EQ.'GE' ) THEN
00412 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
00413 $ C3.EQ.'QLF' ) THEN
00414 IF( SNAME ) THEN
00415 NBMIN = 2
00416 ELSE
00417 NBMIN = 2
00418 END IF
00419 ELSE IF( C3.EQ.'HRD' ) THEN
00420 IF( SNAME ) THEN
00421 NBMIN = 2
00422 ELSE
00423 NBMIN = 2
00424 END IF
00425 ELSE IF( C3.EQ.'BRD' ) THEN
00426 IF( SNAME ) THEN
00427 NBMIN = 2
00428 ELSE
00429 NBMIN = 2
00430 END IF
00431 ELSE IF( C3.EQ.'TRI' ) THEN
00432 IF( SNAME ) THEN
00433 NBMIN = 2
00434 ELSE
00435 NBMIN = 2
00436 END IF
00437 END IF
00438 ELSE IF( C2.EQ.'SY' ) THEN
00439 IF( C3.EQ.'TRF' ) THEN
00440 IF( SNAME ) THEN
00441 NBMIN = 8
00442 ELSE
00443 NBMIN = 8
00444 END IF
00445 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
00446 NBMIN = 2
00447 END IF
00448 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
00449 IF( C3.EQ.'TRD' ) THEN
00450 NBMIN = 2
00451 END IF
00452 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
00453 IF( C3( 1:1 ).EQ.'G' ) THEN
00454 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00455 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00456 $ C4.EQ.'BR' ) THEN
00457 NBMIN = 2
00458 END IF
00459 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
00460 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00461 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00462 $ C4.EQ.'BR' ) THEN
00463 NBMIN = 2
00464 END IF
00465 END IF
00466 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
00467 IF( C3( 1:1 ).EQ.'G' ) THEN
00468 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00469 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00470 $ C4.EQ.'BR' ) THEN
00471 NBMIN = 2
00472 END IF
00473 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
00474 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00475 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00476 $ C4.EQ.'BR' ) THEN
00477 NBMIN = 2
00478 END IF
00479 END IF
00480 END IF
00481 ILAENV = NBMIN
00482 RETURN
00483
00484 300 CONTINUE
00485
00486
00487
00488 NX = 0
00489 IF( C2.EQ.'GE' ) THEN
00490 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
00491 $ C3.EQ.'QLF' ) THEN
00492 IF( SNAME ) THEN
00493 NX = 128
00494 ELSE
00495 NX = 128
00496 END IF
00497 ELSE IF( C3.EQ.'HRD' ) THEN
00498 IF( SNAME ) THEN
00499 NX = 128
00500 ELSE
00501 NX = 128
00502 END IF
00503 ELSE IF( C3.EQ.'BRD' ) THEN
00504 IF( SNAME ) THEN
00505 NX = 128
00506 ELSE
00507 NX = 128
00508 END IF
00509 END IF
00510 ELSE IF( C2.EQ.'SY' ) THEN
00511 IF( SNAME .AND. C3.EQ.'TRD' ) THEN
00512 NX = 32
00513 END IF
00514 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
00515 IF( C3.EQ.'TRD' ) THEN
00516 NX = 32
00517 END IF
00518 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
00519 IF( C3( 1:1 ).EQ.'G' ) THEN
00520 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00521 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00522 $ C4.EQ.'BR' ) THEN
00523 NX = 128
00524 END IF
00525 END IF
00526 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
00527 IF( C3( 1:1 ).EQ.'G' ) THEN
00528 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
00529 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
00530 $ C4.EQ.'BR' ) THEN
00531 NX = 128
00532 END IF
00533 END IF
00534 END IF
00535 ILAENV = NX
00536 RETURN
00537
00538 400 CONTINUE
00539
00540
00541
00542 ILAENV = 6
00543 RETURN
00544
00545 500 CONTINUE
00546
00547
00548
00549 ILAENV = 2
00550 RETURN
00551
00552 600 CONTINUE
00553
00554
00555
00556 ILAENV = INT( REAL( MIN( N1, N2 ) )*1.6E0 )
00557 RETURN
00558
00559 700 CONTINUE
00560
00561
00562
00563 ILAENV = 1
00564 RETURN
00565
00566 800 CONTINUE
00567
00568
00569
00570 ILAENV = 50
00571 RETURN
00572
00573 900 CONTINUE
00574
00575
00576
00577
00578
00579 ILAENV = 25
00580 RETURN
00581
00582 1000 CONTINUE
00583
00584
00585
00586 ILAENV = 1
00587 IF (ILAENV .EQ. 1) THEN
00588 ILAENV = IEEECK( 0, 0.0, 1.0 )
00589 ENDIF
00590 RETURN
00591
00592 1100 CONTINUE
00593
00594
00595
00596 ILAENV = 1
00597 IF (ILAENV .EQ. 1) THEN
00598 ILAENV = IEEECK( 1, 0.0, 1.0 )
00599 ENDIF
00600 RETURN
00601
00602
00603
00604 END
00605 INTEGER FUNCTION IEEECK( ISPEC, ZERO, ONE )
00606
00607
00608
00609
00610
00611
00612 INTEGER ISPEC
00613 REAL ZERO, ONE
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646 REAL POSINF, NEGINF, NAN1, NAN2, NAN3, NAN4, NAN5, NAN6, NEGZRO,
00647 $ NEWZRO
00648
00649
00650 IEEECK = 1
00651
00652 POSINF = ONE /ZERO
00653 IF ( POSINF .LE. ONE ) THEN
00654 IEEECK = 0
00655 RETURN
00656 ENDIF
00657
00658 NEGINF = -ONE / ZERO
00659 IF ( NEGINF .GE. ZERO ) THEN
00660 IEEECK = 0
00661 RETURN
00662 ENDIF
00663
00664 NEGZRO = ONE / ( NEGINF + ONE )
00665 IF ( NEGZRO .NE. ZERO ) THEN
00666 IEEECK = 0
00667 RETURN
00668 ENDIF
00669
00670 NEGINF = ONE / NEGZRO
00671 IF ( NEGINF .GE. ZERO ) THEN
00672 IEEECK = 0
00673 RETURN
00674 ENDIF
00675
00676 NEWZRO = NEGZRO + ZERO
00677 IF ( NEWZRO .NE. ZERO ) THEN
00678 IEEECK = 0
00679 RETURN
00680 ENDIF
00681
00682 POSINF = ONE / NEWZRO
00683 IF ( POSINF .LE. ONE ) THEN
00684 IEEECK = 0
00685 RETURN
00686 ENDIF
00687
00688 NEGINF = NEGINF * POSINF
00689 IF ( NEGINF .GE. ZERO ) THEN
00690 IEEECK = 0
00691 RETURN
00692 ENDIF
00693
00694 POSINF = POSINF * POSINF
00695 IF ( POSINF .LE. ONE ) THEN
00696 IEEECK = 0
00697 RETURN
00698 ENDIF
00699
00700
00701
00702
00703
00704
00705 IF (ISPEC .EQ. 0 ) RETURN
00706
00707 NAN1 = POSINF + NEGINF
00708
00709 NAN2 = POSINF / NEGINF
00710
00711 NAN3 = POSINF / POSINF
00712
00713 NAN4 = POSINF * ZERO
00714
00715 NAN5 = NEGINF * NEGZRO
00716
00717 NAN6 = NAN5 * 0.0
00718
00719 IF ( NAN1 .EQ. NAN1 ) THEN
00720 IEEECK = 0
00721 RETURN
00722 ENDIF
00723
00724 IF ( NAN2 .EQ. NAN2 ) THEN
00725 IEEECK = 0
00726 RETURN
00727 ENDIF
00728
00729 IF ( NAN3 .EQ. NAN3 ) THEN
00730 IEEECK = 0
00731 RETURN
00732 ENDIF
00733
00734 IF ( NAN4 .EQ. NAN4 ) THEN
00735 IEEECK = 0
00736 RETURN
00737 ENDIF
00738
00739 IF ( NAN5 .EQ. NAN5 ) THEN
00740 IEEECK = 0
00741 RETURN
00742 ENDIF
00743
00744 IF ( NAN6 .EQ. NAN6 ) THEN
00745 IEEECK = 0
00746 RETURN
00747 ENDIF
00748
00749 RETURN
00750 END