Skip Navigation Links
Numerical Libraries
Linear Algebra
Differential Equations
Optimization
Samples
Skip Navigation Links
Linear Algebra
CSLapack
CSBlas
   1:  #region Translated by Jose Antonio De Santiago-Castillo.
   2:   
   3:  //Translated by Jose Antonio De Santiago-Castillo. 
   4:  //E-mail:JAntonioDeSantiago@gmail.com
   5:  //Web: www.DotNumerics.com
   6:  //
   7:  //Fortran to C# Translation.
   8:  //Translated by:
   9:  //F2CSharp Version 0.71 (November 10, 2009)
  10:  //Code Optimizations: None
  11:  //
  12:  #endregion
  13:   
  14:  using System;
  15:  using DotNumerics.FortranLibrary;
  16:   
  17:  namespace DotNumerics.CSLapack
  18:  {
  19:      /// <summary>
  20:      /// -- LAPACK auxiliary routine (version 3.1.1) --
  21:      /// Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
  22:      /// January 2007
  23:      /// Purpose
  24:      /// =======
  25:      /// 
  26:      /// ILAENV is called from the LAPACK routines to choose problem-dependent
  27:      /// parameters for the local environment.  See ISPEC for a description of
  28:      /// the parameters.
  29:      /// 
  30:      /// ILAENV returns an INTEGER
  31:      /// if ILAENV .GE. 0: ILAENV returns the value of the parameter specified by ISPEC
  32:      /// if ILAENV .LT. 0:  if ILAENV = -k, the k-th argument had an illegal value.
  33:      /// 
  34:      /// This version provides a set of parameters which should give good,
  35:      /// but not optimal, performance on many of the currently available
  36:      /// computers.  Users are encouraged to modify this subroutine to set
  37:      /// the tuning parameters for their particular machine using the option
  38:      /// and problem size information in the arguments.
  39:      /// 
  40:      /// This routine will not function correctly if it is converted to all
  41:      /// lower case.  Converting it to all upper case is allowed.
  42:      /// 
  43:      ///</summary>
  44:      public class ILAENV
  45:      {
  46:      
  47:   
  48:          #region Dependencies
  49:          
  50:          IEEECK _ieeeck; IPARMQ _iparmq; 
  51:   
  52:          #endregion
  53:   
  54:   
  55:          #region Fields
  56:          
  57:          int I = 0; int IC = 0; int IZ = 0; int NB = 0; int NBMIN = 0; int NX = 0; bool CNAME = false; bool SNAME = false; 
  58:          string C1 = new string(' ', 1);string C2 = new string(' ', 2); string C4 = new string(' ', 2); 
  59:          string C3 = new string(' ', 3);string SUBNAM = new string(' ', 6); 
  60:   
  61:          #endregion
  62:   
  63:          public ILAENV(IEEECK ieeeck, IPARMQ iparmq)
  64:          {
  65:      
  66:   
  67:              #region Set Dependencies
  68:              
  69:              this._ieeeck = ieeeck; this._iparmq = iparmq; 
  70:   
  71:              #endregion
  72:   
  73:          }
  74:      
  75:          public ILAENV()
  76:          {
  77:      
  78:   
  79:              #region Dependencies (Initialization)
  80:              
  81:              IEEECK ieeeck = new IEEECK();
  82:              IPARMQ iparmq = new IPARMQ();
  83:   
  84:              #endregion
  85:   
  86:   
  87:              #region Set Dependencies
  88:              
  89:              this._ieeeck = ieeeck; this._iparmq = iparmq; 
  90:   
  91:              #endregion
  92:   
  93:          }
  94:          /// <summary>
  95:          /// Purpose
  96:          /// =======
  97:          /// 
  98:          /// ILAENV is called from the LAPACK routines to choose problem-dependent
  99:          /// parameters for the local environment.  See ISPEC for a description of
 100:          /// the parameters.
 101:          /// 
 102:          /// ILAENV returns an INTEGER
 103:          /// if ILAENV .GE. 0: ILAENV returns the value of the parameter specified by ISPEC
 104:          /// if ILAENV .LT. 0:  if ILAENV = -k, the k-th argument had an illegal value.
 105:          /// 
 106:          /// This version provides a set of parameters which should give good,
 107:          /// but not optimal, performance on many of the currently available
 108:          /// computers.  Users are encouraged to modify this subroutine to set
 109:          /// the tuning parameters for their particular machine using the option
 110:          /// and problem size information in the arguments.
 111:          /// 
 112:          /// This routine will not function correctly if it is converted to all
 113:          /// lower case.  Converting it to all upper case is allowed.
 114:          /// 
 115:          ///</summary>
 116:          /// <param name="ISPEC">
 117:          /// (input) INTEGER
 118:          /// Specifies the parameter to be returned as the value of
 119:          /// ILAENV.
 120:          /// = 1: the optimal blocksize; if this value is 1, an unblocked
 121:          /// algorithm will give the best performance.
 122:          /// = 2: the minimum block size for which the block routine
 123:          /// should be used; if the usable block size is less than
 124:          /// this value, an unblocked routine should be used.
 125:          /// = 3: the crossover point (in a block routine, for N less
 126:          /// than this value, an unblocked routine should be used)
 127:          /// = 4: the number of shifts, used in the nonsymmetric
 128:          /// eigenvalue routines (DEPRECATED)
 129:          /// = 5: the minimum column dimension for blocking to be used;
 130:          /// rectangular blocks must have dimension at least k by m,
 131:          /// where k is given by ILAENV(2,...) and m by ILAENV(5,...)
 132:          /// = 6: the crossover point for the SVD (when reducing an m by n
 133:          /// matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
 134:          /// this value, a QR factorization is used first to reduce
 135:          /// the matrix to a triangular form.)
 136:          /// = 7: the number of processors
 137:          /// = 8: the crossover point for the multishift QR method
 138:          /// for nonsymmetric eigenvalue problems (DEPRECATED)
 139:          /// = 9: maximum size of the subproblems at the bottom of the
 140:          /// computation tree in the divide-and-conquer algorithm
 141:          /// (used by xGELSD and xGESDD)
 142:          /// =10: ieee NaN arithmetic can be trusted not to trap
 143:          /// =11: infinity arithmetic can be trusted not to trap
 144:          /// 12 .LE. ISPEC .LE. 16:
 145:          /// xHSEQR or one of its subroutines,
 146:          /// see IPARMQ for detailed explanation
 147:          ///</param>
 148:          /// <param name="NAME">
 149:          /// (input) CHARACTER*(*)
 150:          /// The name of the calling subroutine, in either upper case or
 151:          /// lower case.
 152:          ///</param>
 153:          /// <param name="OPTS">
 154:          /// (input) CHARACTER*(*)
 155:          /// The character options to the subroutine NAME, concatenated
 156:          /// into a single character string.  For example, UPLO = 'U',
 157:          /// TRANS = 'T', and DIAG = 'N' for a triangular routine would
 158:          /// be specified as OPTS = 'UTN'.
 159:          ///</param>
 160:          /// <param name="N1">
 161:          /// (input) INTEGER
 162:          ///</param>
 163:          /// <param name="N2">
 164:          /// (input) INTEGER
 165:          ///</param>
 166:          /// <param name="N3">
 167:          /// (input) INTEGER
 168:          ///</param>
 169:          /// <param name="N4">
 170:          /// (input) INTEGER
 171:          /// Problem dimensions for the subroutine NAME; these may not all
 172:          /// be required.
 173:          ///</param>
 174:          public int Run(int ISPEC, string NAME, string OPTS, int N1, int N2, int N3
 175:                          , int N4)
 176:          {
 177:          int ilaenv = 0;
 178:   
 179:              #region Strings
 180:              
 181:                
 182:   
 183:              #endregion
 184:   
 185:   
 186:              #region Prolog
 187:              
 188:              // *
 189:              // *  -- LAPACK auxiliary routine (version 3.1.1) --
 190:              // *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
 191:              // *     January 2007
 192:              // *
 193:              // *     .. Scalar Arguments ..
 194:              // *     ..
 195:              // *
 196:              // *  Purpose
 197:              // *  =======
 198:              // *
 199:              // *  ILAENV is called from the LAPACK routines to choose problem-dependent
 200:              // *  parameters for the local environment.  See ISPEC for a description of
 201:              // *  the parameters.
 202:              // *
 203:              // *  ILAENV returns an INTEGER
 204:              // *  if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC
 205:              // *  if ILAENV < 0:  if ILAENV = -k, the k-th argument had an illegal value.
 206:              // *
 207:              // *  This version provides a set of parameters which should give good,
 208:              // *  but not optimal, performance on many of the currently available
 209:              // *  computers.  Users are encouraged to modify this subroutine to set
 210:              // *  the tuning parameters for their particular machine using the option
 211:              // *  and problem size information in the arguments.
 212:              // *
 213:              // *  This routine will not function correctly if it is converted to all
 214:              // *  lower case.  Converting it to all upper case is allowed.
 215:              // *
 216:              // *  Arguments
 217:              // *  =========
 218:              // *
 219:              // *  ISPEC   (input) INTEGER
 220:              // *          Specifies the parameter to be returned as the value of
 221:              // *          ILAENV.
 222:              // *          = 1: the optimal blocksize; if this value is 1, an unblocked
 223:              // *               algorithm will give the best performance.
 224:              // *          = 2: the minimum block size for which the block routine
 225:              // *               should be used; if the usable block size is less than
 226:              // *               this value, an unblocked routine should be used.
 227:              // *          = 3: the crossover point (in a block routine, for N less
 228:              // *               than this value, an unblocked routine should be used)
 229:              // *          = 4: the number of shifts, used in the nonsymmetric
 230:              // *               eigenvalue routines (DEPRECATED)
 231:              // *          = 5: the minimum column dimension for blocking to be used;
 232:              // *               rectangular blocks must have dimension at least k by m,
 233:              // *               where k is given by ILAENV(2,...) and m by ILAENV(5,...)
 234:              // *          = 6: the crossover point for the SVD (when reducing an m by n
 235:              // *               matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
 236:              // *               this value, a QR factorization is used first to reduce
 237:              // *               the matrix to a triangular form.)
 238:              // *          = 7: the number of processors
 239:              // *          = 8: the crossover point for the multishift QR method
 240:              // *               for nonsymmetric eigenvalue problems (DEPRECATED)
 241:              // *          = 9: maximum size of the subproblems at the bottom of the
 242:              // *               computation tree in the divide-and-conquer algorithm
 243:              // *               (used by xGELSD and xGESDD)
 244:              // *          =10: ieee NaN arithmetic can be trusted not to trap
 245:              // *          =11: infinity arithmetic can be trusted not to trap
 246:              // *          12 <= ISPEC <= 16:
 247:              // *               xHSEQR or one of its subroutines,
 248:              // *               see IPARMQ for detailed explanation
 249:              // *
 250:              // *  NAME    (input) CHARACTER*(*)
 251:              // *          The name of the calling subroutine, in either upper case or
 252:              // *          lower case.
 253:              // *
 254:              // *  OPTS    (input) CHARACTER*(*)
 255:              // *          The character options to the subroutine NAME, concatenated
 256:              // *          into a single character string.  For example, UPLO = 'U',
 257:              // *          TRANS = 'T', and DIAG = 'N' for a triangular routine would
 258:              // *          be specified as OPTS = 'UTN'.
 259:              // *
 260:              // *  N1      (input) INTEGER
 261:              // *  N2      (input) INTEGER
 262:              // *  N3      (input) INTEGER
 263:              // *  N4      (input) INTEGER
 264:              // *          Problem dimensions for the subroutine NAME; these may not all
 265:              // *          be required.
 266:              // *
 267:              // *  Further Details
 268:              // *  ===============
 269:              // *
 270:              // *  The following conventions have been used when calling ILAENV from the
 271:              // *  LAPACK routines:
 272:              // *  1)  OPTS is a concatenation of all of the character options to
 273:              // *      subroutine NAME, in the same order that they appear in the
 274:              // *      argument list for NAME, even if they are not used in determining
 275:              // *      the value of the parameter specified by ISPEC.
 276:              // *  2)  The problem dimensions N1, N2, N3, N4 are specified in the order
 277:              // *      that they appear in the argument list for NAME.  N1 is used
 278:              // *      first, N2 second, and so on, and unused problem dimensions are
 279:              // *      passed a value of -1.
 280:              // *  3)  The parameter value returned by ILAENV is checked for validity in
 281:              // *      the calling subroutine.  For example, ILAENV is used to retrieve
 282:              // *      the optimal blocksize for STRTRI as follows:
 283:              // *
 284:              // *      NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
 285:              // *      IF( NB.LE.1 ) NB = MAX( 1, N )
 286:              // *
 287:              // *  =====================================================================
 288:              // *
 289:              // *     .. Local Scalars ..
 290:              // *     ..
 291:              // *     .. Intrinsic Functions ..
 292:              //      INTRINSIC          CHAR, ICHAR, INT, MIN, REAL;
 293:              // *     ..
 294:              // *     .. External Functions ..
 295:              // *     ..
 296:              // *     .. Executable Statements ..
 297:              // *
 298:   
 299:              #endregion
 300:   
 301:   
 302:              #region Body
 303:              
 304:              switch (ISPEC)
 305:              {
 306:                  case 1: goto LABEL10;
 307:                  case 2: goto LABEL10;
 308:                  case 3: goto LABEL10;
 309:                  case 4: goto LABEL80;
 310:                  case 5: goto LABEL90;
 311:                  case 6: goto LABEL100;
 312:                  case 7: goto LABEL110;
 313:                  case 8: goto LABEL120;
 314:                  case 9: goto LABEL130;
 315:                  case 10: goto LABEL140;
 316:                  case 11: goto LABEL150;
 317:                  case 12: goto LABEL160;
 318:                  case 13: goto LABEL160;
 319:                  case 14: goto LABEL160;
 320:                  case 15: goto LABEL160;
 321:                  case 16: goto LABEL160;
 322:              }
 323:              // *
 324:              // *     Invalid value for ISPEC
 325:              // *
 326:              ilaenv =  - 1;
 327:              return ilaenv;
 328:              // *
 329:          LABEL10:;
 330:              // *
 331:              // *     Convert NAME to upper case if the first character is lower case.
 332:              // *
 333:              ilaenv = 1;
 334:              FortranLib.Copy(ref SUBNAM , NAME);
 335:              IC = Convert.ToInt32(Convert.ToChar(FortranLib.Substring(SUBNAM, 1, 1)));
 336:              IZ = Convert.ToInt32('Z');
 337:              if (IZ == 90 || IZ == 122)
 338:              {
 339:                  // *
 340:                  // *        ASCII character set
 341:                  // *
 342:                  if (IC >= 97 && IC <= 122)
 343:                  {
 344:                      FortranLib.Copy(ref SUBNAM, 1, 1, Convert.ToChar(IC - 32));
 345:                      for (I = 2; I <= 6; I++)
 346:                      {
 347:                          IC = Convert.ToInt32(Convert.ToChar(FortranLib.Substring(SUBNAM, I, I)));
 348:                          if (IC >= 97 && IC <= 122) FortranLib.Copy(ref SUBNAM, I, I, Convert.ToChar(IC - 32));
 349:                      }
 350:                  }
 351:                  // *
 352:              }
 353:              else
 354:              {
 355:                  if (IZ == 233 || IZ == 169)
 356:                  {
 357:                      // *
 358:                      // *        EBCDIC character set
 359:                      // *
 360:                      if ((IC >= 129 && IC <= 137) || (IC >= 145 && IC <= 153) || (IC >= 162 && IC <= 169))
 361:                      {
 362:                          FortranLib.Copy(ref SUBNAM, 1, 1, Convert.ToChar(IC + 64));
 363:                          for (I = 2; I <= 6; I++)
 364:                          {
 365:                              IC = Convert.ToInt32(Convert.ToChar(FortranLib.Substring(SUBNAM, I, I)));
 366:                              if ((IC >= 129 && IC <= 137) || (IC >= 145 && IC <= 153) || (IC >= 162 && IC <= 169)) FortranLib.Copy(ref SUBNAM, I, I, Convert.ToChar(IC + 64));
 367:                          }
 368:                      }
 369:                      // *
 370:                  }
 371:                  else
 372:                  {
 373:                      if (IZ == 218 || IZ == 250)
 374:                      {
 375:                          // *
 376:                          // *        Prime machines:  ASCII+128
 377:                          // *
 378:                          if (IC >= 225 && IC <= 250)
 379:                          {
 380:                              FortranLib.Copy(ref SUBNAM, 1, 1, Convert.ToChar(IC - 32));
 381:                              for (I = 2; I <= 6; I++)
 382:                              {
 383:                                  IC = Convert.ToInt32(Convert.ToChar(FortranLib.Substring(SUBNAM, I, I)));
 384:                                  if (IC >= 225 && IC <= 250) FortranLib.Copy(ref SUBNAM, I, I, Convert.ToChar(IC - 32));
 385:                              }
 386:                          }
 387:                      }
 388:                  }
 389:              }
 390:              // *
 391:              FortranLib.Copy(ref C1 , FortranLib.Substring(SUBNAM, 1, 1));
 392:              SNAME = C1 == "S" || C1 == "D";
 393:              CNAME = C1 == "C" || C1 == "Z";
 394:              if (!(CNAME || SNAME)) return ilaenv;
 395:              FortranLib.Copy(ref C2 , FortranLib.Substring(SUBNAM, 2, 3));
 396:              FortranLib.Copy(ref C3 , FortranLib.Substring(SUBNAM, 4, 6));
 397:              FortranLib.Copy(ref C4 , FortranLib.Substring(C3, 2, 3));
 398:              // *
 399:              switch (ISPEC)
 400:              {
 401:                  case 1: goto LABEL50;
 402:                  case 2: goto LABEL60;
 403:                  case 3: goto LABEL70;
 404:              }
 405:              // *
 406:          LABEL50:;
 407:              // *
 408:              // *     ISPEC = 1:  block size
 409:              // *
 410:              // *     In these examples, separate code is provided for setting NB for
 411:              // *     real and complex.  We assume that NB will take the same value in
 412:              // *     single or double precision.
 413:              // *
 414:              NB = 1;
 415:              // *
 416:              if (C2 == "GE")
 417:              {
 418:                  if (C3 == "TRF")
 419:                  {
 420:                      if (SNAME)
 421:                      {
 422:                          NB = 64;
 423:                      }
 424:                      else
 425:                      {
 426:                          NB = 64;
 427:                      }
 428:                  }
 429:                  else
 430:                  {
 431:                      if (C3 == "QRF" || C3 == "RQF" || C3 == "LQF" || C3 == "QLF")
 432:                      {
 433:                          if (SNAME)
 434:                          {
 435:                              NB = 32;
 436:                          }
 437:                          else
 438:                          {
 439:                              NB = 32;
 440:                          }
 441:                      }
 442:                      else
 443:                      {
 444:                          if (C3 == "HRD")
 445:                          {
 446:                              if (SNAME)
 447:                              {
 448:                                  NB = 32;
 449:                              }
 450:                              else
 451:                              {
 452:                                  NB = 32;
 453:                              }
 454:                          }
 455:                          else
 456:                          {
 457:                              if (C3 == "BRD")
 458:                              {
 459:                                  if (SNAME)
 460:                                  {
 461:                                      NB = 32;
 462:                                  }
 463:                                  else
 464:                                  {
 465:                                      NB = 32;
 466:                                  }
 467:                              }
 468:                              else
 469:                              {
 470:                                  if (C3 == "TRI")
 471:                                  {
 472:                                      if (SNAME)
 473:                                      {
 474:                                          NB = 64;
 475:                                      }
 476:                                      else
 477:                                      {
 478:                                          NB = 64;
 479:                                      }
 480:                                  }
 481:                              }
 482:                          }
 483:                      }
 484:                  }
 485:              }
 486:              else
 487:              {
 488:                  if (C2 == "PO")
 489:                  {
 490:                      if (C3 == "TRF")
 491:                      {
 492:                          if (SNAME)
 493:                          {
 494:                              NB = 64;
 495:                          }
 496:                          else
 497:                          {
 498:                              NB = 64;
 499:                          }
 500:                      }
 501:                  }
 502:                  else
 503:                  {
 504:                      if (C2 == "SY")
 505:                      {
 506:                          if (C3 == "TRF")
 507:                          {
 508:                              if (SNAME)
 509:                              {
 510:                                  NB = 64;
 511:                              }
 512:                              else
 513:                              {
 514:                                  NB = 64;
 515:                              }
 516:                          }
 517:                          else
 518:                          {
 519:                              if (SNAME && C3 == "TRD")
 520:                              {
 521:                                  NB = 32;
 522:                              }
 523:                              else
 524:                              {
 525:                                  if (SNAME && C3 == "GST")
 526:                                  {
 527:                                      NB = 64;
 528:                                  }
 529:                              }
 530:                          }
 531:                      }
 532:                      else
 533:                      {
 534:                          if (CNAME && C2 == "HE")
 535:                          {
 536:                              if (C3 == "TRF")
 537:                              {
 538:                                  NB = 64;
 539:                              }
 540:                              else
 541:                              {
 542:                                  if (C3 == "TRD")
 543:                                  {
 544:                                      NB = 32;
 545:                                  }
 546:                                  else
 547:                                  {
 548:                                      if (C3 == "GST")
 549:                                      {
 550:                                          NB = 64;
 551:                                      }
 552:                                  }
 553:                              }
 554:                          }
 555:                          else
 556:                          {
 557:                              if (SNAME && C2 == "OR")
 558:                              {
 559:                                  if (FortranLib.Substring(C3, 1, 1) == "G")
 560:                                  {
 561:                                      if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 562:                                      {
 563:                                          NB = 32;
 564:                                      }
 565:                                  }
 566:                                  else
 567:                                  {
 568:                                      if (FortranLib.Substring(C3, 1, 1) == "M")
 569:                                      {
 570:                                          if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 571:                                          {
 572:                                              NB = 32;
 573:                                          }
 574:                                      }
 575:                                  }
 576:                              }
 577:                              else
 578:                              {
 579:                                  if (CNAME && C2 == "UN")
 580:                                  {
 581:                                      if (FortranLib.Substring(C3, 1, 1) == "G")
 582:                                      {
 583:                                          if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 584:                                          {
 585:                                              NB = 32;
 586:                                          }
 587:                                      }
 588:                                      else
 589:                                      {
 590:                                          if (FortranLib.Substring(C3, 1, 1) == "M")
 591:                                          {
 592:                                              if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 593:                                              {
 594:                                                  NB = 32;
 595:                                              }
 596:                                          }
 597:                                      }
 598:                                  }
 599:                                  else
 600:                                  {
 601:                                      if (C2 == "GB")
 602:                                      {
 603:                                          if (C3 == "TRF")
 604:                                          {
 605:                                              if (SNAME)
 606:                                              {
 607:                                                  if (N4 <= 64)
 608:                                                  {
 609:                                                      NB = 1;
 610:                                                  }
 611:                                                  else
 612:                                                  {
 613:                                                      NB = 32;
 614:                                                  }
 615:                                              }
 616:                                              else
 617:                                              {
 618:                                                  if (N4 <= 64)
 619:                                                  {
 620:                                                      NB = 1;
 621:                                                  }
 622:                                                  else
 623:                                                  {
 624:                                                      NB = 32;
 625:                                                  }
 626:                                              }
 627:                                          }
 628:                                      }
 629:                                      else
 630:                                      {
 631:                                          if (C2 == "PB")
 632:                                          {
 633:                                              if (C3 == "TRF")
 634:                                              {
 635:                                                  if (SNAME)
 636:                                                  {
 637:                                                      if (N2 <= 64)
 638:                                                      {
 639:                                                          NB = 1;
 640:                                                      }
 641:                                                      else
 642:                                                      {
 643:                                                          NB = 32;
 644:                                                      }
 645:                                                  }
 646:                                                  else
 647:                                                  {
 648:                                                      if (N2 <= 64)
 649:                                                      {
 650:                                                          NB = 1;
 651:                                                      }
 652:                                                      else
 653:                                                      {
 654:                                                          NB = 32;
 655:                                                      }
 656:                                                  }
 657:                                              }
 658:                                          }
 659:                                          else
 660:                                          {
 661:                                              if (C2 == "TR")
 662:                                              {
 663:                                                  if (C3 == "TRI")
 664:                                                  {
 665:                                                      if (SNAME)
 666:                                                      {
 667:                                                          NB = 64;
 668:                                                      }
 669:                                                      else
 670:                                                      {
 671:                                                          NB = 64;
 672:                                                      }
 673:                                                  }
 674:                                              }
 675:                                              else
 676:                                              {
 677:                                                  if (C2 == "LA")
 678:                                                  {
 679:                                                      if (C3 == "UUM")
 680:                                                      {
 681:                                                          if (SNAME)
 682:                                                          {
 683:                                                              NB = 64;
 684:                                                          }
 685:                                                          else
 686:                                                          {
 687:                                                              NB = 64;
 688:                                                          }
 689:                                                      }
 690:                                                  }
 691:                                                  else
 692:                                                  {
 693:                                                      if (SNAME && C2 == "ST")
 694:                                                      {
 695:                                                          if (C3 == "EBZ")
 696:                                                          {
 697:                                                              NB = 1;
 698:                                                          }
 699:                                                      }
 700:                                                  }
 701:                                              }
 702:                                          }
 703:                                      }
 704:                                  }
 705:                              }
 706:                          }
 707:                      }
 708:                  }
 709:              }
 710:              ilaenv = NB;
 711:              return ilaenv;
 712:              // *
 713:          LABEL60:;
 714:              // *
 715:              // *     ISPEC = 2:  minimum block size
 716:              // *
 717:              NBMIN = 2;
 718:              if (C2 == "GE")
 719:              {
 720:                  if (C3 == "QRF" || C3 == "RQF" || C3 == "LQF" || C3 == "QLF")
 721:                  {
 722:                      if (SNAME)
 723:                      {
 724:                          NBMIN = 2;
 725:                      }
 726:                      else
 727:                      {
 728:                          NBMIN = 2;
 729:                      }
 730:                  }
 731:                  else
 732:                  {
 733:                      if (C3 == "HRD")
 734:                      {
 735:                          if (SNAME)
 736:                          {
 737:                              NBMIN = 2;
 738:                          }
 739:                          else
 740:                          {
 741:                              NBMIN = 2;
 742:                          }
 743:                      }
 744:                      else
 745:                      {
 746:                          if (C3 == "BRD")
 747:                          {
 748:                              if (SNAME)
 749:                              {
 750:                                  NBMIN = 2;
 751:                              }
 752:                              else
 753:                              {
 754:                                  NBMIN = 2;
 755:                              }
 756:                          }
 757:                          else
 758:                          {
 759:                              if (C3 == "TRI")
 760:                              {
 761:                                  if (SNAME)
 762:                                  {
 763:                                      NBMIN = 2;
 764:                                  }
 765:                                  else
 766:                                  {
 767:                                      NBMIN = 2;
 768:                                  }
 769:                              }
 770:                          }
 771:                      }
 772:                  }
 773:              }
 774:              else
 775:              {
 776:                  if (C2 == "SY")
 777:                  {
 778:                      if (C3 == "TRF")
 779:                      {
 780:                          if (SNAME)
 781:                          {
 782:                              NBMIN = 8;
 783:                          }
 784:                          else
 785:                          {
 786:                              NBMIN = 8;
 787:                          }
 788:                      }
 789:                      else
 790:                      {
 791:                          if (SNAME && C3 == "TRD")
 792:                          {
 793:                              NBMIN = 2;
 794:                          }
 795:                      }
 796:                  }
 797:                  else
 798:                  {
 799:                      if (CNAME && C2 == "HE")
 800:                      {
 801:                          if (C3 == "TRD")
 802:                          {
 803:                              NBMIN = 2;
 804:                          }
 805:                      }
 806:                      else
 807:                      {
 808:                          if (SNAME && C2 == "OR")
 809:                          {
 810:                              if (FortranLib.Substring(C3, 1, 1) == "G")
 811:                              {
 812:                                  if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 813:                                  {
 814:                                      NBMIN = 2;
 815:                                  }
 816:                              }
 817:                              else
 818:                              {
 819:                                  if (FortranLib.Substring(C3, 1, 1) == "M")
 820:                                  {
 821:                                      if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 822:                                      {
 823:                                          NBMIN = 2;
 824:                                      }
 825:                                  }
 826:                              }
 827:                          }
 828:                          else
 829:                          {
 830:                              if (CNAME && C2 == "UN")
 831:                              {
 832:                                  if (FortranLib.Substring(C3, 1, 1) == "G")
 833:                                  {
 834:                                      if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 835:                                      {
 836:                                          NBMIN = 2;
 837:                                      }
 838:                                  }
 839:                                  else
 840:                                  {
 841:                                      if (FortranLib.Substring(C3, 1, 1) == "M")
 842:                                      {
 843:                                          if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 844:                                          {
 845:                                              NBMIN = 2;
 846:                                          }
 847:                                      }
 848:                                  }
 849:                              }
 850:                          }
 851:                      }
 852:                  }
 853:              }
 854:              ilaenv = NBMIN;
 855:              return ilaenv;
 856:              // *
 857:          LABEL70:;
 858:              // *
 859:              // *     ISPEC = 3:  crossover point
 860:              // *
 861:              NX = 0;
 862:              if (C2 == "GE")
 863:              {
 864:                  if (C3 == "QRF" || C3 == "RQF" || C3 == "LQF" || C3 == "QLF")
 865:                  {
 866:                      if (SNAME)
 867:                      {
 868:                          NX = 128;
 869:                      }
 870:                      else
 871:                      {
 872:                          NX = 128;
 873:                      }
 874:                  }
 875:                  else
 876:                  {
 877:                      if (C3 == "HRD")
 878:                      {
 879:                          if (SNAME)
 880:                          {
 881:                              NX = 128;
 882:                          }
 883:                          else
 884:                          {
 885:                              NX = 128;
 886:                          }
 887:                      }
 888:                      else
 889:                      {
 890:                          if (C3 == "BRD")
 891:                          {
 892:                              if (SNAME)
 893:                              {
 894:                                  NX = 128;
 895:                              }
 896:                              else
 897:                              {
 898:                                  NX = 128;
 899:                              }
 900:                          }
 901:                      }
 902:                  }
 903:              }
 904:              else
 905:              {
 906:                  if (C2 == "SY")
 907:                  {
 908:                      if (SNAME && C3 == "TRD")
 909:                      {
 910:                          NX = 32;
 911:                      }
 912:                  }
 913:                  else
 914:                  {
 915:                      if (CNAME && C2 == "HE")
 916:                      {
 917:                          if (C3 == "TRD")
 918:                          {
 919:                              NX = 32;
 920:                          }
 921:                      }
 922:                      else
 923:                      {
 924:                          if (SNAME && C2 == "OR")
 925:                          {
 926:                              if (FortranLib.Substring(C3, 1, 1) == "G")
 927:                              {
 928:                                  if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 929:                                  {
 930:                                      NX = 128;
 931:                                  }
 932:                              }
 933:                          }
 934:                          else
 935:                          {
 936:                              if (CNAME && C2 == "UN")
 937:                              {
 938:                                  if (FortranLib.Substring(C3, 1, 1) == "G")
 939:                                  {
 940:                                      if (C4 == "QR" || C4 == "RQ" || C4 == "LQ" || C4 == "QL" || C4 == "HR" || C4 == "TR" || C4 == "BR")
 941:                                      {
 942:                                          NX = 128;
 943:                                      }
 944:                                  }
 945:                              }
 946:                          }
 947:                      }
 948:                  }
 949:              }
 950:              ilaenv = NX;
 951:              return ilaenv;
 952:              // *
 953:          LABEL80:;
 954:              // *
 955:              // *     ISPEC = 4:  number of shifts (used by xHSEQR)
 956:              // *
 957:              ilaenv = 6;
 958:              return ilaenv;
 959:              // *
 960:          LABEL90:;
 961:              // *
 962:              // *     ISPEC = 5:  minimum column dimension (not used)
 963:              // *
 964:              ilaenv = 2;
 965:              return ilaenv;
 966:              // *
 967:          LABEL100:;
 968:              // *
 969:              // *     ISPEC = 6:  crossover point for SVD (used by xGELSS and xGESVD)
 970:              // *
 971:              ilaenv = Convert.ToInt32(Math.Truncate(Convert.ToSingle(Math.Min(N1, N2)) * 1.6E0));
 972:              return ilaenv;
 973:              // *
 974:          LABEL110:;
 975:              // *
 976:              // *     ISPEC = 7:  number of processors (not used)
 977:              // *
 978:              ilaenv = 1;
 979:              return ilaenv;
 980:              // *
 981:          LABEL120:;
 982:              // *
 983:              // *     ISPEC = 8:  crossover point for multishift (used by xHSEQR)
 984:              // *
 985:              ilaenv = 50;
 986:              return ilaenv;
 987:              // *
 988:          LABEL130:;
 989:              // *
 990:              // *     ISPEC = 9:  maximum size of the subproblems at the bottom of the
 991:              // *                 computation tree in the divide-and-conquer algorithm
 992:              // *                 (used by xGELSD and xGESDD)
 993:              // *
 994:              ilaenv = 25;
 995:              return ilaenv;
 996:              // *
 997:          LABEL140:;
 998:              // *
 999:              // *     ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
1000:              // *
1001:              // *     ILAENV = 0
1002:              ilaenv = 1;
1003:              if (ilaenv == 1)
1004:              {
1005:                  ilaenv = this._ieeeck.Run(0, 0.0, 1.0);
1006:              }
1007:              return ilaenv;
1008:              // *
1009:          LABEL150:;
1010:              // *
1011:              // *     ISPEC = 11: infinity arithmetic can be trusted not to trap
1012:              // *
1013:              // *     ILAENV = 0
1014:              ilaenv = 1;
1015:              if (ilaenv == 1)
1016:              {
1017:                  ilaenv = this._ieeeck.Run(1, 0.0, 1.0);
1018:              }
1019:              return ilaenv;
1020:              // *
1021:          LABEL160:;
1022:              // *
1023:              // *     12 <= ISPEC <= 16: xHSEQR or one of its subroutines. 
1024:              // *
1025:              ilaenv = this._iparmq.Run(ISPEC, NAME, OPTS, N1, N2, N3, N4);
1026:              return ilaenv;
1027:              // *
1028:              // *     End of ILAENV
1029:              // *
1030:   
1031:              #endregion
1032:   
1033:          }
1034:      }
1035:  }