public class NumericalDifferentiableFunction extends DifferentiableFunction
. The gradient is computed numerically. Each partial
differentiation is computed by the formula
.| Modifier and Type | Field and Description |
|---|---|
protected double |
eps
The constant used in the computation of the gradient.
|
protected Function |
f
The function to be differentiated numerically
|
| Constructor and Description |
|---|
NumericalDifferentiableFunction(Function f,
double epsilon)
Sets the function and value for epsilon for this
NumericalDifferentiableFunction. |
| Modifier and Type | Method and Description |
|---|---|
double |
evaluateFunction(double[] x)
Evaluates the function at a certain vector (in mathematical sense)
x. |
double[] |
evaluateGradientOfFunction(double[] x)
Evaluates the gradient of a function at a certain vector (in mathematical
sense)
x numerically. |
int |
getDimensionOfScope()
Returns the dimension of the scope of the
Function. |
findOneDimensionalMinprotected double eps
protected Function f
public NumericalDifferentiableFunction(Function f, double epsilon) throws IllegalArgumentException
NumericalDifferentiableFunction.f - the function to be usedepsilon - the epsilon used for the numerical differentiationIllegalArgumentException - if epsilon = 0public double[] evaluateGradientOfFunction(double[] x)
throws DimensionException,
EvaluationException
x numerically.evaluateGradientOfFunction in class DifferentiableFunctionx - the current vectorFunction.getDimensionOfScope()DimensionException - if dim(x) != n, with 
EvaluationException - if there was something wrong during the evaluation of the
gradientDifferentiableFunction.evaluateGradientOfFunction(double[])public double evaluateFunction(double[] x)
throws DimensionException,
EvaluationException
Functionx.x - the current vectorDimensionException - if dim(x) != n, with 
EvaluationException - if there was something wrong during the evaluation of the
function