Class IntDoublePair

java.lang.Object
org.tribuo.util.IntDoublePair

public final class IntDoublePair extends Object
A Pair of a primitive int and a primitive double.
  • Field Details

    • index

      public final int index
      The key.
    • value

      public final double value
      The 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

      public static Comparator<IntDoublePair> pairIndexComparator()
      Compare pairs by index.
      Returns:
      Comparator over indices.
    • pairValueComparator

      public static Comparator<IntDoublePair> pairValueComparator()
      Compare pairs by value. Ascending order.
      Returns:
      Comparator over absolute values.
    • pairDescendingValueComparator

      public static Comparator<IntDoublePair> pairDescendingValueComparator()
      Compare pairs by value. Descending order.
      Returns:
      Comparator over absolute values.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object