public class LaguerreSolver extends UnivariateRealSolverImpl
Laguerre's method is global in the sense that it can start with any initial approximation and be able to solve all roots from that point.
defaultFunctionValueAccuracy, f, functionValue, functionValueAccuracy, result, resultComputed
absoluteAccuracy, defaultAbsoluteAccuracy, defaultMaximalIterationCount, defaultRelativeAccuracy, iterationCount, maximalIterationCount, relativeAccuracy
Constructor and Description |
---|
LaguerreSolver()
Deprecated.
in 2.2 (to be removed in 3.0)
|
LaguerreSolver(UnivariateRealFunction f)
Deprecated.
as of 2.0 the function to solve is passed as an argument
to the
solve(UnivariateRealFunction, double, double) or
UnivariateRealSolver.solve(UnivariateRealFunction, double, double, double)
method. |
Modifier and Type | Method and Description |
---|---|
PolynomialFunction |
getPolynomialFunction()
Deprecated.
as of 2.0 the function is not stored anymore within the instance.
|
protected boolean |
isRootOK(double min,
double max,
Complex z)
Returns true iff the given complex root is actually a real zero
in the given interval, within the solver tolerance level.
|
Complex |
solve(Complex[] coefficients,
Complex initial)
Deprecated.
in 2.2.
|
double |
solve(double min,
double max)
Deprecated.
|
double |
solve(double min,
double max,
double initial)
Deprecated.
|
double |
solve(int maxEval,
UnivariateRealFunction f,
double min,
double max)
Find a real root in the given interval.
|
double |
solve(int maxEval,
UnivariateRealFunction f,
double min,
double max,
double initial)
Find a real root in the given interval with initial value.
|
double |
solve(UnivariateRealFunction f,
double min,
double max)
Deprecated.
in 2.2 (to be removed in 3.0).
|
double |
solve(UnivariateRealFunction f,
double min,
double max,
double initial)
Deprecated.
in 2.2 (to be removed in 3.0).
|
Complex[] |
solveAll(Complex[] coefficients,
Complex initial)
Deprecated.
in 2.2.
|
Complex[] |
solveAll(double[] coefficients,
double initial)
Deprecated.
in 2.2.
|
checkResultComputed, clearResult, getFunctionValue, getFunctionValueAccuracy, getResult, isBracketing, isSequence, resetFunctionValueAccuracy, setFunctionValueAccuracy, setResult, setResult, verifyBracketing, verifyInterval, verifySequence
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, incrementIterationsCounter, resetAbsoluteAccuracy, resetIterationsCounter, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
@Deprecated public LaguerreSolver(UnivariateRealFunction f) throws IllegalArgumentException
solve(UnivariateRealFunction, double, double)
or
UnivariateRealSolver.solve(UnivariateRealFunction, double, double, double)
method.f
- function to solveIllegalArgumentException
- if function is not polynomial@Deprecated public LaguerreSolver()
@Deprecated public PolynomialFunction getPolynomialFunction()
@Deprecated public double solve(double min, double max) throws ConvergenceException, FunctionEvaluationException
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.
min
- the lower bound for the interval.max
- the upper bound for the interval.ConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwise.FunctionEvaluationException
- if an error occurs evaluating the function@Deprecated public double solve(double min, double max, double initial) throws ConvergenceException, FunctionEvaluationException
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.
min
- the lower bound for the interval.max
- the upper bound for the interval.initial
- the start value to useConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwise.FunctionEvaluationException
- if an error occurs evaluating the functionpublic double solve(int maxEval, UnivariateRealFunction f, double min, double max, double initial) throws ConvergenceException, FunctionEvaluationException
Requires bracketing condition.
solve
in class UnivariateRealSolverImpl
f
- function to solve (must be polynomial)min
- the lower bound for the intervalmax
- the upper bound for the intervalinitial
- the start value to usemaxEval
- Maximum number of evaluations.ConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalid@Deprecated public double solve(UnivariateRealFunction f, double min, double max, double initial) throws ConvergenceException, FunctionEvaluationException
Requires bracketing condition.
f
- function to solve (must be polynomial)min
- the lower bound for the intervalmax
- the upper bound for the intervalinitial
- the start value to useConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalidpublic double solve(int maxEval, UnivariateRealFunction f, double min, double max) throws ConvergenceException, FunctionEvaluationException
Despite the bracketing condition, the root returned by solve(Complex[], Complex) may not be a real zero inside [min, max]. For example, p(x) = x^3 + 1, min = -2, max = 2, initial = 0. We can either try another initial value, or, as we did here, call solveAll() to obtain all roots and pick up the one that we're looking for.
solve
in class UnivariateRealSolverImpl
f
- the function to solvemin
- the lower bound for the intervalmax
- the upper bound for the intervalmaxEval
- Maximum number of evaluations.ConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalid@Deprecated public double solve(UnivariateRealFunction f, double min, double max) throws ConvergenceException, FunctionEvaluationException
Despite the bracketing condition, the root returned by solve(Complex[], Complex) may not be a real zero inside [min, max]. For example, p(x) = x^3 + 1, min = -2, max = 2, initial = 0. We can either try another initial value, or, as we did here, call solveAll() to obtain all roots and pick up the one that we're looking for.
f
- the function to solvemin
- the lower bound for the intervalmax
- the upper bound for the intervalConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalidprotected boolean isRootOK(double min, double max, Complex z)
min
- the lower bound for the intervalmax
- the upper bound for the intervalz
- the complex root@Deprecated public Complex[] solveAll(double[] coefficients, double initial) throws ConvergenceException, FunctionEvaluationException
coefficients
- the polynomial coefficients arrayinitial
- the start value to useConvergenceException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalid@Deprecated public Complex[] solveAll(Complex[] coefficients, Complex initial) throws MaxIterationsExceededException, FunctionEvaluationException
coefficients
- the polynomial coefficients arrayinitial
- the start value to useMaxIterationsExceededException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalid@Deprecated public Complex solve(Complex[] coefficients, Complex initial) throws MaxIterationsExceededException, FunctionEvaluationException
coefficients
- the polynomial coefficients arrayinitial
- the start value to useMaxIterationsExceededException
- if the maximum iteration count is exceeded
or the solver detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionIllegalArgumentException
- if any parameters are invalidCopyright © 2003–2019. All rights reserved.