-
Notifications
You must be signed in to change notification settings - Fork 275
Add nmod poly divrem with divisor $x^n - c$ #2470
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
base: main
Are you sure you want to change the base?
Conversation
- add nmod_poly_divrem_xnmc, general version - add test, doc, draft of profile
| } | ||
|
|
||
| int lazy = 0; | ||
| nn_ptr RQ = _nmod_vec_init(len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A temporary allocation would be good to try here. @fredrik-johansson how do we deal with stack allocation for these types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like what is at lines 89--94 of nmod_poly/rem.c ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe so!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will give this a try!
|
A bit unusual for this code is that it does a lot of logic in the non-underscore method. Does this functionality actually really make sense as a standalone method, or could it be a special case of a method for dividing by a sparse polynomial after a precomputation? This is currently used in the |
This question --- fast remainder on division by a binomial So my main wish is to have good performance of the underscore lazy variant (which probably means keeping this one specific to binomials). For the rest, I thought this was a fairly classical operation to work on univariate polynomials modulo |
I've just had a look at Interestingly, for monic binomials, the code in
By the way, in case this rings any bell of other places where this may be useful/existing in flint: for |
This adds functions for computing the quotient and remainder in the division by$x^n - c$ . Special cases $c = -1$ , $c = 0$ , $c = 1$ are handled more efficiently with specific code, and for general $c$ this uses precomputations on $c$ if the modulus allows it.
Tests, documentation, profiling files updated.
Excerpt of profile output on zen4 and meteor lake (full output in file below) :
special_rem_profile.txt