Package org.tribuo.util
Class IntDoublePair
java.lang.Object
org.tribuo.util.IntDoublePair
A Pair of a primitive int and a primitive double.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIntDoublePair
(int index, double value) Constructs a tuple out of an int and a double. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
static Comparator<IntDoublePair>
Compare pairs by value.static Comparator<IntDoublePair>
Compare pairs by index.static Comparator<IntDoublePair>
Compare pairs by value.toString()
-
Field Details
-
index
public final int indexThe key. -
value
public final double valueThe value.
-
-
Constructor Details
-
IntDoublePair
public IntDoublePair(int index, double value) Constructs a tuple out of an int and a double.- Parameters:
index
- The int.value
- The double
-
-
Method Details
-
pairIndexComparator
Compare pairs by index.- Returns:
- Comparator over indices.
-
pairValueComparator
Compare pairs by value. Ascending order.- Returns:
- Comparator over absolute values.
-
pairDescendingValueComparator
Compare pairs by value. Descending order.- Returns:
- Comparator over absolute values.
-
equals
-
hashCode
public int hashCode() -
toString
-