Purpose
To compute the coefficients of a real polynomial P(x) from its zeros. The coefficients are stored in decreasing order of the powers of x.Specification
SUBROUTINE MC01PY( K, REZ, IMZ, P, DWORK, INFO ) C .. Scalar Arguments .. INTEGER INFO, K C .. Array Arguments .. DOUBLE PRECISION DWORK(*), IMZ(*), P(*), REZ(*)Arguments
Input/Output Parameters
K (input) INTEGER The number of zeros (and hence the degree) of P(x). K >= 0. REZ (input) DOUBLE PRECISION array, dimension (K) IMZ (input) DOUBLE PRECISION array, dimension (K) The real and imaginary parts of the i-th zero of P(x) must be stored in REZ(i) and IMZ(i), respectively, where i = 1, 2, ..., K. The zeros may be supplied in any order, except that complex conjugate zeros must appear consecutively. P (output) DOUBLE PRECISION array, dimension (K+1) This array contains the coefficients of P(x) in decreasing powers of x.Workspace
DWORK DOUBLE PRECISION array, dimension (K) If K = 0, this array is not referenced.Error Indicator
INFO INTEGER = 0: successful exit; < 0: if INFO = -i, the i-th argument had an illegal value; > 0: if INFO = i, (REZ(i),IMZ(i)) is a complex zero but (REZ(i-1),IMZ(i-1)) is not its conjugate.Method
The routine computes the coefficients of the real K-th degree polynomial P(x) as P(x) = (x - r(1)) * (x - r(2)) * ... * (x - r(K)) where r(i) = (REZ(i),IMZ(i)). Note that REZ(i) = REZ(j) and IMZ(i) = -IMZ(j) if r(i) and r(j) form a complex conjugate pair (where i <> j), and that IMZ(i) = 0 if r(i) is real.Numerical Aspects
None.Further Comments
NoneExample
Program Text
NoneProgram Data
NoneProgram Results
None