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

# minPosition -- position of the smallest element

## Synopsis

• Usage:
minPosition L
• Inputs:
• L, ,
• Outputs:
• i, an integer, the index of the smallest element in the list L

## Description

If the smallest element occurs more than once, the index of its first occurrence is used.

 i1 : minPosition {2, 1, 6, 4, 1} o1 = 1

If L contains elements in a polynomial ring, the MonomialOrder of the ring is used for comparisons.

 i2 : R1 = QQ[x, y, z, MonomialOrder => Lex]; i3 : minPosition {x*y^2, x*y^2 + z^2, y^4, y*z^5} o3 = 3 i4 : R2 = QQ[x, y, z, MonomialOrder => GRevLex]; i5 : minPosition (x*y^2, x*y^2 + z^2, y^4, y*z^5) o5 = 0

More generally, the order of the elements is determined using the ? operator.

## See also

• maxPosition -- position of the largest element
• max -- yields the maximum element in a list or sequence
• min -- yields the minimum element in a list or sequence
• sort -- sort a list or columns of a matrix
• position -- the first element of a list satisfying a condition
• positions -- which elements of a list satisfy a condition
• ? -- comparison operator

## Ways to use minPosition :

• "minPosition(BasicList)"

## For the programmer

The object minPosition is .