Top Description Fields Constructors Methods
org.apache.commons.math3.analysis.solvers

public Class NewtonSolver

extends AbstractDifferentiableUnivariateSolver
Class Inheritance
Annotations
@Deprecated
Imports
org.apache.commons.math3.analysis.DifferentiableUnivariateFunction, org.apache.commons.math3.util.FastMath, org.apache.commons.math3.exception.TooManyEvaluationsException

Deprecated

as of 3.1, replaced by NewtonRaphsonSolver

Implements Newton's Method for finding zeros of real univariate functions.

The function should be continuous but not necessarily smooth.

Field Summary

Modifier and TypeField and Description
private static final double
DEFAULT_ABSOLUTE_ACCURACY

Default absolute accuracy.

Constructor Summary

AccessConstructor and Description
public
NewtonSolver()

Construct a solver.

public
NewtonSolver(double
Absolute accuracy.
absoluteAccuracy
)

Construct a solver.

Method Summary

Modifier and TypeMethod and Description
protected double
doSolve()

Implements abstract org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.doSolve.

Method for implementing actual optimization algorithms in derived classes.

public double

Returns:

the value where the function is zero.
solve
(int
Maximum number of evaluations.
maxEval
,
final DifferentiableUnivariateFunction
Function to solve.
f
,
final double
Lower bound for the interval.
min
,
final double
Upper bound for the interval.
max
)

Overrides org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.solve.

Implements org.apache.commons.math3.analysis.solvers.BaseUnivariateSolver.solve.

Deprecated as a consequence of DifferentiableUnivariateFunction being deprecated.

Find a zero near the midpoint of min and max.

Inherited from org.apache.commons.math3.analysis.solvers.AbstractDifferentiableUnivariateSolver:
computeDerivativeObjectiveValuesetup

Field Detail

DEFAULT_ABSOLUTE_ACCURACYback to summary
private static final double DEFAULT_ABSOLUTE_ACCURACY

Default absolute accuracy.

Constructor Detail

NewtonSolverback to summary
public NewtonSolver()

Construct a solver.

NewtonSolverback to summary
public NewtonSolver(double absoluteAccuracy)

Construct a solver.

Parameters
absoluteAccuracy:double

Absolute accuracy.

Method Detail

doSolveback to summary
protected double doSolve() throws TooManyEvaluationsException

Implements abstract org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.doSolve.

Doc from org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.doSolve.

Method for implementing actual optimization algorithms in derived classes.

Returns:double

the root.

Annotations
@Override
Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
solveback to summary
public double solve(int maxEval, final DifferentiableUnivariateFunction f, final double min, final double max) throws TooManyEvaluationsException

Overrides org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.solve.

Implements org.apache.commons.math3.analysis.solvers.BaseUnivariateSolver.solve.

Deprecated

as a consequence of DifferentiableUnivariateFunction being deprecated. See corresponding docs for further information.

Find a zero near the midpoint of min and max.

Parameters
maxEval:int

Maximum number of evaluations.

f:DifferentiableUnivariateFunction

Function to solve.

min:double

Lower bound for the interval.

max:double

Upper bound for the interval.

Returns:double

the value where the function is zero.

Annotations
@Override
Exceptions
TooManyEvaluationsException:
if the maximum evaluation count is exceeded.
NumberIsTooLargeException:
if min >= max.