jhplot.math.exp4j
Class CustomFunction
java.lang.Object
jhplot.math.exp4j.CustomFunction
public abstract class CustomFunction
- extends Object
this classed is used to create custom functions for exp4j
Example
CustomFunction fooFunc = new CustomFunction("foo") {
public double applyFunction(double value) {
return value*Math.E;
}
};
double varX=12d;
Calculable calc = new ExpressionBuilder("foo(x)").withCustomFunction(fooFunc).withVariable("x",varX).build();
assertTrue(calc.calculate() == Math.E * varX);
applyFunction
public abstract double applyFunction(double[] values)
- apply the function to a value
- Parameters:
values - the values to which the function should be applied.
- Returns:
- the function value
getArgumentCount
public int getArgumentCount()
jHepWork 3.2 ©