-
Notifications
You must be signed in to change notification settings - Fork 59
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
Consolidate the series code #992
Comments
I personally prefer option 2, so have at it. But I think you are going to find Jit time increase the more metaprogramming you do. |
Option 2) should not require any metaprogramming, but I am happy to also make some timings for compile time. |
Ah sorry, maybe it will, you are right. I will give it a try. |
You also have to remember that the Z/nZ code has to work differently to the rest of the code due to the fact that precision doesn't behave the same way. From memory it is possible for precision to increase in this case, which will lead to test failures (hopefully) if you do the same thing as for the other modules. Eventually we also want to have the code more or less work for inexact fields. That becomes harder with generic code for them all. |
Actually, Nemo has almost no test code here, so maybe you won't get test failures, just wrong answers, presumably. |
powering by p in char p will increase the precision, but then, powerin in char p should be handled differently to start with... Also bear in mind that the crossover to AA is not clear. In AA we also miss the AbsSeries I think |
There is AbsSeries in AbstractAlgebra. As for powering, it doesn't look to increase the precision at present:
I seem to remember spending ages working on this issue, so I'm not sure what I'm missing. It seems to me the result should be x^3 + O(x^9) here, but both Nemo and AbstractAlgebra return the above at the moment. Perhaps we made the decision to not return the maximum possible precision. I do remember discussing it at length. |
Regarding powering, see #319 Also note this probably affects multiplication over GF2 and Z/2Z |
This was done recently. There are now five files for each instead of six, but we also implement two more modules. Further consolidation isn't really worth it. |
At the moment working on the series code is rather complicated, as there is a lot of code duplication. Given that we want to add
gfp_*
, this will even get worse. Here are two proposals on how to deal with it.Metaprogramming. We wrap everthing in
for T in [fmpz, fmpq, ...]; @eval ...
. Has the big disadvantage that adding methods for specific types is more complicated.Parametrize the wrapper and have
And similar for
NemoRelSeries{S, T}
. This is basically the same that we did for the Laurent series.With type aliases
fmpz_abs_series = NemoAbsSeries{fmpz, fmpz_poly}
this is even non-breaking and with julia version >= 1.6 this will even be printed asfmpz_abs_series
(see RFC: print all types using equivalent exported aliases JuliaLang/julia#36107).This makes also trivial to add further types and/or adding methods to functions for specific types.
Opinions? I personally prefer option 2). If we can agree on something, I am happy to implement it.
The text was updated successfully, but these errors were encountered: