Combinatorial Classes

There are a lot of design issues which concern combinatorial classes. I'd like to discuss them here. The following are mostly notes from discussion with Nicolas. Once fixed this material should ends in the doc of CombinatorialClass. Please add comment at any places.

Interface and basic usage

The name of the ObjOrientedClasses should be uniform : let's take the example of permutations

The following function are standard and should be documented/publicized for all CombClass:

The following function should be written but are not supposed to be called directly by the user:


The goal here is to be able to inherits smoothly from a combinatorial class to add extra mathematical structure (eg Poset, Group, Monoid).

A solution is to set two (lazy)_attribute in the combinatorial class named element_class and element_parent


When two combinatorial classes As and Bs with object a and b from OOclass A and B are in bijection, there are several possibilities

It is maybe not a very strong rule. Possible exception A is very standard and B is very exotic. Then maybe one can only write b.to_A() and B.from_A

Combinatorial Class Factory

The goal here is to make is simple to take a subclass of a combinatorial class by adding some constraints. For example if p4=Permutations(4). The user may want to get the subclass of p4 of permutations of length say 5. So