Division with remainder for Ore Polynomials#2674
Conversation
rburing
left a comment
There was a problem hiding this comment.
Besides adding these new methods, they will have to be registered in the table of GR methods for gr_ore_poly contexts, around here:
Lines 300 to 302 in 290bd1b
See e.g. gr_poly for how that's done:
Lines 843 to 845 in 290bd1b
Those are some small wrapper functions.
After this, they will also be tested by the generic ring tests.
| status |= gr_zero(GR_ENTRY(A, i, el_size), cctx); | ||
| status |= gr_set(GR_ENTRY(A, k, el_size), c, cctx); | ||
|
|
||
| // B = A * V |
There was a problem hiding this comment.
Here I'm wondering if it wouldn't be better to call lmul_gen repeatedly instead, or introducing a function that multiplies by D^k.
Yes, though I have no idea if the tests do the right thing in the noncommutative case :-) |
Let's find out! :D |
The goal of this Pull Request is to implement division with remainder for Ore polynomials:
// Returns the unique pair (Q, R) such that U = QV + R and ord(R) < ord(V)
int _gr_ore_poly_divrem(gr_ptr Q, gr_ptr R, gr_srcptr U, slong lenU, gr_srcptr V, slong lenV, gr_ore_poly_ctx_t ctx)
int gr_ore_poly_divrem(gr_ore_poly_t Q, gr_ore_poly_t R, const gr_ore_poly_t U, gr_ore_poly_t V, gr_ore_poly_ctx_t ctx)
Tests and documnetation are also added.
If you have any feedback, please feel free to let me know. Thank you!