Opened 4 years ago

#26888 new enhancement

Meta-ticket: Refactoring all combinatorial structures to use SetFactory for the generation of their elements

Reported by: boussica Owned by:
Priority: major Milestone: sage-8.5
Component: combinatorics Keywords:
Cc: hivert, vklein Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Some classes enumerate objects using some statistics. The most common statistics that is used is the size.

For example, we can enumerate permutations using its size or using its number of descents.

For each enumeration, we want to compute a parent that contains all the constraints of the enumeration. SetFactory? is a tool that helps us to construct those parents.

We want to refactor all combinatorial enumeration using SetFactory?.

When two elements is generated with two different parents. If those two parents can be coherced to a common parent, then, the equality of those two elements should be done using the equality defined in the common parent.

SetFactory? should be modified to perform that work.

This functionality will solve some hard-coded equality in lots of combinatorial class, like standart tableaux :

sage: S = StandardTableaux()
sage: tt = S([[1,2]])
sage: tt1 = S[2]
sage: tt.parent()
Standard tableaux
sage: tt1.parent()
Standard tableaux of shape [2]
sage: tt == tt1
True

That last command works because the default function richcmp was overload in sage.tableau.Tableau and the equality that tests the parents are equals was removed.

We don't want to remove the test that checks the parents are equals or have a common parent. (to be discuss)

Moroever, we want to allow user to specify to SetFactory? that two elements are different if they have to distincts parents. (to be discuss)

An example af combinatorial object that uses SetFactory? can be found in the ParallelogramPolyominoes? ticket (see ticket #16110).

Change History (0)

Note: See TracTickets for help on using tickets.