Package com.irurueta.numerical
Class DirectionalDerivativeEvaluator
java.lang.Object
com.irurueta.numerical.DirectionalEvaluator
com.irurueta.numerical.DirectionalDerivativeEvaluator
This class evaluates a multidimensional function and obtains its gradient
along a line; such line is defined by an input point and a given direction.
Using provided input point and direction, the multidimensional function's
input parameters are determined, so they all lay on a line.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final double[]
Array containing gradient at point p.Listener to evaluate a multidimensional function's gradient.Fields inherited from class com.irurueta.numerical.DirectionalEvaluator
direction, listener, p, point
-
Constructor Summary
ConstructorsConstructorDescriptionDirectionalDerivativeEvaluator
(MultiDimensionFunctionEvaluatorListener listener, GradientFunctionEvaluatorListener gradientListener, double[] point, double[] direction) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
differentiateAt
(double x) Computes derivative on current direction of a function at distance x from current point and using current listener and gradient listener.Returns gradient listener that evaluates a multidimensional function gradient.void
setGradientListener
(GradientFunctionEvaluatorListener gradientListener) Sets gradient listener that evaluates a multidimensional function gradient.Methods inherited from class com.irurueta.numerical.DirectionalEvaluator
evaluateAt, getDirection, getListener, getPoint, setListener, setPointAndDirection
-
Field Details
-
gradientListener
Listener to evaluate a multidimensional function's gradient. -
dft
final double[] dftArray containing gradient at point p. This is used internally.
-
-
Constructor Details
-
DirectionalDerivativeEvaluator
public DirectionalDerivativeEvaluator(MultiDimensionFunctionEvaluatorListener listener, GradientFunctionEvaluatorListener gradientListener, double[] point, double[] direction) Constructor.- Parameters:
listener
- Listener to evaluate a multidimensional function.gradientListener
- Listener to evaluate a multidimensional function's gradient.point
- Point used as a reference to determine the function's input parameters along a line.direction
- Vector indicating the direction of the line where the function is evaluated.- Throws:
IllegalArgumentException
- Raised if point and direction don't have the same length.
-
-
Method Details
-
getGradientListener
Returns gradient listener that evaluates a multidimensional function gradient. If the gradient expression is not known (e.g. is not a closed expression), then a GradientEstimator can be used internally in the listener implementation.- Returns:
- Gradient listener.
-
setGradientListener
Sets gradient listener that evaluates a multidimensional function gradient. If the gradient expression is not known (e.g. is not a closed expression), then a GradientEstimator can be used internally in the listener implementation being provided.- Parameters:
gradientListener
- Gradient listener
-
differentiateAt
Computes derivative on current direction of a function at distance x from current point and using current listener and gradient listener.- Parameters:
x
- Distance from current point using current direction where function is being evaluated.- Returns:
- Result of evaluating function.
- Throws:
EvaluationException
- Thrown if function evaluation fails.
-