Multivariate data structures |
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
A coordinate, of type
|
In the above example the product
Multivariate structures are glued to
Mmx] |
use "multimix"; type_mode? := true; |
Mmx] |
x: Coordinate == coordinate ('x) |
:
Mmx] |
y: Coordinate == coordinate ('y) |
:
Mmx] |
coords_xy: Coordinates == coordinates (x, y) |
:
Mmx] |
m == monomial (x) * monomial (y) |
:
Mmx] |
m.coordinates |
:
Wrapped multivariate polynomials are glue to
Mmx] |
X: MVPolynomial Integer == mvpolynomial (1 :> Integer, monomial (x)) |
:
Mmx] |
Y: MVPolynomial Integer == mvpolynomial (1 :> Integer, monomial (y)) |
:
Mmx] |
p == (X + Y)^10 |
:
Mmx] |
p.coordinates |
:
Here
Mmx] |
a: Polynomial_dag Integer == polynomial_dag (1:> Integer, monomial (coordinate ('a))) |
:
Mmx] |
b: Polynomial_dag Integer == polynomial_dag (1:> Integer, monomial (coordinate ('b))) |
:
Mmx] |
(a + b)^3 - 1 |
:
Sparse interpolation features are glued to
Mmx] |
f: Polynomial_dag Integer == det ([a, b; b, a]) |
:
Mmx] |
as_mvpolynomial% f |
:
Sparse interpolation is also available on functions as follows:
Mmx] |
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 ]); } |
:
Mmx] |
h ([1, 2], 101) |
:
Mmx] |
as_mvpolynomial% (h, coords_xy, 10000) |
:
Verbosity and profiling of sparse interpolation can be set
via the global variables