Add nmod poly divrem with divisor $x^n - c$#2470
Add nmod poly divrem with divisor $x^n - c$#2470vneiger wants to merge 9 commits intoflintlib:mainfrom
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.
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.
Something like what is at lines 89--94 of nmod_poly/rem.c ?
There was a problem hiding this comment.
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