next up previous
Next: Asymptotically fast algorithms Up: Algebraic types Previous: Numbers

Univariate polynomials

Figure 4: The hierarchy of univariate polynomial types in libalgebra.
\begin{figure}\htmlimage
\centering\includegraphics[scale=.9]{algpolcat.eps}
\end{figure}

define LinearCombinationType(R: AdditiveType): Category == AdditiveType with {
        *: (R, %) -> %;
        add!: (%, R, %) -> %;
        times!: (R, %) -> %;
        ....................
}


define LinearArithmeticType(R: Join(AdditiveType, ExpressionType)): Category ==
  Join(ArithmeticType, ExpressionType, LinearCombinationType(R)) with {
        ^: (%, AldorInteger) -> %;
        coerce: R -> %;
        ..........................
}


define MonogenicLinearArithmeticType(R: Join(ArithmeticType, ExpressionType)): Category ==
   with {
        apply: (%, ExpressionTree) -> ExpressionTree;
        apply: (TextWriter, %, Symbol) -> TextWriter;
        coefficients: % -> Generator(R);
        ........................
}



define MonogenicAlgebra(R: Join(ArithmeticType, ExpressionType)): Category == 

..........................................

      coerce: Vector(R) -> %
        if (R has GcdDomain) then 
                content: (%) -> R
                primitive: (%) -> (R, %)
                primitivePart: (%) -> %

..........................................


define UnivariatePolynomialAlgebra(R: Join(ArithmeticType, ExpressionType)): Category == 

..........................................

         compose: (%, %) -> %;



define UnivariatePolynomialCategory0(R: Join(ExpressionType, ArithmeticType)): Category == 


       if (R has Field) then EuclideanDomain


define UnivariatePolynomialCategory(R: Join(ExpressionType, ArithmeticType)): Category == 


       if (R has FactorizationRing) then 
                        factor(p: %): R, Product(%) == ..


}

Will be discussed in more detail during next lectures


next up previous
Next: Asymptotically fast algorithms Up: Algebraic types Previous: Numbers
Marc Moreno Maza
2003-06-06