示例#1
0
 private static void selectionSort(
     final boolean[][] a, final long from, final long to, final BooleanComparator comp) {
   for (long i = from; i < to - 1; i++) {
     long m = i;
     for (long j = i + 1; j < to; j++)
       if (comp.compare(BooleanBigArrays.get(a, j), BooleanBigArrays.get(a, m)) < 0) m = j;
     if (m != i) swap(a, i, m);
   }
 }
示例#2
0
 @SuppressWarnings("unchecked")
 private static void selectionSort(final boolean[][] a, final long from, final long to) {
   for (long i = from; i < to - 1; i++) {
     long m = i;
     for (long j = i + 1; j < to; j++)
       if ((!(BooleanBigArrays.get(a, j)) && (BooleanBigArrays.get(a, m)))) m = j;
     if (m != i) swap(a, i, m);
   }
 }
示例#3
0
 /**
  * Sorts the specified big array according to the natural ascending order using quicksort.
  *
  * <p>The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas
  * McIlroy, &ldquo;Engineering a Sort Function&rdquo;, <i>Software: Practice and Experience</i>,
  * 23(11), pages 1249&minus;1265, 1993.
  *
  * @param x the big array to be sorted.
  */
 @SuppressWarnings("unchecked")
 public static void quickSort(final boolean[][] x) {
   quickSort(x, 0, BooleanBigArrays.length(x));
 }
示例#4
0
 /**
  * Sorts the specified big array according to the order induced by the specified comparator using
  * quicksort.
  *
  * <p>The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas
  * McIlroy, &ldquo;Engineering a Sort Function&rdquo;, <i>Software: Practice and Experience</i>,
  * 23(11), pages 1249&minus;1265, 1993.
  *
  * @param x the big array to be sorted.
  * @param comp the comparator to determine the sorting order.
  */
 public static void quickSort(final boolean[][] x, final BooleanComparator comp) {
   quickSort(x, 0, BooleanBigArrays.length(x), comp);
 }
示例#5
0
 public boolean equals(final boolean[][] a, final boolean[][] b) {
   return BooleanBigArrays.equals(a, b);
 }