github.com/gonum/lapack@v0.0.0-20181123203213-e4cdc5a0bff9/internal/testdata/dlasqtest/ilaenv.f (about) 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