Ilaenv.java

package org.mklab.sdpj.gpack.lapackwrap;

import org.mklab.nfc.matrix.ComplexNumericalMatrix;
import org.mklab.nfc.matrix.RealNumericalMatrix;
import org.mklab.nfc.scalar.ComplexNumericalScalar;
import org.mklab.nfc.scalar.RealNumericalScalar;
import org.mklab.sdpj.gpack.f2clibs.LibF77;


/**
 * @author koga
 * @version $Revision$, 2009/04/25
   * @param <RS> type of real scalar
   * @param <RM> type of real matrix
   * @param <CS> type of complex scalar
   * @param <CM> type of complex Matrix
 */
public class Ilaenv<RS extends RealNumericalScalar<RS, RM, CS, CM>, RM extends RealNumericalMatrix<RS, RM, CS, CM>, CS extends ComplexNumericalScalar<RS, RM, CS, CM>, CM extends ComplexNumericalMatrix<RS, RM, CS, CM>> {

  /*  -- LAPACK auxiliary routine (version 3.0) --   
  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
  Courant Institute, Argonne National Lab, and Rice University   
  June 30, 1999   


  Purpose   
  =======   

  ILAENV is called from the LAPACK routines to choose problem-dependent   
  parameters for the local environment.  See ISPEC for a description of   
  the parameters.   

  This version provides a set of parameters which should give good,   
  but not optimal, performance on many of the currently available   
  computers.  Users are encouraged to modify this subroutine to set   
  the tuning parameters for their particular machine using the option   
  and problem size information in the arguments.   

  This routine will not function correctly if it is converted to all   
  lower case.  Converting it to all upper case is allowed.   

  Arguments   
  =========   

  ISPEC   (input) INTEGER   
       Specifies the parameter to be returned as the value of   
       ILAENV.   
       = 1: the optimal blocksize; if this value is 1, an unblocked   
            algorithm will give the best performance.   
       = 2: the minimum block size for which the block routine   
            should be used; if the usable block size is less than   
            this value, an unblocked routine should be used.   
       = 3: the crossover point (in a block routine, for N less   
            than this value, an unblocked routine should be used)   
       = 4: the number of shifts, used in the nonsymmetric   
            eigenvalue routines   
       = 5: the minimum column dimension for blocking to be used;   
            rectangular blocks must have dimension at least k by m,   
            where k is given by ILAENV(2,...) and m by ILAENV(5,...)   
       = 6: the crossover point for the SVD (when reducing an m by n   
            matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds   
            this value, a QR factorization is used first to reduce   
            the matrix to a triangular form.)   
       = 7: the number of processors   
       = 8: the crossover point for the multishift QR and QZ methods   
            for nonsymmetric eigenvalue problems.   
       = 9: maximum size of the subproblems at the bottom of the   
            computation tree in the divide-and-conquer algorithm   
            (used by xGELSD and xGESDD)   
       =10: ieee NaN arithmetic can be trusted not to trap   
       =11: infinity arithmetic can be trusted not to trap   

  NAME    (input) CHARACTER*(*)   
       The name of the calling subroutine, in either upper case or   
       lower case.   

  OPTS    (input) CHARACTER*(*)   
       The character options to the subroutine NAME, concatenated   
       into a single character string.  For example, UPLO = 'U',   
       TRANS = 'T', and DIAG = 'N' for a triangular routine would   
       be specified as OPTS = 'UTN'.   

  N1      (input) INTEGER   
  N2      (input) INTEGER   
  N3      (input) INTEGER   
  N4      (input) INTEGER   
       Problem dimensions for the subroutine NAME; these may not all   
       be required.   

  (ILAENV) (output) INTEGER   
       >= 0: the value of the parameter specified by ISPEC   
       < 0:  if ILAENV = -k, the k-th argument had an illegal value.   

  Further Details   
  ===============   

  The following conventions have been used when calling ILAENV from the   
  LAPACK routines:   
  1)  OPTS is a concatenation of all of the character options to   
   subroutine NAME, in the same order that they appear in the   
   argument list for NAME, even if they are not used in determining   
   the value of the parameter specified by ISPEC.   
  2)  The problem dimensions N1, N2, N3, N4 are specified in the order   
   that they appear in the argument list for NAME.  N1 is used   
   first, N2 second, and so on, and unused problem dimensions are   
   passed a value of -1.   
  3)  The parameter value returned by ILAENV is checked for validity in   
   the calling subroutine.  For example, ILAENV is used to retrieve   
   the optimal blocksize for STRTRI as follows:   

   NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )   
   IF( NB.LE.1 ) NB = MAX( 1, N )   

  =====================================================================
  */
  /**
   * @param ispec ispec
   * @param name name
   * @param opts opts
   * @param n1 n1
   * @param n2 n2
   * @param n3 n3
   * @param n4 n4
   * @param name_len name_len
   * @param opts_len opts_len
   * @param unit unit
   * @return result
   */
  public int execute(int ispec, String name, String opts, int n1, int n2, int n3, int n4, int name_len, int opts_len, RS unit) {
    RS c_b162 = unit.create(0);
    RS c_b163 = unit.create(1);

    int ret_val = -1;
    char[] c2 = new char[2];
    char[] c3 = new char[3];
    char[] c4 = new char[2];
    char[] subnam = new char[6];

    switch (ispec) {
      case 1:
        break;
      case 2:
        break;
      case 3:
        break;
      case 4:
        // ISPEC = 4:  number of shifts (used by xHSEQR)
        ret_val = 6;
        break;
      case 5:
        // ISPEC = 5:  minimum column dimension (not used)
        ret_val = 2;
        break;
      case 6:
        // ISPEC = 6:  crossover point for SVD (used by xGELSS and xGESVD)
        ret_val = (int)(Math.min(n1, n2) * 1.6f);
        break;
      case 7:
        // ISPEC = 7:  number of processors (not used)
        ret_val = 1;
        break;
      case 8:
        // ISPEC = 8:  crossover point for multishift (used by xHSEQR)
        ret_val = 50;
        break;
      case 9:
        /* ISPEC = 9:  maximum size of the subproblems at the bottom of the   
          computation tree in the divide-and-conquer algorithm (used by xGELSD and xGESDD) */
        ret_val = 25;
        break;
      case 10:
        // ISPEC = 10: ieee NaN arithmetic can be trusted not to trap ILAENV = 0
        ret_val = 1;
        if (ret_val == 1) {
          ret_val = ieeeck(0, c_b162, c_b163);
        }
        break;
      case 11:
        // ISPEC = 11: infinity arithmetic can be trusted not to trap ILAENV = 0
        ret_val = 1;
        if (ret_val == 1) {
          ret_val = ieeeck(1, c_b162, c_b163);
        }
        break;
    }

    //L100:
    /*  Convert NAME to upper case if the first character is lower case. */
    if (ispec >= 1 && ispec <= 3) {
      ret_val = 1;

      LibF77.copy(subnam, name, 6, name.length());
      int ic = subnam[0];
      int iz = 'Z';

      //ASCII character set
      if (iz == 90 || iz == 122) {
        if (ic >= 97 && ic <= 122) {
          subnam[0] = (char)(ic - 32);
          for (int i = 2; i <= 6; ++i) {
            ic = subnam[i - 1];
            if (ic >= 97 && ic <= 122) {
              subnam[i - 1] = (char)(ic - 32);
            }
          }
        }
      }

      //EBCDIC character set
      if (iz == 233 || iz == 169) {
        if (ic >= 129 && ic <= 137 || ic >= 145 && ic <= 153 || ic >= 162 && ic <= 169) {
          subnam[0] = (char)(ic + 64);
          for (int i = 2; i <= 6; ++i) {
            ic = subnam[i - 1];
            if (ic >= 129 && ic <= 137 || ic >= 145 && ic <= 153 || ic >= 162 && ic <= 169) {
              subnam[i - 1] = (char)(ic + 64);
            }
          }
        }
      }

      //prime machines: ASCII + 128
      if (iz == 218 || iz == 250) {
        if (ic >= 225 && ic <= 250) {
          subnam[0] = (char)(ic - 32);
          for (int i = 2; i <= 6; ++i) {
            ic = subnam[i - 1];
            if (ic >= 225 && ic <= 250) {
              subnam[i - 1] = (char)(ic - 32);
            }
          }
        }
      }

      char c1 = subnam[0];
      boolean sname = (c1 == 'S' || c1 == 'D');
      boolean cname = (c1 == 'C' || c1 == 'Z');
      if (!(cname || sname)) {
        return ret_val;
      }

      char[] subnam1 = new char[6 - 1];
      char[] subnam3 = new char[6 - 3];
      char[] c3_1 = new char[3 - 1];
      System.arraycopy(subnam, 1, subnam1, 0, 5);
      System.arraycopy(subnam, 3, subnam3, 0, 3);

      LibF77.copy(c2, String.copyValueOf(subnam1), 2, 2);
      LibF77.copy(c3, String.copyValueOf(subnam3), 3, 3);
      System.arraycopy(c3, 1, c3_1, 0, 2);
      LibF77.copy(c4, String.copyValueOf(c3_1), 2, 2);

      switch (ispec) {
        case 1:
          return this.L110(sname, cname, n2, n4, c2, c3, c4);
        case 2:
          return this.L200(sname, cname, c2, c3, c4);
        case 3:
          return this.L300(sname, cname, c2, c3, c4);
      }
      // Invalid value for ISPEC
    }

    return ret_val;
  }

  /**
   * @param c c
   * @param c_b162 c_b162
   * @param c_b163 c_163
   * @return result
   */
  private int ieeeck(int c, RS c_b162, RS c_b163) {
    return new IEEEck<RS,RM,CS,CM>().execute(c, c_b162, c_b163);
  }

  //------
  /*     ISPEC = 1:  block size   

  In these examples, separate code is provided for setting NB for   
  real and complex.  We assume that NB will take the same value in   
  single or double precision. */
  /**
   * @param sname sname
   * @param cname cname
   * @param n2 n2
   * @param n4 n4
   * @param c2 c2
   * @param c3 c3
   * @param c4 c4
   * @return result
   */
  private int L110(boolean sname, boolean cname, int n2, int n4, char[] c2, char[] c3, char[] c4) {
    int nb = 1;

    if (LibF77.compare(c2, "GE", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 64;
        } else {
          nb = 64;
        }
      } else if (LibF77.compare(c3, "QRF", 3, 3) == 0 || LibF77.compare(c3, "RQF", 3, 3) == 0 || LibF77.compare(c3, "LQF", 3, 3) == 0 || LibF77.compare(c3, "QLF", 3, 3) == 0) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
        if (sname) {
          nb = 32;
        } else {
          nb = 32;
        }
      } else if (LibF77.compare(c3, "HRD", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 32;
        } else {
          nb = 32;
        }
      } else if (LibF77.compare(c3, "BRD", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 32;
        } else {
          nb = 32;
        }
      } else if (LibF77.compare(c3, "TRI", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 64;
        } else {
          nb = 64;
        }
      }
    } else if (LibF77.compare(c2, "PO", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 64;
        } else {
          nb = 64;
        }
      }
    } else if (LibF77.compare(c2, "SY", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 64;
        } else {
          nb = 64;
        }
      } else if (sname && LibF77.compare(c3, "TRD", 3, 3) == 0) { //$NON-NLS-1$
        nb = 32;
      } else if (sname && LibF77.compare(c3, "GST", 3, 3) == 0) { //$NON-NLS-1$
        nb = 64;
      }
    } else if (cname && LibF77.compare(c2, "HE", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        nb = 64;
      } else if (LibF77.compare(c3, "TRD", 3, 3) == 0) { //$NON-NLS-1$
        nb = 32;
      } else if (LibF77.compare(c3, "GST", 3, 3) == 0) { //$NON-NLS-1$
        nb = 64;
      }
    } else if (sname && LibF77.compare(c2, "OR", 2, 2) == 0) { //$NON-NLS-1$
      if (c3[0] == 'G') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nb = 32;
        }
      } else if (c3[0] == 'M') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nb = 32;
        }
      }
    } else if (cname && LibF77.compare(c2, "UN", 2, 2) == 0) { //$NON-NLS-1$
      if (c3[0] == 'G') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nb = 32;
        }
      } else if (c3[0] == 'M') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nb = 32;
        }
      }
    } else if (LibF77.compare(c2, "GB", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          if (n4 <= 64) {
            nb = 1;
          } else {
            nb = 32;
          }
        } else {
          if (n4 <= 64) {
            nb = 1;
          } else {
            nb = 32;
          }
        }
      }
    } else if (LibF77.compare(c2, "PB", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          if (n2 <= 64) {
            nb = 1;
          } else {
            nb = 32;
          }
        } else {
          if (n2 <= 64) {
            nb = 1;
          } else {
            nb = 32;
          }
        }
      }
    } else if (LibF77.compare(c2, "TR", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRI", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 64;
        } else {
          nb = 64;
        }
      }
    } else if (LibF77.compare(c2, "LA", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "UUM", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nb = 64;
        } else {
          nb = 64;
        }
      }
    } else if (sname && LibF77.compare(c2, "ST", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "EBZ", 3, 3) == 0) { //$NON-NLS-1$
        nb = 1;
      }
    }
    return nb;
  }

  /**
   * @param sname sname
   * @param cname cname
   * @param c2 c2
   * @param c3 c3
   * @param c4 c4
   * @return result
   */
  private int L200(boolean sname, boolean cname, char[] c2, char[] c3, char[] c4) {
    /*     ISPEC = 2:  minimum block size */

    int nbmin = 2;
    if (LibF77.compare(c2, "GE", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "QRF", 3, 3) == 0 || LibF77.compare(c3, "RQF", 3, 3) == 0 || LibF77.compare(c3, "LQF", 3, 3) == 0 || LibF77.compare(c3, "QLF", 3, 3) == 0) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
        if (sname) {
          nbmin = 2;
        } else {
          nbmin = 2;
        }
      } else if (LibF77.compare(c3, "HRD", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nbmin = 2;
        } else {
          nbmin = 2;
        }
      } else if (LibF77.compare(c3, "BRD", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nbmin = 2;
        } else {
          nbmin = 2;
        }
      } else if (LibF77.compare(c3, "TRI", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nbmin = 2;
        } else {
          nbmin = 2;
        }
      }
    } else if (LibF77.compare(c2, "SY", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRF", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nbmin = 8;
        } else {
          nbmin = 8;
        }
      } else if (sname && LibF77.compare(c3, "TRD", 3, 3) == 0) { //$NON-NLS-1$
        nbmin = 2;
      }
    } else if (cname && LibF77.compare(c2, "HE", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRD", 3, 3) == 0) { //$NON-NLS-1$
        nbmin = 2;
      }
    } else if (sname && LibF77.compare(c2, "OR", 2, 2) == 0) { //$NON-NLS-1$
      if (c3[0] == 'G') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nbmin = 2;
        }
      } else if (c3[0] == 'M') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nbmin = 2;
        }
      }
    } else if (cname && LibF77.compare(c2, "UN", 2, 2) == 0) { //$NON-NLS-1$
      if (c3[0] == 'G') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nbmin = 2;
        }
      } else if (c3[0] == 'M') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nbmin = 2;
        }
      }
    }
    return nbmin;
  }

  /**
   * @param sname sname
   * @param cname cname
   * @param c2 c2
   * @param c3 c3
   * @param c4 c4
   * @return result
   */
  private int L300(boolean sname, boolean cname, char[] c2, char[] c3, char[] c4) {
    /*     ISPEC = 3:  crossover point */

    int nx = 0;
    if (LibF77.compare(c2, "GE", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "QRF", 3, 3) == 0 || LibF77.compare(c3, "RQF", 3, 3) == 0 || LibF77.compare(c3, "LQF", 3, 3) == 0 || LibF77.compare(c3, "QLF", 3, 3) == 0) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
        if (sname) {
          nx = 128;
        } else {
          nx = 128;
        }
      } else if (LibF77.compare(c3, "HRD", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nx = 128;
        } else {
          nx = 128;
        }
      } else if (LibF77.compare(c3, "BRD", 3, 3) == 0) { //$NON-NLS-1$
        if (sname) {
          nx = 128;
        } else {
          nx = 128;
        }
      }
    } else if (LibF77.compare(c2, "SY", 2, 2) == 0) { //$NON-NLS-1$
      if (sname && LibF77.compare(c3, "TRD", 3, 3) == 0) { //$NON-NLS-1$
        nx = 32;
      }
    } else if (cname && LibF77.compare(c2, "HE", 2, 2) == 0) { //$NON-NLS-1$
      if (LibF77.compare(c3, "TRD", 3, 3) == 0) { //$NON-NLS-1$
        nx = 32;
      }
    } else if (sname && LibF77.compare(c2, "OR", 2, 2) == 0) { //$NON-NLS-1$
      if (c3[0] == 'G') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nx = 128;
        }
      }
    } else if (cname && LibF77.compare(c2, "UN", 2, 2) == 0) { //$NON-NLS-1$
      if (c3[0] == 'G') {
        if (LibF77.compare(c4, "QR", 2, 2) == 0 || LibF77.compare(c4, "RQ", 2, 2) == 0 || LibF77.compare(c4, "LQ", 2, 2) == 0 || LibF77.compare(c4, "QL", 2, 2) == 0 || LibF77.compare(c4, "HR", 2, 2) == 0 || LibF77.compare(c4, "TR", 2, 2) == 0 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
            || LibF77.compare(c4, "BR", 2, 2) == 0) { //$NON-NLS-1$
          nx = 128;
        }
      }
    }
    return nx;
  }
}