Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.algorithms.optimization
Class OneDimensionalFunction

    java.lang.Object
      de.jstacs.algorithms.optimization.OneDimensionalFunction

All Implemented Interfaces:
  Function

Direct Known Subclasses:
  NegativeOneDimensionalFunction, OneDimensionalSubFunction, QuadraticFunction

    public abstract class OneDimensionalFunction

extends Object
implements Function

This class implements the interface function for an one-dimensional function.

Author:
  Jens Keilwagen

Constructor Summary
`OneDimensionalFunction()`

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OneDimensionalFunction

    public OneDimensionalFunction()

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`
  Parameters:
    `x` - the current vector
  Returns:
    the evaluation of the function
  Throws:
    `DimensionException` - if dim(x) != n, with f: R^n -> R
    `EvaluationException` - if there was a mistake in evaluating the function

### evaluateFunction

    public abstract double evaluateFunction(double x)
                                     throws EvaluationException

  Evaluates the function at position x.

  Parameters:
    `x` - the current position
  Returns:
    f(x)
  Throws:
    `EvaluationException` - if there was a mistake in evaluating the function

### findMin

    public double[] findMin(double lower,
                            double fLower,
                            double eps,
                            double startDistance)
                     throws EvaluationException

  This method returns a minimum 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. This method is a standard implementation and can be overwritten any time. It uses methods from the class `Optimizer`.

  Parameters:
    `lower` - the initial value of x
    `fLower` - the value f(x)
    `eps` - the threshold to stop the search of the minimum
    `startDistance` - the initial distance for bracketing the minimum
  Returns:
    an array containing x at position 0 and f(x) at position 1
  Throws:
    `EvaluationException` - if there was a mistake in evaluating the function
  See Also:
    `Optimizer`

### getDimensionOfScope

    public final int getDimensionOfScope()

  Description copied from interface: `Function`
  Returns the dimension of the scope of the function.

  Specified by:
    `getDimensionOfScope` in interface `Function`
  Returns:
    dimension of the scope; n, with f: R^n -> R

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD