Class JxnUnivariateFunction
- java.lang.Object
-
- JxnUnivariateFunction
-
- All Implemented Interfaces:
UnivariateFunction
public class JxnUnivariateFunction extends Object implements UnivariateFunction
Wrapper used to pass a method definition to Commons Math algorithms. Computes a command given as a String.
See JxnUnivariateFunction_SolverOptimizer~Demo.jxn for examples.
-
-
Constructor Summary
Constructors Constructor Description JxnUnivariateFunction(String cmd, KmgFormelInterpreter fi)
Deprecated.JxnUnivariateFunction(KmgFormelInterpreter fi, String cmd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toString()
Returns the commandcmd
passed to the constructor.double
value(double x)
Internally called by Commons Math algorithms: Computes the function value using the given argumentx
.
-
-
-
Constructor Detail
-
JxnUnivariateFunction
public JxnUnivariateFunction(KmgFormelInterpreter fi, String cmd)
Constructs anUnivariateFunction
instance to be used by Commons Math algorithms.
Example:uvf = @JxnUnivariateFunction( $this, "Math.sin $x;" )
- Parameters:
fi
- an internal copy offi
is used to executecmd
cmd
- one or more statements separated by ';
'. The commandcmd
must use the variable double$x
to compute a result of type double. Ifcmd
ends with ';
', log output of intermediate steps is suppressed.
-
JxnUnivariateFunction
public JxnUnivariateFunction(String cmd, KmgFormelInterpreter fi)
Deprecated.
-
-
Method Detail
-
value
public double value(double x)
Internally called by Commons Math algorithms: Computes the function value using the given argumentx
.- Specified by:
value
in interfaceUnivariateFunction
-
-