next | previous | forward | backward | up | top | index | toc | home

minPosition -- position of smallest element

Synopsis

Description

If the smallest element occurs more than once, then the first occurrence is used. If x has length 0 an error results.
i1 : minPosition {1,6,4,2}

o1 = 0
Notice that the position of the minimal element is 0, as indexing in Macaulay 2 always starts at 0.

For elements in a polynomial ring, the order used is the monomial order associated with the ring.

i2 : R = QQ[r,s,x,y,z];
i3 : z^2 + x*y + s*z

                  2
o3 = x*y + s*z + z

o3 : R
i4 : minPosition {z^2, s*z, x*y}

o4 = 0
i5 : minPosition(z^2, s*z, x*y)

o5 = 0

See also

Ways to use minPosition :