de.jstacs.algorithms.optimization

## Class 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
• ### Constructor Summary

Constructors
Constructor and Description
NegativeOneDimensionalFunction(OneDimensionalFunction f)
Creates the OneDimensionalFunction f for which -f should be calculated.
• ### Method Summary

All Methods
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.
• ### Methods inherited from class de.jstacs.algorithms.optimization.OneDimensionalFunction

findMin, getDimensionOfScope
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Method Detail

• #### 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