> <\body> Univariate polynomials over are implemented in the class C,V\>|mmx::polynomial>, defined in |algebramix/polynomial.hpp>. The default variant |mmx::polynomial_naive> assumes that is a field, not necessarily commutative. This provides implementations of the naive algorithms. For instance the product, the division, and the gcd have quadratic costs. <\cpp-code> #include \numerix/rational.hpp\ #include \algebramix/polynomial.hpp\ ... polynomial\rational\ x (C(1), 1); // defines the monomial x polynomial\rational\ p= square (x) + 3 * x + 1; Remark that you cannot use the infix operation for powering, for it is usually reserved to bitwise operations. Instead you can use binary powering with . For the sake of efficiency, the monomial > must be constructed as C,V\ (C(1), n)>. For polynomials over a ring you must add the variant V\>|mmx::polynomial_ring_naive> defined in |algebramix/polynomial_ring_naive.hpp>, that essentially contains implementations for the subresultants due to . All classical generic divide and conquer algorithms over any field are implemented in |algebramix/polynomial_dicho.hpp>. Therein is defined the variant V\>|mmx::polynomial_dicho> that implements the Karatsuba product, division with Newton's inversion algorithm, fast Euclidean sequence, the half-gcd algorithm, Padé approximants, fast multipoint evaluation and interpolation, fast multimod and Chinese remaindering. If you want these algorithms to be applied in > you can modify the above piece of code into: <\cpp-code> #include \algebramix/polynomial.hpp\ #include \algebramix/polynomial_dicho.hpp\ #define polynomial_dicho\polynomial_naive\ V ... polynomial\rational,V\ x (C(1), 1); // defines the monomial x polynomial\rational,V\ p= square (x) + 3 * x + 1; For polynomials over a ring you must add the variant V\> defined in |algebramix/polynomial_ring_dicho.hpp>, that essentially contains the half-subresultant alsgorithm. Schönhage & Strassen's, and Cantor & Kaltofen's fast products are implemented in |algebramix/polynomial_schonhage.hpp>. It supports any ring with unity. This provides the a default variant. The Kronecker susbstitution is available for polynomials over polynomials, hardware or long integers, and also with modular coefficients. One must include one of the corresponding files: <\itemize> |algebramix/polynomial_polynomial.hpp>, |algebramix/polynomial_integer.hpp>, |algebramix/polynomial_modular_integer.hpp> |algebramix/polynomial_int.hpp>, |algebramix/polynomial_modular_int.hpp> If the coefficient ring are modular numbers then a special product is available from |algebramix/polynomial_modular.hpp>: it first computes the product of the polynomials made of the preimages of the coefficients and reduces the coefficients at the end. For polynomial over complex numbers you must use |algebramix/polynomial_complex.hpp>. If coefficients are in a quotient field of type |mmx::quotient>, then one should include |algebramix/polynomial_quotient.hpp>. A special variant is directly available for rational numbers in |algebramix/polynomial_rational.hpp>. Operations in /p> are available through the class . Special types of moduli for polynomials is defined in |algebramix/modular_polynomial.hpp>. <\cpp-code> #include "numerix/rational.hpp" #include "algebramix/modular_polynomial.hpp" #define C rational #define Polynomial polynomial\C\ #define Modular modular\modulus\Polynomial\ \ ... Polynomial x (C(1), 1); Polynomial p= square (x) - 2; Modular::set_modulus (p); mmout \\ binpow (Modular (x), 1000) \\ "\\n"; interface> <\session|mathemagix|default> <\input> <|input> use "algebramix"; type_mode? := true; <\unfolded-io> <|unfolded-io> x == polynomial (0, 1) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> (1 + x)^5 <|unfolded-io> +5*x+10*x+10*x+5*x+1>: > <\unfolded-io> <|unfolded-io> gcd (1 + 2*x + x^2, 1 - x^2) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> discriminant (1 + x + x^2) <|unfolded-io> : <\unfolded-io> <|unfolded-io> (1 + x)^5 mod 5 <|unfolded-io> +1>: |)>> . If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.> <\initial> <\collection>