|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.math.ZeroPolynomial
public class ZeroPolynomial
The ZeroPolynomial class computes the zeros of a polynomial with complex coefficients, Aberth's method. This class is a Java translation of a Fortran code written by Dario Andrea Bini, University of Pisa, Italy (bini@dm.unipi.it). Numerical computation of polynomial zeros by means of Aberth's method, Numerical Algorithms, 13 (1996), pp. 179-200. The original Fortran code includes the following notice.
All the software contained in this library is protected by copyright Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN NO EVENT, NEITHER THE AUTHORS, NOR THE PUBLISHER, NOR ANY MEMBER OF THE EDITORIAL BOARD OF THE JOURNAL "NUMERICAL ALGORITHMS", NOR ITS EDITOR-IN-CHIEF, BE LIABLE FOR ANY ERROR IN THE SOFTWARE, ANY MISUSE OF IT OR ANY DAMAGE ARISING OUT OF ITS USE. THE ENTIRE RISK OF USING THE SOFTWARE LIES WITH THE PARTY DOING SO. ANY USE OF THE SOFTWARE CONSTITUTES ACCEPTANCE OF THE TERMS OF THE ABOVE STATEMENT.
Nested Class Summary | |
---|---|
static class |
ZeroPolynomial.DidNotConvergeException
The iteration did not converge |
Field Summary | |
---|---|
static double |
EPSILON_SMALL
The smallest relative spacing for doubles. |
Constructor Summary | |
---|---|
ZeroPolynomial()
Creates an instance of the solver. |
Method Summary | |
---|---|
Complex[] |
computeRoots(Complex[] coef)
Computes the roots of the polynomial with Complex coefficients. |
Complex[] |
computeRoots(double[] coef)
Computes the roots of the polynomial with real coefficients. |
double |
getRadius(int index)
Returns an a-posteriori absolute error bound on the root. |
Complex |
getRoot(int index)
Returns a zero of the polynomial. |
Complex[] |
getRoots()
Returns the zeros of the polynomial. |
boolean |
getStatus(int index)
Returns the error status of a root. |
void |
setMaxIterations(int maxIterations)
Sets the maximum number of iterations allowed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double EPSILON_SMALL
Constructor Detail |
---|
public ZeroPolynomial()
Method Detail |
---|
public Complex[] computeRoots(Complex[] coef) throws ZeroPolynomial.DidNotConvergeException
coef
- a Complex
array containing the
polynomial coefficients.
Complex
array containing the
roots of the polynomial.
ZeroPolynomial.DidNotConvergeException
public Complex[] computeRoots(double[] coef) throws ZeroPolynomial.DidNotConvergeException
coef
- a double
array containing the
polynomial coefficients
Complex
array containing the
roots of the polynomial
ZeroPolynomial.DidNotConvergeException
public double getRadius(int index)
index
- an int
specifying the (0-based) index
of the root whose error bound is to be returned
double
representing the error bound on the
index-th root. NaN is returned if the corresponding root
cannot be represented as floating point due to overflow or
underflow or if the roots have not yet been computed.public Complex getRoot(int index)
index
- an int
which specifies the
(0-based) index of the root to be returned
Complex
which represents the
index-th root of the polynomialpublic Complex[] getRoots()
Complex
array containing the roots
of the polynomialpublic boolean getStatus(int index)
index
- an int
representing the (0-based) index
of the root whose error status is to be returned
boolean
representing the error status on
the index-th root. It is false if the approximation of
the index-th root has been carried out successfully,
for example, the computed approximation can be viewed
as the exact root of a slightly perturbed polynomial. It
is true if more iterations are needed for the index-th
root.public void setMaxIterations(int maxIterations)
maxIterations
- an int
which specifies the
maximum number of iterations allowed
IllegalArgumentException
- is thrown if maxIterations
is
less than or equal to zero.
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |