Skip to content

Commit 726ee2d

Browse files
Merge pull request #2309 from fredrik-johansson/dive2
Have gr_divexact over a gr_poly ring dispatch to gr_poly_divexact
2 parents 7fbc382 + 06c9515 commit 726ee2d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/gr/fmpz.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,15 @@ _gr_fmpz_poly_mullow(fmpz * res,
970970
return GR_SUCCESS;
971971
}
972972

973+
int
974+
_gr_fmpz_poly_divexact2(fmpz * res,
975+
const fmpz * poly1, slong len1,
976+
const fmpz * poly2, slong len2, gr_ctx_t ctx)
977+
{
978+
_fmpz_poly_divexact(res, poly1, len1, poly2, len2);
979+
return GR_SUCCESS;
980+
}
981+
973982
/* defined in gr/fmpz_poly.c */
974983
int _gr_fmpz_poly_factor(fmpz_poly_t c, gr_vec_t factors, gr_vec_t exponents, gr_srcptr x, int flags, gr_ctx_t ctx);
975984

@@ -1194,6 +1203,7 @@ gr_method_tab_input _fmpz_methods_input[] =
11941203
{GR_METHOD_VEC_DOT, (gr_funcptr) _gr_fmpz_vec_dot},
11951204
{GR_METHOD_VEC_DOT_REV, (gr_funcptr) _gr_fmpz_vec_dot_rev},
11961205
{GR_METHOD_POLY_MULLOW, (gr_funcptr) _gr_fmpz_poly_mullow},
1206+
{GR_METHOD_POLY_DIVEXACT, (gr_funcptr) _gr_fmpz_poly_divexact2},
11971207
{GR_METHOD_POLY_FACTOR, (gr_funcptr) _gr_fmpz_poly_factor},
11981208
{GR_METHOD_POLY_ROOTS, (gr_funcptr) _gr_fmpz_roots_gr_poly},
11991209
{GR_METHOD_POLY_ROOTS_OTHER,(gr_funcptr) _gr_fmpz_roots_gr_poly_other},

src/gr/polynomial.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,12 @@ polynomial_div(gr_poly_t res, const gr_poly_t x, const gr_poly_t y, const gr_ctx
559559
}
560560
}
561561

562+
int
563+
polynomial_divexact(gr_poly_t res, const gr_poly_t x, const gr_poly_t y, const gr_ctx_t ctx)
564+
{
565+
return gr_poly_divexact(res, x, y, POLYNOMIAL_ELEM_CTX(ctx));
566+
}
567+
562568
int
563569
polynomial_euclidean_div(gr_poly_t res, const gr_poly_t x, const gr_poly_t y, const gr_ctx_t ctx)
564570
{
@@ -707,6 +713,7 @@ gr_method_tab_input _gr_poly_methods_input[] =
707713
{GR_METHOD_POW_SI, (gr_funcptr) polynomial_pow_si},
708714
{GR_METHOD_POW_FMPZ, (gr_funcptr) polynomial_pow_fmpz},
709715
{GR_METHOD_DIV, (gr_funcptr) polynomial_div},
716+
{GR_METHOD_DIVEXACT, (gr_funcptr) polynomial_divexact},
710717
{GR_METHOD_INV, (gr_funcptr) polynomial_inv},
711718

712719
{GR_METHOD_EUCLIDEAN_DIV, (gr_funcptr) polynomial_euclidean_div},

0 commit comments

Comments
 (0)