XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ cpzero()

void cpzero ( int  n,
doublecomplex  a[],
doublecomplex  r[],
int  iflag,
int  maxiter,
int *  iter,
double  s[],
doublecomplex  work[],
int *  info 
)

Roots of a polynomial (complex coefficients) (Simultaneous iteration for all roots)

Purpose
cpzero computes all roots of a polynomial p(z) with complex coefficients by the iterative method finding all roots simultaneously.
p(z) = a0*z^n + a1*z^(n-1) + ... + an
Parameters
[in]nDegree of polynomial. (n >= 1)
[in]a[]Array a[la] (la >= n + 1)
Complex 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]iflagFlag to indicate if initial estimates of zeros are input.
= 0: No estimates are input.
!= 0: r[] contains estimates of zeros.
[in]maxiterMaximum number of iterations. (maxiter >= 1)
[out]iterNumber of iterations required to converge.
[out]s[]Array s[ls] (ls >= n)
Error bounds for the obtained zeros.
[out]work[]Array work[lwork] (lwork >= 2*(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