Skip to content

Commit 93bd89f

Browse files
committed
fixes finite field interface for elimination orderings
1 parent dfa00f0 commit 93bd89f

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/interfaces/nemo.jl

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ function _convert_finite_field_array_to_abstract_algebra(
111111
nr_vars = nvars(R)
112112
CR = coefficient_ring(R)
113113

114-
len = 0
114+
len = 0
115+
ctr = 0
115116

116-
@show eliminate
117117
if eliminate > 0
118118
z = zeros(Int, eliminate)
119119
end
@@ -122,10 +122,6 @@ function _convert_finite_field_array_to_abstract_algebra(
122122
#= check if element is part of the eliminated basis =#
123123
if eliminate > 0
124124
cmp = convert(Vector{Int}, bexp[(len)*nr_vars+1:(len+1)*nr_vars])
125-
@show i
126-
@show cmp[1:eliminate]
127-
@show z
128-
@show cmp[1:eliminate] > z
129125
if cmp[1:eliminate] > z
130126
continue
131127
end
@@ -141,11 +137,12 @@ function _convert_finite_field_array_to_abstract_algebra(
141137
Nemo.set_exponent_vector!(g[i], j, convert(Vector{Int}, bexp[(len+j-1)*nr_vars+1:(len+j)*nr_vars]))
142138
end
143139
end
140+
ctr += 1
144141
len += blen[i]
145142
end
146-
147-
sort_terms!.(g)
148-
return g
143+
basis = g[1:ctr]
144+
sort_terms!.(basis)
145+
return basis
149146
end
150147

151148
function _convert_rational_array_to_abstract_algebra(

test/interfaces/nemo.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
@test_throws ErrorException AlgebraicSolving._convert_to_msolve(F)
1616
R, (x,y,z) = polynomial_ring(GF(101),["x","y","z"], internal_ordering=:degrevlex)
1717
F = [x^2+1-3, x*y-z, x*z^2-3*y^2]
18-
@show F
1918
res = AlgebraicSolving._convert_to_msolve(F)
2019
@test AlgebraicSolving._convert_finite_field_array_to_abstract_algebra(Int32(3), res[1], res[2], res[3], R) == F
2120
end

0 commit comments

Comments
 (0)