|
|
◆ rpzero()
| void rpzero |
( |
int |
n, |
|
|
double |
a[], |
|
|
doublecomplex |
r[], |
|
|
int |
iflag, |
|
|
int |
maxiter, |
|
|
int * |
iter, |
|
|
double |
s[], |
|
|
doublecomplex |
work[], |
|
|
int * |
info |
|
) |
| |
Roots of a polynomial (real coefficients) (Simultaneous iteration for all roots)
- Purpose
- rpzero computes all roots of a polynomial p(z) with real coefficients by the iterative method finding all roots simultaneously.
p(z) = a0*z^n + a1*z^(n-1) + ... + an
- Parameters
-
| [in] | n | Degree of polynomial. (n >= 1) |
| [in] | a[] | Array a[la] (la >= n + 1)
Real coefficient vector of p(z) (a0 to an). |
| [in,out] | r[] | Array r[lr] (lr >= n)
[in] Initial estimates for zeros. If these are unknown, set iflag = 0 and it is not necessary to set estimates in r[].
Note - Initial estimates must be separated, that is, distinct or not repeated.
[out] The obtained zeros. |
| [in] | iflag | Flag to indicate if initial estimates of zeros are input.
= 0: No estimates are input.
!= 0: r[] contains estimates of zeros. |
| [in] | maxiter | Maximum number of iterations. (maxitr >= 1) |
| [out] | iter | Number of iterations required to converge. |
| [out] | s[] | Array s[ls] (ls >= n)
Error bound for the obtained zeros. |
| [out] | work[] | Array work[lwork] (lwork >= 3*(n + 1))
Work array. |
| [out] | info | = 0: Successful exit
= -1: The argument n had an illegal value (n < 1)
= -2: The argument a had an illegal value (a[0] = 0)
= -5: The argument maxiter had an illegal value (maxiter <= 0)
= 1: Failed to converge after maxiter iterations. Best current estimates of the zeros are in r[]. Error bounds in s[] are not calculated. |
- Reference
- SLATEC
|