Cat::IntegerListsLexClass – the category of combinatorial classes based on combinat::integerListsLexTools

Cat::IntegerListsLexClass represents the category of combinatorial classes based on combinat::integerListsLexTools. It is used for lexicographic enumeration of list of integers verifying some constraints.

This is an internal category. It is used by the special purpose domains combinat::partitions, combinat::compositions, and combinat::integerVectors which provide user-friendly interfaces.

This documentation is only provided here for the curious reader as well as for developers. The interface is subject to incompatible changes anytime in the future. Use at your own risk.

→ Examples

Categories

Cat::CombinatorialClass, Cat::OrderedSet

Details:

Entries

"interfaceIntegerListsLexClass"

The standard common interface of a domain that belongs to Cat::IntegerListsLexClass. This is not really needed anymore.

Technical Methods

To help the writing of integers list classes, the following method is provided. It is not supposed to be called directly, but is rather here to provide default implementations.

parseOptionsIntegerListsLexClass – Parse the standard options of an integers lists Class.

Cat::IntegerListsLexClass::parseOptionsIntegerListsLexClass(t, c)

Parameters:

t

A table of default constraints

c

A sequence of constraints overriding the settings in t

Each constraint is given as an equation constraint=value where constraint is one of the following: MinLength, MaxLength, Length, MinPart, MaxPart, Inner, Outer, MinSlope, MaxSlope. The set of default constraints is given as a table of such equations. Extra constraints are also given as a sequence of such equations.

Example 1:

Here is a way to define the combinatorial class of vectors whose parts are zero or one, of given length and number of ones. As this category provides default implementations for the methods of a combinatorial class, we only need to provide the parseOptions function.

domain zeroOneVectors

    inherits Dom::BaseDomain;

    category Cat::IntegerListsLexClass;

 

    parseOptions :=

        proc(k)

        begin

            dom::parseOptionsIntegerListsLexClass

                   (table(Length   = k,

                          MinPart  = 0,

                          MaxPart  = 1,

                          Inner    = NIL,

                          Outer    = NIL,

                          MinSlope = -infinity,

                          MaxSlope = infinity

                         ),

                    args(2..args(0)));

        end_proc;

end_domain:

Here is now the way to get the lists of such vectors of sum math and length math.

zeroOneVectors::list(2, 4)

math

We now add constraints to force some parts to be equal to zero or one. This is now the way to get the lists of vectors of sum math and length math, having zeros in positions 1 and 3 and ending with one.

zeroOneVectors::list(4, 8, Outer = [0, 1, 0, 1, 1, 1, 1, 1],

                           Inner = [0, 0, 0, 0, 0, 0, 0, 1])

math