next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: listForm

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

/usr/share/Macaulay2/Core/orderedmonoidrings.m2:105:29-110:63: --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.