AlgebraicNumbers.mesa
Last Edited by: Arnon, June 10, 1985 4:19:22 pm PDT
DIRECTORY
Rope USING [ROPE],
IO,
AlgebraClasses,
RatIntervals,
Polynomials;
AlgebraicNumbers: CEDAR DEFINITIONS
= BEGIN OPEN AC: AlgebraClasses, RI: RatIntervals, POL: Polynomials;
Types
AlgebraicNumber: TYPE = REF AlgebraicNumberRec;
AlgebraicNumberRec: TYPE = RECORD [
minPolyRing: AC.Structure, -- a ring of univariate polynomials over any groundField.
minimalPolynomial: POL.Polynomial, -- a monic elt of minPolyRing irreducible over groundField.
real: BOOLFALSE, -- true iff groundField real
isolatingInterval: RI.RatInterval ← NIL -- isolating interval for the unique root of minimalPolynomial which is this real algebraic number.
];
Constructors
MakeAlgebraicNumber: PROC [minPolyRing: AC.Structure, minimalPolynomial: POL.Polynomial, real: BOOLFALSE, isolatingInterval: RI.RatInterval ← NIL] RETURNS [AlgebraicNumber];
minPolyRing is a ring of univariate polynomials over any groundField, minimalPolynomial is a monic elt of minPolyRing irreducible over groundField. If real, then groundField is a real field, and isolatingInterval is an isolating interval for the unique root of minimalPolynomial which is this (real) algebraic number.
IO
ReadAlgebraicNumber: PROC [in: IO.STREAM, minPolyRing: AC.Structure, real: BOOLFALSE] RETURNS [out: AlgebraicNumber];
AlgebraicNumberFromRope: PROC [in: Rope.ROPE, minPolyRing: AC.Structure, real: BOOLFALSE] RETURNS [out: AlgebraicNumber];
AlgebraicNumberToRope: PROC [in: AlgebraicNumber] RETURNS [out: Rope.ROPE];
WriteAlgebraicNumber: PROC [in: AlgebraicNumber, out: IO.STREAM];
END.