Macaulay2 » Documentation
Packages » Permutations :: isWellDefined(Permutation)
next | previous | forward | backward | up | index | toc

isWellDefined(Permutation) -- checks if a list is a valid permutation

Description

isWellDefined p determines if p is a valid permutation. Permutations must be constructed from lists consisting of only the integers $1 \textemdash n$. If a list contains any other elements or does not consist of the entire range, then an error is thrown.

i1 : isWellDefined permutation {1, 2, 3}

o1 = true
i2 : isWellDefined permutation {0, 1, 2}

o2 = false
i3 : isWellDefined permutation {1, 1, 2}

o3 = false

Ways to use this method:


The source of this document is in Permutations/Documentation/mainDocs.m2:471:0.