Ejemplo n.º 1
0
  public void sortLevels() {
    System.out.println("------ Discret Sort --------: " + name);
    if (!alpha) {

      double[] ss = new double[levelP];
      for (int i = 0; i < levelP; i++) {
        // System.out.println( Double.valueOf( levelA[i] ).doubleValue() );
        ss[i] = Double.valueOf(levelA[i]).doubleValue();
      }
      permA = Qsort.qsort(ss, 0, levelP - 1);
    } else {

      String[] sA = new String[levelP];
      for (int i = 0; i < levelP; i++) sA[i] = levelA[i].toUpperCase();
      permA = Qsort.qsort(sA, 0, levelP - 1);
    }
    IpermA = new int[levelP];
    for (int i = 0; i < levelP; i++) {
      IpermA[permA[i]] = i;
    }
  }
Ejemplo n.º 2
0
 public void sortData() {
   System.out.println("--------- Real Sort --------: " + name);
   double[] sA = new double[dataSet.n];
   System.arraycopy(data, 0, sA, 0, dataSet.n);
   sortI = Qsort.qsort(sA, 0, dataSet.n - 1);
 }