Class VectorLookupTable


  • public class VectorLookupTable
    extends Object
    The class VectorLookupTable performs the function of multilinear interpolation for vector lookup tables with an arbitrary number of dimensions.

    todo - method for degrading a table (see LookupTable)

    • Constructor Detail

      • VectorLookupTable

        public VectorLookupTable​(int length,
                                 double[] values,
                                 IntervalPartition... dimensions)
        Constructs an array lookup table for the lookup values and dimensions supplied as arguments.
        Parameters:
        length - the length of the lookup vector.
        values - the lookup values. The values array must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.
        dimensions - the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, see IntervalPartition.
        Throws:
        IllegalArgumentException - if length is less than 1 or the length of values is not equal to length times the number of coordinate grid vertices.
        NullPointerException - if the values array or the dimensions array is null or any dimension is null.
      • VectorLookupTable

        public VectorLookupTable​(int length,
                                 float[] values,
                                 IntervalPartition... dimensions)
        Constructs an array lookup table for the lookup values and dimensions supplied as arguments.
        Parameters:
        length - the length of the lookup vector.
        values - the lookup values. The values array must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.
        dimensions - the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, see IntervalPartition.
        Throws:
        IllegalArgumentException - if length is less than 1 or the length of values is not equal to length times the number of coordinate grid vertices.
        NullPointerException - if the values array or the dimensions array is null or any dimension is null.
      • VectorLookupTable

        public VectorLookupTable​(int length,
                                 double[] values,
                                 double[]... dimensions)
        Constructs an array lookup table for the lookup values and dimensions supplied as arguments.
        Parameters:
        length - the length of the lookup vector.
        values - the lookup values. The values array must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.
        dimensions - the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, see IntervalPartition.
        Throws:
        IllegalArgumentException - if length is less than 1 or the length of values is not equal to length times the number of coordinate grid vertices.
        NullPointerException - if the values array or the dimensions array is null or any dimension is null.
      • VectorLookupTable

        public VectorLookupTable​(int length,
                                 float[] values,
                                 float[]... dimensions)
        Constructs an array lookup table for the lookup values and dimensions supplied as arguments.
        Parameters:
        length - the length of the lookup vector.
        values - the lookup values. The values array must be laid out in row-major order, so that the dimension associated with the last axis varies fastest.
        dimensions - the interval partitions defining the dimensions associated with the lookup table. An interval partition is a strictly increasing sequence of at least two real numbers, see IntervalPartition.
        Throws:
        IllegalArgumentException - if length is less than 1 or the length of values is not equal to length times the number of coordinate grid vertices.
        NullPointerException - if the values array or the dimensions array is null or any dimension is null.
    • Method Detail

      • getDimensionCount

        public final int getDimensionCount()
        Returns the number of dimensions associated with the lookup table.
        Returns:
        the number of dimensions.
      • getDimensions

        public final IntervalPartition[] getDimensions()
        Returns the dimensions associated with the lookup table.
        Returns:
        the dimensions.
      • getDimension

        public final IntervalPartition getDimension​(int i)
        Returns the the ith dimension associated with the lookup table.
        Parameters:
        i - the index number of the dimension of interest
        Returns:
        the ith dimension.
      • getValues

        public final double[] getValues​(double... coordinates)
                                 throws IllegalArgumentException
        Returns an interpolated value array for the given coordinates.
        Parameters:
        coordinates - the coordinates of the lookup point.
        Returns:
        the interpolated value array.
        Throws:
        IllegalArgumentException - if the length of the coordinates array is not equal to the number of dimensions associated with the lookup table.
        NullPointerException - if the coordinates array is null.