igeo

## Class IPiecewiseFunction

- java.lang.Object
- - igeo.IPiecewiseFunction

- All Implemented Interfaces:
    IFunction
  Direct Known Subclasses:
    IPiecewisePolynomialFunction

      public class IPiecewiseFunction
      extends java.lang.Object
      implements IFunction

  Implementation of piecewise function out of multiple IFunction.
  Author:
    Satoru Sugihara

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `double[]` | `domains`
    `IFunction[]` | `functions`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IPiecewiseFunction()`
    `IPiecewiseFunction(double[] dom)`
    `IPiecewiseFunction(double[] dom, IFunction[] funcs)`
    `IPiecewiseFunction(int numOfInterval)`
    `IPiecewiseFunction(IPiecewiseFunction f)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IPiecewiseFunction` | `dup()`
    `double` | `eval(double x)`
    `int` | `getIndexOfDomain(double x)`
    `static int` | `getIndexOfDomain(double x, double[] domains)`
    `int` | `getNumberOfDomains()`
    `void` | `init(double[] dom)`
    `void` | `init(double[] dom, IFunction[] funcs)`
    `void` | `init(int numOfInterval)`
    `void` | `init(IPiecewiseFunction f)`
    `double` | `lowerBoundOfDomain(int index)`
    `void` | `setDomain(int idx, double dom)`
    `void` | `setFunction(int idx, IFunction f)`
    `double` | `upperBoundOfDomain(int index)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### domains

          public double[] domains

    - #### functions

          public IFunction[] functions

  - ### Constructor Detail

    - #### IPiecewiseFunction

          public IPiecewiseFunction(double[] dom,
                            IFunction[] funcs)

    - #### IPiecewiseFunction

          public IPiecewiseFunction(int numOfInterval)

    - #### IPiecewiseFunction

          public IPiecewiseFunction(double[] dom)

    - #### IPiecewiseFunction

          public IPiecewiseFunction(IPiecewiseFunction f)

    - #### IPiecewiseFunction

          public IPiecewiseFunction()

  - ### Method Detail

    - #### dup

          public IPiecewiseFunction dup()

      Specified by:
        `dup` in interface `IFunction`

    - #### init

          public void init(int numOfInterval)

    - #### init

          public void init(double[] dom,
                  IFunction[] funcs)

    - #### init

          public void init(double[] dom)

    - #### init

          public void init(IPiecewiseFunction f)

    - #### setDomain

          public void setDomain(int idx,
                       double dom)

    - #### setFunction

          public void setFunction(int idx,
                         IFunction f)

    - #### getNumberOfDomains

          public int getNumberOfDomains()

    - #### getIndexOfDomain

          public int getIndexOfDomain(double x)

    - #### getIndexOfDomain

          public static int getIndexOfDomain(double x,
                             double[] domains)

    - #### upperBoundOfDomain

          public double upperBoundOfDomain(int index)

    - #### lowerBoundOfDomain

          public double lowerBoundOfDomain(int index)

    - #### eval

          public double eval(double x)

      Specified by:
        `eval` in interface `IFunction`