org.apache.commons.math.optimization.univariate
Class BrentOptimizer
java.lang.Object
org.apache.commons.math.ConvergingAlgorithmImpl
org.apache.commons.math.optimization.univariate.AbstractUnivariateRealOptimizer
org.apache.commons.math.optimization.univariate.BrentOptimizer
- All Implemented Interfaces:
- ConvergingAlgorithm, UnivariateRealOptimizer
public class BrentOptimizer
- extends AbstractUnivariateRealOptimizer
Implements Richard Brent's algorithm (from his book "Algorithms for
Minimization without Derivatives", p. 79) for finding minima of real
univariate functions.
- Since:
- 2.0
- Version:
- $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BrentOptimizer
public BrentOptimizer()
- Construct a solver.
optimize
public double optimize(UnivariateRealFunction f,
GoalType goalType,
double min,
double max,
double startValue)
throws MaxIterationsExceededException,
FunctionEvaluationException
- Find an optimum in the given interval, start at startValue.
An optimizer may require that the interval brackets a single optimum.
- Parameters:
f
- the function to optimize.goalType
- type of optimization goal: either GoalType.MAXIMIZE
or GoalType.MINIMIZE
min
- the lower bound for the interval.max
- the upper bound for the interval.startValue
- the start value to use
- Returns:
- a value where the function is optimum
- Throws:
FunctionEvaluationException
- if an error occurs evaluating the
function
MaxIterationsExceededException
optimize
public double optimize(UnivariateRealFunction f,
GoalType goalType,
double min,
double max)
throws MaxIterationsExceededException,
FunctionEvaluationException
- Find an optimum in the given interval.
An optimizer may require that the interval brackets a single optimum.
- Parameters:
f
- the function to optimize.goalType
- type of optimization goal: either GoalType.MAXIMIZE
or GoalType.MINIMIZE
min
- the lower bound for the interval.max
- the upper bound for the interval.
- Returns:
- a value where the function is optimum
- Throws:
FunctionEvaluationException
- if an error occurs evaluating the
function
MaxIterationsExceededException
Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.