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
Use lazy attribute for _Karatsuba_threshold #24945
Comments
New commits:
|
Commit: |
comment:3
LGTM, but what about making the (default, since there is a method to override it...) threshold an attribute of the base ring instead? |
comment:4
Why is there a need for a try/except here!? |
comment:5
Replying to @videlec:
Because this is happening at Sage startup time. So |
comment:6
Replying to @jdemeyer:
This is very bad. I am very much in favor of something like Marc suggested
that would not depend on some startup effect. |
comment:7
Hmm, adding that to all possible base rings seems strange. I would much rather do it depending on the element class. For example, generic polynomials would not use Karatsuba, but polynomials over |
comment:8
I'm thinking of something like
|
comment:9
Replying to @jdemeyer:
As far as I understand, the goal is not to decide whether to use Karatsuba, but when the generic multiplication code should switch from the schoolbook algorithm to Karatsuba. This depends on the base ring (or its element class): basically, the more expensive multiplication is compared to addition, the lower the threshold should be. And yes, I guess most base rings wouldn't need to override the default value. |
comment:10
But we have really a lot of possible base rings in Sage. Should they all get a |
comment:11
A different solution is to use a |
comment:12
Replying to @jdemeyer:
I don't know. Would it be a problem to have such a method (or a simple attribute) either in the category of rings or even in |
This comment has been minimized.
This comment has been minimized.
Dependencies: #24947 |
comment:15
I went with the simple solution of using a |
This comment has been minimized.
This comment has been minimized.
Reviewer: Marc Mezzarobba |
Changed branch from u/jdemeyer/avoid_importing_matrices_in_polynomial_rings to |
This avoids a nasty import at startup of
matrix.matrix_space
in polynomial rings.I'm adding a dependency on #24947 which is technically not needed, but it makes it easier to merge things in #24742.
Depends on #24947
Component: misc
Author: Jeroen Demeyer
Branch/Commit:
f14395c
Reviewer: Marc Mezzarobba
Issue created by migration from https://trac.sagemath.org/ticket/24945
The text was updated successfully, but these errors were encountered: