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 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
-
JxnMultivariateFunction
public JxnMultivariateFunction(KmgFormelInterpreter fi, String cmd)
Constructs aMultivariateFunction
instance 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 offi
is used to executecmd
cmd
- one or more statements separated by ';
'. The commandcmd
must use the arraydouble[] $x
to compute a result of type double. Ifcmd
ends 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:
value
in interfaceMultivariateFunction
-
-