public class NegativeOneDimensionalFunction extends OneDimensionalFunction
OneDimensionalFunction
. That class is
useful when you want to find a maximum of any one-dimensional function. Just
use this class and find the minimum of your new function. This minimum has
the same abscissa and just a negative ordinate.Constructor and Description |
---|
NegativeOneDimensionalFunction(OneDimensionalFunction f)
|
Modifier and Type | Method and Description |
---|---|
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 . |
findMin, getDimensionOfScope
public NegativeOneDimensionalFunction(OneDimensionalFunction f)
f
- the OneDimensionalFunction
public double evaluateFunction(double[] x) throws DimensionException, EvaluationException
Function
x
.evaluateFunction
in interface Function
evaluateFunction
in class OneDimensionalFunction
x
- the current vectorDimensionException
- if dim(x) != n
, with EvaluationException
- if there was something wrong during the evaluation of the
functionpublic double evaluateFunction(double x) throws EvaluationException
OneDimensionalFunction
x
.evaluateFunction
in class OneDimensionalFunction
x
- the current positionf(x)
EvaluationException
- if there was a mistake during evaluation of the function