-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #6637: standardize the interface to TransitiveIdeal and friends
1. Implement a single entry point for recursively enumerated sets: {{{ RecursivelyEnumeratedSet(seeds, successors, structure=..., enumeration=...) }}} where `structure` takes values in the set `[None, 'forest', 'graded', 'symmetric']` and `enumeration` takes values in the set `[None, 'depth', 'breadth', 'naive']`. 2. Deprecate `TransitiveIdeal`, `TransitiveIdealGraded` and `SearchForest` as entry point. 3. `TransitiveIdeal(succ, seeds)` keeps the same behavior as before and is now the same as `RecursivelyEnumeratedSet(seeds, succ, structure=None, enumeration='naive')`. 4. `TransitiveIdealGraded(succ, seeds, max_depth)` keeps the same behavior as before and is now the same as `RecursivelyEnumeratedSet(seeds, succ, structure=None, enumeration='breadth', max_depth=max_depth)`. Remarks: A. For now the code of `SearchForest` is still in `sage/combinat/backtrack.py`. It should be moved in `sage/sets/recursively_enumerated_set.pyx` in a later ticket. B. `TransitiveIdeal` and `TransitiveIealGraded` are used in the code of `sage/combinat`, `sage/categories` and `sage/groups` at least. These should be updated to use `RecursivelyEnumeratedSet` in a later ticket for speed improvements and also to avoid issues explained in C below. C. Note that there were some issues with `TransitiveIdeal` and `TransitiveIdealGraded`, namely: - Enumeration of `TransitiveIdeal` is claimed to be depth first search in the top level file `backtrack.py`, but in fact, it is neither breadth first neither depth first. It is what I call a naive search. - Enumeration of `TransitiveIdealGraded` is indeed breadth first as claimed but it does not make use of the graded hypothesis at all because it remembers every generated elements. See [http://www.liafa.univ-paris-diderot.fr/~labbe/blogue/2014/04/my- status-report-at-sage-days-57-recursivelyenumeratedset/ my status report at SageDays57] for more info. URL: http://trac.sagemath.org/6637 Reported by: nthiery Ticket author(s): Sébastien Labbé Reviewer(s): Travis Scrimshaw
- Loading branch information
Showing
8 changed files
with
1,280 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#***************************************************************************** | ||
# Copyright (C) 2014 Sage | ||
# | ||
# Distributed under the terms of the GNU General Public License (GPL) | ||
# The full text of the GPL is available at: | ||
# http://www.gnu.org/licenses/ | ||
# | ||
############################################################################### | ||
|
||
cimport sage.structure.parent | ||
|
||
cdef class RecursivelyEnumeratedSet_generic(sage.structure.parent.Parent): | ||
cdef readonly _seeds | ||
cdef public successors | ||
cdef readonly str _enumeration | ||
cdef readonly _max_depth | ||
cdef readonly _graded_component | ||
cdef readonly _graded_component_it | ||
|
||
cpdef seeds(self) | ||
cpdef graded_component(self, depth) | ||
|
||
cdef class RecursivelyEnumeratedSet_symmetric(RecursivelyEnumeratedSet_generic): | ||
cdef set _get_next_graded_component(self, set A, set B) | ||
|
||
cdef class RecursivelyEnumeratedSet_graded(RecursivelyEnumeratedSet_generic): | ||
cdef set _get_next_graded_component(self, set B) | ||
|
Oops, something went wrong.