@@ -5,6 +5,8 @@ from flint.flint_base.flint_base cimport (
55 ordering_c_to_py,
66)
77
8+ from flint.flint_base.flint_base import FLINT_RELEASE
9+
810from flint.utils.typecheck cimport typecheck
911from flint.utils.flint_exceptions import DomainError, IncompatibleContextError
1012
@@ -19,7 +21,6 @@ from flint.flintlib.functions.fmpz_mod_mpoly cimport (
1921 fmpz_mod_mpoly_add_fmpz,
2022 fmpz_mod_mpoly_clear,
2123 fmpz_mod_mpoly_compose_fmpz_mod_mpoly,
22- # fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen,
2324 fmpz_mod_mpoly_ctx_get_modulus,
2425 fmpz_mod_mpoly_ctx_init,
2526 fmpz_mod_mpoly_deflate,
@@ -69,9 +70,11 @@ from flint.flintlib.functions.fmpz_mod_mpoly_factor cimport (
6970 fmpz_mod_mpoly_factor_squarefree,
7071 fmpz_mod_mpoly_factor_t,
7172)
73+ from flint.flintlib.functions.compat cimport compat_fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen
7274
7375from flint.types.fmpz_mpoly cimport fmpz_mpoly_ctx, fmpz_mpoly
7476
77+
7578from cpython.object cimport Py_EQ, Py_NE
7679cimport libc.stdlib
7780
@@ -1093,26 +1096,27 @@ cdef class fmpz_mod_mpoly(flint_mpoly):
10931096 return list(stride ), list(shift )
10941097
10951098 cdef _compose_gens_(self , ctx , slong *mapping ):
1096- # FIXME: Remove this when https://github.com/flintlib/flint/pull/2068 is
1097- # resolved
1098-
1099- # cdef fmpz_mod_mpoly res = create_fmpz_mod_mpoly(ctx)
1100- # fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen(
1101- # res.val,
1102- # self.val,
1103- # mapping,
1104- # self.ctx.val,
1105- # (<fmpz_mod_mpoly_ctx>ctx).val
1106- # )
1099+ # FIXME: Remove this when FLINT < 3.2 is dropped
1100+ cdef fmpz_mod_mpoly res
1101+ if FLINT_RELEASE >= 30200 :
1102+ res = create_fmpz_mod_mpoly(ctx)
1103+ compat_fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen(
1104+ res.val,
1105+ self .val,
1106+ mapping,
1107+ self .ctx.val,
1108+ (< fmpz_mod_mpoly_ctx> ctx).val
1109+ )
1110+ return res
11071111
11081112 cdef:
11091113 fmpz_mpoly_ctx mpoly_ctx = fmpz_mpoly_ctx.from_context(self .context())
11101114 fmpz_mpoly_ctx res_ctx = fmpz_mpoly_ctx.from_context(ctx)
11111115
11121116 fmpz_mpoly poly = mpoly_ctx.from_dict(self .to_dict())
1113- fmpz_mpoly res = poly._compose_gens_(res_ctx, mapping)
1117+ fmpz_mpoly res1 = poly._compose_gens_(res_ctx, mapping)
11141118
1115- return ctx.from_dict(res .to_dict())
1119+ return ctx.from_dict(res1 .to_dict())
11161120
11171121
11181122cdef class fmpz_mod_mpoly_vec:
0 commit comments