Enumerated set of lists of integers with constraints: front-end#
IntegerLists: class which models an enumerated set of lists of integers with certain constraints. This is a Python front-end where all user-accessible functionality should be implemented.
- class sage.combinat.integer_lists.lists.IntegerList#
Element class for
- class sage.combinat.integer_lists.lists.IntegerLists(*args, **kwds)#
Enumerated set of lists of integers with constraints.
Currently, this is simply an abstract base class which should not be used by itself. See
IntegerListsLexfor a class which can be used by end users.
IntegerListsis just a Python front-end, acting as a
Parent, supporting element classes and so on. The attribute
.backendwhich is an instance of
sage.combinat.integer_lists.base.IntegerListsBackendis the Cython back-end which implements all operations such as iteration.
The front-end (i.e. this class) and the back-end are supposed to be orthogonal: there is no imposed correspondence between front-ends and back-ends.
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 back-end, but they will be presented to the user by a different front-end.
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