de.jstacs.algorithms.optimization
Class NegativeOneDimensionalFunction
java.lang.Object
de.jstacs.algorithms.optimization.OneDimensionalFunction
de.jstacs.algorithms.optimization.NegativeOneDimensionalFunction
- All Implemented Interfaces:
- Function
public class NegativeOneDimensionalFunction
- extends OneDimensionalFunction
This class extends the class 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.
- Author:
- Jens Keilwagen
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NegativeOneDimensionalFunction
public NegativeOneDimensionalFunction(OneDimensionalFunction f)
- Creates the
OneDimensionalFunction f for which
-f should be calculated.
- Parameters:
f - the OneDimensionalFunction
evaluateFunction
public double evaluateFunction(double[] x)
throws DimensionException,
EvaluationException
- Description copied from interface:
Function
- Evaluates the function at a certain vector (in mathematical sense)
x.
- Specified by:
evaluateFunction in interface Function- Overrides:
evaluateFunction in class OneDimensionalFunction
- Parameters:
x - the current vector
- Returns:
- the evaluation of the function
- Throws:
DimensionException - if dim(x) != n, with
EvaluationException - if there was something wrong during the evaluation of the
function
evaluateFunction
public double evaluateFunction(double x)
throws EvaluationException
- Description copied from class:
OneDimensionalFunction
- Evaluates the function at position
x.
- Specified by:
evaluateFunction in class OneDimensionalFunction
- Parameters:
x - the current position
- Returns:
f(x)
- Throws:
EvaluationException - if there was a mistake during evaluation of the function