jhplot.math.exp4j
Class CustomFunction

java.lang.Object
  extended by 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);
 


Method Summary
abstract  double applyFunction(double[] values)
          apply the function to a value
 int getArgumentCount()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 ©