Documentation of 'umontreal.iro.lecuyer.util.DoubleArrayComparator' Java class
DoubleArrayComparator
JavaScript is disabled on your browser.
java.lang.Object
umontreal.iro.lecuyer.util.DoubleArrayComparator
All Implemented Interfaces:
java.util.Comparator<double[]>
public class DoubleArrayComparator
extends java.lang.Object
implements java.util.Comparator<double[]>
An implementation of Comparator which compares two
double arrays by comparing their i -th element,
where i is given in the constructor.
Method compare(d1, d2) returns -1 , 0 , or 1 depending on
whether d1[i] is less than, equal to, or greater than
d2[i] .
Constructor Summary
Constructors
Constructor and Description
DoubleArrayComparator (int i)
Constructs a comparator, where i is the index
used for the comparisons.
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
int
compare (double[] d1,
double[] d2)
Returns -1 , 0 , or 1 depending on
whether d1[i] is less than, equal
to, or greater than d2[i] .
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Constructor Detail
DoubleArrayComparator
public DoubleArrayComparator(int i)
Constructs a comparator, where i is the index
used for the comparisons.
Parameters:
i - index used for comparison
Method Detail
compare
public int compare(double[] d1,
double[] d2)
Returns -1 , 0 , or 1 depending on
whether d1[i] is less than, equal
to, or greater than d2[i] .
Specified by:
compare in interface java.util.Comparator<double[]>
Parameters:
d1 - first array
d2 - second array
DMelt 3.0 © DataMelt by jWork.ORG
You see the box below because you did not login.