Class LinearFunc.Updatable

java.lang.Object
net.algart.math.functions.LinearFunc
net.algart.math.functions.LinearFunc.Updatable
All Implemented Interfaces:
Func, Func.Updatable
Enclosing class:
LinearFunc

public static class LinearFunc.Updatable extends LinearFunc implements Func.Updatable

Updatable extension of the linear function with one argument.

  • Method Details

    • 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
      Specified by:
      get in class LinearFunc
      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
      Specified by:
      get in class LinearFunc
      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
      Specified by:
      get in class LinearFunc
      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
      Specified by:
      get in class LinearFunc
      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
      Specified by:
      get in class LinearFunc
      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
      Specified by:
      get in class LinearFunc
      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.
    • set

      public void set(double[] x, double newResult)
      Description copied from interface: Func.Updatable
      Correct some of x arguments so that get(x) will be, as possible, equal to newResult. For example, if this is one-argument function f(x), and its inverse function is g(y) (g(f(x))=x), then this method should assign x[0]=g(newResult).

      This method does not guarantee the precise equality get(x)==newResult. (Usually, it is impossible due to limited precision of floating-point calculations.) But this method should try to provide this equality (after its call) with, as possible, maximal possible precision.

      Specified by:
      set in interface Func.Updatable
      Parameters:
      x - the function arguments.
      newResult - the desired function result.