Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-02 - 43,50145/pgcd.doc
There are 2 other files named pgcd.doc in the archive. Click here to see a list.
SUBROUTINE PGCD

PURPOSE
   DETERMINE GREATEST COMMON DIVISOR OF TWO POLYNOMIALS

USAGE
   CALL PGCD(X,IDIMX,Y,IDIMY,WORK,EPS,IER)

DESCRIPTION OF PARAMETERS
   X	 -  VECTOR OF COEFFICIENTS FOR FIRST POLYNOMIAL,
	    ORDERED FROM SMALLEST TO LARGEST POWER
   IDIMX -  DIMENSION OF X
   Y	 -  VECTOR OF COEFFICIENTS FOR SECOND POLYNOMIAL,
	    ORDERED FROM SMALLEST TO LARGEST POWER.
	    THIS IS REPLACED BY GREATEST COMMON DIVISOR
   IDIMY -  DIMENSION OF Y
   WORK  -  WORKING STORAGE ARRAY
   EPS	 -  TOLERANCE VALUE BELOW WHICH COEFFICIENT IS
	    ELIMINATED DURING NORMALIZATION
   IER	 -  RESULTANT ERROR CODE WHERE
	    IER=0  NO ERROR
	    IER=1  X OR Y IS ZERO POLYNOMIAL

REMARKS
   IDIMX MUST BE GREATER THAN IDIMY
   IDIMY=1 ON RETURN MEANS X AND Y ARE PRIME, THE GCD IS A
   CONSTANT. IDIMX IS DESTROYED DURING COMPUTATION.

SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
   PDIV
   PNORM

METHOD
   GREATEST COMMON DIVISOR OF TWO POLYNOMIALS X AND Y IS
   DETERMINED BY MEANS OF EUCLIDEAN ALGORITHM. COEFFICIENT
   VECTORS X AND Y ARE DESTROYED AND GREATEST COMMON
   DIVISOR IS GENERATED IN Y.