Package com.irurueta.numerical
Class GradientEstimator
java.lang.Object
com.irurueta.numerical.GradientEstimator
- Direct Known Subclasses:
SavitzkyGolayGradientEstimator
,SymmetricGradientEstimator
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Constant considered as machine precision.protected final MultiDimensionFunctionEvaluatorListener
Listener to evaluate a multidimensional function.private double[]
Internal array to hold input parameter's values. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor. -
Method Summary
-
Field Details
-
EPS
public static final double EPSConstant considered as machine precision.- See Also:
-
listener
Listener to evaluate a multidimensional function. -
xh
private double[] xhInternal array to hold input parameter's values.
-
-
Constructor Details
-
GradientEstimator
Constructor.- Parameters:
listener
- Listener to evaluate a multidimensional function.
-
-
Method Details
-
gradient
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
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.
-