From a48fb57234396bd72e46af440d2988fb460def99 Mon Sep 17 00:00:00 2001 From: ederc Date: Thu, 1 Aug 2024 21:17:40 +0200 Subject: [PATCH 1/3] generalizes test for zero ideal input --- src/algorithms/groebner-bases.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/algorithms/groebner-bases.jl b/src/algorithms/groebner-bases.jl index 37d48d0..e88dbb6 100644 --- a/src/algorithms/groebner-bases.jl +++ b/src/algorithms/groebner-bases.jl @@ -151,7 +151,9 @@ function _core_groebner_basis( F = I.gens R = first(F).parent - if F == [R(0)] + + if F == repeat([R(0)], length(F)) + I.gb[eliminate] = F return F end nr_vars = nvars(R) From 1fd216a2036baf757c0fe4ea6ee9e16f7b2a4291 Mon Sep 17 00:00:00 2001 From: ederc Date: Thu, 1 Aug 2024 21:18:34 +0200 Subject: [PATCH 2/3] adds test after conversion to msolve input format if all input is invalid --- src/algorithms/groebner-bases.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/algorithms/groebner-bases.jl b/src/algorithms/groebner-bases.jl index e88dbb6..a9e2eb3 100644 --- a/src/algorithms/groebner-bases.jl +++ b/src/algorithms/groebner-bases.jl @@ -166,7 +166,6 @@ function _core_groebner_basis( error("Number of variables to be eliminated is bigger than number of variables in ring.") end reduce_gb = Int(complete_reduction) - # convert ideal to flattened arrays of ints if !(field_char == 0) @@ -178,6 +177,11 @@ function _core_groebner_basis( # nr_gens might change if F contains zero polynomials lens, cfs, exps, nr_gens = _convert_to_msolve(F) + # recheck if all input data is invalid + if nr_gens == 0 + I.gb[eliminate] = F + return I.gb[eliminate] + end gb_ld = Ref(Cint(0)) gb_len = Ref(Ptr{Cint}(0)) gb_exp = Ref(Ptr{Cint}(0)) From 279d71dfc10f0f9abbb8cc7970878d23c2d0368b Mon Sep 17 00:00:00 2001 From: ederc Date: Thu, 1 Aug 2024 21:19:09 +0200 Subject: [PATCH 3/3] prepares bug fix release --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bea0c9a..30e143d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AlgebraicSolving" uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" authors = ["ederc ", "Mohab Safey El Din "] -version = "0.6.0" +version = "0.6.1" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"