Package tagalong.math

Class LinearizedLookupTable

java.lang.Object
tagalong.math.LinearizedLookupTable

public class LinearizedLookupTable extends Object
Linearized Lookup Table
  • Constructor Summary

    Constructors
    Constructor
    Description
    LinearizedLookupTable(double[] id, double[] values)
    Constructs a lookup table containing IDs and their corresponding values
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    lookup(double id)
    Returns the value that the ID maps to on a continuous, linearized function
    int
    Gets length of ID array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LinearizedLookupTable

      public LinearizedLookupTable(double[] id, double[] values)
      Constructs a lookup table containing IDs and their corresponding values
      Parameters:
      id - array of identifiers
      values - array of values corresponding to the IDs
  • Method Details

    • lookup

      public double lookup(double id)
      Returns the value that the ID maps to on a continuous, linearized function
      Parameters:
      id - ID contained in the lookup table
      Returns:
      value using linearized lookup
    • size

      public int size()
      Gets length of ID array
      Returns:
      length of ID array