Macaulay2 » Documentation
Packages » Macaulay2Doc :: listForm
next | previous | forward | backward | up | index | toc

listForm -- convert to list form

Synopsis

Description

A monomial is represented by the list of its exponents. A polynomial is represented by lists of pairs (m, c)x, one for each term, where m is a list of exponents for monomial, and c is the coefficient.

i1 : R = ZZ/101[x,y,z];
i2 : listForm (x^2 - 7 + x*y*z^11 + y)

o2 = {({1, 1, 11}, 1), ({2, 0, 0}, 1), ({0, 1, 0}, 1), ({0, 0, 0}, -7)}

o2 : List

Code

../../../../../Macaulay2/m2/monoids.m2:131:26-136:64: --source code:
listForm RingElement := f -> (
    R := ring f;
    n := numgens R;
    k := coefficientRing R;
    (cc, mm) := rawPairs(raw k, raw f);
    toList apply(cc, mm, (c, m) -> (exponents(n, m), promote(c, k))))

See also

Ways to use listForm :

For the programmer

The object listForm is a method function.