Class GradientEstimator

java.lang.Object
com.irurueta.numerical.GradientEstimator
Direct Known Subclasses:
SavitzkyGolayGradientEstimator, SymmetricGradientEstimator

public class GradientEstimator extends Object
Class to estimate the gradient of a multidimensional function. This class evaluates a function at very close locations of a given input point in order to determine the gradient at such point.
  • Field Details

    • EPS

      public static final double EPS
      Constant considered as machine precision.
      See Also:
    • listener

      protected final MultiDimensionFunctionEvaluatorListener listener
      Listener to evaluate a multidimensional function.
    • xh

      private double[] xh
      Internal array to hold input parameter's values.
  • Constructor Details

  • Method Details

    • gradient

      public double[] gradient(double[] point) throws EvaluationException
      Returns the gradient of a multidimensional function at provided point.
      Parameters:
      point - Input point.
      Returns:
      Gradient.
      Throws:
      EvaluationException - Raised if function cannot be evaluated.
    • gradient

      public void gradient(double[] point, double[] result) throws EvaluationException
      Sets estimated gradient in provided result array of a multidimensional function at provided point. This method is preferred respect to gradient(double[]) because result array can be reused and hence is more memory efficient.
      Parameters:
      point - Input point.
      result - Output parameter containing estimated array. This parameter must be an array of length equal to point.
      Throws:
      EvaluationException - Raised if function cannot be evaluated.
      IllegalArgumentException - Raised if length of result and point are not equal.