-
-
Notifications
You must be signed in to change notification settings - Fork 509
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
bijectionist does avoidable work #39307
Labels
Comments
While looking into this I also realised that Also,
is a little discouraging. |
Note to myself: I need to track users of
|
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Jan 19, 2025
…ing_relations This is related to sagemath#39307. I need to understand precisely how manipulation of `_P`, `_compute_possible_block_values`, etc. interact, and this is a tiny step in this direction. URL: sagemath#39310 Reported by: Martin Rubey Reviewer(s): David Coudert, Martin Rubey
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Jan 19, 2025
Fix sagemath#39307 Since the package is currently probably a bit under-used, this should be checked thoroughly. URL: sagemath#39313 Reported by: Martin Rubey Reviewer(s): David Coudert, Martin Rubey
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps To Reproduce
Suppose we are calling
with large sets
A
andB
, eg., with 20000 elements each, as in the doctest.Expected Behavior
This should return almost immediately, since no work needs to be done.
Actual Behavior
Instead, it takes a long time. This is because
__init__
finally callsself.set_constant_blocks([])
, which in turn callsself._compute_possible_block_values()
, which will then compute the intersection of the two element setsfor each block of
self._P
. Hereself._P
is aDisjointSet
of singletons - one block for each element ofself._A
. In fact, this will always be the value ofself._P
, whenever we are looking for a bijection (i.e.,self._tau
is the identity map).However, initially, these two sets are all of
self._A
.So:
self._compute_possible_block_values()
self._compute_possible_block_values()
for the case of very few non-singleton blocks.Additional Information
No response
Environment
irrelevant.
Checklist
The text was updated successfully, but these errors were encountered: