public class LaguerreSolver extends AbstractPolynomialSolver
A First Course in Numerical Analysis, ISBN 048641454X, chapter 8.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. The algorithm requires a bracketing condition.
Constructor and Description |
---|
LaguerreSolver()
Construct a solver with default accuracy (1e-6).
|
LaguerreSolver(double absoluteAccuracy)
Construct a solver.
|
LaguerreSolver(double relativeAccuracy,
double absoluteAccuracy)
Construct a solver.
|
LaguerreSolver(double relativeAccuracy,
double absoluteAccuracy,
double functionValueAccuracy)
Construct a solver.
|
Modifier and Type | Method and Description |
---|---|
double |
doSolve()
Method for implementing actual optimization algorithms in derived
classes.
|
double |
laguerre(double lo,
double hi,
double fLo,
double fHi)
Deprecated.
This method should not be part of the public API: It will
be made private in version 4.0.
|
Complex[] |
solveAllComplex(double[] coefficients,
double initial)
Find all complex roots for the polynomial with the given
coefficients, starting from the given initial value.
|
Complex[] |
solveAllComplex(double[] coefficients,
double initial,
int maxEval)
Find all complex roots for the polynomial with the given
coefficients, starting from the given initial value.
|
Complex |
solveComplex(double[] coefficients,
double initial)
Find a complex root for the polynomial with the given coefficients,
starting from the given initial value.
|
Complex |
solveComplex(double[] coefficients,
double initial,
int maxEval)
Find a complex root for the polynomial with the given coefficients,
starting from the given initial value.
|
getCoefficients, setup
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, solve, solve, solve, verifyBracketing, verifyInterval, verifySequence
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solve
public LaguerreSolver()
public LaguerreSolver(double absoluteAccuracy)
absoluteAccuracy
- Absolute accuracy.public LaguerreSolver(double relativeAccuracy, double absoluteAccuracy)
relativeAccuracy
- Relative accuracy.absoluteAccuracy
- Absolute accuracy.public LaguerreSolver(double relativeAccuracy, double absoluteAccuracy, double functionValueAccuracy)
relativeAccuracy
- Relative accuracy.absoluteAccuracy
- Absolute accuracy.functionValueAccuracy
- Function value accuracy.public double doSolve() throws TooManyEvaluationsException, NumberIsTooLargeException, NoBracketingException
doSolve
in class BaseAbstractUnivariateSolver<PolynomialFunction>
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.NumberIsTooLargeException
@Deprecated public double laguerre(double lo, double hi, double fLo, double fHi)
LaguerreSolver.ComplexSolver.solve(Complex[],Complex)
may
not be a real zero inside [min, max]
.
For example, p(x) = x3 + 1,
with min = -2
, max = 2
, initial = 0
.
When it occurs, this code calls
LaguerreSolver.ComplexSolver.solveAll(Complex[],Complex)
in order to obtain all roots and picks up one real root.lo
- Lower bound of the search interval.hi
- Higher bound of the search interval.fLo
- Function value at the lower bound of the search interval.fHi
- Function value at the higher bound of the search interval.public Complex[] solveAllComplex(double[] coefficients, double initial) throws NullArgumentException, NoDataException, TooManyEvaluationsException
Note: This method is not part of the API of BaseUnivariateSolver
.
coefficients
- Polynomial coefficients.initial
- Start value.TooManyEvaluationsException
- if the maximum number of evaluations is exceeded when solving for one of the rootsNullArgumentException
- if the coefficients
is
null
.NoDataException
- if the coefficients
array is empty.public Complex[] solveAllComplex(double[] coefficients, double initial, int maxEval) throws NullArgumentException, NoDataException, TooManyEvaluationsException
Note: This method is not part of the API of BaseUnivariateSolver
.
coefficients
- polynomial coefficientsinitial
- start valuemaxEval
- maximum number of evaluationsTooManyEvaluationsException
- if the maximum number of evaluations is exceeded when solving for one of the rootsNullArgumentException
- if the coefficients
is
null
NoDataException
- if the coefficients
array is emptypublic Complex solveComplex(double[] coefficients, double initial) throws NullArgumentException, NoDataException, TooManyEvaluationsException
Note: This method is not part of the API of BaseUnivariateSolver
.
coefficients
- Polynomial coefficients.initial
- Start value.TooManyEvaluationsException
- if the maximum number of evaluations is exceeded.NullArgumentException
- if the coefficients
is
null
.NoDataException
- if the coefficients
array is empty.public Complex solveComplex(double[] coefficients, double initial, int maxEval) throws NullArgumentException, NoDataException, TooManyEvaluationsException
Note: This method is not part of the API of BaseUnivariateSolver
.
coefficients
- polynomial coefficientsinitial
- start valuemaxEval
- maximum number of evaluationsTooManyEvaluationsException
- if the maximum number of evaluations is exceededNullArgumentException
- if the coefficients
is
null
NoDataException
- if the coefficients
array is emptyCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.