Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map_reduce failing on IntegerVectorsModPermutationGroup #22184

Open
nthiery opened this issue Jan 13, 2017 · 1 comment
Open

map_reduce failing on IntegerVectorsModPermutationGroup #22184

nthiery opened this issue Jan 13, 2017 · 1 comment

Comments

@nthiery
Copy link
Contributor

nthiery commented Jan 13, 2017

IntegerVectorsModPermutationGroup elements are generated recursively
along a search tree. Alas, the map_reduce feature of
RecursivelyEnumeratedSets/SearchForest is broken:

sage: G = CyclicPermutationGroup(5)
sage: V = IntegerVectorsModPermutationGroup(G)
sage: V.map_reduce(lambda x: 1, operator.add, 0)
...
AttributeError: 'IntegerVectorsModPermutationGroup_All_with_category'
object has no attribute '_roots'

That seems to be because the SearchForest structure in V is not fully
initialized, or alternatively SearchForest and RESetMapReduce don't
quite agree on the API to recover the roots: f.roots() or f._roots.

Let's fix that for now:

sage: V._roots = V.roots()

Still does not work:

sage: V.map_reduce(lambda x: 1, operator.add, 0)
Process RESetMapReduceWorker-4:
Traceback (most recent call last):
...
assert max(self) <= self.parent()._max_part,
'Entries of %s must be inferiors to %s'%(self, self.parent()._max_part)
...

Plausibly that's because the postprocessing is not initialized
properly; so internal nodes in the trees get converted into end
results when they should not.

CC: @hivert @sagetrac-nborie @seblabbe @slel

Component: combinatorics

Issue created by migration from https://trac.sagemath.org/ticket/22184

@nthiery nthiery added this to the sage-7.6 milestone Jan 13, 2017
@slel

This comment has been minimized.

@slel slel removed this from the sage-7.6 milestone May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants