Package com.irurueta.numerical
Class DirectionalEvaluator
java.lang.Object
com.irurueta.numerical.DirectionalEvaluator
- Direct Known Subclasses:
DirectionalDerivativeEvaluator
This class evaluates a multidimensional function 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 TypeFieldDescriptionprotected double[]
Vector indicating the direction of the line where the function is evaluated.protected MultiDimensionFunctionEvaluatorListener
Listener to evaluate a multidimensional function.protected final double[]
Point currently being evaluated in the multidimensional function.protected double[]
Point used as a reference to determine the function's input parameters along a line. -
Constructor Summary
ConstructorsConstructorDescriptionDirectionalEvaluator
(MultiDimensionFunctionEvaluatorListener listener, double[] point, double[] direction) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
evaluateAt
(double x) Evaluates a function using current listener at a distance x from current point using current directiondouble[]
Returns array indicating the direction of the line where the function is evaluated.Returns listener to evaluate a multidimensional function.double[]
getPoint()
Returns point used as a reference to determine the function's input parameters along a line.void
Sets listener to evaluate a multidimensional function.final void
setPointAndDirection
(double[] point, double[] direction) Sets point used as a reference to determine the function's input parameters along a line and the direction of the line where the function is evaluated.
-
Field Details
-
listener
Listener to evaluate a multidimensional function. -
point
protected double[] pointPoint used as a reference to determine the function's input parameters along a line. -
direction
protected double[] directionVector indicating the direction of the line where the function is evaluated. -
p
protected final double[] pPoint currently being evaluated in the multidimensional function. This is used internally.
-
-
Constructor Details
-
DirectionalEvaluator
public DirectionalEvaluator(MultiDimensionFunctionEvaluatorListener listener, double[] point, double[] direction) Constructor.- Parameters:
listener
- Listener to evaluate a multidimensional function.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
-
getListener
Returns listener to evaluate a multidimensional function.- Returns:
- Listener to evaluate a multidimensional function.
-
setListener
Sets listener to evaluate a multidimensional function.- Parameters:
listener
- Listener to evaluate a multidimensional function.
-
getPoint
public double[] getPoint()Returns point used as a reference to determine the function's input parameters along a line.- Returns:
- Point used as a reference to determine the function's input parameters along a line
-
getDirection
public double[] getDirection()Returns array indicating the direction of the line where the function is evaluated.- Returns:
- Array indicating the direction of the line where the function is evaluated.
-
setPointAndDirection
public final void setPointAndDirection(double[] point, double[] direction) Sets point used as a reference to determine the function's input parameters along a line and the direction of the line where the function is evaluated.- Parameters:
point
- Point used as a reference to determine the function's input parameters along a line.direction
- Array indicating the direction of the line where the function is evaluated.- Throws:
IllegalArgumentException
- Raised if point and direction don't have the same length.
-
evaluateAt
Evaluates a function using current listener at a distance x from current point using current direction- Parameters:
x
- Distance from provided point using provided direction where function is being evaluated- Returns:
- Result of evaluating the function
- Throws:
EvaluationException
- Thrown if function evaluation fails
-