Class JxnMultivariateFunction
- java.lang.Object
-
- JxnMultivariateFunction
-
- All Implemented Interfaces:
MultivariateFunction
public class JxnMultivariateFunction extends Object implements MultivariateFunction
Wrapper used to pass a method definition to Commons Math algorithms. Computes a command given as a String.
See JxnMultivariateFunction_Optimization~Demo.jxn for an example.
-
-
Constructor Summary
Constructors Constructor Description JxnMultivariateFunction(String cmd, KmgFormelInterpreter fi)Deprecated.JxnMultivariateFunction(KmgFormelInterpreter fi, String cmd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringtoString()Returns the commandcmdpassed to the constructor.doublevalue(double[] x)Internally called by Commons Math algorithms: Computes the function value using the given argumentx.
-
-
-
Constructor Detail
-
JxnMultivariateFunction
public JxnMultivariateFunction(KmgFormelInterpreter fi, String cmd)
Constructs aMultivariateFunctioninstance to be used by Commons Math algorithms.
Example:mvf = @JxnMultivariateFunction( $this, "( $x[0]^2 + 2.5 $x[1]^2 - $x[1] ) * Math.exp( 1 - $x[0]^2 - $x[1]^2 );" )- Parameters:
fi- an internal copy offiis used to executecmdcmd- one or more statements separated by ';'. The commandcmdmust use the arraydouble[] $xto compute a result of type double. Ifcmdends with ';', log output of intermediate steps is suppressed.
-
JxnMultivariateFunction
public JxnMultivariateFunction(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:
valuein interfaceMultivariateFunction
-
-