Skip to content

Commit 9053d9b

Browse files
author
Remi Prebet
committed
GB of zero ideal is 0
1 parent 5781ff5 commit 9053d9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/algorithms/groebner-bases.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function _core_groebner_basis(
152152
F = I.gens
153153

154154
if iszero(F)
155-
I.gb[eliminate] = QQMPolyRingElem[]
155+
I.gb[eliminate] = length(F)==0 ? F : F[1:1]
156156
return I.gb[eliminate]
157157
end
158158

@@ -207,6 +207,11 @@ function _core_groebner_basis(
207207
nr_thrds, max_nr_pairs, 0, la_option, reduce_gb, 0, info_level)
208208
end
209209

210+
if nr_terms == 0
211+
I.gb[eliminate] = [R(0)]
212+
return I.gb[eliminate]
213+
end
214+
210215
# convert to julia array, also give memory management to julia
211216
jl_ld = gb_ld[]
212217
jl_len = Base.unsafe_wrap(Array, gb_len[], jl_ld)

0 commit comments

Comments
 (0)