Skip to content

Commit 271a57c

Browse files
committed
handles zero ideal input
1 parent a6c7a99 commit 271a57c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/algorithms/groebner-bases.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ function _core_groebner_basis(
131131

132132
F = I.gens
133133
R = first(F).parent
134+
if F == [R(0)]
135+
return F
136+
end
134137
nr_vars = nvars(R)
135138
nr_gens = length(F)
136139
field_char = Int(characteristic(R))
137140

141+
println(field_char)
142+
println(I)
143+
138144
mon_order = 0
139145
elim_block_size = eliminate
140146
reduce_gb = Int(complete_reduction)

src/algorithms/normal-forms.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,18 @@ function _core_normal_form(
121121

122122
#= first get a degree reverse lexicographical Gröbner basis for I =#
123123
if !haskey(I.gb, 0)
124-
groebner_basis(I, eliminate = 0, la_option = 44, info_level = info_level)
124+
if field_char > 2^17
125+
groebner_basis(I, eliminate = 0, la_option = 44, info_level = info_level)
126+
else
127+
groebner_basis(I, eliminate = 0, la_option = 2, info_level = info_level)
128+
end
125129
end
126130
G = I.gb[0]
127131

132+
if G == [R(0)]
133+
return F
134+
end
135+
128136
tbr_nr_gens = length(F)
129137
bs_nr_gens = length(G)
130138
is_gb = 1

0 commit comments

Comments
 (0)