Skip to content

Commit ceb5977

Browse files
committed
uses lower level interface to AbstractAlgebra multivariate polynomials over finite fields
1 parent 5c1ba82 commit ceb5977

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/interfaces/nemo.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,15 @@ function _convert_finite_field_array_to_abstract_algebra(
112112
if bcf[len+1] == 0
113113
push!(basis, R(0))
114114
else
115-
g = MPolyBuildCtx(R)
115+
g = zero(R)
116+
ccall((:fq_nmod_mpoly_resize, Nemo.libflint), Cvoid, (Ref{FqMPolyRingElem}, Int, Ref{FqMPolyRing}), g, blen[i], parent(g))
116117
for j in 1:blen[i]
117-
push_term!(g, CR(bcf[len+j]),
118-
convert(Vector{Int}, bexp[(len+j-1)*nr_vars+1:(len+j)*nr_vars]))
118+
Nemo.setcoeff!(g, j, CR(bcf[len+j]))
119119
end
120-
push!(basis, finish(g))
120+
for j in 1:blen[i]
121+
Nemo.set_exponent_vector!(g, j, convert(Vector{Int}, bexp[(len+j-1)*nr_vars+1:(len+j)*nr_vars]))
122+
end
123+
push!(basis, g)
121124
end
122125
len += blen[i]
123126
end

0 commit comments

Comments
 (0)