Class DirectionalEvaluator

java.lang.Object
com.irurueta.numerical.DirectionalEvaluator
Direct Known Subclasses:
DirectionalDerivativeEvaluator

public class DirectionalEvaluator extends Object
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 Details

    • listener

      Listener to evaluate a multidimensional function.
    • point

      protected double[] point
      Point used as a reference to determine the function's input parameters along a line.
    • direction

      protected double[] direction
      Vector indicating the direction of the line where the function is evaluated.
    • p

      protected final double[] p
      Point 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

      public void setListener(MultiDimensionFunctionEvaluatorListener listener)
      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

      public double evaluateAt(double x) throws EvaluationException
      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