@@ -5,6 +5,8 @@ from flint.flint_base.flint_base cimport (
5
5
ordering_c_to_py,
6
6
)
7
7
8
+ from flint.flint_base.flint_base import FLINT_RELEASE
9
+
8
10
from flint.utils.typecheck cimport typecheck
9
11
from flint.utils.flint_exceptions import DomainError, IncompatibleContextError
10
12
@@ -19,7 +21,6 @@ from flint.flintlib.functions.fmpz_mod_mpoly cimport (
19
21
fmpz_mod_mpoly_add_fmpz,
20
22
fmpz_mod_mpoly_clear,
21
23
fmpz_mod_mpoly_compose_fmpz_mod_mpoly,
22
- # fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen,
23
24
fmpz_mod_mpoly_ctx_get_modulus,
24
25
fmpz_mod_mpoly_ctx_init,
25
26
fmpz_mod_mpoly_deflate,
@@ -69,9 +70,11 @@ from flint.flintlib.functions.fmpz_mod_mpoly_factor cimport (
69
70
fmpz_mod_mpoly_factor_squarefree,
70
71
fmpz_mod_mpoly_factor_t,
71
72
)
73
+ from flint.flintlib.functions.compat cimport compat_fmpz_mod_mpoly_compose_fmpz_mod_mpoly_gen
72
74
73
75
from flint.types.fmpz_mpoly cimport fmpz_mpoly_ctx, fmpz_mpoly
74
76
77
+
75
78
from cpython.object cimport Py_EQ, Py_NE
76
79
cimport libc.stdlib
77
80
@@ -1093,26 +1096,27 @@ cdef class fmpz_mod_mpoly(flint_mpoly):
1093
1096
return list(stride ), list(shift )
1094
1097
1095
1098
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
1107
1111
1108
1112
cdef:
1109
1113
fmpz_mpoly_ctx mpoly_ctx = fmpz_mpoly_ctx.from_context(self .context())
1110
1114
fmpz_mpoly_ctx res_ctx = fmpz_mpoly_ctx.from_context(ctx)
1111
1115
1112
1116
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)
1114
1118
1115
- return ctx.from_dict(res .to_dict())
1119
+ return ctx.from_dict(res1 .to_dict())
1116
1120
1117
1121
1118
1122
cdef class fmpz_mod_mpoly_vec:
0 commit comments