> <\body> Dense and sparse representations of polynomials assume that internal operations are applied on polynomials having the same number of variables. For computing comfortably with any finite number of variables that can be different for different polynomials, the library proposes wrappers to monomials and polynomials, that store an additional set of coordinates. The general wrapper R\>|mmx::multivariate>, defined in |multimix/multivariate.hpp>, basically contains an element of type and a related set of coordinates. A coordinate, of type |mmx::multivariate_coordinate>, is essentially seen as a unique symbol made of a . A set of coordinates is of type |mmx::multivariate_coordinates>, as defined in |multimix/multivariate_coordinates.hpp>, which also contains related set operations. <\cpp-code> #include \multimix/monomial.hpp\ #include \multimix/multivariate.hpp\ \; // construction of coordinates from literals multivariate_coordinate\\ x (lit ("x")), y (lit ("y")), z (lit ("z")); multivariate_coordinates\\ coords_xy (vec (x, y)); multivariate_coordinates\\ coords_xz (vec (x, z)); \; // definition of the monomial x * y^2 multivariate\monomial\\ \ m1 (coords_xy, vec\nat\ (1, 2) ); // definition of the monomial x^3 * z^2 multivariate\monomial\\ \ m2 (coords_xz, vec\nat\ (3, 2)); mmout \\ m1 * m2 \\ lf; In the above example the product represents the monomial *y*z>, whose set of coordinates is ,y,z|}>>. Multivariate structures are glued to , and can be used as follows: <\session|mathemagix|default> <\input> <|input> use "multimix"; type_mode? := true; <\unfolded-io> <|unfolded-io> x: Coordinate == coordinate ('x) <|unfolded-io> : <\unfolded-io> <|unfolded-io> y: Coordinate == coordinate ('y) <|unfolded-io> : <\unfolded-io> <|unfolded-io> coords_xy: Coordinates == coordinates (x, y) <|unfolded-io> >: <\unfolded-io> <|unfolded-io> m == monomial (x) * monomial (y) <|unfolded-io> : <\unfolded-io> <|unfolded-io> m.coordinates <|unfolded-io> >: Wrapped multivariate polynomials are glue to , and can be used naturally as in the following example, continued from the previous session: <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> X: MVPolynomial Integer == mvpolynomial (1 :\ Integer, monomial (x)) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> Y: MVPolynomial Integer == mvpolynomial (1 :\ Integer, monomial (y)) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> p == (X + Y)^10 <|unfolded-io> +10*x*y+45*x*y+120*x*y+210*x*y+252*x*y+210*x*y+120*x*y+45*x*y+10*x*y+x>: > <\unfolded-io> <|unfolded-io> p.coordinates <|unfolded-io> >: Here is used internally. Wrapped dag polynomials can also be used as follows: <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> a: Polynomial_dag Integer == \ \ polynomial_dag (1:\ Integer, monomial (coordinate ('a))) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> b: Polynomial_dag Integer == \ \ polynomial_dag (1:\ Integer, monomial (coordinate ('b))) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> (a + b)^3 - 1 <|unfolded-io> *-1>: > Sparse interpolation features are glued to and can be used as follows on a dag polynomial (continued from the previous session): <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> f: Polynomial_dag Integer == det ([a, b; b, a]) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> as_mvpolynomial% f <|unfolded-io> +a>: > Sparse interpolation is also available on functions as follows: <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> h (v: Vector Integer, p: Integer): Integer == { \ \ \ m: Modulus Integer == modulus p; \ \ \ return preimage big_add ([ (z mod m)^10 / (10 mod m) \| z in v ]); } <|unfolded-io> : <\unfolded-io> <|unfolded-io> h ([1, 2], 101) <|unfolded-io> : <\unfolded-io> <|unfolded-io> as_mvpolynomial% (h, coords_xy, 10000) <|unfolded-io> *y+*x>: > Verbosity and profiling of sparse interpolation can be set the global variables and . . 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>