edu.neu.ccs
Class FC

java.lang.Object
  extended byedu.neu.ccs.FC

public class FC
extends Object

Class FC is a collection of static methods that make it easy to create and manipulate complex functions of one argument, that is, objects that implement the interface FunctionComplex.OneArg. Such function objects must have a method of the form:

public XComplex evaluate(XComplex x)

Class FC cannot be instantiated.

Since:
2.4.0
Version:
2.4.0

Field Summary
static FunctionComplex.OneArg exp
          The function x --> exp(x).
static FunctionComplex.OneArg identity
          The identity function x --> x.
static FunctionComplex.OneArg log
          The function x --> log(x).
static FunctionComplex.OneArg sqrt
          The function x --> sqrt(x).
 
Constructor Summary
private FC()
           
 
Method Summary
static FunctionComplex.OneArg add(FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          The function to add functions f,g: f + g.
static FunctionComplex.OneArg aToPowerX(XComplex a)
          The function x --> a-to-the-power-x = XComplex.generalPower(a,x).
private static void checkNull(String method, FunctionComplex.OneArg f)
          Check for null function arguments and throw a NullPointerException if necessary.
private static void checkNull(String method, FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          Check for null function arguments and throw a NullPointerException if necessary.
static FunctionComplex.OneArg compose(FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          The function to compose functions f,g: x --> f(g(x)).
static FunctionComplex.OneArg constant(XComplex c)
          The constant function x --> c.
static FunctionComplex.OneArg divide(FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          The function to divide functions f,g: f / g.
static FunctionComplex.OneArg generalPower(FunctionComplex.OneArg f, double d)
          The function to compute the function f-to-the-power-d.
static FunctionComplex.OneArg generalPower(FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          The function to compute the function f-to-the-power-g.
static FunctionComplex.OneArg generalPower(FunctionComplex.OneArg f, XComplex z)
          The function to compute the function f-to-the-power-z.
static FunctionComplex.OneArg generalPower(XComplex z, FunctionComplex.OneArg f)
          The function to compute the function z-to-the-power-f.
static FunctionComplex.OneArg linear(XComplex a, XComplex b)
          The linear function x --> a * x + b.
static FunctionComplex.OneArg multiply(FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          The function to multiply functions f,g: f * g.
static FunctionComplex.OneArg power(FunctionComplex.OneArg f, int n)
          The function to compute the function f-to-the-power-n.
static FunctionComplex.OneArg scale(XComplex a)
          The scale function x --> a * x.
static FunctionComplex.OneArg subtract(FunctionComplex.OneArg f, FunctionComplex.OneArg g)
          The function to subtract functions f,g: f - g.
static FunctionComplex.OneArg translate(XComplex b)
          The translate function x --> x + b.
static FunctionComplex.OneArg xToPowerA(XComplex a)
          The function x --> x-to-the-power-a = XComplex.generalPower(x,a).
static FunctionComplex.OneArg xToPowerN(int n)
          The function x --> x-to-the-power-n = XComplex.power(x,n).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identity

public static final FunctionComplex.OneArg identity
The identity function x --> x.


exp

public static final FunctionComplex.OneArg exp
The function x --> exp(x).


log

public static final FunctionComplex.OneArg log
The function x --> log(x).


sqrt

public static final FunctionComplex.OneArg sqrt
The function x --> sqrt(x).

Constructor Detail

FC

private FC()
Method Detail

constant

public static FunctionComplex.OneArg constant(XComplex c)
The constant function x --> c.

Parameters:
c - the constant.

scale

public static FunctionComplex.OneArg scale(XComplex a)
The scale function x --> a * x.

Parameters:
a - the scale.

translate

public static FunctionComplex.OneArg translate(XComplex b)
The translate function x --> x + b.

Parameters:
b - the translate.

linear

public static FunctionComplex.OneArg linear(XComplex a,
                                            XComplex b)
The linear function x --> a * x + b.

Parameters:
a - the scale.
b - the translate.

xToPowerN

public static FunctionComplex.OneArg xToPowerN(int n)
The function x --> x-to-the-power-n = XComplex.power(x,n).


xToPowerA

public static FunctionComplex.OneArg xToPowerA(XComplex a)
The function x --> x-to-the-power-a = XComplex.generalPower(x,a).


aToPowerX

public static FunctionComplex.OneArg aToPowerX(XComplex a)
The function x --> a-to-the-power-x = XComplex.generalPower(a,x).


add

public static FunctionComplex.OneArg add(FunctionComplex.OneArg f,
                                         FunctionComplex.OneArg g)
The function to add functions f,g: f + g.


subtract

public static FunctionComplex.OneArg subtract(FunctionComplex.OneArg f,
                                              FunctionComplex.OneArg g)
The function to subtract functions f,g: f - g.


multiply

public static FunctionComplex.OneArg multiply(FunctionComplex.OneArg f,
                                              FunctionComplex.OneArg g)
The function to multiply functions f,g: f * g.


divide

public static FunctionComplex.OneArg divide(FunctionComplex.OneArg f,
                                            FunctionComplex.OneArg g)
The function to divide functions f,g: f / g.


compose

public static FunctionComplex.OneArg compose(FunctionComplex.OneArg f,
                                             FunctionComplex.OneArg g)
The function to compose functions f,g: x --> f(g(x)).


power

public static FunctionComplex.OneArg power(FunctionComplex.OneArg f,
                                           int n)
The function to compute the function f-to-the-power-n.


generalPower

public static FunctionComplex.OneArg generalPower(FunctionComplex.OneArg f,
                                                  double d)
The function to compute the function f-to-the-power-d.


generalPower

public static FunctionComplex.OneArg generalPower(FunctionComplex.OneArg f,
                                                  XComplex z)
The function to compute the function f-to-the-power-z.


generalPower

public static FunctionComplex.OneArg generalPower(XComplex z,
                                                  FunctionComplex.OneArg f)
The function to compute the function z-to-the-power-f.


generalPower

public static FunctionComplex.OneArg generalPower(FunctionComplex.OneArg f,
                                                  FunctionComplex.OneArg g)
The function to compute the function f-to-the-power-g.


checkNull

private static void checkNull(String method,
                              FunctionComplex.OneArg f)
Check for null function arguments and throw a NullPointerException if necessary.

Parameters:
method - the string name of the method
f - the function argument

checkNull

private static void checkNull(String method,
                              FunctionComplex.OneArg f,
                              FunctionComplex.OneArg g)
Check for null function arguments and throw a NullPointerException if necessary.

Parameters:
method - the string name of the method
f - the first function argument
g - the second function argument