org.apache.commons.math3.analysis.solvers
Class RiddersSolver

java.lang.Object
  extended by org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver<UnivariateFunction>
      extended by org.apache.commons.math3.analysis.solvers.AbstractUnivariateSolver
          extended by org.apache.commons.math3.analysis.solvers.RiddersSolver
All Implemented Interfaces:
BaseUnivariateSolver<UnivariateFunction>, UnivariateSolver

public class RiddersSolver
extends AbstractUnivariateSolver

Implements the Ridders' Method for root finding of real univariate functions. For reference, see C. Ridders, A new algorithm for computing a single root of a real continuous function , IEEE Transactions on Circuits and Systems, 26 (1979), 979 - 980.

The function should be continuous but not necessarily smooth.

Since:
1.2
Version:
$Id: RiddersSolver.java 7721 2013-02-14 14:07:13Z CardosoP $

Constructor Summary
RiddersSolver()
          Construct a solver with default accuracy (1e-6).
RiddersSolver(double absoluteAccuracy)
          Construct a solver.
RiddersSolver(double relativeAccuracy, double absoluteAccuracy)
          Construct a solver.
 
Method Summary
protected  double doSolve()
          Method for implementing actual optimization algorithms in derived classes.
 
Methods inherited from class org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, setup, solve, solve, solve, verifyBracketing, verifyInterval, verifySequence
 
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.math3.analysis.solvers.BaseUnivariateSolver
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solve
 

Constructor Detail

RiddersSolver

public RiddersSolver()
Construct a solver with default accuracy (1e-6).


RiddersSolver

public RiddersSolver(double absoluteAccuracy)
Construct a solver.

Parameters:
absoluteAccuracy - Absolute accuracy.

RiddersSolver

public RiddersSolver(double relativeAccuracy,
                     double absoluteAccuracy)
Construct a solver.

Parameters:
relativeAccuracy - Relative accuracy.
absoluteAccuracy - Absolute accuracy.
Method Detail

doSolve

protected double doSolve()
                  throws TooManyEvaluationsException,
                         NoBracketingException
Method for implementing actual optimization algorithms in derived classes.

Specified by:
doSolve in class BaseAbstractUnivariateSolver<UnivariateFunction>
Returns:
the root.
Throws:
TooManyEvaluationsException - if the maximal number of evaluations is exceeded.
NoBracketingException - if the initial search interval does not bracket a root and the solver requires it.


Copyright © 2016 CNES. All Rights Reserved.