@@ -35,20 +35,20 @@ signature and the second the underlying polynomial.
3535julia> using AlgebraicSolving
3636
3737julia> R, vars = polynomial_ring(GF(17), ["x$i " for i in 1:4])
38- (Multivariate polynomial ring in 4 variables over GF(17), fpMPolyRingElem [x1, x2, x3, x4])
38+ (Multivariate polynomial ring in 4 variables over GF(17), FqMPolyRingElem [x1, x2, x3, x4])
3939
4040julia> F = AlgebraicSolving.cyclic(R)
41- fpMPolyRingElem [x1 + x2 + x3 + x4, x1*x2 + x1*x4 + x2*x3 + x3*x4, x1*x2*x3 + x1*x2*x4 + x1*x3*x4 + x2*x3*x4, x1*x2*x3*x4 + 16]
41+ FqMPolyRingElem [x1 + x2 + x3 + x4, x1*x2 + x1*x4 + x2*x3 + x3*x4, x1*x2*x3 + x1*x2*x4 + x1*x3*x4 + x2*x3*x4, x1*x2*x3*x4 + 16]
4242
4343julia> Fhom = AlgebraicSolving._homogenize(F.gens)
44- 4-element Vector{fpMPolyRingElem }:
44+ 4-element Vector{FqMPolyRingElem }:
4545 x1 + x2 + x3 + x4
4646 x1*x2 + x2*x3 + x1*x4 + x3*x4
4747 x1*x2*x3 + x1*x2*x4 + x1*x3*x4 + x2*x3*x4
4848 x1*x2*x3*x4 + 16*x5^4
4949
5050julia> sig_groebner_basis(Fhom)
51- 7-element Vector{Tuple{Tuple{Int64, fpMPolyRingElem }, fpMPolyRingElem }}:
51+ 7-element Vector{Tuple{Tuple{Int64, FqMPolyRingElem }, FqMPolyRingElem }}:
5252 ((1, 1), x1 + x2 + x3 + x4)
5353 ((2, 1), x2^2 + 2*x2*x4 + x4^2)
5454 ((3, 1), x2*x3^2 + x3^2*x4 + 16*x2*x4^2 + 16*x4^3)
@@ -59,7 +59,7 @@ julia> sig_groebner_basis(Fhom)
5959```
6060"""
6161function sig_groebner_basis (sys:: Vector{T} ; info_level:: Int = 0 , degbound:: Int = 0 ) where {T <: MPolyRingElem }
62- R = first (sys). parent
62+ R = parent ( first (sys))
6363 Rchar = characteristic (R)
6464
6565 # check if input is ok
@@ -131,9 +131,9 @@ function sig_groebner_basis(sys::Vector{T}; info_level::Int=0, degbound::Int=0)
131131 m = monomial (SVector {nv} ((Exp). (exps[j])))
132132 eidx = insert_in_hash_table! (basis_ht, m)
133133 if isone (j)
134- inver = inv (Coeff (cfs[1 ]. data ), char)
134+ inver = inv (Coeff (lift (ZZ, cfs[1 ]) ), char)
135135 end
136- cf = isone (j) ? one (Coeff) : mul (inver, Coeff (cfs[j]. data ), char)
136+ cf = isone (j) ? one (Coeff) : mul (inver, Coeff (lift (ZZ, cfs[j]) ), char)
137137 mons[j] = eidx
138138 coeffs[j] = cf
139139 end
@@ -181,13 +181,13 @@ function sig_groebner_basis(sys::Vector{T}; info_level::Int=0, degbound::Int=0)
181181 exps = [basis_ht. exponents[m]. exps for m in basis. monomials[i]]
182182 ctx = MPolyBuildCtx (R)
183183 for (e, c) in zip (exps, basis. coefficients[i])
184- push_term! (ctx, c , Vector {Int} (e))
184+ push_term! (ctx, coefficient_ring (R)(c) , Vector {Int} (e))
185185 end
186186 pol = finish (ctx)
187187
188188 s = basis. sigs[i]
189189 ctx = MPolyBuildCtx (R)
190- push_term! (ctx, 1 , Vector {Int} (monomial (s). exps))
190+ push_term! (ctx, one ( coefficient_ring (R)) , Vector {Int} (monomial (s). exps))
191191 sig = (Int (index (s)), finish (ctx))
192192
193193 push! (outp, (sig, pol))
0 commit comments