public abstract class OneDimensionalFunction extends Object implements Function
Function
for an one-dimensional
function.Constructor and Description |
---|
OneDimensionalFunction() |
Modifier and Type | Method and Description |
---|---|
abstract double |
evaluateFunction(double x)
Evaluates the function at position
x . |
double |
evaluateFunction(double[] x)
Evaluates the function at a certain vector (in mathematical sense)
x . |
double[] |
findMin(double lower,
double fLower,
double eps,
double startDistance)
This method returns a minimum
x and the value
f(x) , starting the search at lower . |
int |
getDimensionOfScope()
Returns the dimension of the scope of the
Function . |
public double evaluateFunction(double[] x) throws DimensionException, EvaluationException
Function
x
.evaluateFunction
in interface Function
x
- the current vectorDimensionException
- if dim(x) != n
, with EvaluationException
- if there was something wrong during the evaluation of the
functionpublic abstract double evaluateFunction(double x) throws EvaluationException
x
.x
- the current positionf(x)
EvaluationException
- if there was a mistake during evaluation of the functionpublic double[] findMin(double lower, double fLower, double eps, double startDistance) throws EvaluationException
x
and the value
f(x)
, starting the search at lower
. First the
minimum is tried to be bracketed and then the interval is tried to be
reduced.Optimizer
.lower
- the initial value of x
fLower
- the value f(x)
eps
- the threshold to stop the search of the minimumstartDistance
- the initial distance for bracketing the minimumx
at position 0 and
f(x)
at position 1EvaluationException
- if there was a mistake during the evaluation of the functionOptimizer
public final int getDimensionOfScope()
Function
Function
.getDimensionOfScope
in interface Function
n
with