Enumerated set of lists of integers with constraints: frontend¶
IntegerLists
: class which models an enumerated set of lists of integers with certain constraints. This is a Python frontend where all useraccessible functionality should be implemented.

class
sage.combinat.integer_lists.lists.
IntegerList
¶ Bases:
sage.structure.list_clone.ClonableArray
Element class for
IntegerLists
.
check
()¶ Check to make sure this is a valid element in its
IntegerLists
parent.EXAMPLES:
sage: C = IntegerListsLex(4) sage: C([4]).check() True sage: C([5]).check() False


class
sage.combinat.integer_lists.lists.
IntegerLists
(*args, **kwds)¶ Bases:
sage.structure.parent.Parent
Enumerated set of lists of integers with constraints.
Currently, this is simply an abstract base class which should not be used by itself. See
IntegerListsLex
for a class which can be used by end users.IntegerLists
is just a Python frontend, acting as aParent
, supporting element classes and so on. The attribute.backend
which is an instance ofsage.combinat.integer_lists.base.IntegerListsBackend
is the Cython backend which implements all operations such as iteration.The frontend (i.e. this class) and the backend are supposed to be orthogonal: there is no imposed correspondence between frontends and backends.
For example, the set of partitions of 5 and the set of weakly decreasing sequences which sum to 5 might be implemented by the same backend, but they will be presented to the user by a different frontend.
EXAMPLES:
sage: from sage.combinat.integer_lists import IntegerLists sage: L = IntegerLists(5) sage: L Integer lists of sum 5 satisfying certain constraints sage: IntegerListsLex(2, length=3, name="A given name") A given name

Element
¶ alias of
IntegerList

backend_class
¶ alias of
sage.combinat.integer_lists.base.IntegerListsBackend
