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. This implementation is an adaptation partly based on the Python code from SciPy (module "optimize.py" v0.5).- Since:
- 2.0
- Version:
- $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 févr. 2011) $
-
-
Field Summary
-
Fields inherited from class org.apache.commons.math.optimization.univariate.AbstractUnivariateRealOptimizer
functionValue, result, resultComputed
-
Fields inherited from class org.apache.commons.math.ConvergingAlgorithmImpl
absoluteAccuracy, defaultAbsoluteAccuracy, defaultMaximalIterationCount, defaultRelativeAccuracy, iterationCount, maximalIterationCount, relativeAccuracy
-
-
Constructor Summary
Constructors Constructor Description BrentOptimizer()
Construct a solver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
doOptimize()
Method for implementing actual optimization algorithms in derived classes.-
Methods inherited from class org.apache.commons.math.optimization.univariate.AbstractUnivariateRealOptimizer
checkResultComputed, clearResult, computeObjectiveValue, computeObjectiveValue, getEvaluations, getFunctionValue, getGoalType, getMax, getMaxEvaluations, getMin, getResult, getStartValue, optimize, optimize, setFunctionValue, setMaxEvaluations, setResult
-
Methods inherited from class org.apache.commons.math.ConvergingAlgorithmImpl
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, incrementIterationsCounter, resetAbsoluteAccuracy, resetIterationsCounter, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.math.ConvergingAlgorithm
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
-
-
-
-
Method Detail
-
doOptimize
protected double doOptimize() throws MaxIterationsExceededException, FunctionEvaluationException
Method for implementing actual optimization algorithms in derived classes. From version 3.0 onwards, this method will be abstract - i.e. concrete implementations will have to implement it. If this method is not implemented, subclasses must overrideAbstractUnivariateRealOptimizer.optimize(UnivariateRealFunction, GoalType, double, double)
.- Overrides:
doOptimize
in classAbstractUnivariateRealOptimizer
- Returns:
- the optimum.
- Throws:
MaxIterationsExceededException
- if the maximum iteration count is exceeded.FunctionEvaluationException
- if an error occurs evaluating the function.
-
-