Beispiel #1
0
  /* really __gl_pqSortMinimum */
  Object pqMinimum() {
    Object sortMin, heapMin;

    if (size == 0) {
      return heap.pqMinimum();
    }
    sortMin = keys[order[size - 1]];
    if (!heap.pqIsEmpty()) {
      heapMin = heap.pqMinimum();
      if (com.sun.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
        return heapMin;
      }
    }
    return sortMin;
  }
Beispiel #2
0
  /* really __gl_pqSortExtractMin */
  Object pqExtractMin() {
    Object sortMin, heapMin;

    if (size == 0) {
      return heap.pqExtractMin();
    }
    sortMin = keys[order[size - 1]];
    if (!heap.pqIsEmpty()) {
      heapMin = heap.pqMinimum();
      if (LEQ(leq, heapMin, sortMin)) {
        return heap.pqExtractMin();
      }
    }
    do {
      --size;
    } while (size > 0 && keys[order[size - 1]] == null);
    return sortMin;
  }