Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorial:polynomials_tutorial [2010/03/28 10:01] – joswig | user_guide:tutorials:polynomials_tutorial [2019/02/04 22:55] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Basic Usage of Polynomials in Perl ===== | + | {{page>.:latest: |
- | + | ||
- | A polynomial always carries a reference to a polynomial ring. Polynomial in different rings cannot be added, multiplied, or whatever. | + | |
- | + | ||
- | <code> | + | |
- | $r=new Ring(qw(x y)); | + | |
- | </ | + | |
- | + | ||
- | It may be convenient to use special variable names for the indeterminates. | + | |
- | + | ||
- | < | + | |
- | polytope> | + | |
- | </ | + | |
- | + | ||
- | Notice that the variable names are chosen to match the print names; but this is " | + | |
- | + | ||
- | < | + | |
- | polytope> | + | |
- | polytope> | + | |
- | polytope> | + | |
- | 1 + 2*x + x^2 + 2*y + 3*x*y + y^2 + x^2*y + x*y^2 | + | |
- | </ | + | |
- | + | ||
- | Standard arithmetic function " | + | |
- | + | ||
- | Here is one way to produce polytopes from polynomials (as the convex hull of the exponent vectors of all terms). | + | |
- | + | ||
- | < | + | |
- | polytope> | + | |
- | polytope> | + | |
- | 1 0 0 | + | |
- | 1 2 0 | + | |
- | 1 0 2 | + | |
- | 1 2 1 | + | |
- | 1 1 2 | + | |
- | polytope> | + | |
- | 1 | + | |
- | </ | + | |
- | + | ||
- | The final " | + | |