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

◆ rpqr79()

void rpqr79 ( int  n,
double  a[],
doublecomplex  r[],
double  work[],
int  lwork,
int *  info 
)

Roots of a polynomial (real coefficients) (Companion matrix eigenvalues)

Purpose
rpqr79 computes all roots of a polynomial p(z) with real coefficients by computing the eigenvalues of the companion matrix.
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)
Real coefficient vector of p(z) (a0 to an).
[out]r[]Array r[lr] (lr >= n)
The obtained zeros.
[out]work[]Array work[lwork]
Work array.
[in]lworkSize of work array. (lwork >= n*(n + 13))
[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 lwork had an illegal value (lwork too small)
= 1: Failed to converge QR iteration on some eigenvalue of the companion matrix
Reference
SLATEC