Interface VectorFunction


  • public interface VectorFunction
    A class that defines an n-Dimensional vector function y[] = fn(x[]) (named "function") that can be called by math tools such as root finders. Also defines the derivative of the function. dy[]/dx = d fn(x[])/dx (oddly enough, named "derivative").

    Modified by: Joseph A. Huwaldt

    Version:
    February 23, 2025
    Author:
    Joseph A. Huwaldt Date: July 4, 2010
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void function​(int n, double[] x, double[] y)
      User supplied method that calculates the function y[] = fn(x[]).
      boolean jacobian​(int n, double[] x, double[][] jac)
      User supplied method that calculates the Jacobian of the function.
    • Method Detail

      • function

        void function​(int n,
                      double[] x,
                      double[] y)
               throws RootException
        User supplied method that calculates the function y[] = fn(x[]).
        Parameters:
        n - The number of variables in the x & y arrays.
        x - Independent parameters to the function, passed in as input.
        y - An existing array that is filled in with the outputs of the function
        Throws:
        RootException - if there is a problem computing the function.
      • jacobian

        boolean jacobian​(int n,
                         double[] x,
                         double[][] jac)
        User supplied method that calculates the Jacobian of the function.
        Parameters:
        n - The number of rows and columns in the Jacobian.
        x - Independent parameters to the function, passed in as input.
        jac - The Jacobian array.
        Returns:
        true if the Jacobian was computed by this method, false if it was not.
        Throws:
        RootException - if there is a problem computing the Jacobian.