[Previous] [Next] [Contents]

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

Introduction

Cat::IntegerListsLexClass represents the category of combinatorial classes based on combinat::integerListsLexTools. It is used for lexicographic enumeration of list of integer 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.

Generating the category


Cat::IntegerListsLexClass()

Categories

Cat::CombinatorialClass, Cat::OrderedSet

Details

Basic Entries

interfaceIntegerListsLexClass

The standard common interface of a domain that belongs to Cat::IntegerListsLexClass.

Details

Method parseOptionsIntegerListsLexClass: Parse the standard options of an integers lists Class.

Example 1

Here is a way to define the domain of vector of zero and one of a given length with a given number of one. One only needs to provide the parseOptions functions

>> 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 2 and length 4.

>> zeroOneVectors::list(2, 4)
     
      [[1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1], [0, 1, 1, 0],
      
         [0, 1, 0, 1], [0, 0, 1, 1]]
        

One can now add constraints to force some element to be equal to zero or one. Here is now the way to get the lists of such vectors of sum 4 and length 6, having zeros in position 1 and 3 and ending with a one.

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

Changes

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package