Class CoordinateTransformedFunc

java.lang.Object
net.algart.math.functions.CoordinateTransformedFunc
All Implemented Interfaces:
Func

public class CoordinateTransformedFunc extends Object implements Func

A function, the arguments of which are transformed by some coordinate transformation operator in n-dimensional Euclidean space. It is built on the base of some parent function f and some coordinate transformation operator O. This function g is the following: g(x) = O g(x) = f(map(x)), x = x0, x1, ..., xn-1, map(x) is the result of applying CoordinateTransformationOperator.map(double[], double[]) method to x array. In other words, the basic get(double[] x) method of this instance is equivalent to the following code:

 double[] y = new double[x.length];
 operator.map(y, x);
 return parent.get(y);
 

This class is immutable and thread-safe: there are no ways to modify settings of the created instance.

Author:
Daniel Alievsky
See Also:
  • Method Details

    • getInstance

      public static Func getInstance(Func parent, CoordinateTransformationOperator operator)
      Returns an instance of this class for the given parent function and operator. (If operator is Operator.IDENTITY or equivalent, this method may return the parent argument.)

      The result is almost always an instance of this class, but there is an exception: if operator is an identity operator, which does not change the passed parent function at all, this method can just return parent argument.

      Parameters:
      parent - the parent function.
      operator - the operator, transforming the arguments of this function before passing them to the parent one.
      Returns:
      new function.
      Throws:
      NullPointerException - if one of the arguments is null.
    • parent

      public Func parent()
      Returns the parent function of this one: the first argument of getInstance method.
      Returns:
      the parent function of this one.
    • operator

      Returns the operator, used while building this transformed function: the second argument of getInstance method.
      Returns:
      the operator, used while building this transformed function.
    • get

      public double get(double... x)
      Description copied from interface: Func
      Returns the result of this function for the given arguments: f(x0, x1, ..., xx.length-1).

      This method must not change the values of x elements!

      Specified by:
      get in interface Func
      Parameters:
      x - the function arguments.
      Returns:
      the function result.
    • get

      public double get()
      Description copied from interface: Func
      Equivalent to get(new double[0]). Provides better performance because it does not require Java array creation.
      Specified by:
      get in interface Func
      Returns:
      the function result.
    • get

      public double get(double x0)
      Description copied from interface: Func
      Equivalent to get(new double[] {x0}). Provides better performance because it does not require Java array creation.
      Specified by:
      get in interface Func
      Parameters:
      x0 - the function argument.
      Returns:
      the function result.
    • get

      public double get(double x0, double x1)
      Description copied from interface: Func
      Equivalent to get(new double[] {x0, x1}). Provides better performance because it does not require Java array creation.
      Specified by:
      get in interface Func
      Parameters:
      x0 - the first function argument.
      x1 - the second function argument.
      Returns:
      the function result.
    • get

      public double get(double x0, double x1, double x2)
      Description copied from interface: Func
      Equivalent to get(new double[] {x0, x1, x2}). Provides better performance because it does not require Java array creation.
      Specified by:
      get in interface Func
      Parameters:
      x0 - the first function argument.
      x1 - the second function argument.
      x2 - the third function argument.
      Returns:
      the function result.
    • get

      public double get(double x0, double x1, double x2, double x3)
      Description copied from interface: Func
      Equivalent to get(new double[] {x0, x1, x2, x3}). Provides better performance because it does not require Java array creation.
      Specified by:
      get in interface Func
      Parameters:
      x0 - the first function argument.
      x1 - the second function argument.
      x2 - the third function argument.
      x3 - the fourth function argument.
      Returns:
      the function result.
    • toString

      public String toString()
      Returns a brief string description of this object.
      Overrides:
      toString in class Object
      Returns:
      a brief string description of this object.