25package umontreal.ssj.util.multidimsort;
27import java.util.Comparator;
60 public int compare(
double[] d1,
double[] d2) {
61 if (j >= d1.length || j >= d2.length)
62 throw new IllegalArgumentException(
"Comparing in a" +
"dimension larger than array dimension");
63 return (d1[j] < d2[j] ? -1 : (d1[j] > d2[j] ? 1 : 0));
DoubleArrayComparator(int j)
Constructs a comparator, where j is the coordinate used for the comparisons.
int compare(double[] d1, double[] d2)
Returns , , or depending on whether d1[j] is less than, equal to, or greater than d2[j].