|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.F
Class F is a collection of static methods
that make it easy to create and manipulate functions of one
argument, that is, objects that implement the interface
Function.OneArg. Such function objects must
have a method of the form:
public double evaluate(double x)
This class defines methods that make all functions of one argument in the following packages into objects:
java.lang.Mathedu.neu.ccs.util.MathUtilitiesIn addition, the class defines methods to add, subtract, multiply, divide, and compose functions of one argument.
Finally, some additional useful methods are defined.
Class F cannot be instantiated.
In 2.5.0, made a slight change to the random function and removed the related functional method randomDouble.
| Field Summary | |
static Function.OneArg |
abs
The function x --> abs(x). |
static Function.OneArg |
acos
The function x --> acos(x). |
static Function.OneArg |
acosdeg
The function x --> acosdeg(x). |
static Function.OneArg |
asin
The function x --> asin(x). |
static Function.OneArg |
asindeg
The function x --> asindeg(x). |
static Function.OneArg |
atan
The function x --> atan(x). |
static Function.OneArg |
atandeg
The function x --> atandeg(x). |
static Function.OneArg |
ceil
The function x --> ceil(x). |
static Function.OneArg |
cos
The function x --> cos(x). |
static Function.OneArg |
cosdeg
The function x --> cosdeg(x). |
static Function.OneArg |
exp
The function x --> exp(x). |
static Function.OneArg |
exp10
The function x --> 10-to-the-power-x = exp(x * log(10)). |
static Function.OneArg |
exp2
The function x --> 2-to-the-power-x = exp(x * log(2)). |
static Function.OneArg |
floor
The function x --> floor(x). |
static Function.OneArg |
identity
The identity function x --> x. |
static Function.OneArg |
log
The function x --> log(x). |
static Function.OneArg |
log10
The function x --> log-base-10(x) = log(x) / log(10). |
static Function.OneArg |
log2
The function x --> log-base-2(x) = log(x) / log(2). |
private static double |
logOf10
The constant log(10). |
private static double |
logOf2
The constant log(2). |
static Function.OneArg |
random
The function x --> Math.random() * x. |
static Function.OneArg |
rint
The function x --> rint(x). |
static Function.OneArg |
sin
The function x --> sin(x). |
static Function.OneArg |
sindeg
The function x --> sindeg(x). |
static Function.OneArg |
sqrt
The function x --> sqrt(x). |
static Function.OneArg |
tan
The function x --> tan(x). |
static Function.OneArg |
tandeg
The function x --> tandeg(x). |
static Function.OneArg |
toDegrees
The function x --> toDegrees(x). |
static Function.OneArg |
toRadians
The function x --> toRadians(x). |
| Constructor Summary | |
private |
F()
|
| Method Summary | |
static Function.OneArg |
add(Function.OneArg f,
Function.OneArg g)
The function to add functions f,g: f + g. |
static Function.OneArg |
atan2(Function.OneArg f,
Function.OneArg g)
The function to compute the function atan2(f, g). |
static Function.OneArg |
atan2deg(Function.OneArg f,
Function.OneArg g)
The function to compute the function atan2deg(f, g). |
static Function.OneArg |
aToPowerX(double a)
The function x --> a-to-the-power-x = Math.pow(a, x). |
private static void |
checkNull(String method,
Function.OneArg f)
Check for null function arguments and throw a
NullPointerException if necessary. |
private static void |
checkNull(String method,
Function.OneArg f,
Function.OneArg g)
Check for null function arguments and throw a
NullPointerException if necessary. |
static Function.OneArg |
compose(Function.OneArg f,
Function.OneArg g)
The function to compose functions f,g: x --> f(g(x)). |
static Function.OneArg |
constant(double c)
The constant function x --> c. |
static Function.OneArg |
divide(Function.OneArg f,
Function.OneArg g)
The function to divide functions f,g: f / g. |
static Function.OneArg |
linear(double a,
double b)
The linear function x --> a * x + b. |
static Function.OneArg |
max(Function.OneArg f,
Function.OneArg g)
The function to compute the function max(f, g). |
static Function.OneArg |
min(Function.OneArg f,
Function.OneArg g)
The function to compute the function min(f, g). |
static Function.OneArg |
multiply(Function.OneArg f,
Function.OneArg g)
The function to multiply functions f,g: f * g. |
static Function.OneArg |
pow(double a,
Function.OneArg f)
The function to compute the function a-to-the-power-f = Math.pow(a,f.evaluate(x)). |
static Function.OneArg |
pow(Function.OneArg f,
double a)
The function to compute the function f-to-the-power-a = Math.pow(f.evaluate(x),a). |
static Function.OneArg |
pow(Function.OneArg f,
Function.OneArg g)
The function to compute the function f-to-the-power-g = Math.pow(f.evaluate(x),g.evaluate(x)). |
static Function.OneArg |
power(Function.OneArg f,
int n)
The function to compute the function f-to-the-power-n = MathUtilities.power(f.evaluate(x),n). |
static Function.OneArg |
scale(double a)
The scale function x --> a * x. |
static Function.OneArg |
subtract(Function.OneArg f,
Function.OneArg g)
The function to subtract functions f,g: f - g. |
static Function.OneArg |
translate(double b)
The translate function x --> x + b. |
static Function.OneArg |
xToPowerA(double a)
The function x --> x-to-the-power-a = Math.pow(x, a). |
static Function.OneArg |
xToPowerN(int n)
The function x --> x-to-the-power-n = MathUtilities.power(x,n). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final double logOf2
private static final double logOf10
public static final Function.OneArg identity
public static final Function.OneArg abs
public static final Function.OneArg ceil
public static final Function.OneArg floor
public static final Function.OneArg rint
public static final Function.OneArg sin
public static final Function.OneArg cos
public static final Function.OneArg tan
public static final Function.OneArg asin
public static final Function.OneArg acos
public static final Function.OneArg atan
public static final Function.OneArg sindeg
public static final Function.OneArg cosdeg
public static final Function.OneArg tandeg
public static final Function.OneArg asindeg
public static final Function.OneArg acosdeg
public static final Function.OneArg atandeg
public static final Function.OneArg toDegrees
public static final Function.OneArg toRadians
public static final Function.OneArg exp
public static final Function.OneArg log
public static final Function.OneArg exp2
public static final Function.OneArg log2
public static final Function.OneArg exp10
public static final Function.OneArg log10
public static final Function.OneArg sqrt
public static final Function.OneArg random
The function x --> Math.random() * x.
In effect, returns a random number between 0 and x.
| Constructor Detail |
private F()
| Method Detail |
public static Function.OneArg constant(double c)
c - the constant.public static Function.OneArg scale(double a)
a - the scale.public static Function.OneArg translate(double b)
b - the translate.
public static Function.OneArg linear(double a,
double b)
a - the scale.b - the translate.public static Function.OneArg xToPowerN(int n)
MathUtilities.power(x,n).
public static Function.OneArg xToPowerA(double a)
public static Function.OneArg aToPowerX(double a)
public static Function.OneArg add(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg subtract(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg multiply(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg divide(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg compose(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg min(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg max(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg power(Function.OneArg f,
int n)
MathUtilities.power(f.evaluate(x),n).
public static Function.OneArg pow(Function.OneArg f,
double a)
Math.pow(f.evaluate(x),a).
public static Function.OneArg pow(double a,
Function.OneArg f)
Math.pow(a,f.evaluate(x)).
public static Function.OneArg pow(Function.OneArg f,
Function.OneArg g)
Math.pow(f.evaluate(x),g.evaluate(x)).
public static Function.OneArg atan2(Function.OneArg f,
Function.OneArg g)
public static Function.OneArg atan2deg(Function.OneArg f,
Function.OneArg g)
private static void checkNull(String method,
Function.OneArg f)
null function arguments and throw a
NullPointerException if necessary.
method - the string name of the methodf - the function argument
private static void checkNull(String method,
Function.OneArg f,
Function.OneArg g)
null function arguments and throw a
NullPointerException if necessary.
method - the string name of the methodf - the first function argumentg - the second function argument
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||