|
|
◆ rpzero2()
| void rpzero2 |
( |
int |
n, |
|
|
double |
a[], |
|
|
double |
rr[], |
|
|
double |
ri[], |
|
|
int |
iflag, |
|
|
int |
maxiter, |
|
|
int * |
iter, |
|
|
double |
s[], |
|
|
double |
work[], |
|
|
int * |
info |
|
) |
| |
Roots of a polynomial (real coefficients) (Simultaneous iteration for all roots) (Complex type is not used)
- Purpose
- rpzero2 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
The obtained zeros are output to the separate real type variables for real and imaginary parts.
- 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] | rr[] | Array rr[lrr] (lrr >= n)
[in] Real parts of initial estimates for zeros. If these are unknown, set iflag = 0 and it is not necessary to set estimates in rr[].
Note - Initial estimates must be separated, that is, distinct or not repeated.
[out] Real part of the obtained zeros. |
| [in,out] | ri[] | Array ri[lri] (lri >= n)
[in] Imaginary parts of initial estimates for zeros. If these are unknown, set iflag = 0 and it is not necessary to set estimates in ri[].
Note - Initial estimates must be separated, that is, distinct or not repeated.
[out] Imaginary part of the obtained zeros. |
| [in] | iflag | Flag to indicate if initial estimates of zeros are input.
= 0: No estimates are input.
!= 0: rr[] and ri[] contain 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 >= 8*n + 6)
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)
= -6: The argument maxiter had an illegal value (maxiter <= 0)
= 1: Failed to converge after maxiter iterations. Best current estimates of the zeros are in rr[] and ri[]. Error bounds in s[] are not calculated. |
- Reference
- SLATEC
|