org.apache.commons.math.analysis.solvers
Interface BaseUnivariateRealSolver<FUNC extends UnivariateRealFunction>

Type Parameters:
FUNC - Type of function to solve.
All Known Subinterfaces:
BracketedUnivariateRealSolver<FUNC>, DifferentiableUnivariateRealSolver, PolynomialSolver, UnivariateRealSolver
All Known Implementing Classes:
AbstractDifferentiableUnivariateRealSolver, AbstractPolynomialSolver, AbstractUnivariateRealSolver, BaseAbstractUnivariateRealSolver, BaseSecantSolver, BisectionSolver, BracketingNthOrderBrentSolver, BrentSolver, IllinoisSolver, LaguerreSolver, MullerSolver, MullerSolver2, NewtonSolver, PegasusSolver, RegulaFalsiSolver, RiddersSolver, SecantSolver

public interface BaseUnivariateRealSolver<FUNC extends UnivariateRealFunction>

Interface for (univariate real) rootfinding algorithms. Implementations will search for only one zero in the given interval. This class is not intended for use outside of the Apache Commons Math library, regular user should rely on more specific interfaces like UnivariateRealSolver, {link PolynomialSolver} or DifferentiableUnivariateRealSolver.

Since:
3.0
Version:
$Id$
See Also:
UnivariateRealSolver, PolynomialSolver, DifferentiableUnivariateRealSolver

Method Summary
 double getAbsoluteAccuracy()
           
 int getEvaluations()
          Get the number of evaluations of the objective function.
 double getFunctionValueAccuracy()
           
 int getMaxEvaluations()
          Get the maximal number of function evaluations.
 double getRelativeAccuracy()
           
 double solve(int maxEval, FUNC f, double startValue)
          Solve for a zero in the vicinity of startValue.
 double solve(int maxEval, FUNC f, double min, double max)
          Solve for a zero root in the given interval.
 double solve(int maxEval, FUNC f, double min, double max, double startValue)
          Solve for a zero in the given interval, start at startValue.
 

Method Detail

getMaxEvaluations

int getMaxEvaluations()
Get the maximal number of function evaluations.

Returns:
the maximal number of function evaluations.

getEvaluations

int getEvaluations()
Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the optimize method. It is 0 if the method has not been called yet.

Returns:
the number of evaluations of the objective function.

getAbsoluteAccuracy

double getAbsoluteAccuracy()
Returns:
the absolute accuracy.

getRelativeAccuracy

double getRelativeAccuracy()
Returns:
the relative accuracy.

getFunctionValueAccuracy

double getFunctionValueAccuracy()
Returns:
the function value accuracy.

solve

double solve(int maxEval,
             FUNC f,
             double min,
             double max)
Solve for a zero root in the given interval. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

Parameters:
maxEval - Maximum number of evaluations.
f - Function to solve.
min - Lower bound for the interval.
max - Upper bound for the interval.
Returns:
a value where the function is zero.
Throws:
MathIllegalArgumentException - if the arguments do not satisfy the requirements specified by the solver.
TooManyEvaluationsException - if the allowed number of evaluations is exceeded.

solve

double solve(int maxEval,
             FUNC f,
             double min,
             double max,
             double startValue)
Solve for a zero in the given interval, start at startValue. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

Parameters:
maxEval - Maximum number of evaluations.
f - Function to solve.
min - Lower bound for the interval.
max - Upper bound for the interval.
startValue - Start value to use.
Returns:
a value where the function is zero.
Throws:
MathIllegalArgumentException - if the arguments do not satisfy the requirements specified by the solver.
TooManyEvaluationsException - if the allowed number of evaluations is exceeded.

solve

double solve(int maxEval,
             FUNC f,
             double startValue)
Solve for a zero in the vicinity of startValue.

Parameters:
f - Function to solve.
startValue - Start value to use.
maxEval - Maximum number of evaluations.
Returns:
a value where the function is zero.
Throws:
MathIllegalArgumentException - if the arguments do not satisfy the requirements specified by the solver.
TooManyEvaluationsException - if the allowed number of evaluations is exceeded.


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.