Class FastFunc

    • Constructor Summary

      Constructors 
      Constructor Description
      FastFunc​(double min, double max, int nSamples)
      Main Constructor in which the values of this function are computed
    • Constructor Detail

      • FastFunc

        public FastFunc​(double min,
                        double max,
                        int nSamples)
        Main Constructor in which the values of this function are computed
        Parameters:
        min - minimum value to sample
        max - maximum value to sample
        samples - number of samples
    • Method Detail

      • lookup

        public double lookup​(double x)
        Returns the value of the precomputed function using a simple nearest neighbor interpolation.
        Parameters:
        x - function argument (you must ensure this is in range)
        Returns:
        value of the function
      • lookup

        public void lookup​(double[][] A,
                           double[][] x)
        Returns the value of the precomputed function using a simple nearest neighbor interpolation. size(A) should = size(x).
        Parameters:
        A - function values
        x - arguments
      • evaluate

        public double evaluate​(double x)