Class RealValuedFunctionThree

java.lang.Object
org.bzdev.math.RealValuedFunctionVA
org.bzdev.math.RealValuedFunctionThree
All Implemented Interfaces:
RealValuedFunctThreeOps, RealValuedFunctVAOps, VADomainOps

public class RealValuedFunctionThree extends RealValuedFunctionVA implements RealValuedFunctThreeOps
Class defining a real-valued function with three real arguments.

This is intended for cases in which a function should be passed as an argument.

A subclass will typically override one or more of the methods valueAt, deriv1At, deriv2At, deriv3At, deriv11At, deriv12At, deriv13At, deriv21At, deriv22At, deriv23At, deriv31At, deriv32At, and deriv33At to provide the values for a function and its first and second partial derivative. For any that are not available, an UnsupportedOperationException will be thrown.

The class also provides scripting-language support. If a Scripting context is named scripting, the following EMCAScript code will implement a function and its derivatives:


     importClass(org.bzdev.RealValuedFunctionThree);
     ....
     // assume ourObject is a Java class with a method setFunction
     // that takes a RealValuedFunctionThree as its argument.
     funct = new RealValuedFunctionThree(scripting,
               {valueAt: function(x,y,z) {return Math.sin(x)*Math.cos(y)*z;},
                deriv1At: function(x,y,z) {return Math.cos(x)*Math.cos(y)*z;},
                deriv2At: function(x,y,z) {
                   return -Math.sin(x)*Math.sin(y)*z;
                },
                deriv3At: function(x,y,z) {return Math.sin(x) * Math.cos(y);},
                deriv11At: function(x,y,z) {
                    return -Math.sin(x) * Math.cos(y) * z;
                },
                deriv12At: function(x,y,z) {
                    return -Math.cos(x) * Math.sin(y) * z;
                },
                deriv13At: function(x,y,z) {return Math.cos(x)*Math.sin(y);},
                deriv21At: function(x,y,z) {
                    return -Math.cos(x) * Math.sin(y) * z;
                },
                deriv22At: function(x,y,z) {
                    return -Math.sin(x) * Math.cos(y) * z;}
                deriv23At: function(x,y,z) {
                    return -Math.sin(x) * Math.sin(y);
                }
                deriv31At: function(x,y,z) {
                    return Math.cos(x) * Math.cos(y);
                },
                deriv32At: function(x,y,z) {
                    return -Math.sin(x) * Math.sin(y);
                },
                deriv33At: function(x,y,z) {return 0.0;}
               };
     ourObject.setFunction(funct);
 
Alternatively, one may use the following code where the functions defining the derivatives are provided by name:

     importClass(org.bzdev.RealValuedFunctionThree);
     ...
     function f(x,y,z) {return Math.sin(x) * Math.cos(y) * z;}
     function f1(x,y,z) {return Math.cos(x) * Math.cos(y) * z;}
     function f2(x,y,z) {return -Math.sin(x) * Math.sin(y) * z;}
     function f3(x,y,z) {return Math.sin(x) * Math.cos(y);}
     function f11(x,y,z) {return -Math.sin(x) * Math.cos(y) * z;}
     function f12(x,y,z) {return  -Math.cos(x) * Math.sin(y) * z;}
     function f13(x,y,z) {return  Math.cos(x) * Math.cos(y);}
     function f21(x,y,z) {return -Math.cos(x) * Math.sin(y) * z;}
     function f22(x,y,z) {return -Math.sin(x) * Math.cos(y) * z;}
     function f23(x,y,z) {return -Math.sin(x) * Math.sin(y);}
     function f31(x,y,z) {return Math.cos(x) * Math.cos(y)}
     function f32(x,y,z) {return  -Math.sin(x) * Math.sin(y);}
     function f33(x,y,z) {return  0.0;}
     ...
     // assume ourObject is a Java class with a method setFunction
     // that takes a RealValuedFunction as its argument.
     funct = new RealValuedFunction(scripting, "f", "f1", "f2", "f3"
                                      "f11", "f12", "f13", 
                                      "f21", "f22", "f23",
                                      "f31", "f32", "f33");
     ourObject.setFunction(funct);
 
  • Constructor Details

    • RealValuedFunctionThree

      public RealValuedFunctionThree()
      Constructor.
    • RealValuedFunctionThree

      public RealValuedFunctionThree(RealValuedFunctThreeOps function)
      Constructor given a function. The argument implements RealValuedFunctThreeOps and can be a lambda expression with three arguments. The interface RealValuedFunctThreeOps provides a single method: RealValuedFunctThreeOps.valueAt(double,double,double) that, when called, provides the function's value.
      Parameters:
      function - the function
    • RealValuedFunctionThree

      public RealValuedFunctionThree(RealValuedFunctThreeOps function, RealValuedFunctThreeOps function1, RealValuedFunctThreeOps function2, RealValuedFunctThreeOps function3)
      Constructor given a function and its first partial derivatives. The arguments implement RealValuedFunctThreeOps and can be a lambda expression with three arguments. The interface RealValuedFunctThreeOps provides a single method: RealValuedFunctThreeOps.valueAt(double,double,double) that, when called, provides the function's value.
      Parameters:
      function - the function; null if not provided
      function1 - the function that provides the value for the deriv1At(double,double,double); null if this partial derivative is not defined.
      function2 - the function that provides the value for the deriv2At(double,double,double); null if this partial derivative is not defined.
      function3 - the function that provides the value for the deriv3At(double,double,double); null if this partial derivative is not defined.
    • RealValuedFunctionThree

      public RealValuedFunctionThree(RealValuedFunctThreeOps function, RealValuedFunctThreeOps function1, RealValuedFunctThreeOps function2, RealValuedFunctThreeOps function3, RealValuedFunctThreeOps function11, RealValuedFunctThreeOps function12, RealValuedFunctThreeOps function13, RealValuedFunctThreeOps function21, RealValuedFunctThreeOps function22, RealValuedFunctThreeOps function23, RealValuedFunctThreeOps function31, RealValuedFunctThreeOps function32, RealValuedFunctThreeOps function33)
      Constructor given a function and its first and second partial derivatives. The arguments implement RealValuedFunctThreeOps and can be a lambda expression with three arguments. The interface RealValuedFunctThreeOps provides a single method: RealValuedFunctThreeOps.valueAt(double,double,double) that, when called, provides the function's value.
      Parameters:
      function - the function; null if not provided
      function1 - the function that provides the value for the deriv1At(double,double,double); null if this partial derivative is not defined.
      function2 - the function that provides the value for the deriv2At(double,double,double); null if this partial derivative is not defined.
      function3 - the function that provides the value for the deriv3At(double,double,double); null if this partial derivative is not defined.
      function11 - the function that provides the value for the deriv11At(double,double,double); null if this partial derivative is not defined.
      function12 - the function that provides the value for the deriv21At(double,double,double); null if this partial derivative is not defined.
      function13 - the function that provides the value for the deriv13At(double,double,double); null if this partial derivative is not defined.
      function21 - the function that provides the value for the deriv21At(double,double,double); null if this partial derivative is not defined.
      function22 - the function that provides the value for the deriv22At(double,double,double); null if this partial derivative is not defined.
      function23 - the function that provides the value for the deriv23At(double,double,double); null if this partial derivative is not defined.
      function31 - the function that provides the value for the deriv31At(double,double,double); null if this partial derivative is not defined.
      function32 - the function that provides the value for the deriv32At(double,double,double); null if this partial derivative is not defined.
      function33 - the function that provides the value for the deriv33At(double,double,double); null if this partial derivative is not defined.
    • RealValuedFunctionThree

      public RealValuedFunctionThree(ScriptingContext scriptingContext, Object object)
      Constructor when the function is provided by a script object. The parameter 'object' is expected to be either an instance of RealValuedFunctionThree or an object defined by a scripting language with methods named "valueAt", "deriv1At" "deriv2At", "deriv11At", "deriv12At", deriv21At", and "deriv22At". Each of these methods takes two arguments, both real numbers, and returns a number. For a real-valued function f(x1,x2), these methods are defined as follows:
      • valueAt returns f(x1,x2).
      • deriv1At returns $\frac{\partial f}{\partial x_1}$ evaluated at the point (x1,x2,x3).
      • deriv2At returns $\frac{\partial f}{\partial x_2}$ evaluated at the point (x1,x2,x3).
      • deriv3At returns $\frac{\partial f}{\partial x_3}$ evaluated at the point (x1,x2,x3).
      • deriv11At returns $\frac{\partial^2 f}{\partial x_1^2}$ evaluated at the point (x1,x2,x3).
      • deriv12At returns $\frac{\partial^2 f}{\partial x_1 \partial x_2}$ evaluated at the point (x1,x2,x3).
      • deriv13At returns $\frac{\partial^2 f}{\partial x_1 \partial x_3}$ evaluated at the point (x1,x2,x3).
      • deriv21At returns $\frac{\partial^2 f}{\partial x_2 \partial x_1}$ evaluated at the point (x1,x2).
      • deriv22At returns $\frac{\partial^2 f}{\partial x_2^2}$ evaluated at the point (x1,x2,x3).
      • deriv23At returns $\frac{\partial^2 f}{\partial x_2 \partial x_3}$ evaluated at the point (x1,x2,x3).
      • deriv31At returns $\frac{\partial^2 f}{\partial x_3 \partial x_1}$ evaluated at the point (x1,x2,x3).
      • deriv32At returns $\frac{\partial^2 f}{\partial x_3 \partial x_2}$ evaluated at the point (x1,x2,x3).
      • deriv33At returns $\frac{\partial^2 f}{\partial x_3^2}$ evaluated at the point (x1,x2,x3).
      Parameters:
      scriptingContext - the scripting context
      object - an object from a scripting environment defining the methods defined above or a subset of those methods
    • RealValuedFunctionThree

      public RealValuedFunctionThree(ScriptingContext scriptingContext, String fname, String f1name, String f2name, String f3name)
      Constructor when the function and its first derivatives are provided by functions defined in scripts. The script functions are expected to define up to three functions, and their names are used as the arguments for this method.
      Parameters:
      scriptingContext - the scripting context
      fname - the name of a scripting-language function of three arguments; null if the valueAt method is not supported
      f1name - the name of a scripting-language function of three arguments providing the desired function's first derivative with respect to the first argument; null if the deriv1At method is not supported
      f2name - the name of a scripting-language function of three arguments providing the desired function's first derivative with respect to the second argument; null if the deriv2At method is not supported
      f3name - the name of a scripting-language function of three arguments providing the desired function's first derivative with respect to the third argument; null if the deriv3At method is not supported
    • RealValuedFunctionThree

      public RealValuedFunctionThree(ScriptingContext scriptingContext, String fname, String f1name, String f2name, String f3name, String f11name, String f12name, String f13name, String f21name, String f22name, String f23name, String f31name, String f32name, String f33name)
      Constructor when the function and its first and second derivatives are provided by functions defined in scripts. The script functions are expected to define up to three functions, and their names are used as the arguments for this method.
      Parameters:
      scriptingContext - the scripting context
      fname - the name of a scripting-language function of three arguments; null if the valueAt method is not supported
      f1name - the name of a scripting-language function of three arguments providing the desired function's first derivative with respect to the first argument; null if the deriv1At method is not supported
      f2name - the name of a scripting-language function of three arguments providing the desired function's first derivative with respect to the second argument; null if the deriv2At method is not supported
      f3name - the name of a scripting-language function of three arguments providing the desired function's first derivative with respect to the third argument; null if the deriv3At method is not supported
      f11name - the name of the scripting-language function of three arguments providing the value for deriv11At(double,double,double).
      f12name - the name of the scripting-language function of three arguments providing the value for deriv12At(double,double,double).
      f13name - the name of the scripting-language function of three arguments providing the value for deriv13At(double,double,double).
      f21name - the name of the scripting-language function of three arguments providing the value for deriv21At(double,double,double).
      f22name - the name of the scripting-language function of three arguments providing the value for deriv22At(double,double,double).
      f23name - the name of the scripting-language function of three arguments providing the value for deriv23At(double,double,double).
      f31name - the name of the scripting-language function of three arguments providing the value for deriv31At(double,double,double).
      f32name - the name of the scripting-language function of three arguments providing the value for deriv32At(double,double,double).
      f33name - the name of the scripting-language function of three arguments providing the value for deriv33At(double,double,double).
  • Method Details

    • getDomainMin

      public final double getDomainMin(int i) throws IllegalArgumentException, IllegalStateException
      Description copied from class: RealValuedFunctionVA
      Get the greatest lower bound of the ith argument when the arguments are in the domain of the function. The implementation will either return the most negative double-precision number or the result of calling a method named getDomainMin (with the same arguments as this method) provided by an object created by a scripting language. If an object created via a scripting language is not passed to a constructor, and a different value is appropriate, this method should be overridden.
      Specified by:
      getDomainMin in interface VADomainOps
      Overrides:
      getDomainMin in class RealValuedFunctionVA
      Parameters:
      i - the index determining the argument for which this method applies (0th, 1st, ...)
      Returns:
      the minimum value
      Throws:
      IllegalArgumentException - the argument is out of range
      IllegalStateException - the function was not fully initialized.
    • getDomainMax

      public final double getDomainMax(int i) throws IllegalArgumentException, IllegalStateException
      Description copied from class: RealValuedFunctionVA
      Get the least upper bound of the ith argument when the arguments are in the domain of the function. The implementation will either return the largest double-precision number or the result of calling a method named getDomainMax (with the same arguments as this method) provided by an object created by a scripting language. If an object created via a scripting language is not passed to a constructor, and a different value is appropriate, this method should be overridden.
      Specified by:
      getDomainMax in interface VADomainOps
      Overrides:
      getDomainMax in class RealValuedFunctionVA
      Parameters:
      i - the index determining the argument for which this method applies (0th, 1st, ...)
      Returns:
      the maximum value
      Throws:
      IllegalArgumentException - the argument is out of range
      IllegalStateException - the function was not fully initialized.
    • domainMinClosed

      public final boolean domainMinClosed(int i) throws IllegalArgumentException, IllegalStateException
      Description copied from class: RealValuedFunctionVA
      Determine if the domain minimum for the ith argument, when the arguments are in the domain of the function, is in the function's domain. The implementation will either return true or the result of calling a method named getDomainMinClosed (with the same arguments as this method) provided by an object created by a scripting language. If an object created via a scripting language is not passed to a constructor, and a different value is appropriate, this method should be overridden.
      Specified by:
      domainMinClosed in interface VADomainOps
      Overrides:
      domainMinClosed in class RealValuedFunctionVA
      Parameters:
      i - the index determining the argument for which this method applies (0th, 1st, ...)
      Returns:
      true if the domain minimum is in the domain; false if it is the greatest lower bound for the domain
      Throws:
      IllegalArgumentException - the argument is out of range
      IllegalStateException - the function was not fully initialized.
    • domainMaxClosed

      public final boolean domainMaxClosed(int i) throws IllegalArgumentException, IllegalStateException
      Description copied from class: RealValuedFunctionVA
      Determine if the domain maximum for the ith argument, when the arguments are in the domain of the function, is in the function's domain. The implementation will either return true or the result of calling a method named getDomainMaxClosed (with the same arguments as this method) provided by an object created by a scripting language. If an object created via a scripting language is not passed to a constructor, and a different value is appropriate, this method should be overridden.
      Specified by:
      domainMaxClosed in interface VADomainOps
      Overrides:
      domainMaxClosed in class RealValuedFunctionVA
      Parameters:
      i - the index determining the argument for which this method applies (0th, 1st, ...)
      Returns:
      true if the domain maximum is in the domain; false if it is the least upper bound for the domain
      Throws:
      IllegalArgumentException - the argument is out of range
      IllegalStateException - the function was not fully initialized.
    • getDomainMin1

      public double getDomainMin1() throws IllegalStateException
      Get the minimum value of the first argument in the domain of the function.
      Returns:
      the minimum value
      Throws:
      IllegalStateException - the function was not fully initialized.
    • getDomainMax1

      public double getDomainMax1() throws IllegalStateException
      Get the maximum value of the first argument in the domain of the function.
      Returns:
      the maximum value
      Throws:
      IllegalStateException - the function was not fully initialized.
    • getDomainMin2

      public double getDomainMin2() throws IllegalStateException
      Get the minimum value of the second argument in the domain of the function.
      Returns:
      the minimum value
      Throws:
      IllegalStateException - the function was not fully initialized.
    • getDomainMax2

      public double getDomainMax2() throws IllegalStateException
      Get the maximum value of the second argument in the domain of the function.
      Returns:
      the maximum value
      Throws:
      IllegalStateException - the function was not fully initialized.
    • getDomainMin3

      public double getDomainMin3() throws IllegalStateException
      Get the minimum value of the third argument in the domain of the function.
      Returns:
      the minimum value
      Throws:
      IllegalStateException - the function was not fully initialized.
    • getDomainMax3

      public double getDomainMax3() throws IllegalStateException
      Get the maximum value of the third argument in the domain of the function.
      Returns:
      the maximum value
      Throws:
      IllegalStateException - the function was not fully initialized.
    • domainMin1Closed

      public boolean domainMin1Closed() throws IllegalStateException
      Determine if the domain minimum for the first argument is in the domain.
      Returns:
      true if the domain minimum is in the domain; false if it is the greatest lower bound for the domain
      Throws:
      IllegalStateException - the function was not fully initialized.
    • domainMax1Closed

      public boolean domainMax1Closed() throws IllegalStateException
      Determine if the domain maximum for the first argument is in the domain.
      Returns:
      true if the domain maximum is in the domain; false if it is the least upper bound for the domain
      Throws:
      IllegalStateException - the function was not fully initialized.
    • domainMin2Closed

      public boolean domainMin2Closed() throws IllegalStateException
      Determine if the domain minimum for the second argument is in the domain.
      Returns:
      true if the domain minimum is in the domain; false if it is the greatest lower bound for the domain
      Throws:
      IllegalStateException - the function was not fully initialized.
    • domainMax2Closed

      public boolean domainMax2Closed() throws IllegalStateException
      Determine if the domain maximum for the second argument is in the domain.
      Returns:
      true if the domain maximum is in the domain; false if it is the least upper bound for the domain
      Throws:
      IllegalStateException - the function was not fully initialized.
    • domainMin3Closed

      public boolean domainMin3Closed() throws IllegalStateException
      Determine if the domain minimum for the third argument is in the domain.
      Returns:
      true if the domain minimum is in the domain; false if it is the greatest lower bound for the domain
      Throws:
      IllegalStateException - the function was not fully initialized.
    • domainMax3Closed

      public boolean domainMax3Closed() throws IllegalStateException
      Determine if the domain maximum for the third argument is in the domain.
      Returns:
      true if the domain maximum is in the domain; false if it is the least upper bound for the domain
      Throws:
      IllegalStateException - the function was not fully initialized.
    • isInDomain

      public final boolean isInDomain(double... args) throws UnsupportedOperationException, IllegalArgumentException, IllegalStateException
      Description copied from class: RealValuedFunctionVA
      Determine if a point is within the domain of this function.

      The default behavior of this method assumes the domain is a rectangular region and uses the methods RealValuedFunctionVA.getDomainMin(int), RealValuedFunctionVA.getDomainMax(int), RealValuedFunctionVA.domainMinClosed(int), RealValuedFunctionVA.domainMaxClosed(int), to determine if the arguments represent a point in the functions domain. If the domain is not rectangular with each side either in or not in the domain, then this method must be overridden. If it is not possible with a reasonable amount of computation to determine that a point is in the domain, an UnsupportedOperationException may be thrown. If this exception is thrown, it should be thrown regardless of the arguments.

      Specified by:
      isInDomain in interface VADomainOps
      Overrides:
      isInDomain in class RealValuedFunctionVA
      Parameters:
      args - the arguments (x0,x1,...) giving the coordinates of a point
      Returns:
      true if the point (x0,x1,...) is in this function's domain; false otherwise
      Throws:
      UnsupportedOperationException - domain membership could not be determined.
      IllegalArgumentException - an argument is out of range
      IllegalStateException - the function was not fully initialized.
    • isInDomain

      public boolean isInDomain(double x, double y, double z) throws UnsupportedOperationException, IllegalStateException
      Determine if a point (x, y) is within the domain of a real-valued function of two arguments.

      The default behavior of this method assumes the domain is a rectangular region and uses the methods getDomainMin1(), getDomainMin2(), getDomainMax1(), getDomainMax2() domainMin1Closed(), domainMin2Closed(), domainMax1Closed(), and domainMax2Closed() to determine if the arguments represent a point in the functions domain. If the domain is not rectangular with each side either in or not in the domain, then this method must be overridden. If it is not possible with a reasonable amount of computation to determine that a point is in the domain, an UnsupportedOperationException may be thrown. If this exception is thrown, it should be thrown regardless of the arguments.

      Parameters:
      x - the 1st coordinate
      y - the 2nd coordinate
      z - the 3rd coordinate
      Returns:
      true if the point (x, y) is in this function's domain; false otherwise
      Throws:
      UnsupportedOperationException - domain membership could not be determined.
      IllegalStateException
    • valueAt

      public final double valueAt(double... args) throws IllegalArgumentException, UnsupportedOperationException
      Description copied from class: RealValuedFunctionVA
      Call the function.
      Specified by:
      valueAt in interface RealValuedFunctThreeOps
      Specified by:
      valueAt in interface RealValuedFunctVAOps
      Overrides:
      valueAt in class RealValuedFunctionVA
      Parameters:
      args - the function's arguments
      Returns:
      the value of the function for the given arguments
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
    • valueAt

      public double valueAt(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Call the function.
      Specified by:
      valueAt in interface RealValuedFunctThreeOps
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the function for the given arguments
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv

      public final RealValuedFunctThreeOps deriv(int i)
      Get a function that computes the value of partial derivative that would be computed by calling derivAt(int,double...).
      Parameters:
      i - the index of the argument (0 for the first argument, 1 for the second, etc.)
      Returns:
      the function
    • derivAt

      public final double derivAt(int i, double... args) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial f}{\partial x_i}$ for a function f(x0,x1, ...).

      This method calls a method named deriv<i+1>At(...) where i is the value of the first argument. One should usually override those methods instead of this one.

      Overrides:
      derivAt in class RealValuedFunctionVA
      Parameters:
      i - the index indicating that the partial derivative is computed for the ith argument, numbered from zero
      args - the function f's arguments
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv1

      public RealValuedFunctThreeOps deriv1()
      Get a function computing $\frac{\partial f}{\partial x_1}$.
      Returns:
      a function that computes $\frac{\partial f}{\partial x_1}$ where f is this real-valued function
    • deriv1At

      public double deriv1At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial f}{\partial x_1}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv2

      public RealValuedFunctThreeOps deriv2()
      Get a function computing $\frac{\partial f}{\partial x_2}$.
      Returns:
      a function that computes $\frac{\partial f}{\partial x_2}$ where f is this real-valued function
    • deriv2At

      public double deriv2At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial f}{\partial x_2}$ for a function f(x2x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv3

      public RealValuedFunctThreeOps deriv3()
      Get a function computing $\frac{\partial f}{\partial x_3}$.
      Returns:
      a function that computes $\frac{\partial f}{\partial x_3}$ where f is this real-valued function
    • deriv3At

      public double deriv3At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException
      Evaluate the partial derivative $\frac{\partial f}{\partial x_3}$ for the function f(x1,x2,x3).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
    • secondDeriv

      public final RealValuedFunctThreeOps secondDeriv(int i, int j)
      Get a function that computes the value of partial derivative that would be computed by calling secondDerivAt(int,int,double...).
      Parameters:
      i - the argument index for the first derivative
      j - the argument index for the second derivative
      Returns:
      the function
    • secondDerivAt

      public final double secondDerivAt(int i, int j, double... args) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_i \partial z_j}$ for a function f(x0,x1, ...).

      This method calls a method named deriv<i+1><j+1>At(...) where i and j are the values of the first two arguments. One should usually override those methods instead of this one.

      Overrides:
      secondDerivAt in class RealValuedFunctionVA
      Parameters:
      i - the index indicating that the partial derivative is computed for the ith argument, numbered from 0
      j - the index indicating that the partial derivative is computed for the jth argument, numbered from 0
      args - the function f's arguments
      Returns:
      the value of the partial derivative $\frac{\partial^2 f}{\partial x_i \partial z_j}$ for the given arguments x0, x1, ...
      Throws:
      IllegalArgumentException - the function's arguments were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv11

      public RealValuedFunctThreeOps deriv11()
      Get a function that computes $\frac{\partial^2 f}{\partial x_1^2}$ where f is this function.
      Returns:
      a function that computes $\frac{\partial^2 f}{\partial x_1^2}$
    • deriv11At

      public double deriv11At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_1^2}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv12

      public RealValuedFunctThreeOps deriv12()
      Get a function that computes $\frac{\partial^2 f}{\partial x_1 \partial x_2}$ where f is this function.
      Returns:
      a function that computes $\frac{\partial^2 f}{\partial x_1 \partial x_2}$ where f is this function. ∂2f / (∂x1 ∂x2)
    • deriv12At

      public double deriv12At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_1 \partial x_2}$ where f is this function. * ∂2f / (∂x1 ∂x2) for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv13

      public RealValuedFunctThreeOps deriv13()
      Get a function that computes $\frac{\partial^2 f}{\partial x_1 \partial x_3}$ where f is this function.
      Returns:
      a function that computes $\frac{\partial^2 f}{\partial x_1 \partial x_3}$
    • deriv13At

      public double deriv13At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_1 \partial x_3}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv21

      public RealValuedFunctThreeOps deriv21()
      Get a function that computes $\frac{\partial^2 f}{\partial x_2 \partial x_1}$ where f is this function.
      Returns:
      a function that computes $\frac{\partial^2 f}{\partial x_2 \partial x_1}$
    • deriv21At

      public double deriv21At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_2 \partial x_1}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv22

      public RealValuedFunctThreeOps deriv22()
      Get a function that computes $\frac{\partial^2 f}{\partial x_2^2}$ where f is this function.
      Returns:
      a function that computes ∂2f / ∂x22
    • deriv22At

      public double deriv22At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_2^2}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv23

      public RealValuedFunctThreeOps deriv23()
      Get a function that computes $\frac{\partial^2 f}{\partial x_2 \partial x_3}$ where f is this function.
      Returns:
      a function that computes ∂2f / ∂x23
    • deriv23At

      public double deriv23At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_2 \partial x_3}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv31

      public RealValuedFunctThreeOps deriv31()
      Get a function that computes $\frac{\partial^2 f}{\partial x_3 \partial x_1}$ where f is this function.
      Returns:
      a function that computes ∂2f / ∂x31
    • deriv31At

      public double deriv31At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_3 \partial x_1}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv32

      public RealValuedFunctThreeOps deriv32()
      Get a function that computes $\frac{\partial^2 f}{\partial x_3 \partial x_2}$ where f is this function.
      Returns:
      a function that computes $\frac{\partial^2 f}{\partial x_3 \partial x_2}$
    • deriv32At

      public double deriv32At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_3 \partial x_2}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.
    • deriv33

      public RealValuedFunctThreeOps deriv33()
      Get a function that computes $\frac{\partial^2 f}{\partial x_3^2}$ where f is this function.
      Returns:
      a function that computes $\frac{\partial^2 f}{\partial x_3^2}$
    • deriv33At

      public double deriv33At(double arg1, double arg2, double arg3) throws IllegalArgumentException, UnsupportedOperationException, IllegalStateException
      Evaluate the partial derivative $\frac{\partial^2 f}{\partial x_3^2}$ for a function f(x1x2).
      Parameters:
      arg1 - the function's first argument
      arg2 - the function's second argument
      arg3 - the function's third argument
      Returns:
      the value of the partial derivative for the given argument
      Throws:
      IllegalArgumentException - the function's argument(s) were out of range
      UnsupportedOperationException - the operation is not supported.
      IllegalStateException - the function was not fully initialized.