From c156d921e3e1538d2c26592f2abc67a83be4a23f Mon Sep 17 00:00:00 2001 From: jwelp Date: Mon, 26 Jul 2021 09:52:17 +0200 Subject: [PATCH 01/85] setup --- src/Groebnerwalk/GW.jl | 177 +++++++++++++++++++ src/Groebnerwalk/GWtest.jl | 149 ++++++++++++++++ src/Groebnerwalk/GWutils.jl | 308 ++++++++++++++++++++++++++++++++++ src/Groebnerwalk/UtilsGenWalk | 275 ++++++++++++++++++++++++++++++ src/Groebnerwalk/UtilsStWalk | 30 ++++ src/Groebnerwalk/testwiese | 35 ++++ 6 files changed, 974 insertions(+) create mode 100644 src/Groebnerwalk/GW.jl create mode 100644 src/Groebnerwalk/GWtest.jl create mode 100644 src/Groebnerwalk/GWutils.jl create mode 100644 src/Groebnerwalk/UtilsGenWalk create mode 100644 src/Groebnerwalk/UtilsStWalk create mode 100644 src/Groebnerwalk/testwiese diff --git a/src/Groebnerwalk/GW.jl b/src/Groebnerwalk/GW.jl new file mode 100644 index 000000000..3b3b79003 --- /dev/null +++ b/src/Groebnerwalk/GW.jl @@ -0,0 +1,177 @@ +using Oscar + + + +############################################################### +#Implementation of the gröbner walk. +#TODO: Implement pertubed version. +#TODO: Implement generic version. +#TODO: Implement fractal version. +############################################################### + + +############################################################### +#Top-Level +#TODO: Implement input checks +#Fragen: +#Singular.reduce für f % G selbst programmieren? +#Interreduction selbst endgültig programmieren programmieren? +#Für divrem in Oscar-Ideal: sinnvoller möglich? +#Arithmetik von Polynomen -> Immer MPolyBuildCTX? +############################################################### + +function groebner_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, +) + + if grwalktype == :standard + walk = (x, y, z) -> standard_walk(x, y, z) + elseif grwalktype == :generic + walk = (x, y, z) -> generic_walk(x, y, z) + elseif grwalktype == :pertubed + walk = (x, y, z) -> pertubed_walk(x, y, z) + elseif grwalktype == :fractal + walk = (x, y, z) -> fractal_walk(x, y, z) + #error("Choose a strategy from: :generic, :standard ...") + # fill the list or implement a functionality to choose the best + # way w.r.t. the type of the ideal + end + + ######TODO:Check the parameter##### + R = singular_ring(base_ring(G)) + I = Singular.Ideal(R, [R(x) for x in gens(G)]) + + return walk(I, S, T) +end + + +############################################################### +#Standard-version of the groebner walk by Collart et al +############################################################### +function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + cweight = S[1, :] + tweight = T[1, :] + G = standard_step(I, cweight, tweight, T) + + #loop + while cweight != tweight + cweight = nextw(G, cweight, tweight) + G = standard_step(G, cweight, tweight, T) + #@info "Current Gröbnerbase: " G + end + + #finalization + S, V = change_order(G, T) + return Oscar.Singular.Ideal(S, [change_ring(gen, S) for gen in gens(G)]) + +end + +function standard_step( + G::Singular.sideal, + cw::Array{Int64,1}, + tw::Array{Int64,1}, + T::Matrix{Int64}, +) + R = base_ring(G) + S, V = change_order(G, cw, T) + inwG = initials(S, gens(G), cw) + IinwG = Singular.std( + Oscar.Singular.Ideal(S, [S(x) for x in inwG]), + complete_reduction = true, + ) + + #Lifting to GB of new cone + rest = [ + gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) + for gen in gens(IinwG) + ] + Gnew = Oscar.Singular.Ideal(S, [S(x) for x in rest]) + Gnew.isGB = true + + return Oscar.Singular.std(Gnew, complete_reduction = true) +end + +############################################################### +#Generic-version of the groebner walk by Fukuda et al. (2007) +############################################################### + + +function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + R, V = change_order(G, T) + + v = nextV(G, [0], S, T) + lm = [Singular.leading_monomial(g) for g in gens(G)] + + while !isempty(v) + G, lm = generic_step(G, R, v, T, lm) + @info "Current Gröbnerbase: " G + v = nextV(G,lm, v, S, T) + end + G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + return G +end + +function generic_step( + G::Singular.sideal, + S::MPolyRing, + v::Vector{Int64}, + T::Matrix{Int64}, + lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + R = base_ring(G) + facet_Generators = facet_initials(S, G, v, lm) + + facet_Ideal = Singular.std( + Oscar.Singular.Ideal(S, [S(x) for x in facet_Generators]), + complete_reduction = true, + ) + + println("Facet Ideal: ", facet_Ideal) + + liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) + Gnew = Oscar.Singular.Ideal(S, [S(x) for x in liftArray]) + + #println("New lifted GB: ", Gnew, " with LM: ", Newlm) + Gnew = interreduce_new(Gnew, Newlm) + Gnew = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) + Gnew.isGB = true + return Gnew, Newlm +end + + +############################################################### +#Fractal-version of the groebner walk by Amrhein & Gloor (200) +############################################################### + +function fractal_walk( + G::Singular.sideal, + cweight::Array{Int,1}, + tweight::Array{Int,1}, + tord::Symbol, +) + + T = ordering_as_Matrix(tweight, tord) + M = nextw(G, cweight, tweight) + R = base_ring(G) + S, V = change_order(G, cw, tw, ordering) + + inwG = initials(S, gens(G), cw) + + IinwG = Singular.std( + Oscar.Singular.Ideal(S, [S(x) for x in inwG]), + complete_reduction = true, + ) + G.isGB = true + + #Lifting to GB of new cone + rest = [ + gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) + for gen in gens(IinwG) + ] + Gnew = Oscar.Singular.Ideal(S, [S(x) for x in rest]) + Gnew.isGB = true + return std(Gnew, complete_reduction = true) +end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl new file mode 100644 index 000000000..33623763b --- /dev/null +++ b/src/Groebnerwalk/GWtest.jl @@ -0,0 +1,149 @@ +using Pkg + +using Oscar + + +case = 4 + + +if case == 1 || case == 99 + R, (x, y) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + ) + + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = Singular.Ideal(R, [f1, f2]) + + I = Oscar.Singular.std(I, complete_reduction = true) + + S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) + + J = groebner_walk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :generic, + ) + T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + + S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) + T2 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + println("test 1: ", equalitytest(T1, T2)) +end + +if case == 2 || case == 99 + + R, (x, y, z) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([5, 4, 1], :deglex)), + ) + + f1 = x^2 - y + f2 = y^2 - x * z - y * z + I = Singular.Ideal(R, [f1, f2]) + + I = Oscar.Singular.std(I, complete_reduction = true) + + + J = groebner_walk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :generic, + ) + + S, V = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), + ) + T1 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]), + complete_reduction = true, + ) + T2 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + println("test 2: ", equalitytest(T1, T2)) + +end + + +if case == 3 || case == 99 + R, (x, y) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:deglex, 2)), + ) + + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = Singular.Ideal(R, [f1, f2]) + + I = Oscar.Singular.std(I, complete_reduction = true) + + T1 = groebner_walk( + I, + ordering_as_matrix(:deglex, 2), + ordering_as_matrix(:lex, 2), + :generic, + ) + S, V = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y"], + ordering = Oscar.Singular.ordering_M([1 0; 0 1]), + ) + T2 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + println("test 3: ", equalitytest(T1, T2)) + +end + +if case == 4 || case == 99 + R, (x, y, z, u, v, w) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + + f1 = x * y^3 + y^4 + y * z^2 - u^2 #* y * x * w^3 + f2 = 2 * x^2 * y + x^3 * y + 2 #* w * y^2 * z #+ u * x * v^4 + f3 = 2 - 3 * x^2 * v * w #+ #u+ w^2 #* y + v^3 + I = Singular.Ideal(R, [f1, f2, f3]) + I = Oscar.Singular.std(I, complete_reduction = true) + + + @time J = groebner_walk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic + ) + + + S, V = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Oscar.Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T1 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + + println("test 4: ", equalitytest(T1, T2)) +end diff --git a/src/Groebnerwalk/GWutils.jl b/src/Groebnerwalk/GWutils.jl new file mode 100644 index 000000000..2a12e473e --- /dev/null +++ b/src/Groebnerwalk/GWutils.jl @@ -0,0 +1,308 @@ + +using Oscar + + + + + +#Returns the initials of polynomials w.r.t. a weight vector. +#The ordering doesn´t affect this. +function initials( + R::MPolyRing, + G::Array{T,1}, + w::Array{K,1}, +) where {T<:RingElement,K<:Number} + inits = [] + for g in G + maxw = 0 + indexw = [] + e = collect(Singular.exponent_vectors(g)) + for i = 1:length(g) + tmpw = dot(w, e[i]) + if maxw == tmpw + push!(indexw, (i, e[i])) + #rethink this. gens are preordered + elseif maxw < tmpw + indexw = [] + push!(indexw, (i, e[i])) + maxw = tmpw + end + end + inw = MPolyBuildCtx(R) + for (k, j) in indexw + push_term!(inw, collect(Singular.coefficients(g))[k], j) + end + h = finish(inw) + push!(inits, h) + end + return inits +end + +function diff_vectors( + I::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + ) + v = [] + for i in 1:ngens(I) + ltu = Singular.leading_exponent_vector(Lm[i]) + for e in filter(x -> ltu != x, collect(Singular.exponent_vectors(gens(I)[i]))) + push!(v, ltu .- e) + end + end + return unique!(v) +end + +function diff_vectors(I::Singular.sideal) + v = [] + for g in gens(I) + ltu = Singular.leading_exponent_vector(g) + for e in Singular.exponent_vectors(tail(g)) + push!(v, ltu .- e) + end + end + return unique!(v) +end + +############################################################### +#TODO: Change T instead of using a() +############################################################### +function change_order( + I::Singular.sideal, + cweight::Array{L,1}, + T::Matrix{Int64}, +) where {L<:Number,K<:Number} + R = I.base_ring + G = Singular.gens(I.base_ring) + Gstrich = string.(G) + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_a(cweight) * + Oscar.Singular.ordering_M(T), + ) + return S, H +end + +function change_order( + I::Singular.sideal, + M::Matrix{Int64}, +) where {T<:Number,K<:Number} + R = I.base_ring + G = Singular.gens(I.base_ring) + Gstrich = string.(G) + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_M(M), + ) + #@error("Not implemented yet") + return S, H +end + +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(coefficients(p), exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + push_term!(M, c, v) + end + return finish(M) +end +function change_ring(p::Singular.spoly, R::MPolyRing) + cvzip = zip(coefficients(p), exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + push_term!(M, c, v) + end + return finish(M) +end + +function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) + if length(w) > 2 + if ord == :lex || ord == Symbol("Singular(lp)") + return [ + w' + ident_matrix(length(w))[1:length(w)-1, :] + ] + end + if ord == :deglex + return [ + w' + ones(Int64, length(w))' + ident_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :degrevlex || a.ord == Symbol("Singular(dp)") + return [ + w' + ones(Int64, length(w))' + anti_diagonal_matrix(length(w))[1:length(w)-2, :] + ] + end + else + error("not implemented yet") + end +end + +function ordering_as_matrix(ord::Symbol, nvars::Int64) + if ord == :lex || ord == Symbol("Singular(lp)") + #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int64, nvars)' + ident_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :degrevlex || a.ord == Symbol("Singular(dp)") + return [ + ones(Int64, nvars)' + anti_diagonal_matrix(nvars)[1:nvars-1, :] + ] + end +end + + + +#Not needed at the moment. Use this instead of a(),ordering_M +function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) + M = [ + v' + T[1:length(v)-1, :] + ] + return M +end + +function pert_Vectors(M::Matrix{Int64}, p::Integer) + +end + +function tdeg(p::Singular.spoly) + max = 0 + for mon in monomials + ev = collect(exponent_vectors(mon)) + sum = 0 + for e in ev + sum = e + sum + end + if (max < sum) + max = sum + end + end + return max +end + +function interreduce_new( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}) + R=base_ring(G) + gens = collect(Singular.gens(G)) + changed = true + while changed + changed = false + for i = 1:ngens(G) + #gensrest = filter(x -> x != gens[i], gens) + gensrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + Lmrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + ## New function + for j = 1:ngens(G) + if i != j + push!(gensrest, gens[j]) + push!(Lmrest, Lm[j]) + end + end + #Lmrest = filter(x -> x != Lm[i], Lm) + gen =reducegeneric_recursiv(gens[i], Singular.Ideal(R,gensrest), Lmrest) + if gens[i] != gen + changed = true + gens[i]= first(Singular.gens(Singular.Ideal(R, R(gen)))) + break + end + end +end + return Oscar.Singular.Ideal(R, [R(p) for p in gens]) +end +#Refactor: Using Polynomial-arithmetik is expensive. Use MPolybuildCTX +#=function interreduce( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + reducedGB = [] + R = base_ring(G) + S, V = PolynomialRing( + base_ring(R).base_ring, + [String(s) for s in symbols(R)], + ordering = :lex, + ) + lm = gens(ideal(S, Lm)) + gen = gens(ideal(S, gens(G))) + changed = true + while changed + changed = false + for i = 1:ngens(G) + Lmrest = filter(x -> x != lm[i], lm) + genrest = filter(x -> x != gen[i], gen) + poly = gen[i] + for mon in terms(gen[i]) + (q, r) = divrem(mon, Lmrest) + if r == 0 + changed = true + poly = poly - change_ring(R(vec_sum(q, genrest)), R) + break + if poly == 0 + lm[i] = 0 + end + end + end + push!(reducedGB, poly) + end + gen = gens(ideal(S, [S(p) for p in reducedGB])) + reducedGB = [] + end + return Oscar.Singular.Ideal(R, [R(p) for p in gen]) +end +=# +#Refactor: Using Polynomial-arithmetik is expensive. Use MPolybuildCTX +function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) + poly = 0 + for i = 1:length(p) + poly = poly + p[i] * q[i] + end + return poly +end +# Singular.isequal depends on order of generators +function equalitytest(G::Singular.sideal, K::Singular.sideal) + generators = gens(G) + count = 0 + for gen in generators + for r in gens(K) + if gen - r == 0 + count = count + 1 + end + end + end + if count == ngens(G) + return true + end + return false +end + + +############################################# +# unspecific help functions +############################################# +function ident_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end diff --git a/src/Groebnerwalk/UtilsGenWalk b/src/Groebnerwalk/UtilsGenWalk new file mode 100644 index 000000000..5a8380ee2 --- /dev/null +++ b/src/Groebnerwalk/UtilsGenWalk @@ -0,0 +1,275 @@ +using Oscar + + +function facet_initials( + R::MPolyRing, + G::Singular.sideal, + v::Vector{Int64}, + lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + inits = [] + count = 1 + for g in gens(G) + inw = MPolyBuildCtx(R) + #V = filter(x -> less_facet(S, x), diff_vectors(G) + el = collect(Singular.exponent_vectors(lm[count]))[1] + + for i = 1:length(g) + e = collect(Singular.exponent_vectors(g))[i] + if el == e || isparallel(el - e, v) + push_term!(inw, collect(Singular.coefficients(g))[i], e) + end + end + + #push_term!(inw, collect(Singular.coefficients(lm[count]))[1], collect(Singular.exponent_vectors(lm[count]))[1]) + h = finish(inw) + push!(inits, h) + count = count + 1 + + end + #@info "Facet Initials: " inits + return inits +end + +function isparallel(u::Vector{Int64}, v::Vector{Int64}) + #TODO: maybe false this way + count = 1 + x = 0 + for i in 1:length(u) + if u[i] == 0 + if v[count] == 0 + count = count + 1 + else + return false + end + else + x = v[count] // u[i] + count = count + 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + if v[i] != x * u[i] + return false + end + end + return true +end + +#=function reducegeneric( + p::Singular.spoly, + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + R = base_ring(G) + S, V = PolynomialRing( + base_ring(R).base_ring, + [String(s) for s in symbols(R)], + ordering = :lex, + ) + lm = gens(ideal(S, Lm)) + gen = gens(ideal(S, gens(G))) + h = first(gens(ideal(S, [p]))) + Gh = [] + for i = 1:ngens(G) + for mon in terms(h) + (q, r) = divrem(mon, lm[i]) + if r == 0 + push!(Gh, (lm[i], gen[i], q)) + break + end + end + end + while (h != 0 && !isempty(Gh)) + (l, g, q) = first(Gh) + h = h - g * q + + #println("terminated:", " = ", h , " spaace ", g, " * ", q) + Gh = [] + term = false + for i = 1:ngens(G) + for mon in terms(h) + (q, r) = divrem(mon, lm[i]) + if r == 0 + term = true + push!(Gh, (lm[i], gen[i], q)) + #println("mon", mon) + #println(lm[i]," * ", q," = ", mon, " from ", h) + break + end + end + term == true ? break : continue + end + end + return h +end +=# +function liftgeneric( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + I::Singular.sideal, +) + S = base_ring(G) + count = 1 + Newlm = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + liftArray = Array{fmpq_mpoly,1}(undef, 0) + for g in gens(I) + diff = + change_ring(g, S) - reducegeneric_recursiv(change_ring(g, S), G, Lm) + if diff != 0 + push!(Newlm, Oscar.Singular.leading_monomial(g)) + push!(liftArray, diff) + end + end + return check_zeros(liftArray, Newlm) +end + +function check_zeros( + G::Vector{fmpq_mpoly}, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + Lm = filter(x -> x != 0, Lm) + G = filter(x -> x != 0, G) + return G, Lm +end + +function nextV( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) + @info "#1 Current V: " V + + filter!(x -> less_than_zero(T, x), V) + @info "#2 Current V: " V + + if (w != [0]) + filter!(x -> less_facet(w, x, S, T), V) + end + @info "#3 Current V: " V + if isempty(V) + return V + end + + + minV = V[1] + for i = 2:length(V) + if less_facet(V[i], minV, S, T) + minV = V[i] + end + end + + @info "#4 Current V: " minV + return minV +end +function nextV( + G::Singular.sideal, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + V = filter(x -> bigger_than_zero(S, x), diff_vectors(G)) + @info "#1 Current V: " V + + filter!(x -> less_than_zero(T, x), V) + @info "#2 Current V: " V + + if (w != [0]) + filter!(x -> less_facet(w, x, S, T), V) + end + @info "#3 Current V: " V + if isempty(V) + return V + end + + + minV = V[1] + for i = 2:length(V) + if less_facet(V[i], minV, S, T) + minV = V[i] + end + end + + @info "#4 Current V: " minV + return minV +end + + +function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + for i = 1:size(M)[1] + d = dot(M[i, :], v) + if (d != 0) + return d > 0 + end + end + return false +end + + +function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + for i = 1:size(M)[1] + d = dot(M[i, :], v) + if (d != 0) + return d < 0 + end + end + return false +end + +function less_facet( + u::Vector{Int64}, + v::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + for i = 1:size(T)[1] + for j = 1:size(S)[1] + Tuv = dot(T[i, :], u) * dot(S[j, :], v) + Tvu = dot(T[i, :], v) * dot(S[j, :], u) + if Tuv != Tvu + return Tuv < Tvu + end + end + end + return false +end + +function reducegeneric_recursiv( + p::T, + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) where {T<:RingElement} + R = base_ring(G) + S, V = PolynomialRing( + base_ring(R).base_ring, + [String(s) for s in symbols(R)], + ordering = :lex, + ) + Gh = [] + for i = 1:ngens(G) + for mon in terms(first(gens(ideal(S, [p])))) + (q, r) = divrem(mon, gens(ideal(S, Lm))[i]) + if r == 0 + push!(Gh, (i, q)) + break + end + end + end + if !isempty(Gh) + for (i, q) in Gh + return reducegeneric_recursiv( + p - q * gens(ideal(S, gens(G)))[i], + G, + Lm, + ) + end + else + return p + end +end diff --git a/src/Groebnerwalk/UtilsStWalk b/src/Groebnerwalk/UtilsStWalk new file mode 100644 index 000000000..febbe246b --- /dev/null +++ b/src/Groebnerwalk/UtilsStWalk @@ -0,0 +1,30 @@ +using Oscar + + +#Solves problems with wight vectors of floats. +function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + +function nextw( + I::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + #@info "Computing next Boundingvector for I = " base_ring(I) + tv = [] + for v in diff_vectors(I) + if dot(tweight, v) < 0 + push!(tv, dot(cweight, v) // (dot(cweight, v) - dot(tweight, v))) + end + end + #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] + push!(tv, 1) + t = minimum(tv) + w = (1 - t) * cweight + t * tweight + return convertBoundingVector(w) +end diff --git a/src/Groebnerwalk/testwiese b/src/Groebnerwalk/testwiese new file mode 100644 index 000000000..c7563f199 --- /dev/null +++ b/src/Groebnerwalk/testwiese @@ -0,0 +1,35 @@ +using Pkg + +using Oscar +import Oscar: MPolyIdeal, singular_ring +import Oscar.Singular: std, Ideal, ordering_ws +import AbstractAlgebra + +S, (x, y) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y"], + ordering = Oscar.Singular.ordering_wp([1, 1]), +) +R, (x, y) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y"], + ordering = Oscar.Singular.ordering_wp([100, 17]), +) + + + + + + +#R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"], ordering =:deglex) + +#R, (x, y) = PolynomialRing(QQ, ["x", "y"], ordering= :degrevlex) +f1 = -x*y^2 + y^6 - y^3 +f2 = x*y^3 - x - y^2 +f3 = x^2 - y^3 +lm = y^6, x*y^3, x^2] +#f1= x*y^3+y^4+y*z^2 -u^2*y*x*w^3 +#f2= 2*x^2*y+x^3*y+2*x*y^2*z + u*x*v^4 +#f3=2 - 3*x^2*y+ w^2*y + v^3 +#I = ideal(R, [f1,f2]); +I = Singular.Ideal(S, f1, f2, f3) From 426402ebdc14b8d6b9c3c4b81bb5f99038006ef2 Mon Sep 17 00:00:00 2001 From: jwelp Date: Mon, 26 Jul 2021 10:03:49 +0200 Subject: [PATCH 02/85] Setting up packages --- src/Groebnerwalk.jl | 4 ++++ src/Groebnerwalk/{UtilsGenWalk => GenWalk.jl} | 0 src/Groebnerwalk/{GW.jl => GroebnerWalk.jl} | 1 + src/Groebnerwalk/{GWutils.jl => GroebnerWalkUtils.jl} | 0 src/Groebnerwalk/{UtilsStWalk => StWalk.jl} | 0 src/Singular.jl | 2 ++ 6 files changed, 7 insertions(+) create mode 100644 src/Groebnerwalk.jl rename src/Groebnerwalk/{UtilsGenWalk => GenWalk.jl} (100%) rename src/Groebnerwalk/{GW.jl => GroebnerWalk.jl} (99%) rename src/Groebnerwalk/{GWutils.jl => GroebnerWalkUtils.jl} (100%) rename src/Groebnerwalk/{UtilsStWalk => StWalk.jl} (100%) diff --git a/src/Groebnerwalk.jl b/src/Groebnerwalk.jl new file mode 100644 index 000000000..82b0b24a2 --- /dev/null +++ b/src/Groebnerwalk.jl @@ -0,0 +1,4 @@ +include("Groebnewalk/GroebnerWalk.jl") +include("Groebnewalk/GroebnerWalkUtils.jl") +include("Groebnewalk/GenWalk.jl") +include("Groebnewalk/StWalk.jl") diff --git a/src/Groebnerwalk/UtilsGenWalk b/src/Groebnerwalk/GenWalk.jl similarity index 100% rename from src/Groebnerwalk/UtilsGenWalk rename to src/Groebnerwalk/GenWalk.jl diff --git a/src/Groebnerwalk/GW.jl b/src/Groebnerwalk/GroebnerWalk.jl similarity index 99% rename from src/Groebnerwalk/GW.jl rename to src/Groebnerwalk/GroebnerWalk.jl index 3b3b79003..1711359db 100644 --- a/src/Groebnerwalk/GW.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -1,5 +1,6 @@ using Oscar +export groebner_walk ############################################################### diff --git a/src/Groebnerwalk/GWutils.jl b/src/Groebnerwalk/GroebnerWalkUtils.jl similarity index 100% rename from src/Groebnerwalk/GWutils.jl rename to src/Groebnerwalk/GroebnerWalkUtils.jl diff --git a/src/Groebnerwalk/UtilsStWalk b/src/Groebnerwalk/StWalk.jl similarity index 100% rename from src/Groebnerwalk/UtilsStWalk rename to src/Groebnerwalk/StWalk.jl diff --git a/src/Singular.jl b/src/Singular.jl index 805cd66df..1ba315e4b 100644 --- a/src/Singular.jl +++ b/src/Singular.jl @@ -214,4 +214,6 @@ include("Map.jl") include("MessyHacks.jl") +include("Groebnerwalk.jl") + end # module From c70571f38e5e2b263ec4e50b52d54ef946e282e9 Mon Sep 17 00:00:00 2001 From: jwelp Date: Mon, 26 Jul 2021 16:27:11 +0200 Subject: [PATCH 03/85] cleanup --- src/Groebnerwalk/GWtest.jl | 21 ++++++++---- src/Groebnerwalk/GenWalk.jl | 48 --------------------------- src/Groebnerwalk/GroebnerWalk.jl | 10 +++--- src/Groebnerwalk/GroebnerWalkUtils.jl | 44 ++---------------------- src/Groebnerwalk/StWalk.jl | 2 +- 5 files changed, 23 insertions(+), 102 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 33623763b..9db57a82f 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -3,7 +3,7 @@ using Pkg using Oscar -case = 4 +case = 3 if case == 1 || case == 99 @@ -119,9 +119,9 @@ if case == 4 || case == 99 ) - f1 = x * y^3 + y^4 + y * z^2 - u^2 #* y * x * w^3 - f2 = 2 * x^2 * y + x^3 * y + 2 #* w * y^2 * z #+ u * x * v^4 - f3 = 2 - 3 * x^2 * v * w #+ #u+ w^2 #* y + v^3 + f1 = y^4 + y * z^2 - u^2*w + f2 = 2 * x^2 * y + x^3 * w *u^2 +x + f3 = 2 - 3 * x^2 * v *z^4 *w I = Singular.Ideal(R, [f1, f2, f3]) I = Oscar.Singular.std(I, complete_reduction = true) @@ -130,7 +130,12 @@ if case == 4 || case == 99 I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :generic + ) + @time K = groebner_walk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, ) @@ -139,11 +144,13 @@ if case == 4 || case == 99 ["x", "y", "z", "u", "v", "w"], ordering = Oscar.Singular.ordering_M(ordering_as_matrix(:lex, 6)), ) - @time T1 = Singular.std( + T1 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + - println("test 4: ", equalitytest(T1, T2)) + println("test 4: ", equalitytest(T2,T3)) end diff --git a/src/Groebnerwalk/GenWalk.jl b/src/Groebnerwalk/GenWalk.jl index 5a8380ee2..2b2955f20 100644 --- a/src/Groebnerwalk/GenWalk.jl +++ b/src/Groebnerwalk/GenWalk.jl @@ -59,54 +59,6 @@ function isparallel(u::Vector{Int64}, v::Vector{Int64}) return true end -#=function reducegeneric( - p::Singular.spoly, - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, -) - R = base_ring(G) - S, V = PolynomialRing( - base_ring(R).base_ring, - [String(s) for s in symbols(R)], - ordering = :lex, - ) - lm = gens(ideal(S, Lm)) - gen = gens(ideal(S, gens(G))) - h = first(gens(ideal(S, [p]))) - Gh = [] - for i = 1:ngens(G) - for mon in terms(h) - (q, r) = divrem(mon, lm[i]) - if r == 0 - push!(Gh, (lm[i], gen[i], q)) - break - end - end - end - while (h != 0 && !isempty(Gh)) - (l, g, q) = first(Gh) - h = h - g * q - - #println("terminated:", " = ", h , " spaace ", g, " * ", q) - Gh = [] - term = false - for i = 1:ngens(G) - for mon in terms(h) - (q, r) = divrem(mon, lm[i]) - if r == 0 - term = true - push!(Gh, (lm[i], gen[i], q)) - #println("mon", mon) - #println(lm[i]," * ", q," = ", mon, " from ", h) - break - end - end - term == true ? break : continue - end - end - return h -end -=# function liftgeneric( G::Singular.sideal, Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 1711359db..caf8a4998 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -1,12 +1,12 @@ using Oscar -export groebner_walk +export groebnerwalk ############################################################### #Implementation of the gröbner walk. #TODO: Implement pertubed version. -#TODO: Implement generic version. +#TODO: Improve GenWalk algorithm #TODO: Implement fractal version. ############################################################### @@ -16,12 +16,11 @@ export groebner_walk #TODO: Implement input checks #Fragen: #Singular.reduce für f % G selbst programmieren? -#Interreduction selbst endgültig programmieren programmieren? -#Für divrem in Oscar-Ideal: sinnvoller möglich? +#Für divrem in Oscar-Ideal: sinnvoller möglich? reduce liefert nur den rest #Arithmetik von Polynomen -> Immer MPolyBuildCTX? ############################################################### -function groebner_walk( +function groebnerwalk( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -145,6 +144,7 @@ end ############################################################### #Fractal-version of the groebner walk by Amrhein & Gloor (200) +#TODO: Finish this ############################################################### function fractal_walk( diff --git a/src/Groebnerwalk/GroebnerWalkUtils.jl b/src/Groebnerwalk/GroebnerWalkUtils.jl index 2a12e473e..672698dc3 100644 --- a/src/Groebnerwalk/GroebnerWalkUtils.jl +++ b/src/Groebnerwalk/GroebnerWalkUtils.jl @@ -222,47 +222,8 @@ function interreduce_new( end return Oscar.Singular.Ideal(R, [R(p) for p in gens]) end -#Refactor: Using Polynomial-arithmetik is expensive. Use MPolybuildCTX -#=function interreduce( - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, -) - reducedGB = [] - R = base_ring(G) - S, V = PolynomialRing( - base_ring(R).base_ring, - [String(s) for s in symbols(R)], - ordering = :lex, - ) - lm = gens(ideal(S, Lm)) - gen = gens(ideal(S, gens(G))) - changed = true - while changed - changed = false - for i = 1:ngens(G) - Lmrest = filter(x -> x != lm[i], lm) - genrest = filter(x -> x != gen[i], gen) - poly = gen[i] - for mon in terms(gen[i]) - (q, r) = divrem(mon, Lmrest) - if r == 0 - changed = true - poly = poly - change_ring(R(vec_sum(q, genrest)), R) - break - if poly == 0 - lm[i] = 0 - end - end - end - push!(reducedGB, poly) - end - gen = gens(ideal(S, [S(p) for p in reducedGB])) - reducedGB = [] - end - return Oscar.Singular.Ideal(R, [R(p) for p in gen]) -end -=# -#Refactor: Using Polynomial-arithmetik is expensive. Use MPolybuildCTX + +#Use MPolybuildCTX function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) poly = 0 for i = 1:length(p) @@ -270,6 +231,7 @@ function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) end return poly end + # Singular.isequal depends on order of generators function equalitytest(G::Singular.sideal, K::Singular.sideal) generators = gens(G) diff --git a/src/Groebnerwalk/StWalk.jl b/src/Groebnerwalk/StWalk.jl index febbe246b..934ddfe13 100644 --- a/src/Groebnerwalk/StWalk.jl +++ b/src/Groebnerwalk/StWalk.jl @@ -1,7 +1,7 @@ using Oscar -#Solves problems with wight vectors of floats. +#Solves problems with weight vectors of floats. function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int64}() for i = 1:length(wtemp) From c4145250cd31786f2092c2a8866618dac410d086 Mon Sep 17 00:00:00 2001 From: jwelp Date: Mon, 26 Jul 2021 16:30:57 +0200 Subject: [PATCH 04/85] cleanup --- src/Groebnerwalk/GroebnerWalk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index caf8a4998..342a685ab 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -129,7 +129,7 @@ function generic_step( complete_reduction = true, ) - println("Facet Ideal: ", facet_Ideal) + #println("Facet Ideal: ", facet_Ideal) liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) Gnew = Oscar.Singular.Ideal(S, [S(x) for x in liftArray]) From 2a43a5418ff2d991774f596934a78f3d81dde847 Mon Sep 17 00:00:00 2001 From: jwelp Date: Mon, 26 Jul 2021 16:44:17 +0200 Subject: [PATCH 05/85] refactor --- src/Groebnerwalk/GroebnerWalkUtils.jl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Groebnerwalk/GroebnerWalkUtils.jl b/src/Groebnerwalk/GroebnerWalkUtils.jl index 672698dc3..f6dd780d7 100644 --- a/src/Groebnerwalk/GroebnerWalkUtils.jl +++ b/src/Groebnerwalk/GroebnerWalkUtils.jl @@ -1,10 +1,5 @@ - using Oscar - - - - #Returns the initials of polynomials w.r.t. a weight vector. #The ordering doesn´t affect this. function initials( From 6852f10e1e808723bf260d19e31016535f0d4840 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 27 Jul 2021 08:05:46 +0200 Subject: [PATCH 06/85] Refactor / Comments --- src/Groebnerwalk/GWtest.jl | 12 +- src/Groebnerwalk/GenericWalkUtilitys.jl | 230 +++++++++++++++++++ src/Groebnerwalk/GroebnerWalk.jl | 2 - src/Groebnerwalk/GroebnerWalkUtilitys.jl | 269 +++++++++++++++++++++++ src/Groebnerwalk/StandardWalkUtilitys.jl | 33 +++ 5 files changed, 538 insertions(+), 8 deletions(-) create mode 100644 src/Groebnerwalk/GenericWalkUtilitys.jl create mode 100644 src/Groebnerwalk/GroebnerWalkUtilitys.jl create mode 100644 src/Groebnerwalk/StandardWalkUtilitys.jl diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 9db57a82f..19e95521c 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -3,7 +3,7 @@ using Pkg using Oscar -case = 3 +case = 1 if case == 1 || case == 99 @@ -21,7 +21,7 @@ if case == 1 || case == 99 S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) - J = groebner_walk( + J = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), @@ -53,7 +53,7 @@ if case == 2 || case == 99 I = Oscar.Singular.std(I, complete_reduction = true) - J = groebner_walk( + J = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), @@ -92,7 +92,7 @@ if case == 3 || case == 99 I = Oscar.Singular.std(I, complete_reduction = true) - T1 = groebner_walk( + T1 = groebnerwalk( I, ordering_as_matrix(:deglex, 2), ordering_as_matrix(:lex, 2), @@ -126,12 +126,12 @@ if case == 4 || case == 99 I = Oscar.Singular.std(I, complete_reduction = true) - @time J = groebner_walk( + @time J = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), ) - @time K = groebner_walk( + @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl new file mode 100644 index 000000000..e6e5bce71 --- /dev/null +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -0,0 +1,230 @@ +using Oscar + +############################################################### +#Utilitys for generic_walk +############################################################### + +function facet_initials( + R::MPolyRing, + G::Singular.sideal, + v::Vector{Int64}, + lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + inits = [] + count = 1 + for g in gens(G) + inw = MPolyBuildCtx(R) + #V = filter(x -> less_facet(S, x), diff_vectors(G) + el = collect(Singular.exponent_vectors(lm[count]))[1] + + for i = 1:length(g) + e = collect(Singular.exponent_vectors(g))[i] + if el == e || isparallel(el - e, v) + push_term!(inw, collect(Singular.coefficients(g))[i], e) + end + end + + #push_term!(inw, collect(Singular.coefficients(lm[count]))[1], collect(Singular.exponent_vectors(lm[count]))[1]) + h = finish(inw) + push!(inits, h) + count = count + 1 + + end + #@info "Facet Initials: " inits + return inits +end + +function isparallel(u::Vector{Int64}, v::Vector{Int64}) + #TODO: maybe false this way + count = 1 + x = 0 + for i in 1:length(u) + if u[i] == 0 + if v[count] == 0 + count = count + 1 + else + return false + end + else + x = v[count] // u[i] + count = count + 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + if v[i] != x * u[i] + return false + end + end + return true +end + +function liftgeneric( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + I::Singular.sideal, +) + S = base_ring(G) + count = 1 + Newlm = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + liftArray = Array{fmpq_mpoly,1}(undef, 0) + for g in gens(I) + diff = + change_ring(g, S) - reducegeneric_recursiv(change_ring(g, S), G, Lm) + if diff != 0 + push!(Newlm, Oscar.Singular.leading_monomial(g)) + push!(liftArray, diff) + end + end + return check_zeros(liftArray, Newlm) +end + +function check_zeros( + G::Vector{fmpq_mpoly}, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + Lm = filter(x -> x != 0, Lm) + G = filter(x -> x != 0, G) + return G, Lm +end + +function nextV( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) + @info "#1 Current V: " V + + filter!(x -> less_than_zero(T, x), V) + @info "#2 Current V: " V + + if (w != [0]) + filter!(x -> less_facet(w, x, S, T), V) + end + @info "#3 Current V: " V + if isempty(V) + return V + end + + + minV = V[1] + for i = 2:length(V) + if less_facet(V[i], minV, S, T) + minV = V[i] + end + end + + @info "#4 Current V: " minV + return minV +end +function nextV( + G::Singular.sideal, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + V = filter(x -> bigger_than_zero(S, x), diff_vectors(G)) + @info "#1 Current V: " V + + filter!(x -> less_than_zero(T, x), V) + @info "#2 Current V: " V + + if (w != [0]) + filter!(x -> less_facet(w, x, S, T), V) + end + @info "#3 Current V: " V + if isempty(V) + return V + end + + + minV = V[1] + for i = 2:length(V) + if less_facet(V[i], minV, S, T) + minV = V[i] + end + end + + @info "#4 Current V: " minV + return minV +end + + +function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + for i = 1:size(M)[1] + d = dot(M[i, :], v) + if (d != 0) + return d > 0 + end + end + return false +end + + +function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + for i = 1:size(M)[1] + d = dot(M[i, :], v) + if (d != 0) + return d < 0 + end + end + return false +end + +function less_facet( + u::Vector{Int64}, + v::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + for i = 1:size(T)[1] + for j = 1:size(S)[1] + Tuv = dot(T[i, :], u) * dot(S[j, :], v) + Tvu = dot(T[i, :], v) * dot(S[j, :], u) + if Tuv != Tvu + return Tuv < Tvu + end + end + end + return false +end + +function reducegeneric_recursiv( + p::T, + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) where {T<:RingElement} + R = base_ring(G) + S, V = PolynomialRing( + base_ring(R).base_ring, + [String(s) for s in symbols(R)], + ordering = :lex, + ) + Gh = [] + for i = 1:ngens(G) + for mon in terms(first(gens(ideal(S, [p])))) + (q, r) = divrem(mon, gens(ideal(S, Lm))[i]) + if r == 0 + push!(Gh, (i, q)) + break + end + end + end + if !isempty(Gh) + for (i, q) in Gh + return reducegeneric_recursiv( + p - q * gens(ideal(S, gens(G)))[i], + G, + Lm, + ) + end + else + return p + end +end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 342a685ab..1fc46f794 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -2,7 +2,6 @@ using Oscar export groebnerwalk - ############################################################### #Implementation of the gröbner walk. #TODO: Implement pertubed version. @@ -10,7 +9,6 @@ export groebnerwalk #TODO: Implement fractal version. ############################################################### - ############################################################### #Top-Level #TODO: Implement input checks diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl new file mode 100644 index 000000000..9ff8cb4fb --- /dev/null +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -0,0 +1,269 @@ +using Oscar + +############################################################### +#Utilitys for Groebnerwalks +############################################################### + +#Returns the initials of polynomials w.r.t. a weight vector. +#The ordering doesn´t affect this. +function initials( + R::MPolyRing, + G::Array{T,1}, + w::Array{K,1}, +) where {T<:RingElement,K<:Number} + inits = [] + for g in G + maxw = 0 + indexw = [] + e = collect(Singular.exponent_vectors(g)) + for i = 1:length(g) + tmpw = dot(w, e[i]) + if maxw == tmpw + push!(indexw, (i, e[i])) + #rethink this. gens are preordered + elseif maxw < tmpw + indexw = [] + push!(indexw, (i, e[i])) + maxw = tmpw + end + end + inw = MPolyBuildCtx(R) + for (k, j) in indexw + push_term!(inw, collect(Singular.coefficients(g))[k], j) + end + h = finish(inw) + push!(inits, h) + end + return inits +end + +function diff_vectors( + I::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + ) + v = [] + for i in 1:ngens(I) + ltu = Singular.leading_exponent_vector(Lm[i]) + for e in filter(x -> ltu != x, collect(Singular.exponent_vectors(gens(I)[i]))) + push!(v, ltu .- e) + end + end + return unique!(v) +end + +function diff_vectors(I::Singular.sideal) + v = [] + for g in gens(I) + ltu = Singular.leading_exponent_vector(g) + for e in Singular.exponent_vectors(tail(g)) + push!(v, ltu .- e) + end + end + return unique!(v) +end + +############################################################### +#TODO: Change T instead of using a() +############################################################### +function change_order( + I::Singular.sideal, + cweight::Array{L,1}, + T::Matrix{Int64}, +) where {L<:Number,K<:Number} + R = I.base_ring + G = Singular.gens(I.base_ring) + Gstrich = string.(G) + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_a(cweight) * + Oscar.Singular.ordering_M(T), + ) + return S, H +end + +function change_order( + I::Singular.sideal, + M::Matrix{Int64}, +) where {T<:Number,K<:Number} + R = I.base_ring + G = Singular.gens(I.base_ring) + Gstrich = string.(G) + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_M(M), + ) + #@error("Not implemented yet") + return S, H +end + +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(coefficients(p), exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + push_term!(M, c, v) + end + return finish(M) +end +function change_ring(p::Singular.spoly, R::MPolyRing) + cvzip = zip(coefficients(p), exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + push_term!(M, c, v) + end + return finish(M) +end + +function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) + if length(w) > 2 + if ord == :lex || ord == Symbol("Singular(lp)") + return [ + w' + ident_matrix(length(w))[1:length(w)-1, :] + ] + end + if ord == :deglex + return [ + w' + ones(Int64, length(w))' + ident_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :degrevlex || a.ord == Symbol("Singular(dp)") + return [ + w' + ones(Int64, length(w))' + anti_diagonal_matrix(length(w))[1:length(w)-2, :] + ] + end + else + error("not implemented yet") + end +end + +function ordering_as_matrix(ord::Symbol, nvars::Int64) + if ord == :lex || ord == Symbol("Singular(lp)") + #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int64, nvars)' + ident_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :degrevlex || a.ord == Symbol("Singular(dp)") + return [ + ones(Int64, nvars)' + anti_diagonal_matrix(nvars)[1:nvars-1, :] + ] + end +end + + + +#Not needed at the moment. Use this instead of a(),ordering_M +function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) + M = [ + v' + T[1:length(v)-1, :] + ] + return M +end + +function pert_Vectors(M::Matrix{Int64}, p::Integer) + +end + +function tdeg(p::Singular.spoly) + max = 0 + for mon in monomials + ev = collect(exponent_vectors(mon)) + sum = 0 + for e in ev + sum = e + sum + end + if (max < sum) + max = sum + end + end + return max +end + +function interreduce_new( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}) + R=base_ring(G) + gens = collect(Singular.gens(G)) + changed = true + while changed + changed = false + for i = 1:ngens(G) + #gensrest = filter(x -> x != gens[i], gens) + gensrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + Lmrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + ## New function + for j = 1:ngens(G) + if i != j + push!(gensrest, gens[j]) + push!(Lmrest, Lm[j]) + end + end + #Lmrest = filter(x -> x != Lm[i], Lm) + gen =reducegeneric_recursiv(gens[i], Singular.Ideal(R,gensrest), Lmrest) + if gens[i] != gen + changed = true + gens[i]= first(Singular.gens(Singular.Ideal(R, R(gen)))) + break + end + end +end + return Oscar.Singular.Ideal(R, [R(p) for p in gens]) +end + +#Use MPolybuildCTX +function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) + poly = 0 + for i = 1:length(p) + poly = poly + p[i] * q[i] + end + return poly +end + +# Singular.isequal depends on order of generators +function equalitytest(G::Singular.sideal, K::Singular.sideal) + generators = gens(G) + count = 0 + for gen in generators + for r in gens(K) + if gen - r == 0 + count = count + 1 + end + end + end + if count == ngens(G) + return true + end + return false +end + + +############################################# +# unspecific help functions +############################################# +function ident_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl new file mode 100644 index 000000000..4ac6c618f --- /dev/null +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -0,0 +1,33 @@ +using Oscar + +############################################################### +#Utilitys for standard_walk +############################################################### + +#Solves problems with weight vectors of floats. +function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + +function nextw( + I::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + #@info "Computing next Boundingvector for I = " base_ring(I) + tv = [] + for v in diff_vectors(I) + if dot(tweight, v) < 0 + push!(tv, dot(cweight, v) // (dot(cweight, v) - dot(tweight, v))) + end + end + #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] + push!(tv, 1) + t = minimum(tv) + w = (1 - t) * cweight + t * tweight + return convertBoundingVector(w) +end From 3b451462eccd1f799e1f51de146b1e5d5153964d Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 27 Jul 2021 08:08:38 +0200 Subject: [PATCH 07/85] delete --- src/Groebnerwalk/GenWalk.jl | 227 ---------------------- src/Groebnerwalk/GroebnerWalkUtils.jl | 265 -------------------------- src/Groebnerwalk/StWalk.jl | 30 --- 3 files changed, 522 deletions(-) delete mode 100644 src/Groebnerwalk/GenWalk.jl delete mode 100644 src/Groebnerwalk/GroebnerWalkUtils.jl delete mode 100644 src/Groebnerwalk/StWalk.jl diff --git a/src/Groebnerwalk/GenWalk.jl b/src/Groebnerwalk/GenWalk.jl deleted file mode 100644 index 2b2955f20..000000000 --- a/src/Groebnerwalk/GenWalk.jl +++ /dev/null @@ -1,227 +0,0 @@ -using Oscar - - -function facet_initials( - R::MPolyRing, - G::Singular.sideal, - v::Vector{Int64}, - lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, -) - inits = [] - count = 1 - for g in gens(G) - inw = MPolyBuildCtx(R) - #V = filter(x -> less_facet(S, x), diff_vectors(G) - el = collect(Singular.exponent_vectors(lm[count]))[1] - - for i = 1:length(g) - e = collect(Singular.exponent_vectors(g))[i] - if el == e || isparallel(el - e, v) - push_term!(inw, collect(Singular.coefficients(g))[i], e) - end - end - - #push_term!(inw, collect(Singular.coefficients(lm[count]))[1], collect(Singular.exponent_vectors(lm[count]))[1]) - h = finish(inw) - push!(inits, h) - count = count + 1 - - end - #@info "Facet Initials: " inits - return inits -end - -function isparallel(u::Vector{Int64}, v::Vector{Int64}) - #TODO: maybe false this way - count = 1 - x = 0 - for i in 1:length(u) - if u[i] == 0 - if v[count] == 0 - count = count + 1 - else - return false - end - else - x = v[count] // u[i] - count = count + 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - if v[i] != x * u[i] - return false - end - end - return true -end - -function liftgeneric( - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, - I::Singular.sideal, -) - S = base_ring(G) - count = 1 - Newlm = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - liftArray = Array{fmpq_mpoly,1}(undef, 0) - for g in gens(I) - diff = - change_ring(g, S) - reducegeneric_recursiv(change_ring(g, S), G, Lm) - if diff != 0 - push!(Newlm, Oscar.Singular.leading_monomial(g)) - push!(liftArray, diff) - end - end - return check_zeros(liftArray, Newlm) -end - -function check_zeros( - G::Vector{fmpq_mpoly}, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, -) - Lm = filter(x -> x != 0, Lm) - G = filter(x -> x != 0, G) - return G, Lm -end - -function nextV( - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) - @info "#1 Current V: " V - - filter!(x -> less_than_zero(T, x), V) - @info "#2 Current V: " V - - if (w != [0]) - filter!(x -> less_facet(w, x, S, T), V) - end - @info "#3 Current V: " V - if isempty(V) - return V - end - - - minV = V[1] - for i = 2:length(V) - if less_facet(V[i], minV, S, T) - minV = V[i] - end - end - - @info "#4 Current V: " minV - return minV -end -function nextV( - G::Singular.sideal, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - V = filter(x -> bigger_than_zero(S, x), diff_vectors(G)) - @info "#1 Current V: " V - - filter!(x -> less_than_zero(T, x), V) - @info "#2 Current V: " V - - if (w != [0]) - filter!(x -> less_facet(w, x, S, T), V) - end - @info "#3 Current V: " V - if isempty(V) - return V - end - - - minV = V[1] - for i = 2:length(V) - if less_facet(V[i], minV, S, T) - minV = V[i] - end - end - - @info "#4 Current V: " minV - return minV -end - - -function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - for i = 1:size(M)[1] - d = dot(M[i, :], v) - if (d != 0) - return d > 0 - end - end - return false -end - - -function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - for i = 1:size(M)[1] - d = dot(M[i, :], v) - if (d != 0) - return d < 0 - end - end - return false -end - -function less_facet( - u::Vector{Int64}, - v::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - for i = 1:size(T)[1] - for j = 1:size(S)[1] - Tuv = dot(T[i, :], u) * dot(S[j, :], v) - Tvu = dot(T[i, :], v) * dot(S[j, :], u) - if Tuv != Tvu - return Tuv < Tvu - end - end - end - return false -end - -function reducegeneric_recursiv( - p::T, - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, -) where {T<:RingElement} - R = base_ring(G) - S, V = PolynomialRing( - base_ring(R).base_ring, - [String(s) for s in symbols(R)], - ordering = :lex, - ) - Gh = [] - for i = 1:ngens(G) - for mon in terms(first(gens(ideal(S, [p])))) - (q, r) = divrem(mon, gens(ideal(S, Lm))[i]) - if r == 0 - push!(Gh, (i, q)) - break - end - end - end - if !isempty(Gh) - for (i, q) in Gh - return reducegeneric_recursiv( - p - q * gens(ideal(S, gens(G)))[i], - G, - Lm, - ) - end - else - return p - end -end diff --git a/src/Groebnerwalk/GroebnerWalkUtils.jl b/src/Groebnerwalk/GroebnerWalkUtils.jl deleted file mode 100644 index f6dd780d7..000000000 --- a/src/Groebnerwalk/GroebnerWalkUtils.jl +++ /dev/null @@ -1,265 +0,0 @@ -using Oscar - -#Returns the initials of polynomials w.r.t. a weight vector. -#The ordering doesn´t affect this. -function initials( - R::MPolyRing, - G::Array{T,1}, - w::Array{K,1}, -) where {T<:RingElement,K<:Number} - inits = [] - for g in G - maxw = 0 - indexw = [] - e = collect(Singular.exponent_vectors(g)) - for i = 1:length(g) - tmpw = dot(w, e[i]) - if maxw == tmpw - push!(indexw, (i, e[i])) - #rethink this. gens are preordered - elseif maxw < tmpw - indexw = [] - push!(indexw, (i, e[i])) - maxw = tmpw - end - end - inw = MPolyBuildCtx(R) - for (k, j) in indexw - push_term!(inw, collect(Singular.coefficients(g))[k], j) - end - h = finish(inw) - push!(inits, h) - end - return inits -end - -function diff_vectors( - I::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, - ) - v = [] - for i in 1:ngens(I) - ltu = Singular.leading_exponent_vector(Lm[i]) - for e in filter(x -> ltu != x, collect(Singular.exponent_vectors(gens(I)[i]))) - push!(v, ltu .- e) - end - end - return unique!(v) -end - -function diff_vectors(I::Singular.sideal) - v = [] - for g in gens(I) - ltu = Singular.leading_exponent_vector(g) - for e in Singular.exponent_vectors(tail(g)) - push!(v, ltu .- e) - end - end - return unique!(v) -end - -############################################################### -#TODO: Change T instead of using a() -############################################################### -function change_order( - I::Singular.sideal, - cweight::Array{L,1}, - T::Matrix{Int64}, -) where {L<:Number,K<:Number} - R = I.base_ring - G = Singular.gens(I.base_ring) - Gstrich = string.(G) - S, H = Oscar.Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Oscar.Singular.ordering_a(cweight) * - Oscar.Singular.ordering_M(T), - ) - return S, H -end - -function change_order( - I::Singular.sideal, - M::Matrix{Int64}, -) where {T<:Number,K<:Number} - R = I.base_ring - G = Singular.gens(I.base_ring) - Gstrich = string.(G) - S, H = Oscar.Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Oscar.Singular.ordering_M(M), - ) - #@error("Not implemented yet") - return S, H -end - -function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(coefficients(p), exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - push_term!(M, c, v) - end - return finish(M) -end -function change_ring(p::Singular.spoly, R::MPolyRing) - cvzip = zip(coefficients(p), exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - push_term!(M, c, v) - end - return finish(M) -end - -function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) - if length(w) > 2 - if ord == :lex || ord == Symbol("Singular(lp)") - return [ - w' - ident_matrix(length(w))[1:length(w)-1, :] - ] - end - if ord == :deglex - return [ - w' - ones(Int64, length(w))' - ident_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :degrevlex || a.ord == Symbol("Singular(dp)") - return [ - w' - ones(Int64, length(w))' - anti_diagonal_matrix(length(w))[1:length(w)-2, :] - ] - end - else - error("not implemented yet") - end -end - -function ordering_as_matrix(ord::Symbol, nvars::Int64) - if ord == :lex || ord == Symbol("Singular(lp)") - #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] - return ident_matrix(nvars) - end - if ord == :deglex - return [ - ones(Int64, nvars)' - ident_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :degrevlex || a.ord == Symbol("Singular(dp)") - return [ - ones(Int64, nvars)' - anti_diagonal_matrix(nvars)[1:nvars-1, :] - ] - end -end - - - -#Not needed at the moment. Use this instead of a(),ordering_M -function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) - M = [ - v' - T[1:length(v)-1, :] - ] - return M -end - -function pert_Vectors(M::Matrix{Int64}, p::Integer) - -end - -function tdeg(p::Singular.spoly) - max = 0 - for mon in monomials - ev = collect(exponent_vectors(mon)) - sum = 0 - for e in ev - sum = e + sum - end - if (max < sum) - max = sum - end - end - return max -end - -function interreduce_new( - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}) - R=base_ring(G) - gens = collect(Singular.gens(G)) - changed = true - while changed - changed = false - for i = 1:ngens(G) - #gensrest = filter(x -> x != gens[i], gens) - gensrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - Lmrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - ## New function - for j = 1:ngens(G) - if i != j - push!(gensrest, gens[j]) - push!(Lmrest, Lm[j]) - end - end - #Lmrest = filter(x -> x != Lm[i], Lm) - gen =reducegeneric_recursiv(gens[i], Singular.Ideal(R,gensrest), Lmrest) - if gens[i] != gen - changed = true - gens[i]= first(Singular.gens(Singular.Ideal(R, R(gen)))) - break - end - end -end - return Oscar.Singular.Ideal(R, [R(p) for p in gens]) -end - -#Use MPolybuildCTX -function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) - poly = 0 - for i = 1:length(p) - poly = poly + p[i] * q[i] - end - return poly -end - -# Singular.isequal depends on order of generators -function equalitytest(G::Singular.sideal, K::Singular.sideal) - generators = gens(G) - count = 0 - for gen in generators - for r in gens(K) - if gen - r == 0 - count = count + 1 - end - end - end - if count == ngens(G) - return true - end - return false -end - - -############################################# -# unspecific help functions -############################################# -function ident_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, n+1-i] = -1 - end - return M -end diff --git a/src/Groebnerwalk/StWalk.jl b/src/Groebnerwalk/StWalk.jl deleted file mode 100644 index 934ddfe13..000000000 --- a/src/Groebnerwalk/StWalk.jl +++ /dev/null @@ -1,30 +0,0 @@ -using Oscar - - -#Solves problems with weight vectors of floats. -function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int64}() - for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) - end - return w -end - -function nextw( - I::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} - #@info "Computing next Boundingvector for I = " base_ring(I) - tv = [] - for v in diff_vectors(I) - if dot(tweight, v) < 0 - push!(tv, dot(cweight, v) // (dot(cweight, v) - dot(tweight, v))) - end - end - #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] - push!(tv, 1) - t = minimum(tv) - w = (1 - t) * cweight + t * tweight - return convertBoundingVector(w) -end From 2999eb6b7d32cf89ccd1651b3c857b7ae9ba2c91 Mon Sep 17 00:00:00 2001 From: jwelp Date: Sun, 8 Aug 2021 16:14:41 +0200 Subject: [PATCH 08/85] feat: PertubedWalk --- src/Groebnerwalk/GWtest.jl | 31 ++++++++--- src/Groebnerwalk/GenericWalkUtilitys.jl | 16 +++--- src/Groebnerwalk/GroebnerWalk.jl | 65 ++++++++++++------------ src/Groebnerwalk/GroebnerWalkUtilitys.jl | 59 +++++++++++++++++++-- src/Groebnerwalk/StandardWalkUtilitys.jl | 1 + 5 files changed, 121 insertions(+), 51 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 19e95521c..0bc9f8e6a 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -25,17 +25,26 @@ if case == 1 || case == 99 I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), - :generic, + ) + K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :pertubed, + 2, ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) - T2 = Singular.std( + T3 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - println("test 1: ", equalitytest(T1, T2)) + println("test 1: ", equalitytest(T3, T1)) + println("test 2: ", equalitytest(T3, T2)) + end if case == 2 || case == 99 @@ -131,11 +140,18 @@ if case == 4 || case == 99 ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), ) - @time K = groebnerwalk( +#= @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), :generic, + ) =# + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 2 ) @@ -149,8 +165,11 @@ if case == 4 || case == 99 complete_reduction = true, ) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + #T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - println("test 4: ", equalitytest(T2,T3)) +println("T4 ", T4) +println("T2 ", T2) + println("test 4: ", equalitytest(T2,T1), " and ", equalitytest(T1, T4), " and ", equalitytest(T1, T4)) end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index e6e5bce71..f065182bf 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -99,15 +99,15 @@ function nextV( T::Matrix{Int64}, ) V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) - @info "#1 Current V: " V + #@info "#1 Current V: " V filter!(x -> less_than_zero(T, x), V) - @info "#2 Current V: " V + #@info "#2 Current V: " V if (w != [0]) filter!(x -> less_facet(w, x, S, T), V) end - @info "#3 Current V: " V + #@info "#3 Current V: " V if isempty(V) return V end @@ -120,7 +120,7 @@ function nextV( end end - @info "#4 Current V: " minV + #@info "#4 Current V: " minV return minV end function nextV( @@ -130,15 +130,15 @@ function nextV( T::Matrix{Int64}, ) V = filter(x -> bigger_than_zero(S, x), diff_vectors(G)) - @info "#1 Current V: " V + #@info "#1 Current V: " V filter!(x -> less_than_zero(T, x), V) - @info "#2 Current V: " V + #@info "#2 Current V: " V if (w != [0]) filter!(x -> less_facet(w, x, S, T), V) end - @info "#3 Current V: " V + #@info "#3 Current V: " V if isempty(V) return V end @@ -151,7 +151,7 @@ function nextV( end end - @info "#4 Current V: " minV + #@info "#4 Current V: " minV return minV end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 1fc46f794..919ce4553 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -23,6 +23,7 @@ function groebnerwalk( S::Matrix{Int64}, T::Matrix{Int64}, grwalktype::Symbol = :standard, + k::Int64 = 0, ) if grwalktype == :standard @@ -30,7 +31,7 @@ function groebnerwalk( elseif grwalktype == :generic walk = (x, y, z) -> generic_walk(x, y, z) elseif grwalktype == :pertubed - walk = (x, y, z) -> pertubed_walk(x, y, z) + walk = (x, y, z) -> pertubed_walk(x, y, z, k) elseif grwalktype == :fractal walk = (x, y, z) -> fractal_walk(x, y, z) #error("Choose a strategy from: :generic, :standard ...") @@ -58,7 +59,7 @@ function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while cweight != tweight cweight = nextw(G, cweight, tweight) G = standard_step(G, cweight, tweight, T) - #@info "Current Gröbnerbase: " G + @info "Current Gröbnerbase: " G end #finalization @@ -105,7 +106,7 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while !isempty(v) G, lm = generic_step(G, R, v, T, lm) - @info "Current Gröbnerbase: " G + #@info "Current Gröbnerbase: " G v = nextV(G,lm, v, S, T) end G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) @@ -140,37 +141,35 @@ function generic_step( end + ############################################################### -#Fractal-version of the groebner walk by Amrhein & Gloor (200) -#TODO: Finish this +#Pertubed-version of the groebner walk Amrhein et al. ############################################################### +function pertubed_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, k::Int64) + p = k + sweight = pert_Vectors(G, S, p) + println(sweight) -function fractal_walk( - G::Singular.sideal, - cweight::Array{Int,1}, - tweight::Array{Int,1}, - tord::Symbol, -) - - T = ordering_as_Matrix(tweight, tord) - M = nextw(G, cweight, tweight) - R = base_ring(G) - S, V = change_order(G, cw, tw, ordering) - - inwG = initials(S, gens(G), cw) - - IinwG = Singular.std( - Oscar.Singular.Ideal(S, [S(x) for x in inwG]), - complete_reduction = true, - ) - G.isGB = true - - #Lifting to GB of new cone - rest = [ - gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) - for gen in gens(IinwG) - ] - Gnew = Oscar.Singular.Ideal(S, [S(x) for x in rest]) - Gnew.isGB = true - return std(Gnew, complete_reduction = true) + #loop + term = false + while !term + tweight = pert_Vectors(G, T, p) + println(tweight) + G = groebnerwalk(G, change_weight_vector(sweight, S), change_weight_vector(tweight,T)) + #@info "Current Gröbnerbase: " G + if inCone(G, T, tweight) + term = true + else + if k == 1 + R, V = change_order(G, T) + G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + G = Singular.std(G, complete_reduction=true) + term = true + end + println(k) + p = p-1 + sweight = tweight + end +end + return G end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 9ff8cb4fb..a34469294 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -142,6 +142,14 @@ function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) end end +function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) + return [ + w' + M[2:length(w), :] + ] +end + + function ordering_as_matrix(ord::Symbol, nvars::Int64) if ord == :lex || ord == Symbol("Singular(lp)") #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] @@ -172,17 +180,48 @@ function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) return M end -function pert_Vectors(M::Matrix{Int64}, p::Integer) - +function pert_Vectors(G:: Singular.sideal, M::Matrix{Int64}, p::Integer) + m = [] + n = size(M)[1] + for i in 1:p + max = M[i, 1] + for j in 2:n + if M[i, j] > max + println(M[i,j]) + max = M[i,j] + println(max) + end + end + push!(m, max) + end + msum = 0 + for i in 2:p + msum = msum + m[i] +end +println(msum) +maxtdeg = 0 +for g in gens(G) + td = tdeg(g) + if (td > maxtdeg) + maxtdeg = td + end +end +println(maxtdeg) +e = maxtdeg * msum + 1 +w = M[1,:] * e^(p-1) +for i in 2:p + w = w + e^(p-i)* M[i,:] +end +return w end function tdeg(p::Singular.spoly) max = 0 - for mon in monomials + for mon in monomials(p) ev = collect(exponent_vectors(mon)) sum = 0 for e in ev - sum = e + sum + sum = e[1] + sum end if (max < sum) max = sum @@ -191,6 +230,18 @@ function tdeg(p::Singular.spoly) return max end +function inCone(G::Singular.sideal, T::Matrix{Int64}, w::Vector{Int64}) + R, V = change_order(G, T) + G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(gens(G), initials(R, gens(G), w)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end + function interreduce_new( G::Singular.sideal, Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}) diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index 4ac6c618f..c2d6b7787 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -4,6 +4,7 @@ using Oscar #Utilitys for standard_walk ############################################################### + #Solves problems with weight vectors of floats. function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int64}() From 4bb4f6624d81c42c35c8b25dbc20281e64327486 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 10 Aug 2021 10:43:53 +0200 Subject: [PATCH 09/85] Bug: fixed in standard_step. Pertubed_walk- prototype works fine --- src/Groebnerwalk/GroebnerWalk.jl | 28 +++--- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 109 ++++++++++++----------- 2 files changed, 74 insertions(+), 63 deletions(-) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 919ce4553..217b9fefe 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -42,7 +42,6 @@ function groebnerwalk( ######TODO:Check the parameter##### R = singular_ring(base_ring(G)) I = Singular.Ideal(R, [R(x) for x in gens(G)]) - return walk(I, S, T) end @@ -53,7 +52,7 @@ end function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] tweight = T[1, :] - G = standard_step(I, cweight, tweight, T) + G = standard_step(G, cweight, tweight, T) #loop while cweight != tweight @@ -77,12 +76,14 @@ function standard_step( R = base_ring(G) S, V = change_order(G, cw, T) inwG = initials(S, gens(G), cw) + IinwG = Singular.std( Oscar.Singular.Ideal(S, [S(x) for x in inwG]), complete_reduction = true, ) #Lifting to GB of new cone + G.isGB = true rest = [ gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) for gen in gens(IinwG) @@ -148,28 +149,29 @@ end function pertubed_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, k::Int64) p = k sweight = pert_Vectors(G, S, p) - println(sweight) - + Gnew = G #loop term = false while !term - tweight = pert_Vectors(G, T, p) - println(tweight) - G = groebnerwalk(G, change_weight_vector(sweight, S), change_weight_vector(tweight,T)) + tweight = pert_Vectors(Gnew, T, p) + Sp = current_Order_of_Cone(sweight, T) + Tp = current_Order_of_Cone(tweight, T) + + Gnew = groebnerwalk(Gnew, Sp, Tp) #@info "Current Gröbnerbase: " G - if inCone(G, T, tweight) + if inCone(Gnew, T, tweight) term = true + break else if k == 1 - R, V = change_order(G, T) - G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - G = Singular.std(G, complete_reduction=true) + R, V = change_order(Gnew, T) + Gnew = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) + Gnew = Singular.std(Gnew, complete_reduction=true) term = true end - println(k) p = p-1 sweight = tweight end end - return G + return Gnew end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index a34469294..3f00ea175 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -40,11 +40,14 @@ end function diff_vectors( I::Singular.sideal, Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, - ) +) v = [] - for i in 1:ngens(I) + for i = 1:ngens(I) ltu = Singular.leading_exponent_vector(Lm[i]) - for e in filter(x -> ltu != x, collect(Singular.exponent_vectors(gens(I)[i]))) + for e in filter( + x -> ltu != x, + collect(Singular.exponent_vectors(gens(I)[i])), + ) push!(v, ltu .- e) end end @@ -144,9 +147,9 @@ end function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) return [ - w' - M[2:length(w), :] - ] + w' + M[2:length(w), :] + ] end @@ -173,6 +176,9 @@ end #Not needed at the moment. Use this instead of a(),ordering_M function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) + if isequal(v, T[1,:]) + return T + end M = [ v' T[1:length(v)-1, :] @@ -180,39 +186,36 @@ function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) return M end -function pert_Vectors(G:: Singular.sideal, M::Matrix{Int64}, p::Integer) +function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) m = [] n = size(M)[1] - for i in 1:p + for i = 1:p max = M[i, 1] - for j in 2:n - if M[i, j] > max - println(M[i,j]) - max = M[i,j] - println(max) + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp end end push!(m, max) end msum = 0 - for i in 2:p - msum = msum + m[i] -end -println(msum) -maxtdeg = 0 -for g in gens(G) - td = tdeg(g) - if (td > maxtdeg) - maxtdeg = td + for i = 2:p + msum = msum + m[i] end -end -println(maxtdeg) -e = maxtdeg * msum + 1 -w = M[1,:] * e^(p-1) -for i in 2:p - w = w + e^(p-i)* M[i,:] -end -return w + maxtdeg = 0 + for g in gens(G) + td = tdeg(g) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w = w + e^(p - i) * M[i, :] + end + return w end function tdeg(p::Singular.spoly) @@ -244,32 +247,38 @@ end function interreduce_new( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}) - R=base_ring(G) + Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, +) + R = base_ring(G) gens = collect(Singular.gens(G)) changed = true while changed changed = false - for i = 1:ngens(G) - #gensrest = filter(x -> x != gens[i], gens) - gensrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - Lmrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - ## New function - for j = 1:ngens(G) - if i != j - push!(gensrest, gens[j]) - push!(Lmrest, Lm[j]) - end - end - #Lmrest = filter(x -> x != Lm[i], Lm) - gen =reducegeneric_recursiv(gens[i], Singular.Ideal(R,gensrest), Lmrest) - if gens[i] != gen - changed = true - gens[i]= first(Singular.gens(Singular.Ideal(R, R(gen)))) - break + for i = 1:ngens(G) + #gensrest = filter(x -> x != gens[i], gens) + gensrest = + Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + Lmrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + ## New function + for j = 1:ngens(G) + if i != j + push!(gensrest, gens[j]) + push!(Lmrest, Lm[j]) + end + end + #Lmrest = filter(x -> x != Lm[i], Lm) + gen = reducegeneric_recursiv( + gens[i], + Singular.Ideal(R, gensrest), + Lmrest, + ) + if gens[i] != gen + changed = true + gens[i] = first(Singular.gens(Singular.Ideal(R, R(gen)))) + break + end end end -end return Oscar.Singular.Ideal(R, [R(p) for p in gens]) end From c76362843d7f5a608a2618db0c0ca2b3ec2dd167 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 10 Aug 2021 17:02:34 +0200 Subject: [PATCH 10/85] Bug fixed: pertubed Algorithm had wrong ordering --- src/Groebnerwalk/GWtest.jl | 10 ++++---- src/Groebnerwalk/GroebnerWalk.jl | 30 +++++++++++++----------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 22 ++++------------- src/Groebnerwalk/StandardWalkUtilitys.jl | 8 ++++--- 4 files changed, 29 insertions(+), 41 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 0bc9f8e6a..521d1c039 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -3,7 +3,7 @@ using Pkg using Oscar -case = 1 +case = 2 if case == 1 || case == 99 @@ -66,7 +66,8 @@ if case == 2 || case == 99 I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), - :generic, + :pertubed, + 3 ) S, V = Oscar.Singular.PolynomialRing( @@ -150,8 +151,7 @@ if case == 4 || case == 99 I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :pertubed, - 2 + :generic, ) @@ -169,7 +169,5 @@ if case == 4 || case == 99 T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) -println("T4 ", T4) -println("T2 ", T2) println("test 4: ", equalitytest(T2,T1), " and ", equalitytest(T1, T4), " and ", equalitytest(T1, T4)) end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 217b9fefe..773aaca5e 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -42,7 +42,10 @@ function groebnerwalk( ######TODO:Check the parameter##### R = singular_ring(base_ring(G)) I = Singular.Ideal(R, [R(x) for x in gens(G)]) - return walk(I, S, T) + + Gb = walk(I, S, T) + S, V = change_order(Gb, T) + return Oscar.Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end @@ -53,17 +56,19 @@ function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] tweight = T[1, :] G = standard_step(G, cweight, tweight, T) + standard_walk(G, S, T, cweight, tweight) +end + +function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, cweight::Vector{Int64}, tweight::Vector{Int64}) #loop while cweight != tweight cweight = nextw(G, cweight, tweight) G = standard_step(G, cweight, tweight, T) - @info "Current Gröbnerbase: " G + #@info "Current Gröbnerbase: " G end - #finalization - S, V = change_order(G, T) - return Oscar.Singular.Ideal(S, [change_ring(gen, S) for gen in gens(G)]) + return G end @@ -76,7 +81,6 @@ function standard_step( R = base_ring(G) S, V = change_order(G, cw, T) inwG = initials(S, gens(G), cw) - IinwG = Singular.std( Oscar.Singular.Ideal(S, [S(x) for x in inwG]), complete_reduction = true, @@ -103,14 +107,13 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R, V = change_order(G, T) v = nextV(G, [0], S, T) - lm = [Singular.leading_monomial(g) for g in gens(G)] + lm = [Oscar.Singular.leading_monomial(g) for g in gens(G)] while !isempty(v) G, lm = generic_step(G, R, v, T, lm) #@info "Current Gröbnerbase: " G v = nextV(G,lm, v, S, T) end - G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) return G end @@ -119,7 +122,7 @@ function generic_step( S::MPolyRing, v::Vector{Int64}, T::Matrix{Int64}, - lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}} ) R = base_ring(G) facet_Generators = facet_initials(S, G, v, lm) @@ -132,7 +135,7 @@ function generic_step( #println("Facet Ideal: ", facet_Ideal) liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) - Gnew = Oscar.Singular.Ideal(S, [S(x) for x in liftArray]) + Gnew = Oscar.Singular.Ideal(S, [x for x in liftArray]) #println("New lifted GB: ", Gnew, " with LM: ", Newlm) Gnew = interreduce_new(Gnew, Newlm) @@ -153,12 +156,11 @@ function pertubed_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, k #loop term = false while !term + println(Gnew) tweight = pert_Vectors(Gnew, T, p) - Sp = current_Order_of_Cone(sweight, T) - Tp = current_Order_of_Cone(tweight, T) - - Gnew = groebnerwalk(Gnew, Sp, Tp) + Gnew = standard_walk(Gnew, S, T, sweight, tweight) #@info "Current Gröbnerbase: " G + if inCone(Gnew, T, tweight) term = true break diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 3f00ea175..e81c095b1 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -39,7 +39,7 @@ end function diff_vectors( I::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, ) v = [] for i = 1:ngens(I) @@ -172,20 +172,6 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) end end - - -#Not needed at the moment. Use this instead of a(),ordering_M -function current_Order_of_Cone(v::Vector{Int64}, T::Matrix{Int64}) - if isequal(v, T[1,:]) - return T - end - M = [ - v' - T[1:length(v)-1, :] - ] - return M -end - function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) m = [] n = size(M)[1] @@ -247,7 +233,7 @@ end function interreduce_new( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, ) R = base_ring(G) gens = collect(Singular.gens(G)) @@ -257,8 +243,8 @@ function interreduce_new( for i = 1:ngens(G) #gensrest = filter(x -> x != gens[i], gens) gensrest = - Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - Lmrest = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) + Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + Lmrest = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) ## New function for j = 1:ngens(G) if i != j diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index c2d6b7787..542e4ed4f 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -15,13 +15,15 @@ function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} end function nextw( - I::Singular.sideal, + G::Singular.sideal, cweight::Array{T,1}, tweight::Array{K,1}, ) where {T<:Number,K<:Number} - #@info "Computing next Boundingvector for I = " base_ring(I) tv = [] - for v in diff_vectors(I) + if cweight == [4,1] + +end + for v in diff_vectors(G) if dot(tweight, v) < 0 push!(tv, dot(cweight, v) // (dot(cweight, v) - dot(tweight, v))) end From 12a430cfc927b40a379bc756ff6d254401c0a0d5 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 10 Aug 2021 17:03:05 +0200 Subject: [PATCH 11/85] Changes from Oscar-Update --- src/Groebnerwalk/GenericWalkUtilitys.jl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index f065182bf..ea200b749 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -8,7 +8,7 @@ function facet_initials( R::MPolyRing, G::Singular.sideal, v::Vector{Int64}, - lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, ) inits = [] count = 1 @@ -64,18 +64,18 @@ end function liftgeneric( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, I::Singular.sideal, ) S = base_ring(G) count = 1 - Newlm = Array{Singular.spoly{Singular.n_unknown{fmpq}},1}(undef, 0) - liftArray = Array{fmpq_mpoly,1}(undef, 0) + Newlm = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + liftArray = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) for g in gens(I) diff = - change_ring(g, S) - reducegeneric_recursiv(change_ring(g, S), G, Lm) + change_ring(g, S) - first(gens(Oscar.Singular.Ideal(S, S(reducegeneric_recursiv(change_ring(g, S), G, Lm))))) if diff != 0 - push!(Newlm, Oscar.Singular.leading_monomial(g)) + push!(Newlm, Singular.leading_monomial(g)) push!(liftArray, diff) end end @@ -83,8 +83,8 @@ function liftgeneric( end function check_zeros( - G::Vector{fmpq_mpoly}, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + G::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, ) Lm = filter(x -> x != 0, Lm) G = filter(x -> x != 0, G) @@ -93,7 +93,7 @@ end function nextV( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, @@ -198,7 +198,7 @@ end function reducegeneric_recursiv( p::T, G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_unknown{fmpq}}}, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, ) where {T<:RingElement} R = base_ring(G) S, V = PolynomialRing( @@ -216,10 +216,11 @@ function reducegeneric_recursiv( end end end + mul = gens(ideal(S, gens(G))) if !isempty(Gh) for (i, q) in Gh return reducegeneric_recursiv( - p - q * gens(ideal(S, gens(G)))[i], + first(gens(ideal(S, [p]))) - (q * mul[i]), G, Lm, ) From ee5cf54b65e654bcfe9336befdefedd1917e5305 Mon Sep 17 00:00:00 2001 From: jwelp Date: Fri, 20 Aug 2021 17:37:53 +0200 Subject: [PATCH 12/85] Bug --- src/Groebnerwalk/GWtest.jl | 22 ++++++++++------------ src/Groebnerwalk/StandardWalkUtilitys.jl | 11 +++++++---- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 521d1c039..c4d34d511 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -3,7 +3,7 @@ using Pkg using Oscar -case = 2 +case = 1 if case == 1 || case == 99 @@ -21,17 +21,18 @@ if case == 1 || case == 99 S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) - J = groebnerwalk( + @time J = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), + :fractal ) - K = groebnerwalk( + @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :pertubed, - 2, + 2 ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) @@ -62,12 +63,11 @@ if case == 2 || case == 99 I = Oscar.Singular.std(I, complete_reduction = true) - J = groebnerwalk( + @time J = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), - :pertubed, - 3 + :fractal, ) S, V = Oscar.Singular.PolynomialRing( @@ -75,11 +75,9 @@ if case == 2 || case == 99 ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), ) - T1 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]), - complete_reduction = true, - ) - T2 = Singular.std( + T1 =Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + + @time T2 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index 542e4ed4f..de30418f2 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -20,12 +20,15 @@ function nextw( tweight::Array{K,1}, ) where {T<:Number,K<:Number} tv = [] - if cweight == [4,1] -end for v in diff_vectors(G) - if dot(tweight, v) < 0 - push!(tv, dot(cweight, v) // (dot(cweight, v) - dot(tweight, v))) + cw = dot(cweight, v) + tw = dot(tweight, v) + ctw = cw - tw + if tw < 0 + if ctw != 0 + push!(tv, cw // ctw) + end end end #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] From 37947741ae712bcf1cb779c5bfedacc57c3e3ef7 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 24 Aug 2021 16:12:38 +0200 Subject: [PATCH 13/85] feat: FractalWalk feat: Struct MonomialOrder --- src/Groebnerwalk/GroebnerWalk.jl | 99 ++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 17 deletions(-) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 773aaca5e..49a26aa02 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -4,9 +4,9 @@ export groebnerwalk ############################################################### #Implementation of the gröbner walk. -#TODO: Implement pertubed version. +#TODO: Improve pertubed version. #TODO: Improve GenWalk algorithm -#TODO: Implement fractal version. +#TODO: Improve fractal version. ############################################################### ############################################################### @@ -59,13 +59,19 @@ function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) standard_walk(G, S, T, cweight, tweight) end -function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, cweight::Vector{Int64}, tweight::Vector{Int64}) +function standard_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, +) #loop while cweight != tweight cweight = nextw(G, cweight, tweight) G = standard_step(G, cweight, tweight, T) - #@info "Current Gröbnerbase: " G + @info "Current Gröbnerbase: " G end return G @@ -112,7 +118,7 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while !isempty(v) G, lm = generic_step(G, R, v, T, lm) #@info "Current Gröbnerbase: " G - v = nextV(G,lm, v, S, T) + v = nextV(G, lm, v, S, T) end return G end @@ -122,7 +128,7 @@ function generic_step( S::MPolyRing, v::Vector{Int64}, T::Matrix{Int64}, - lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}} + lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, ) R = base_ring(G) facet_Generators = facet_initials(S, G, v, lm) @@ -145,11 +151,15 @@ function generic_step( end - ############################################################### #Pertubed-version of the groebner walk Amrhein et al. ############################################################### -function pertubed_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, k::Int64) +function pertubed_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + k::Int64, +) p = k sweight = pert_Vectors(G, S, p) Gnew = G @@ -165,15 +175,70 @@ function pertubed_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, k term = true break else - if k == 1 - R, V = change_order(Gnew, T) - Gnew = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) - Gnew = Singular.std(Gnew, complete_reduction=true) - term = true + if k == 1 + R, V = change_order(Gnew, T) + Gnew = Oscar.Singular.Ideal( + R, + [change_ring(x, R) for x in gens(Gnew)], + ) + Gnew = Singular.std(Gnew, complete_reduction = true) + term = true + end + p = p - 1 + sweight = tweight + end end - p = p-1 - sweight = tweight - end -end return Gnew end + +function fractal_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + + return fractal_recursiv(G, S, T,S[1,:], PVecs, 1) +end + +function fractal_recursiv( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + term = false + G.isGB = true + + while !term + w = nextw(G, cweight, PVecs[p]) + if w == PVecs[p] + if inCone(G, T, w) + println(G, T, w) + println(inCone(G,T,w)) + term = true + break + else + PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + end + end + Rn, V = change_order(G, w, T) + Gw = initials(R, gens(G), w) + if p == nvars(R) + Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) + else + Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, w, PVecs, p + 1) + end + + rest = [ + change_ring(gen, Rn) - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), Rn) + for gen in gens(Gnew) + ] + G = Oscar.Singular.Ideal(Rn, [Rn(x) for x in rest]) + G.isGB = true + G = Singular.std(G, complete_reduction = true) + R = Rn + end + @info "Current Gröbnerbase: " G + + return G +end From 32218828c8fe1d15f1aa70cefc5e8b3bda55c7c8 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 24 Aug 2021 21:06:28 +0200 Subject: [PATCH 14/85] still a bug --- src/Groebnerwalk/GWtest.jl | 54 +++++----- src/Groebnerwalk/GroebnerWalk.jl | 72 ++++++++++++- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 132 ++++++++++++++++++++++- src/Groebnerwalk/StandardWalkUtilitys.jl | 4 +- 4 files changed, 227 insertions(+), 35 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index c4d34d511..2d38a71ae 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -21,18 +21,16 @@ if case == 1 || case == 99 S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) - @time J = groebnerwalk( + @time J = fractal_walk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :fractal + MonomialOrder(ordering_as_matrix(:revlex, 2), [1, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [0]), ) @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), - :pertubed, - 2 + :standard, ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) @@ -63,11 +61,10 @@ if case == 2 || case == 99 I = Oscar.Singular.std(I, complete_reduction = true) - @time J = groebnerwalk( + @time J = fractal_walk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :fractal, + MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [0]), ) S, V = Oscar.Singular.PolynomialRing( @@ -75,7 +72,7 @@ if case == 2 || case == 99 ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), ) - T1 =Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) @time T2 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), @@ -127,29 +124,33 @@ if case == 4 || case == 99 ) - f1 = y^4 + y * z^2 - u^2*w - f2 = 2 * x^2 * y + x^3 * w *u^2 +x - f3 = 2 - 3 * x^2 * v *z^4 *w + f1 = y^4 + y * z^2 - u^2 * w + f2 = 2 * x^2 * y + x^3 * w * u^2 + x + f3 = 2 - 3 * x^2 * v * z^4 * w I = Singular.Ideal(R, [f1, f2, f3]) I = Oscar.Singular.std(I, complete_reduction = true) - @time J = groebnerwalk( + @time J = fractal_walk( I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - ) -#= @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) =# + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [0]), + ) + #= @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) =# @time L = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :generic, + :standard, ) @@ -166,6 +167,7 @@ if case == 4 || case == 99 #T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + println("std :", T1) - println("test 4: ", equalitytest(T2,T1), " and ", equalitytest(T1, T4), " and ", equalitytest(T1, T4)) + println("test 4: ", equalitytest(T2, T1), " and ", equalitytest(T1, T4)) end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 49a26aa02..876a51541 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -71,7 +71,7 @@ function standard_walk( while cweight != tweight cweight = nextw(G, cweight, tweight) G = standard_step(G, cweight, tweight, T) - @info "Current Gröbnerbase: " G + #@info "Current Gröbnerbase: " G end return G @@ -190,7 +190,7 @@ function pertubed_walk( end return Gnew end - +#= function fractal_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] @@ -226,7 +226,7 @@ function fractal_recursiv( if p == nvars(R) Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) else - Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, w, PVecs, p + 1) + Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, PVecs, p + 1) end rest = [ @@ -242,3 +242,69 @@ function fractal_recursiv( return G end +=# + + PVecs = [] + function checkPvecs() + global PVecs + println(PVecs) + end +function fractal_walk(G::Singular.sideal, S::MonomialOrder{Matrix{Int64}, Vector{Int64}}, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}) + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + + return fractal_recursiv(G, S, T, PVecs, 1) +end + +function fractal_recursiv( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64}, Vector{Int64}}, + T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + term = false + G.isGB = true + if S.t == [0] + cweight = S.w +else + cweight = S.t +end + + while !term + w = nextw(G, cweight, PVecs[p]) + + T.t = w + Rn, V = change_order(G, T) + Gw = initials(R, gens(G), w) + if p == nvars(R) + Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) + term = true + else + #tempPVecs = [pert_Vectors(G, insert_weight_vector(w, T.m), i) for i = 1:nvars(R)] + Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, PVecs, p + 1) + end + + rest = [ + change_ring(gen, Rn) - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), Rn) + for gen in gens(Gnew) + ] + G = Oscar.Singular.Ideal(Rn, [Rn(x) for x in rest]) + G.isGB = true + G = Singular.std(G, complete_reduction = true) + R = Rn + S = T + + if cweight == PVecs[p] + if inCone(G, T, PVecs[p]) + return G + else + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + end + end + cweight = w + @info "Current Gröbnerbase: " G + end + + return G +end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index e81c095b1..1a1522aa0 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -36,6 +36,11 @@ function initials( end return inits end +mutable struct MonomialOrder{T<:Matrix{Int64},v<:Vector{Int64}, tv<:Vector{Int64}} + m::T + w::v + t::tv +end function diff_vectors( I::Singular.sideal, @@ -84,6 +89,29 @@ function change_order( ) return S, H end +function change_order( + I::Singular.sideal, + T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, +) where {L<:Number,K<:Number} + R = I.base_ring + G = Singular.gens(I.base_ring) + Gstrich = string.(G) + if T.w == [0] + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_a(T.t)* + Oscar.Singular.ordering_M(T.m), + ) + end + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_a(T.t) *Oscar.Singular.ordering_a(T.w)* + Oscar.Singular.ordering_M(T.m) + ) + return S, H +end function change_order( I::Singular.sideal, @@ -151,6 +179,12 @@ function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) M[2:length(w), :] ] end +function insert_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) + return [ + w' + M[1:length(w)-1, :] + ] +end function ordering_as_matrix(ord::Symbol, nvars::Int64) @@ -164,14 +198,54 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) ident_matrix(nvars)[1:nvars-1, :] ] end - if ord == :degrevlex || a.ord == Symbol("Singular(dp)") + if ord == :degrevlex || ord == Symbol("Singular(dp)") return [ ones(Int64, nvars)' anti_diagonal_matrix(nvars)[1:nvars-1, :] ] end + if ord == :revlex || ord == Symbol("Singular(dp)") + return anti_diagonal_matrix(nvars)[1:nvars, :] + + end end +function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) + m = [] + if T.w == nothing + M = T.m +else + M = insert_weight_vector(T.w, T.m) +end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum = msum + m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w = w + e^(p - i) * M[i, :] + end + return w +end function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) m = [] n = size(M)[1] @@ -203,6 +277,42 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) end return w end +function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) + m = [] + if T.w == nothing + M = T.m +else + M = insert_weight_vector(T.w, T.m) +end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum = msum + m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w = w + e^(p - i) * M[i, :] + end + return w +end function tdeg(p::Singular.spoly) max = 0 @@ -219,10 +329,10 @@ function tdeg(p::Singular.spoly) return max end -function inCone(G::Singular.sideal, T::Matrix{Int64}, w::Vector{Int64}) - R, V = change_order(G, T) - G = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(gens(G), initials(R, gens(G), w)) +function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) + R, V = change_order(G, t, T) + I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(gens(I), initials(R, gens(I), t)) for (g, ing) in cvzip if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) return false @@ -230,6 +340,18 @@ function inCone(G::Singular.sideal, T::Matrix{Int64}, w::Vector{Int64}) end return true end +function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) + R, V = change_order(G, MonomialOrder(T.m, T.w, [0])) + I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(gens(I), initials(R, gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end + function interreduce_new( G::Singular.sideal, diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index de30418f2..4590f5660 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -20,7 +20,6 @@ function nextw( tweight::Array{K,1}, ) where {T<:Number,K<:Number} tv = [] - for v in diff_vectors(G) cw = dot(cweight, v) tw = dot(tweight, v) @@ -34,6 +33,9 @@ function nextw( #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] push!(tv, 1) t = minimum(tv) + if (t == 1 || 0 == float(t)) + return tweight + end w = (1 - t) * cweight + t * tweight return convertBoundingVector(w) end From 940462ab08897ab8b608c4006127667f41353bb3 Mon Sep 17 00:00:00 2001 From: jwelp Date: Wed, 25 Aug 2021 13:08:02 +0200 Subject: [PATCH 15/85] Running: FractalWalk GenericWalk STandardWalk New Bug in: PertubedWalk --- src/Groebnerwalk/GWtest.jl | 28 ++++++++++---- src/Groebnerwalk/GroebnerWalk.jl | 49 +++++++++++++----------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 16 ++++---- src/Groebnerwalk/StandardWalkUtilitys.jl | 10 ++--- 4 files changed, 60 insertions(+), 43 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 2d38a71ae..4031e9927 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -3,8 +3,8 @@ using Pkg using Oscar -case = 1 - +case = 99 +success = true if case == 1 || case == 99 R, (x, y) = Oscar.Singular.PolynomialRing( @@ -23,14 +23,15 @@ if case == 1 || case == 99 @time J = fractal_walk( I, - MonomialOrder(ordering_as_matrix(:revlex, 2), [1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [0]), + MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [1, 0]), ) @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), - :standard, + :pertubed, + 2 ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) @@ -43,7 +44,9 @@ if case == 1 || case == 99 println("test 1: ", equalitytest(T3, T1)) println("test 2: ", equalitytest(T3, T2)) - + if !(equalitytest(T3, T1) && equalitytest(T3, T2)) + success = false + end end if case == 2 || case == 99 @@ -64,7 +67,7 @@ if case == 2 || case == 99 @time J = fractal_walk( I, MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [0]), + MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [6, 1, 3]), ) S, V = Oscar.Singular.PolynomialRing( @@ -80,7 +83,9 @@ if case == 2 || case == 99 ) println("test 2: ", equalitytest(T1, T2)) - + if !(equalitytest(T2, T1)) + success = false + end end @@ -114,6 +119,9 @@ if case == 3 || case == 99 ) println("test 3: ", equalitytest(T1, T2)) + if !(equalitytest(T2, T1)) + success = false + end end if case == 4 || case == 99 @@ -170,4 +178,8 @@ if case == 4 || case == 99 println("std :", T1) println("test 4: ", equalitytest(T2, T1), " and ", equalitytest(T1, T4)) + if !(equalitytest(T2, T1) && equalitytest(T1, T4)) + success = false + end end +println("All tests were: ", success) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 876a51541..9de076406 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -55,7 +55,6 @@ end function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] tweight = T[1, :] - G = standard_step(G, cweight, tweight, T) standard_walk(G, S, T, cweight, tweight) end @@ -67,13 +66,17 @@ function standard_walk( tweight::Vector{Int64}, ) +w = cweight #loop - while cweight != tweight - cweight = nextw(G, cweight, tweight) + while w != [0] + cweight = w G = standard_step(G, cweight, tweight, T) - #@info "Current Gröbnerbase: " G + w = nextw(G, cweight, tweight) + @info "Current Gröbnerbase: " G + end + if !inCone(G, MonomialOrder(T,[0],tweight), cweight) + G = standard_step(G ,tweight, tweight, T) end - return G end @@ -251,7 +254,6 @@ end end function fractal_walk(G::Singular.sideal, S::MonomialOrder{Matrix{Int64}, Vector{Int64}}, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}) global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - return fractal_recursiv(G, S, T, PVecs, 1) end @@ -265,21 +267,33 @@ function fractal_recursiv( R = base_ring(G) term = false G.isGB = true - if S.t == [0] cweight = S.w -else - cweight = S.t -end + while !term w = nextw(G, cweight, PVecs[p]) - - T.t = w + if w == [0] + if !inCone(G, T, cweight) + w = PVecs[p] + println("false w") + else + if inCone(G, T, PVecs[p]) + @info "Incone Gröbnerbase: " G "in depth: " p + return G + else + println("test") + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + checkPvecs() + w = nextw(G, cweight, PVecs[p]) + end + end + end + T.w = w Rn, V = change_order(G, T) Gw = initials(R, gens(G), w) if p == nvars(R) Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) - term = true + @info "Computed Gröbnerbase: " Gnew "in depth: " p else #tempPVecs = [pert_Vectors(G, insert_weight_vector(w, T.m), i) for i = 1:nvars(R)] Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, PVecs, p + 1) @@ -294,16 +308,7 @@ end G = Singular.std(G, complete_reduction = true) R = Rn S = T - - if cweight == PVecs[p] - if inCone(G, T, PVecs[p]) - return G - else - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - end - end cweight = w - @info "Current Gröbnerbase: " G end return G diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 1a1522aa0..cf506f150 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -96,21 +96,20 @@ function change_order( R = I.base_ring G = Singular.gens(I.base_ring) Gstrich = string.(G) - if T.w == [0] S, H = Oscar.Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Oscar.Singular.ordering_a(T.t)* + ordering = Oscar.Singular.ordering_a(T.w)* Oscar.Singular.ordering_M(T.m), ) - end - S, H = Oscar.Singular.PolynomialRing( +#= S, H = Oscar.Singular.PolynomialRing( R.base_ring, Gstrich, ordering = Oscar.Singular.ordering_a(T.t) *Oscar.Singular.ordering_a(T.w)* Oscar.Singular.ordering_M(T.m) ) return S, H + =# end function change_order( @@ -212,10 +211,10 @@ end function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) m = [] - if T.w == nothing + if T.t == nothing M = T.m else - M = insert_weight_vector(T.w, T.m) + M = insert_weight_vector(T.t, T.m) end n = size(M)[1] for i = 1:p @@ -279,7 +278,8 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) end function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) m = [] - if T.w == nothing + if T.t == T.m[1,size(T.m)[1]] + println("testtest") M = T.m else M = insert_weight_vector(T.w, T.m) @@ -341,7 +341,7 @@ function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) return true end function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) - R, V = change_order(G, MonomialOrder(T.m, T.w, [0])) + R, V = change_order(G, T.t, T.m) I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) cvzip = zip(gens(I), initials(R, gens(I), t)) for (g, ing) in cvzip diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index 4590f5660..4f0bdce5e 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -25,16 +25,16 @@ function nextw( tw = dot(tweight, v) ctw = cw - tw if tw < 0 - if ctw != 0 push!(tv, cw // ctw) end - end end #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] - push!(tv, 1) + if isempty(tv) + return [0] + end t = minimum(tv) - if (t == 1 || 0 == float(t)) - return tweight + if (0 == float(t)) + return [0] end w = (1 - t) * cweight + t * tweight return convertBoundingVector(w) From 3f7b45b819c9e2ce18517a5fdccd37218e2875ca Mon Sep 17 00:00:00 2001 From: jwelp Date: Wed, 25 Aug 2021 15:48:45 +0200 Subject: [PATCH 16/85] All current examples are running --- src/Groebnerwalk/FractalWalkUtilitys.jl | 71 ++++++++++++ src/Groebnerwalk/GWtest.jl | 136 +++++++++++++---------- src/Groebnerwalk/GenericWalkUtilitys.jl | 38 +++++++ src/Groebnerwalk/GroebnerWalk.jl | 31 ++++-- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 119 ++++---------------- src/Groebnerwalk/StandardWalkUtilitys.jl | 12 +- 6 files changed, 238 insertions(+), 169 deletions(-) create mode 100644 src/Groebnerwalk/FractalWalkUtilitys.jl diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl new file mode 100644 index 000000000..f78f2b459 --- /dev/null +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -0,0 +1,71 @@ +include("GroebnerWalkUtilitys.jl") + +#Solves problems with weight vectors of floats. +function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + +function nextw_fr( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + tv = [] + for v in diff_vectors(G) + cw = dot(cweight, v) + tw = dot(tweight, v) + ctw = cw - tw + if tw < 0 + push!(tv, cw // ctw) + end + end + #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] + if isempty(tv) + return [0] + end + t = minimum(tv) + if (0 == float(t)) + return [0] + end + w = (1 - t) * cweight + t * tweight + return convertBoundingVector(w) +end + +function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) + R, V = change_order(G, T.t, T.m) + I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(gens(I), initials(R, gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end + +function change_order( + I::Singular.sideal, + T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, +) where {L<:Number,K<:Number} + R = I.base_ring + G = Singular.gens(I.base_ring) + Gstrich = string.(G) + S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_a(T.w)* + Oscar.Singular.ordering_M(T.m), + ) +#= S, H = Oscar.Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Oscar.Singular.ordering_a(T.t) *Oscar.Singular.ordering_a(T.w)* + Oscar.Singular.ordering_M(T.m) + ) + return S, H + =# +end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 4031e9927..01ea348cc 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -1,4 +1,5 @@ using Pkg +include("GroebnerWalk.jl") using Oscar @@ -26,6 +27,13 @@ if case == 1 || case == 99 MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [1, 0]), ) + + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :standard + ) @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), @@ -33,20 +41,32 @@ if case == 1 || case == 99 :pertubed, 2 ) + #= + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :generic + ) =# T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + #T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) - T3 = Singular.std( + T0 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - println("test 1: ", equalitytest(T3, T1)) - println("test 2: ", equalitytest(T3, T2)) - if !(equalitytest(T3, T1) && equalitytest(T3, T2)) - success = false - end + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + #println("test generic: ", equalitytest(T4, T0)) + + + #if !(equalitytest(T2, T1) && equalitytest(T3, T4)) + # success = false + #end end if case == 2 || case == 99 @@ -69,62 +89,55 @@ if case == 2 || case == 99 MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [6, 1, 3]), ) + @time K = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :pertubed, + 2 + ) + @time L = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :standard, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :generic, + ) S, V = Oscar.Singular.PolynomialRing( QQ, ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), ) - T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - @time T2 = Singular.std( + + T0 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) + T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - println("test 2: ", equalitytest(T1, T2)) - if !(equalitytest(T2, T1)) - success = false - end -end - - -if case == 3 || case == 99 - R, (x, y) = Oscar.Singular.PolynomialRing( - QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:deglex, 2)), - ) - - f1 = x^2 - y^3 - f2 = x^3 - y^2 - x - I = Singular.Ideal(R, [f1, f2]) + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equalitytest(T4, T0)) - I = Oscar.Singular.std(I, complete_reduction = true) - T1 = groebnerwalk( - I, - ordering_as_matrix(:deglex, 2), - ordering_as_matrix(:lex, 2), - :generic, - ) - S, V = Oscar.Singular.PolynomialRing( - QQ, - ["x", "y"], - ordering = Oscar.Singular.ordering_M([1 0; 0 1]), - ) - T2 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - println("test 3: ", equalitytest(T1, T2)) - - if !(equalitytest(T2, T1)) + if !(equalitytest(T2, T1) && equalitytest(T3, T4)) success = false end end -if case == 4 || case == 99 + +if case == 3 || case == 99 R, (x, y, z, u, v, w) = Oscar.Singular.PolynomialRing( QQ, ["x", "y", "z", "u", "v", "w"], @@ -148,18 +161,25 @@ if case == 4 || case == 99 ), MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [0]), ) - #= @time K = groebnerwalk( + @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :generic, - ) =# + :pertubed, + 3 + ) @time L = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), :standard, ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) S, V = Oscar.Singular.PolynomialRing( @@ -167,18 +187,22 @@ if case == 4 || case == 99 ["x", "y", "z", "u", "v", "w"], ordering = Oscar.Singular.ordering_M(ordering_as_matrix(:lex, 6)), ) - T1 = Singular.std( + T0 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - #T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equalitytest(T4, T0)) - println("std :", T1) - println("test 4: ", equalitytest(T2, T1), " and ", equalitytest(T1, T4)) - if !(equalitytest(T2, T1) && equalitytest(T1, T4)) + if !(equalitytest(T2, T1) && equalitytest(T3, T4)) success = false end end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index ea200b749..fa96fd338 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -1,4 +1,5 @@ using Oscar +include("GroebnerWalkUtilitys.jl") ############################################################### #Utilitys for generic_walk @@ -229,3 +230,40 @@ function reducegeneric_recursiv( return p end end + +function interreduce_new( + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, +) + R = base_ring(G) + gens = collect(Singular.gens(G)) + changed = true + while changed + changed = false + for i = 1:ngens(G) + #gensrest = filter(x -> x != gens[i], gens) + gensrest = + Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + Lmrest = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + ## New function + for j = 1:ngens(G) + if i != j + push!(gensrest, gens[j]) + push!(Lmrest, Lm[j]) + end + end + #Lmrest = filter(x -> x != Lm[i], Lm) + gen = reducegeneric_recursiv( + gens[i], + Singular.Ideal(R, gensrest), + Lmrest, + ) + if gens[i] != gen + changed = true + gens[i] = first(Singular.gens(Singular.Ideal(R, R(gen)))) + break + end + end + end + return Oscar.Singular.Ideal(R, [R(p) for p in gens]) +end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 9de076406..ec445d9d9 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -1,4 +1,9 @@ using Oscar +include("GroebnerWalkUtilitys.jl") +include("FractalWalkUtilitys.jl") +include("GenericWalkUtilitys.jl") +include("StandardWalkUtilitys.jl") + export groebnerwalk @@ -66,16 +71,17 @@ function standard_walk( tweight::Vector{Int64}, ) -w = cweight #loop - while w != [0] - cweight = w + term = false + while !term G = standard_step(G, cweight, tweight, T) - w = nextw(G, cweight, tweight) - @info "Current Gröbnerbase: " G + println(cweight, tweight) + if cweight == tweight + term = true + else + cweight = nextw(G, cweight, tweight) end - if !inCone(G, MonomialOrder(T,[0],tweight), cweight) - G = standard_step(G ,tweight, tweight, T) + @info "Current Gröbnerbase: " G end return G @@ -169,14 +175,14 @@ function pertubed_walk( #loop term = false while !term - println(Gnew) tweight = pert_Vectors(Gnew, T, p) + println(tweight) Gnew = standard_walk(Gnew, S, T, sweight, tweight) - #@info "Current Gröbnerbase: " G + @info "Current Gröbnerbase in Top level: " Gnew if inCone(Gnew, T, tweight) term = true - break + println("test") else if k == 1 R, V = change_order(Gnew, T) @@ -186,7 +192,10 @@ function pertubed_walk( ) Gnew = Singular.std(Gnew, complete_reduction = true) term = true + println("test2") end + println("test3") + p = p - 1 sweight = tweight end @@ -271,7 +280,7 @@ function fractal_recursiv( while !term - w = nextw(G, cweight, PVecs[p]) + w = nextw_fr(G, cweight, PVecs[p]) if w == [0] if !inCone(G, T, cweight) w = PVecs[p] diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index cf506f150..da576b00e 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -1,5 +1,4 @@ using Oscar - ############################################################### #Utilitys for Groebnerwalks ############################################################### @@ -89,28 +88,7 @@ function change_order( ) return S, H end -function change_order( - I::Singular.sideal, - T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, -) where {L<:Number,K<:Number} - R = I.base_ring - G = Singular.gens(I.base_ring) - Gstrich = string.(G) - S, H = Oscar.Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Oscar.Singular.ordering_a(T.w)* - Oscar.Singular.ordering_M(T.m), - ) -#= S, H = Oscar.Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Oscar.Singular.ordering_a(T.t) *Oscar.Singular.ordering_a(T.w)* - Oscar.Singular.ordering_M(T.m) - ) - return S, H - =# -end + function change_order( I::Singular.sideal, @@ -203,12 +181,8 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) anti_diagonal_matrix(nvars)[1:nvars-1, :] ] end - if ord == :revlex || ord == Symbol("Singular(dp)") - return anti_diagonal_matrix(nvars)[1:nvars, :] - - end end - +#= function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) m = [] if T.t == nothing @@ -245,6 +219,7 @@ end end return w end +=# function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) m = [] n = size(M)[1] @@ -330,18 +305,7 @@ function tdeg(p::Singular.spoly) end function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) - R, V = change_order(G, t, T) - I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(gens(I), initials(R, gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end -function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) - R, V = change_order(G, T.t, T.m) + R, V = change_order(G, T) I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) cvzip = zip(gens(I), initials(R, gens(I), t)) for (g, ing) in cvzip @@ -353,42 +317,9 @@ function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64 end -function interreduce_new( - G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, -) - R = base_ring(G) - gens = collect(Singular.gens(G)) - changed = true - while changed - changed = false - for i = 1:ngens(G) - #gensrest = filter(x -> x != gens[i], gens) - gensrest = - Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) - Lmrest = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) - ## New function - for j = 1:ngens(G) - if i != j - push!(gensrest, gens[j]) - push!(Lmrest, Lm[j]) - end - end - #Lmrest = filter(x -> x != Lm[i], Lm) - gen = reducegeneric_recursiv( - gens[i], - Singular.Ideal(R, gensrest), - Lmrest, - ) - if gens[i] != gen - changed = true - gens[i] = first(Singular.gens(Singular.Ideal(R, R(gen)))) - break - end - end - end - return Oscar.Singular.Ideal(R, [R(p) for p in gens]) -end +############################################# +# unspecific help functions +############################################# #Use MPolybuildCTX function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) @@ -399,6 +330,22 @@ function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) return poly end +function ident_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end + # Singular.isequal depends on order of generators function equalitytest(G::Singular.sideal, K::Singular.sideal) generators = gens(G) @@ -415,23 +362,3 @@ function equalitytest(G::Singular.sideal, K::Singular.sideal) end return false end - - -############################################# -# unspecific help functions -############################################# -function ident_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, n+1-i] = -1 - end - return M -end diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index 4f0bdce5e..2203dd90d 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -1,4 +1,5 @@ using Oscar +include("GroebnerWalkUtilitys.jl") ############################################################### #Utilitys for standard_walk @@ -20,22 +21,21 @@ function nextw( tweight::Array{K,1}, ) where {T<:Number,K<:Number} tv = [] + for v in diff_vectors(G) cw = dot(cweight, v) tw = dot(tweight, v) ctw = cw - tw if tw < 0 + if ctw != 0 push!(tv, cw // ctw) end + end end #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] - if isempty(tv) - return [0] - end + push!(tv, 1) t = minimum(tv) - if (0 == float(t)) - return [0] - end + println(t) w = (1 - t) * cweight + t * tweight return convertBoundingVector(w) end From 41e1537cd21fb38907c3fd91c0f2500d48f60850 Mon Sep 17 00:00:00 2001 From: jwelp Date: Wed, 25 Aug 2021 16:15:58 +0200 Subject: [PATCH 17/85] refactoring --- src/Groebnerwalk/FractalWalkUtilitys.jl | 10 ++++++++++ src/Groebnerwalk/GWtest.jl | 14 ++++++------- src/Groebnerwalk/GroebnerWalk.jl | 25 +++++++----------------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 10 ++++++++++ 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index f78f2b459..ad8869e0a 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -69,3 +69,13 @@ function change_order( return S, H =# end + +function liftGWfr(G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) +rest = [ + change_ring(gen, S) - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) + for gen in gens(Gw) +] +G = Oscar.Singular.Ideal(S, [S(x) for x in rest]) +G.isGB = true +return G +end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 01ea348cc..4c3b0ab4e 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -41,17 +41,17 @@ if case == 1 || case == 99 :pertubed, 2 ) - #= + @time M = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :generic - ) =# + ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - #T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T0 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), @@ -61,12 +61,12 @@ if case == 1 || case == 99 println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) - #println("test generic: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T4, T0)) - #if !(equalitytest(T2, T1) && equalitytest(T3, T4)) - # success = false - #end + if !(equalitytest(T2, T1) && equalitytest(T3, T4)) + success = false + end end if case == 2 || case == 99 diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index ec445d9d9..29af717bc 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -95,21 +95,20 @@ function standard_step( ) R = base_ring(G) S, V = change_order(G, cw, T) + + #taking initials inwG = initials(S, gens(G), cw) + + #Initial Ideal IinwG = Singular.std( Oscar.Singular.Ideal(S, [S(x) for x in inwG]), complete_reduction = true, ) #Lifting to GB of new cone - G.isGB = true - rest = [ - gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) - for gen in gens(IinwG) - ] - Gnew = Oscar.Singular.Ideal(S, [S(x) for x in rest]) - Gnew.isGB = true + Gnew = liftGW(G, IinwG, R, S) + #Interreduce return Oscar.Singular.std(Gnew, complete_reduction = true) end @@ -147,12 +146,9 @@ function generic_step( complete_reduction = true, ) - #println("Facet Ideal: ", facet_Ideal) - liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) Gnew = Oscar.Singular.Ideal(S, [x for x in liftArray]) - #println("New lifted GB: ", Gnew, " with LM: ", Newlm) Gnew = interreduce_new(Gnew, Newlm) Gnew = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) Gnew.isGB = true @@ -304,21 +300,14 @@ function fractal_recursiv( Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) @info "Computed Gröbnerbase: " Gnew "in depth: " p else - #tempPVecs = [pert_Vectors(G, insert_weight_vector(w, T.m), i) for i = 1:nvars(R)] Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, PVecs, p + 1) end - rest = [ - change_ring(gen, Rn) - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), Rn) - for gen in gens(Gnew) - ] - G = Oscar.Singular.Ideal(Rn, [Rn(x) for x in rest]) - G.isGB = true + G = liftGWfr(G, Gnew, R, Rn) G = Singular.std(G, complete_reduction = true) R = Rn S = T cweight = w end - return G end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index da576b00e..4825e46e4 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -316,6 +316,16 @@ function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) return true end +function liftGW(G::Singular.sideal, InG::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) + G.isGB = true + rest = [ + gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) + for gen in gens(InG) + ] + Gnew = Oscar.Singular.Ideal(S, [S(x) for x in rest]) + Gnew.isGB = true + return Gnew +end ############################################# # unspecific help functions From 88072f73e6b37e8ebbfc644886c7a2bd9623dc2c Mon Sep 17 00:00:00 2001 From: jwelp Date: Thu, 26 Aug 2021 18:27:24 +0200 Subject: [PATCH 18/85] Versions of fractwalk --- src/Groebnerwalk/FractalWalkUtilitys.jl | 30 +- src/Groebnerwalk/GWtest.jl | 121 +++++++- src/Groebnerwalk/GroebnerWalk.jl | 350 ++++++++++++++++++++--- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 15 +- src/Groebnerwalk/StandardWalkUtilitys.jl | 1 - 5 files changed, 465 insertions(+), 52 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index ad8869e0a..57441d0e2 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -3,6 +3,7 @@ include("GroebnerWalkUtilitys.jl") #Solves problems with weight vectors of floats. function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int64}() + for i = 1:length(wtemp) push!(w, float(divexact(wtemp[i], gcd(wtemp)))) end @@ -14,6 +15,9 @@ function nextw_fr( cweight::Array{T,1}, tweight::Array{K,1}, ) where {T<:Number,K<:Number} +if (cweight == tweight) + return [0] +end tv = [] for v in diff_vectors(G) cw = dot(cweight, v) @@ -24,14 +28,15 @@ function nextw_fr( end end #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] - if isempty(tv) - return [0] - end + push!(tv, 1) t = minimum(tv) if (0 == float(t)) - return [0] + return cweight end w = (1 - t) * cweight + t * tweight + if (t == 1) + return tweight + end return convertBoundingVector(w) end @@ -79,3 +84,20 @@ G = Oscar.Singular.Ideal(S, [S(x) for x in rest]) G.isGB = true return G end + +function ismonomial(Gw::Vector{Any}) + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 1 + return false + end + end + return true +end +function isBinomial(Gw::Vector{Any}) + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return false + end + end + return true +end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 4c3b0ab4e..a89732767 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -4,7 +4,7 @@ include("GroebnerWalk.jl") using Oscar -case = 99 +case = 4 success = true if case == 1 || case == 99 @@ -27,6 +27,11 @@ if case == 1 || case == 99 MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [1, 0]), ) + @time JJ = fractal_walk_lookahead( + I, + MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [1, 0]), + ) @time L = groebnerwalk( I, @@ -52,19 +57,20 @@ if case == 1 || case == 99 T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) T0 = Singular.std( Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - +println("test fractal2: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) println("test generic: ", equalitytest(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T4)) + if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) success = false end end @@ -89,6 +95,11 @@ if case == 2 || case == 99 MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [6, 1, 3]), ) + @time JJ = fractal_walk_lookahead( + I, + MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [6, 1, 3]), + ) @time K = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), @@ -124,14 +135,15 @@ if case == 2 || case == 99 T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - + T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) +println("test fractal2: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) println("test generic: ", equalitytest(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T4)) + if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) success = false end end @@ -159,8 +171,18 @@ if case == 3 || case == 99 [1, 1, 1, 1, 1, 1], [0], ), - MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [0]), + MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]), ) + @time JJ = fractal_walk_lookahead( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]), + ) + @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), @@ -195,15 +217,100 @@ if case == 3 || case == 99 T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) +println("test fractal2: ", equalitytest(T0, T5)) + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equalitytest(T4, T0)) + + + if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) + success = false + end + +end +if case == 4 || case == 99 + R, (q, c, p ,d) = Oscar.Singular.PolynomialRing( + QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ) + + + f1 = 2*c*d*p*q - 4 *c*d + 2*p*q + 4 * p*q*c - 4 *d^2*q -2*d^2*p*q + p^2*d^2 -2*c^2*q+c^2*q^2+2*c*d*q -2*c*d*q^2+d^2 * q^2-2*c*d*p-8*p+c^2+4*d^2-2*q+10*p^2+2 + f2 = 2*d*p*q+4*d*p^2+d*p-7*d*p+c*p - 3*p*q*c + 4*c + f3 = -2*p^2 + 8*p-2-2*p*q - 2*q + f4 = 4-4*p-4*q^2+3c^2*q^2-6*c^2*q+3*c^2+9*p^2*d^2+6*d^2*p*q - 3d^2*q^2 - 24*p*d^2 + 12*d^2 + 4*p^2 + 12*c*d*p +12*c*d*q + 12 *c*d*p*q - 12*c*d + I = Singular.Ideal(R, [f1, f2, f3, f4]) + I = Oscar.Singular.std(I, complete_reduction = true) +println(I) + + @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 4), + [1, 1, 1, 1], + [0], + ), + MonomialOrder(ordering_as_matrix(:lex, 4), [1, 0, 0, 0], [1, 0, 0, 0]), + ) + @time JJ = fractal_walk_lookahead( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 4), + [1, 1, 1, 1], + [0], + ), + MonomialOrder(ordering_as_matrix(:lex, 4), [1, 0, 0, 0], [1, 0, 0, 0]), + ) + + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :pertubed, + 3 + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :standard, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :standard, + ) + + + S, V = Oscar.Singular.PolynomialRing( + QQ, + ["q", "c", "p", "d"], + ordering = Oscar.Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ) + T0 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) println("test fractal: ", equalitytest(T0, T1)) + println("test fractal2: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) println("test generic: ", equalitytest(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T4)) + if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) success = false end + end println("All tests were: ", success) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 29af717bc..e850ca840 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -23,6 +23,13 @@ export groebnerwalk #Arithmetik von Polynomen -> Immer MPolyBuildCTX? ############################################################### +counter = 0 +function getCounter() + global counter + temp = counter + counter = 0 + return temp +end function groebnerwalk( G::Singular.sideal, S::Matrix{Int64}, @@ -39,6 +46,12 @@ function groebnerwalk( walk = (x, y, z) -> pertubed_walk(x, y, z, k) elseif grwalktype == :fractal walk = (x, y, z) -> fractal_walk(x, y, z) + elseif grwalktype == :fractal2 + walk = (x, y, z) -> fractal_walk2(x, y, z) + elseif grwalktype == :fractal3 + walk = (x, y, z) -> fractal_walk3(x, y, z) + elseif grwalktype == :fractal4 + walk = (x, y, z) -> fractal_walk_lookahead(x, y, z) #error("Choose a strategy from: :generic, :standard ...") # fill the list or implement a functionality to choose the best # way w.r.t. the type of the ideal @@ -49,6 +62,8 @@ function groebnerwalk( I = Singular.Ideal(R, [R(x) for x in gens(G)]) Gb = walk(I, S, T) + println("Cones crossed: ", getCounter()) + S, V = change_order(Gb, T) return Oscar.Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end @@ -60,6 +75,9 @@ end function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] tweight = T[1, :] + println("Standardwalk results") + println("Crossed Cones in: ") + standard_walk(G, S, T, cweight, tweight) end @@ -75,16 +93,15 @@ function standard_walk( term = false while !term G = standard_step(G, cweight, tweight, T) - println(cweight, tweight) + global counter = getCounter() + 1 + println(cweight) if cweight == tweight term = true else - cweight = nextw(G, cweight, tweight) - end - @info "Current Gröbnerbase: " G + cweight = nextw(G, cweight, tweight) + end end return G - end function standard_step( @@ -98,7 +115,6 @@ function standard_step( #taking initials inwG = initials(S, gens(G), cw) - #Initial Ideal IinwG = Singular.std( Oscar.Singular.Ideal(S, [S(x) for x in inwG]), @@ -122,8 +138,11 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) v = nextV(G, [0], S, T) lm = [Oscar.Singular.leading_monomial(g) for g in gens(G)] - + println("GenericWalk results") + println("Crossed Cones with facetNormal: ") while !isempty(v) + global counter = getCounter() + 1 + println(v) G, lm = generic_step(G, R, v, T, lm) #@info "Current Gröbnerbase: " G v = nextV(G, lm, v, S, T) @@ -170,15 +189,15 @@ function pertubed_walk( Gnew = G #loop term = false + println("PertubedWalk results") + println("Crossed Cones in: ") + while !term tweight = pert_Vectors(Gnew, T, p) - println(tweight) Gnew = standard_walk(Gnew, S, T, sweight, tweight) - @info "Current Gröbnerbase in Top level: " Gnew if inCone(Gnew, T, tweight) term = true - println("test") else if k == 1 R, V = change_order(Gnew, T) @@ -188,9 +207,7 @@ function pertubed_walk( ) Gnew = Singular.std(Gnew, complete_reduction = true) term = true - println("test2") end - println("test3") p = p - 1 sweight = tweight @@ -252,20 +269,29 @@ function fractal_recursiv( end =# - PVecs = [] - function checkPvecs() - global PVecs - println(PVecs) - end -function fractal_walk(G::Singular.sideal, S::MonomialOrder{Matrix{Int64}, Vector{Int64}}, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - return fractal_recursiv(G, S, T, PVecs, 1) +PVecs = [] +function checkPvecs() + global PVecs + println(PVecs) +end +function fractal_walk( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) +global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + +println("FacrtalWalk_standard results") +println("Crossed Cones in: ") +Gb = fractal_recursiv(G, S, T, PVecs, 1) +println("Cones crossed: ", getCounter()) +return Gb end function fractal_recursiv( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64}, Vector{Int64}}, - T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, PVecs::Vector{Vector{Int64}}, p::Int64, ) @@ -277,30 +303,288 @@ function fractal_recursiv( while !term w = nextw_fr(G, cweight, PVecs[p]) - if w == [0] - if !inCone(G, T, cweight) - w = PVecs[p] - println("false w") + if (w == [0]) + if inCone(G, T, PVecs[p]) + #@info "Incone Gröbnerbase: " G "in depth: " p + #println(inCone) + return G else + #println("test") + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + #checkPvecs() + continue + end + end + T.w = w + Rn, V = change_order(G, T) + Gw = initials(R, gens(G), w) + if p == nvars(R) + Gnew = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + #@info "Computed Gröbnerbase: " Gnew "in depth: " p + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + global counter = getCounter() + 1 + else + Gnew = fractal_recursiv( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PVecs, + p + 1, + ) + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + + end + + G = liftGWfr(G, Gnew, R, Rn) + G = Singular.std(G, complete_reduction = true) + R = Rn + S = T + cweight = w + end + + return G +end +cwPert = [] +firstStepMode = false +function cwpert(p::Int64) + cwPert[p] +end + +function fractal_walk2( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) +global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + +println("FractalWalk_withStartorder results") +println("Crossed Cones in: ") +Gb = fractal_recursiv2(G, S, T, PVecs, 1) +println("Cones crossed: ", getCounter()) +return Gb +end + +function fractal_recursiv2( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + term = false + G.isGB = true + if (p == 1) + if !ismonomial(initials(R, gens(G), S.w)) + println("nomonomial") + global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + cweight = cwPert[p] + else + cweight = S.w + end + + while !term + w = nextw_fr(G, cweight, PVecs[p]) + if w == [0] + if inCone(G, T, PVecs[p]) - @info "Incone Gröbnerbase: " G "in depth: " p + #@info "Incone Gröbnerbase: " G "in depth: " p + #println(inCone) return G else - println("test") global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - checkPvecs() - w = nextw(G, cweight, PVecs[p]) + continue end end + T.w = w + Rn, V = change_order(G, T) + Gw = initials(R, gens(G), w) + if p == nvars(R) + Gnew = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth: ", p) + global counter = getCounter() + 1 + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + + else + Gnew = fractal_recursiv2( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PVecs, + p + 1, + ) + global firstStepMode = false + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + end + + G = liftGWfr(G, Gnew, R, Rn) + G = Singular.std(G, complete_reduction = true) + R = Rn + S = T + cweight = w + end + return G +end +function fractal_walk3( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) +global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + +println("FractalWalk_withStartorderLex results") +println("Crossed Cones in: ") +Gb = fractal_recursiv3(G, S, T, PVecs, 1) +println("Cones crossed: ", getCounter()) +return Gb +end + +function fractal_recursiv3( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + term = false + G.isGB = true + if (p == 1) + if !ismonomial(initials(R, gens(G), S.w)) + global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + cweight = cwPert[p] + else + cweight = S.w + end + +#println(cwPert) + while !term + w = nextw_fr(G, cweight, PVecs[p]) + #println(cweight, w) + + if (p == 1 && w == PVecs[p]) + p = p + 1 + end + if w == [0] + + if inCone(G, T, PVecs[p]) + #@info "Incone Gröbnerbase: " G "in depth: " p + #println(inCone) + return G + else + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + continue + end end T.w = w Rn, V = change_order(G, T) Gw = initials(R, gens(G), w) if p == nvars(R) - Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) - @info "Computed Gröbnerbase: " Gnew "in depth: " p + Gnew = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + global counter = getCounter() + 1 + println(w, " in depth: ", p) + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + else - Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, PVecs, p + 1) + Gnew = fractal_recursiv3( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PVecs, + p + 1, + ) + global firstStepMode = false + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + end + + G = liftGWfr(G, Gnew, R, Rn) + G = Singular.std(G, complete_reduction = true) + R = Rn + S = T + cweight = w + end + return G +end +function fractal_walk_lookahead( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) +println("FractalWalk_lookahead results") +println("Crossed Cones in: ") + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + + Gb = fractal_recursiv_lookahead(G, S, T, PVecs, 1) + println("Cones crossed: ", getCounter()) + return Gb +end + +function fractal_recursiv_lookahead( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + term = false + G.isGB = true + cweight = S.w + + + while !term + w = nextw_fr(G, cweight, PVecs[p]) + if (w == [0]) + if inCone(G, T, PVecs[p]) + #@info "Incone Gröbnerbase: " G "in depth: " p + return G + else + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + #checkPvecs() + continue + end + end + T.w = w + Rn, V = change_order(G, T) + Gw = initials(R, gens(G), w) + if (p == nvars(R) || isBinomial(Gw)) + Gnew = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth: ", p) + global counter = getCounter() + 1 + #@info "Computed Gröbnerbase: " Gnew "in depth: " p + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + + else + Gnew = fractal_recursiv_lookahead( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PVecs, + p + 1, + ) + #println("Computed Gröbnerbase: ", w, "in depth: ", p) + end G = liftGWfr(G, Gnew, R, Rn) diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 4825e46e4..73e7fd0e3 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -182,14 +182,15 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) ] end end -#= -function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) - m = [] - if T.t == nothing + +function pert_Vectors(G::Singular.sideal, Mo::MonomialOrder{Matrix{Int64}}, t::Vector{Int64}, p::Integer) + if t == Mo.m[1,size(Mo.m)[1]] + println("testtest") M = T.m else - M = insert_weight_vector(T.t, T.m) + M = insert_weight_vector(t, Mo.m) end +m = [] n = size(M)[1] for i = 1:p max = M[i, 1] @@ -219,7 +220,7 @@ end end return w end -=# + function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) m = [] n = size(M)[1] @@ -257,7 +258,7 @@ function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector println("testtest") M = T.m else - M = insert_weight_vector(T.w, T.m) + M = insert_weight_vector(T.t, T.m) end n = size(M)[1] for i = 1:p diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index 2203dd90d..a71337ec9 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -35,7 +35,6 @@ function nextw( #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] push!(tv, 1) t = minimum(tv) - println(t) w = (1 - t) * cweight + t * tweight return convertBoundingVector(w) end From 92c650c0c796e3eb156a3eacf35289f613cae48e Mon Sep 17 00:00:00 2001 From: jwelp Date: Fri, 27 Aug 2021 17:26:48 +0200 Subject: [PATCH 19/85] All current examples working --- src/Groebnerwalk/FractalWalkUtilitys.jl | 62 +++++----- src/Groebnerwalk/GroebnerWalk.jl | 150 +++++++++-------------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 44 ++++++- src/Groebnerwalk/StandardWalkUtilitys.jl | 3 +- 4 files changed, 134 insertions(+), 125 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index 57441d0e2..abac8e57a 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -10,35 +10,6 @@ function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} return w end -function nextw_fr( - G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} -if (cweight == tweight) - return [0] -end - tv = [] - for v in diff_vectors(G) - cw = dot(cweight, v) - tw = dot(tweight, v) - ctw = cw - tw - if tw < 0 - push!(tv, cw // ctw) - end - end - #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] - push!(tv, 1) - t = minimum(tv) - if (0 == float(t)) - return cweight - end - w = (1 - t) * cweight + t * tweight - if (t == 1) - return tweight - end - return convertBoundingVector(w) -end function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) R, V = change_order(G, T.t, T.m) @@ -101,3 +72,36 @@ function isBinomial(Gw::Vector{Any}) end return true end +function nextw_fr( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} +if (cweight == tweight) + return [0] +end + tv = [] + for v in diff_vectors(G) + tw = dot(tweight, v) + if tw < 0 + push!(tv, dot(cweight, v) // (dot(cweight, v) - tw)) + end + end + #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] + push!(tv, 1) + t = minimum(tv) + if (0 == numerator(t)) + filter!(x -> (numerator(x) > 0 && x!=1), tv) + if isempty(tv) + return[0] + else + t = minimum(tv) + end + end + if (t == 1) + return tweight + end + w = (1 - t) * cweight + t * tweight + + return convertBoundingVector(w) +end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index e850ca840..34749d6a7 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -186,6 +186,7 @@ function pertubed_walk( ) p = k sweight = pert_Vectors(G, S, p) + println(sweight) Gnew = G #loop term = false @@ -208,66 +209,38 @@ function pertubed_walk( Gnew = Singular.std(Gnew, complete_reduction = true) term = true end - p = p - 1 sweight = tweight end end return Gnew end -#= -function fractal_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - return fractal_recursiv(G, S, T,S[1,:], PVecs, 1) +counterFr = 0 +counterFrFin = false +function deleteCounterFr() + global counterFr + temp = counterFr + counterFr = 0 + global counterFrFin = false + return temp end - -function fractal_recursiv( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - PVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = base_ring(G) - term = false - G.isGB = true - - while !term - w = nextw(G, cweight, PVecs[p]) - if w == PVecs[p] - if inCone(G, T, w) - println(G, T, w) - println(inCone(G,T,w)) - term = true - break - else - PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - end - end - Rn, V = change_order(G, w, T) - Gw = initials(R, gens(G), w) - if p == nvars(R) - Gnew = Singular.std(Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true) - else - Gnew = fractal_recursiv(Singular.Ideal(R, [x for x in Gw]), S, T, PVecs, p + 1) - end - - rest = [ - change_ring(gen, Rn) - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), Rn) - for gen in gens(Gnew) - ] - G = Oscar.Singular.Ideal(Rn, [Rn(x) for x in rest]) - G.isGB = true - G = Singular.std(G, complete_reduction = true) - R = Rn - end - @info "Current Gröbnerbase: " G - - return G +function getCounterFr() + global counterFr + return counterFr end -=# +function raiseCounterFr(std::Bool = false) + global counterFrFin + if !counterFrFin || std + counterFrFin = true + global counterFr = getCounterFr() + 1 + return true + end + return false + end + function resetCounterFr() + global counterFrFin = false + end PVecs = [] function checkPvecs() @@ -284,7 +257,7 @@ global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] println("FacrtalWalk_standard results") println("Crossed Cones in: ") Gb = fractal_recursiv(G, S, T, PVecs, 1) -println("Cones crossed: ", getCounter()) +println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -300,34 +273,34 @@ function fractal_recursiv( G.isGB = true cweight = S.w - while !term w = nextw_fr(G, cweight, PVecs[p]) if (w == [0]) if inCone(G, T, PVecs[p]) - #@info "Incone Gröbnerbase: " G "in depth: " p - #println(inCone) + if raiseCounterFr() + println(PVecs[p], " in depth", p) + end return G else - #println("test") - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - #checkPvecs() + global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] + println(PVecs) continue end end T.w = w Rn, V = change_order(G, T) Gw = initials(R, gens(G), w) + if p == nvars(R) Gnew = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) println(w, " in depth", p) - #@info "Computed Gröbnerbase: " Gnew "in depth: " p - #println("Computed Gröbnerbase: ", w, "in depth: ", p) - global counter = getCounter() + 1 + raiseCounterFr(true) else + resetCounterFr() + Gnew = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), S, @@ -335,11 +308,10 @@ function fractal_recursiv( PVecs, p + 1, ) - #println("Computed Gröbnerbase: ", w, "in depth: ", p) - end G = liftGWfr(G, Gnew, R, Rn) + G = Singular.std(G, complete_reduction = true) R = Rn S = T @@ -348,6 +320,7 @@ function fractal_recursiv( return G end + cwPert = [] firstStepMode = false function cwpert(p::Int64) @@ -364,7 +337,7 @@ global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] println("FractalWalk_withStartorder results") println("Crossed Cones in: ") Gb = fractal_recursiv2(G, S, T, PVecs, 1) -println("Cones crossed: ", getCounter()) +println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -396,11 +369,12 @@ function fractal_recursiv2( if w == [0] if inCone(G, T, PVecs[p]) - #@info "Incone Gröbnerbase: " G "in depth: " p - #println(inCone) + if raiseCounterFr() + println(PVecs[p], " in depth", p) + end return G else - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] continue end end @@ -412,11 +386,12 @@ function fractal_recursiv2( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - println(w, " in depth: ", p) - global counter = getCounter() + 1 + println(w, " in depth", p) + raiseCounterFr(true) #println("Computed Gröbnerbase: ", w, "in depth: ", p) else + resetCounterFr() Gnew = fractal_recursiv2( Singular.Ideal(R, [x for x in Gw]), S, @@ -425,7 +400,6 @@ function fractal_recursiv2( p + 1, ) global firstStepMode = false - #println("Computed Gröbnerbase: ", w, "in depth: ", p) end G = liftGWfr(G, Gnew, R, Rn) @@ -442,11 +416,10 @@ function fractal_walk3( T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - println("FractalWalk_withStartorderLex results") println("Crossed Cones in: ") Gb = fractal_recursiv3(G, S, T, PVecs, 1) -println("Cones crossed: ", getCounter()) +println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -483,11 +456,12 @@ function fractal_recursiv3( if w == [0] if inCone(G, T, PVecs[p]) - #@info "Incone Gröbnerbase: " G "in depth: " p - #println(inCone) + if raiseCounterFr() + println(PVecs[p], " in depth", p) + end return G else - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] continue end end @@ -499,11 +473,12 @@ function fractal_recursiv3( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - global counter = getCounter() + 1 - println(w, " in depth: ", p) + println(w, " in depth", p) + raiseCounterFr(true) #println("Computed Gröbnerbase: ", w, "in depth: ", p) else + resetCounterFr Gnew = fractal_recursiv3( Singular.Ideal(R, [x for x in Gw]), S, @@ -512,7 +487,6 @@ function fractal_recursiv3( p + 1, ) global firstStepMode = false - #println("Computed Gröbnerbase: ", w, "in depth: ", p) end G = liftGWfr(G, Gnew, R, Rn) @@ -533,7 +507,7 @@ println("Crossed Cones in: ") global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] Gb = fractal_recursiv_lookahead(G, S, T, PVecs, 1) - println("Cones crossed: ", getCounter()) + println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -554,10 +528,12 @@ function fractal_recursiv_lookahead( w = nextw_fr(G, cweight, PVecs[p]) if (w == [0]) if inCone(G, T, PVecs[p]) - #@info "Incone Gröbnerbase: " G "in depth: " p - return G + if raiseCounterFr() + println(PVecs[p], " in depth", p) + end + return G else - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] #checkPvecs() continue end @@ -570,12 +546,10 @@ function fractal_recursiv_lookahead( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - println(w, " in depth: ", p) - global counter = getCounter() + 1 - #@info "Computed Gröbnerbase: " Gnew "in depth: " p - #println("Computed Gröbnerbase: ", w, "in depth: ", p) - + println(w, " in depth", p) + raiseCounterFr(true) else + resetCounterFr() Gnew = fractal_recursiv_lookahead( Singular.Ideal(R, [x for x in Gw]), S, @@ -583,8 +557,6 @@ function fractal_recursiv_lookahead( PVecs, p + 1, ) - #println("Computed Gröbnerbase: ", w, "in depth: ", p) - end G = liftGWfr(G, Gnew, R, Rn) diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 73e7fd0e3..889842e91 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -184,9 +184,8 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) end function pert_Vectors(G::Singular.sideal, Mo::MonomialOrder{Matrix{Int64}}, t::Vector{Int64}, p::Integer) - if t == Mo.m[1,size(Mo.m)[1]] - println("testtest") - M = T.m + if t == Mo.m[1,:] + M = Mo.m else M = insert_weight_vector(t, Mo.m) end @@ -254,8 +253,7 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) end function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) m = [] - if T.t == T.m[1,size(T.m)[1]] - println("testtest") + if T.t == T.m[1,:] M = T.m else M = insert_weight_vector(T.t, T.m) @@ -289,6 +287,42 @@ end end return w end +function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, mult::Int64, p::Integer) + m = [] + if T.t == T.m[1,:] + M = T.m +else + M = insert_weight_vector(T.t, T.m) +end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum = msum + m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 * mult + w = M[1, :] * e^(p - 1) + for i = 2:p + w = w + e^(p - i) * M[i, :] + end + return w +end function tdeg(p::Singular.spoly) max = 0 diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index a71337ec9..f8212cff0 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -21,7 +21,6 @@ function nextw( tweight::Array{K,1}, ) where {T<:Number,K<:Number} tv = [] - for v in diff_vectors(G) cw = dot(cweight, v) tw = dot(tweight, v) @@ -32,8 +31,8 @@ function nextw( end end end - #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] push!(tv, 1) + filter!(x -> numerator(x)!=0, tv) t = minimum(tv) w = (1 - t) * cweight + t * tweight return convertBoundingVector(w) From 2b589ffef6cdb0ec3f15a59b4deac44fa360ea0b Mon Sep 17 00:00:00 2001 From: jwelp Date: Sun, 29 Aug 2021 19:59:45 +0200 Subject: [PATCH 20/85] feat: TranWalk feat: new nextW - method for pertubed Walks Solved: Bug in tdeg() --- src/Groebnerwalk/FractalWalkUtilitys.jl | 47 ++++- src/Groebnerwalk/GWtest.jl | 224 ++++++++++++++++++----- src/Groebnerwalk/GroebnerWalk.jl | 80 ++++++-- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 14 +- src/Groebnerwalk/TranWalkUtilitys.jl | 30 +++ 5 files changed, 324 insertions(+), 71 deletions(-) create mode 100644 src/Groebnerwalk/TranWalkUtilitys.jl diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index abac8e57a..f4a6090bc 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -87,7 +87,6 @@ end push!(tv, dot(cweight, v) // (dot(cweight, v) - tw)) end end - #tv = [dot(cweight, v) < 0 ? dot(cweight, v) / (dot(cweight, v) - dot(tweight, v)) : nothing for v = V ] push!(tv, 1) t = minimum(tv) if (0 == numerator(t)) @@ -105,3 +104,49 @@ end return convertBoundingVector(w) end + +function diff_vectors_lt(I::Singular.sideal) + zip = [] + v = [] + for g in gens(I) + ltu = Singular.leading_exponent_vector(g) + for e in Singular.exponent_vectors(tail(g)) + push!(v, (ltu .- e)) + end + push!(zip, (unique(v), ltu)) + v = [] + end + return zip +end + +function nextW_2(G::Singular.sideal, + w::Array{T,1}, + sigma::Array{K,1}, + ) where {T<:Number,K<:Number} + if (w == sigma) + return [0] + end + +tmin = 2 +t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w,a)- dot(w,v) + dot(sigma,v) - dot(sigma, a)) + if frac != 0 + t = (dot(w,a) - dot(w,v)) // frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + + if tmin <= 1 + w = w + tmin * (sigma - w) +else + return [0] +end + return convertBoundingVector(w) + end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index a89732767..165fcbcb4 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -4,7 +4,7 @@ include("GroebnerWalk.jl") using Oscar -case = 4 +case = 3 success = true if case == 1 || case == 99 @@ -22,6 +22,12 @@ if case == 1 || case == 99 S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :tran, + ) @time J = fractal_walk( I, MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), @@ -37,33 +43,36 @@ if case == 1 || case == 99 I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), - :standard + :standard, ) @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :pertubed, - 2 + 2, ) @time M = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), - :generic + :generic, + ) + + T0 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) - T0 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) -println("test fractal2: ", equalitytest(T0, T5)) + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) @@ -71,7 +80,7 @@ println("test fractal2: ", equalitytest(T0, T5)) if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) - success = false + success = false end end @@ -89,7 +98,12 @@ if case == 2 || case == 99 I = Oscar.Singular.std(I, complete_reduction = true) - + @time H = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :tran, + ) @time J = fractal_walk( I, MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), @@ -105,7 +119,7 @@ if case == 2 || case == 99 ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), :pertubed, - 2 + 3, ) @time L = groebnerwalk( I, @@ -136,7 +150,10 @@ if case == 2 || case == 99 T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) -println("test fractal2: ", equalitytest(T0, T5)) + T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) @@ -163,7 +180,12 @@ if case == 3 || case == 99 I = Singular.Ideal(R, [f1, f2, f3]) I = Oscar.Singular.std(I, complete_reduction = true) - + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) @time J = fractal_walk( I, MonomialOrder( @@ -171,7 +193,11 @@ if case == 3 || case == 99 [1, 1, 1, 1, 1, 1], [0], ), - MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), ) @time JJ = fractal_walk_lookahead( I, @@ -180,16 +206,20 @@ if case == 3 || case == 99 [1, 1, 1, 1, 1, 1], [0], ), - MonomialOrder(ordering_as_matrix(:lex, 6), [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0]), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 3 - ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 4, + ) @time L = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), @@ -218,7 +248,10 @@ if case == 3 || case == 99 T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) -println("test fractal2: ", equalitytest(T0, T5)) + T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) @@ -231,47 +264,63 @@ println("test fractal2: ", equalitytest(T0, T5)) end if case == 4 || case == 99 - R, (q, c, p ,d) = Oscar.Singular.PolynomialRing( + R, (q, c, p, d) = Oscar.Singular.PolynomialRing( QQ, ["q", "c", "p", "d"], ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), ) - f1 = 2*c*d*p*q - 4 *c*d + 2*p*q + 4 * p*q*c - 4 *d^2*q -2*d^2*p*q + p^2*d^2 -2*c^2*q+c^2*q^2+2*c*d*q -2*c*d*q^2+d^2 * q^2-2*c*d*p-8*p+c^2+4*d^2-2*q+10*p^2+2 - f2 = 2*d*p*q+4*d*p^2+d*p-7*d*p+c*p - 3*p*q*c + 4*c - f3 = -2*p^2 + 8*p-2-2*p*q - 2*q - f4 = 4-4*p-4*q^2+3c^2*q^2-6*c^2*q+3*c^2+9*p^2*d^2+6*d^2*p*q - 3d^2*q^2 - 24*p*d^2 + 12*d^2 + 4*p^2 + 12*c*d*p +12*c*d*q + 12 *c*d*p*q - 12*c*d + f1 = + 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - + 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + + c^2 * q^2 + + 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - 8 * p + + c^2 + + 4 * d^2 - 2 * q + + 10 * p^2 + + 2 + f2 = + 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - + 3 * p * q * c + 4 * c + f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q + f4 = + 4 - 4 * p - 4 * q^2 + 3*c^2 * q^2 - 6 * c^2 * q + + 3 * c^2 + + 9 * p^2 * d^2 + + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + + 12 * d^2 + + 4 * p^2 + + 12 * c * d * p + + 12 * c * d * q + + 12 * c * d * p * q - 12 * c * d I = Singular.Ideal(R, [f1, f2, f3, f4]) I = Oscar.Singular.std(I, complete_reduction = true) -println(I) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :tran, + ) @time J = fractal_walk( I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 4), - [1, 1, 1, 1], - [0], - ), + MonomialOrder(ordering_as_matrix(:degrevlex, 4), [1, 1, 1, 1], [0]), MonomialOrder(ordering_as_matrix(:lex, 4), [1, 0, 0, 0], [1, 0, 0, 0]), ) @time JJ = fractal_walk_lookahead( I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 4), - [1, 1, 1, 1], - [0], - ), + MonomialOrder(ordering_as_matrix(:degrevlex, 4), [1, 1, 1, 1], [0]), MonomialOrder(ordering_as_matrix(:lex, 4), [1, 0, 0, 0], [1, 0, 0, 0]), ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :pertubed, - 3 - ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :pertubed, + 4, + ) @time L = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), @@ -300,7 +349,9 @@ println(I) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + println("test tran: ", equalitytest(T0, T6)) println("test fractal: ", equalitytest(T0, T1)) println("test fractal2: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) @@ -313,4 +364,83 @@ println(I) end end +if case == 5 || case == 99 + R, (x, y, z) = Oscar.Singular.PolynomialRing( + QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = x^2 +x*y^2 *z - 2x * y +y^4 + y^2 + z^2 + f2 = -x^3 *y^2 + x*y^2 * z + x *y * z^3 -2x*y + y^4 + f3 = -2x^2*y + x* y^4 + y *z^4 - 3 + I = Singular.Ideal(R, [f1, f2, f3]) + + I = Oscar.Singular.std(I, complete_reduction = true) + + S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y", "z"], ordering = :lex) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + ) + + @time J = fractal_walk( + I, + MonomialOrder(ordering_as_matrix(:degrevlex, 3), [1, 1, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 3), [1, 0, 0], [1, 0, 0]), + ) + @time JJ = fractal_walk_lookahead( + I, + MonomialOrder(ordering_as_matrix(:degrevlex, 3), [1, 1, 1], [0]), + MonomialOrder(ordering_as_matrix(:lex, 3), [1, 0, 0], [1, 0, 0]), + ) + + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :standard, + ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :pertubed, + 3, + ) + + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :standard, + ) + T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + + @time T0 = Singular.std( + Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equalitytest(T4, T0)) + + + if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) + success = false + end + +end + println("All tests were: ", success) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 34749d6a7..967eec864 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -3,6 +3,8 @@ include("GroebnerWalkUtilitys.jl") include("FractalWalkUtilitys.jl") include("GenericWalkUtilitys.jl") include("StandardWalkUtilitys.jl") +include("TranWalkUtilitys.jl") + export groebnerwalk @@ -17,10 +19,6 @@ export groebnerwalk ############################################################### #Top-Level #TODO: Implement input checks -#Fragen: -#Singular.reduce für f % G selbst programmieren? -#Für divrem in Oscar-Ideal: sinnvoller möglich? reduce liefert nur den rest -#Arithmetik von Polynomen -> Immer MPolyBuildCTX? ############################################################### counter = 0 @@ -52,6 +50,8 @@ function groebnerwalk( walk = (x, y, z) -> fractal_walk3(x, y, z) elseif grwalktype == :fractal4 walk = (x, y, z) -> fractal_walk_lookahead(x, y, z) + elseif grwalktype == :tran + walk = (x, y, z) -> tran_walk(x, y, z) #error("Choose a strategy from: :generic, :standard ...") # fill the list or implement a functionality to choose the best # way w.r.t. the type of the ideal @@ -186,6 +186,7 @@ function pertubed_walk( ) p = k sweight = pert_Vectors(G, S, p) + #sweight = S[1,:] println(sweight) Gnew = G #loop @@ -247,17 +248,24 @@ function checkPvecs() global PVecs println(PVecs) end + +sigma = [] + +function getSigma() + global sigma + return sigma +end function fractal_walk( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - +global sigma = S.w println("FacrtalWalk_standard results") println("Crossed Cones in: ") Gb = fractal_recursiv(G, S, T, PVecs, 1) -println("Cones crossed: ", deleteCounterFr()) +println("Cones crossed: ", deleteCounterFr(), " and ", getCounter()) return Gb end @@ -271,10 +279,10 @@ function fractal_recursiv( R = base_ring(G) term = false G.isGB = true - cweight = S.w + cweight = getSigma() while !term - w = nextw_fr(G, cweight, PVecs[p]) + w = nextW_2(G, cweight, PVecs[p]) if (w == [0]) if inCone(G, T, PVecs[p]) if raiseCounterFr() @@ -282,7 +290,7 @@ function fractal_recursiv( end return G else - global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] println(PVecs) continue end @@ -300,6 +308,7 @@ function fractal_recursiv( raiseCounterFr(true) else resetCounterFr() + println("up in: ", p, " with: ", w) Gnew = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), @@ -308,8 +317,11 @@ function fractal_recursiv( PVecs, p + 1, ) + resetCounterFr() + end + global counter = getCounter() + 1 G = liftGWfr(G, Gnew, R, Rn) G = Singular.std(G, complete_reduction = true) @@ -333,7 +345,7 @@ function fractal_walk2( T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - +global sigma = S.w println("FractalWalk_withStartorder results") println("Crossed Cones in: ") Gb = fractal_recursiv2(G, S, T, PVecs, 1) @@ -361,11 +373,11 @@ function fractal_recursiv2( if firstStepMode cweight = cwPert[p] else - cweight = S.w + cweight = getSigma() end while !term - w = nextw_fr(G, cweight, PVecs[p]) + w = nextW_2(G, cweight, PVecs[p]) if w == [0] if inCone(G, T, PVecs[p]) @@ -374,7 +386,7 @@ function fractal_recursiv2( end return G else - global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] continue end end @@ -391,7 +403,6 @@ function fractal_recursiv2( #println("Computed Gröbnerbase: ", w, "in depth: ", p) else - resetCounterFr() Gnew = fractal_recursiv2( Singular.Ideal(R, [x for x in Gw]), S, @@ -399,6 +410,8 @@ function fractal_recursiv2( PVecs, p + 1, ) + resetCounterFr() + global firstStepMode = false end @@ -461,7 +474,7 @@ function fractal_recursiv3( end return G else - global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] continue end end @@ -525,7 +538,7 @@ function fractal_recursiv_lookahead( while !term - w = nextw_fr(G, cweight, PVecs[p]) + w = nextW_2(G, cweight, PVecs[p]) if (w == [0]) if inCone(G, T, PVecs[p]) if raiseCounterFr() @@ -533,7 +546,7 @@ function fractal_recursiv_lookahead( end return G else - global PVecs = [pert_Vectors(G, T, 10, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] #checkPvecs() continue end @@ -549,6 +562,8 @@ function fractal_recursiv_lookahead( println(w, " in depth", p) raiseCounterFr(true) else + println("up in: ", p, " with: ", w) + resetCounterFr() Gnew = fractal_recursiv_lookahead( Singular.Ideal(R, [x for x in Gw]), @@ -567,3 +582,34 @@ function fractal_recursiv_lookahead( end return G end + +############################################################### +#Tran-version of the groebner walk by Tran (2002) +############################################################### + +function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + cweight = S[1, :] + tweight = T[1, :] + println("Tranwalk results") + println("Crossed Cones in: ") + + #loop + term = false + while !term + w = nextw(G, cweight, tweight) + println(cweight, tweight) + if w == tweight + if inCone(G, T, cweight) + return G + else + #TODO: Implement: if in several cones + tweight = representationVector(G, T) + continue + end + end + G = standard_step(G, w, tweight, T) + global counter = getCounter() + 1 + println(w) + cweight = w + end +end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 889842e91..870f87763 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -207,7 +207,7 @@ m = [] end maxtdeg = 0 for g in gens(G) - td = tdeg(g) + td = tdeg(g,n) if (td > maxtdeg) maxtdeg = td end @@ -239,7 +239,7 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) end maxtdeg = 0 for g in gens(G) - td = tdeg(g) + td = tdeg(g,n) if (td > maxtdeg) maxtdeg = td end @@ -275,7 +275,7 @@ end end maxtdeg = 0 for g in gens(G) - td = tdeg(g) + td = tdeg(g,n) if (td > maxtdeg) maxtdeg = td end @@ -311,7 +311,7 @@ end end maxtdeg = 0 for g in gens(G) - td = tdeg(g) + td = tdeg(g,n) if (td > maxtdeg) maxtdeg = td end @@ -324,13 +324,15 @@ end return w end -function tdeg(p::Singular.spoly) +function tdeg(p::Singular.spoly, n::Int64) max = 0 for mon in monomials(p) ev = collect(exponent_vectors(mon)) sum = 0 for e in ev - sum = e[1] + sum + for i in 1:n + sum = e[i] + sum + end end if (max < sum) max = sum diff --git a/src/Groebnerwalk/TranWalkUtilitys.jl b/src/Groebnerwalk/TranWalkUtilitys.jl new file mode 100644 index 000000000..4119fcc9a --- /dev/null +++ b/src/Groebnerwalk/TranWalkUtilitys.jl @@ -0,0 +1,30 @@ +include("GroebnerWalkUtilitys.jl") + + +function representationVector(G::Singular.sideal, T::Matrix{Int64}) + n = Singular.ncols(T) + M = 0 + for i in 1:n + for j in 1:n + temp = T[i,j] + if M < temp + M = temp + end +end +end + + d0 = 0 + for g in gens(G) +# println(g, " in tedeg", tdeg(g)) + temp = tdeg(g,n) + if d0 < temp + d0 = temp + end +end +d = M * (2*d0^2 + (n + 1)* d0) +w = d^(n-1) * T[1,:] +for i in 2:n + w = w + d^(n-i) * T[i,:] +end +return w +end From e71163851f55901fd118fadea8370847c2a72459 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 7 Sep 2021 13:23:49 +0200 Subject: [PATCH 21/85] Small fix --- src/Groebnerwalk/GWtest.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 165fcbcb4..c5841bf63 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -4,7 +4,7 @@ include("GroebnerWalk.jl") using Oscar -case = 3 +case = 1 success = true if case == 1 || case == 99 @@ -180,13 +180,13 @@ if case == 3 || case == 99 I = Singular.Ideal(R, [f1, f2, f3]) I = Oscar.Singular.std(I, complete_reduction = true) - @time L = groebnerwalk( + @time H = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), :standard, ) - @time J = fractal_walk( +#= @time J = fractal_walk( I, MonomialOrder( ordering_as_matrix(:degrevlex, 6), @@ -198,7 +198,7 @@ if case == 3 || case == 99 [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], ), - ) + ) =# @time JJ = fractal_walk_lookahead( I, MonomialOrder( @@ -243,7 +243,7 @@ if case == 3 || case == 99 Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) +# T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) @@ -252,13 +252,13 @@ if case == 3 || case == 99 println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) + #println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) println("test generic: ", equalitytest(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) + if !(equalitytest(T2, T0) && equalitytest(T3, T4) && equalitytest(T0, T5)) success = false end @@ -297,7 +297,7 @@ if case == 4 || case == 99 I = Singular.Ideal(R, [f1, f2, f3, f4]) I = Oscar.Singular.std(I, complete_reduction = true) - @time L = groebnerwalk( + @time H = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), @@ -331,7 +331,7 @@ if case == 4 || case == 99 I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :standard, + :generic, ) @@ -415,7 +415,7 @@ if case == 5 || case == 99 I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - :standard, + :generic, ) T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) From d4539368f151ad57d1c2304e2d5bd80bfe499991 Mon Sep 17 00:00:00 2001 From: jwelp Date: Tue, 7 Sep 2021 15:26:44 +0200 Subject: [PATCH 22/85] feat: modulo() --- src/Groebnerwalk/GenericWalkUtilitys.jl | 158 ++++++++++++++++++++++-- src/Groebnerwalk/GroebnerWalk.jl | 3 +- 2 files changed, 152 insertions(+), 9 deletions(-) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index fa96fd338..c4458d362 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -39,7 +39,7 @@ function isparallel(u::Vector{Int64}, v::Vector{Int64}) #TODO: maybe false this way count = 1 x = 0 - for i in 1:length(u) + for i = 1:length(u) if u[i] == 0 if v[count] == 0 count = count + 1 @@ -74,7 +74,16 @@ function liftgeneric( liftArray = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) for g in gens(I) diff = - change_ring(g, S) - first(gens(Oscar.Singular.Ideal(S, S(reducegeneric_recursiv(change_ring(g, S), G, Lm))))) + subtractTerms(change_ring(g, S), + S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), nvars(S)) + #= println("red 2:", + change_ring(g, S) - + S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), + ) + println("red 1:", + change_ring(g, S) - + S(reducegeneric_recursiv(change_ring(g, S), G, Lm)), + ) =# if diff != 0 push!(Newlm, Singular.leading_monomial(g)) push!(liftArray, diff) @@ -195,7 +204,129 @@ function less_facet( end return false end +function reduce_modulo( + p::Singular.spoly{Singular.n_FieldElem{fmpq}}, + lm::Singular.spoly{Singular.n_FieldElem{fmpq}}, + S::MPolyRing, +) + a = [] + r = 0 + div = false + newpoly = Singular.MPolyBuildCtx(S) + for term in Singular.terms(p) + #println(term, "and p", lm) + (b, c) = Singular.divides(change_ring(term, S), change_ring(lm, S)) + #println("mult ",c) + if b + #= if c == 1 + push_term!(newpoly, 1, zeros(Int64, 1, nvars(S))) + else =# + push_term!( + newpoly, + collect(Singular.coefficients(c))[1], + collect(Singular.exponent_vectors(c))[1], + ) + # end + div = true + end + end + if div + np = finish(newpoly) + return (np, true) + end + return (nothing, false) +end +changedInReduction = false +function hasChangedInReduction() + global changedInReduction + temp = changedInReduction + global changedInReduction = false + return temp +end +function reducegeneric_recursiv2( + p::Singular.spoly, + G::Singular.sideal, + Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, +) where {T<:RingElement} + R = base_ring(G) + S, V = Singular.PolynomialRing( + base_ring(R).base_ring, + [String(s) for s in symbols(R)], + ordering = :lex, + ) + Gh = [] + for i = 1:ngens(G) + (q, b) = reduce_modulo(change_ring(p, S), change_ring(Lm[i], S), S) + if b + push!(Gh, (i, q)) + break + end + end + if !isempty(Gh) + mul = [x for x in gens(G)] + global changedInReduction = true + for (i, q) in Gh + #= println("pretet ", p, "and", q * change_ring(mul[i], S)) + println( + "test ", + subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), + ) =# + return reducegeneric_recursiv2( + subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), + G, + Lm, + ) + end + else + return p + end +end +function subtractTerms(p::Singular.spoly, q::Singular.spoly, dim::Int64) + sol = MPolyBuildCtx(R) + ep = collect(Singular.exponent_vectors(p)) + eq = collect(Singular.exponent_vectors(q)) + cp = collect(Singular.coefficients(p)) + cq = collect(Singular.coefficients(q)) + dummy = zeros(Int64, dim) + dummy[1] = -1 + for j = 1:length(ep) + fin = false + for k = 1:length(eq) + equals = true + for i = 1:dim + if ep[j][i] != eq[k][i] + equals = false + break + end + end + if equals + diff = cp[j] - cq[k] + if diff != 0 + push_term!( + sol, + diff, + ep[j], + ) + end + fin = true + eq[k] = dummy #delete Vector if equal + break + end + end + if !fin + push_term!(sol, cp[j], ep[j]) + end + end + for i in 1:length(eq) + if eq[i][1] != -1 + push_term!(sol, - cq[i], eq[i]) +end + end + h = finish(sol) + return h +end +#= function reducegeneric_recursiv( p::T, G::Singular.sideal, @@ -211,8 +342,10 @@ function reducegeneric_recursiv( for i = 1:ngens(G) for mon in terms(first(gens(ideal(S, [p])))) (q, r) = divrem(mon, gens(ideal(S, Lm))[i]) + #printn("q ",q,"r ", r, "mon", mon, "p ", p) if r == 0 push!(Gh, (i, q)) + #println(q) break end end @@ -230,7 +363,7 @@ function reducegeneric_recursiv( return p end end - +=# function interreduce_new( G::Singular.sideal, Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, @@ -244,7 +377,8 @@ function interreduce_new( #gensrest = filter(x -> x != gens[i], gens) gensrest = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) - Lmrest = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + Lmrest = + Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) ## New function for j = 1:ngens(G) if i != j @@ -253,14 +387,24 @@ function interreduce_new( end end #Lmrest = filter(x -> x != Lm[i], Lm) - gen = reducegeneric_recursiv( + gen = reducegeneric_recursiv2( gens[i], Singular.Ideal(R, gensrest), Lmrest, ) - if gens[i] != gen + #= println("interred 2 :", reducegeneric_recursiv2( + gens[i], + Singular.Ideal(R, gensrest), + Lmrest, + )) + println("interred 1 :", reducegeneric_recursiv( + gens[i], + Singular.Ideal(R, gensrest), + Lmrest, + )) =# + if hasChangedInReduction() changed = true - gens[i] = first(Singular.gens(Singular.Ideal(R, R(gen)))) + gens[i] = first(Singular.gens(Singular.Ideal(R, change_ring(gen, R)))) break end end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 967eec864..7c1ac6594 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -167,8 +167,8 @@ function generic_step( liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) Gnew = Oscar.Singular.Ideal(S, [x for x in liftArray]) - Gnew = interreduce_new(Gnew, Newlm) + Gnew = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) Gnew.isGB = true return Gnew, Newlm @@ -187,7 +187,6 @@ function pertubed_walk( p = k sweight = pert_Vectors(G, S, p) #sweight = S[1,:] - println(sweight) Gnew = G #loop term = false From b94217478c31a07660eb7f37900efbaf54922189 Mon Sep 17 00:00:00 2001 From: jwelp Date: Wed, 8 Sep 2021 11:18:24 +0200 Subject: [PATCH 23/85] Removed Dependency: Oscar --- src/Groebnerwalk/FractalWalkUtilitys.jl | 22 ++-- src/Groebnerwalk/GWtest.jl | 141 +++++++++++------------ src/Groebnerwalk/GenericWalkUtilitys.jl | 107 ++++++++--------- src/Groebnerwalk/GroebnerWalk.jl | 54 ++++----- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 64 +++++----- src/Groebnerwalk/StandardWalkUtilitys.jl | 1 - src/Groebnerwalk/TranWalkUtilitys.jl | 4 +- 7 files changed, 195 insertions(+), 198 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index f4a6090bc..d255d4a60 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -13,8 +13,8 @@ end function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) R, V = change_order(G, T.t, T.m) - I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(gens(I), initials(R, gens(I), t)) + I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) return false @@ -30,17 +30,17 @@ function change_order( R = I.base_ring G = Singular.gens(I.base_ring) Gstrich = string.(G) - S, H = Oscar.Singular.PolynomialRing( + S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Oscar.Singular.ordering_a(T.w)* - Oscar.Singular.ordering_M(T.m), + ordering = Singular.ordering_a(T.w)* + Singular.ordering_M(T.m), ) -#= S, H = Oscar.Singular.PolynomialRing( +#= S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Oscar.Singular.ordering_a(T.t) *Oscar.Singular.ordering_a(T.w)* - Oscar.Singular.ordering_M(T.m) + ordering = Singular.ordering_a(T.t) *Singular.ordering_a(T.w)* + Singular.ordering_M(T.m) ) return S, H =# @@ -48,10 +48,10 @@ end function liftGWfr(G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) rest = [ - change_ring(gen, S) - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) - for gen in gens(Gw) + change_ring(gen, S) - change_ring(Singular.reduce(change_ring(gen, R), G), S) + for gen in Singular.gens(Gw) ] -G = Oscar.Singular.Ideal(S, [S(x) for x in rest]) +G = Singular.Ideal(S, [S(x) for x in rest]) G.isGB = true return G end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index c5841bf63..3da6ed31e 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -1,15 +1,11 @@ -using Pkg include("GroebnerWalk.jl") -using Oscar - - -case = 1 +case = 3 success = true if case == 1 || case == 99 - R, (x, y) = Oscar.Singular.PolynomialRing( - QQ, + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, ["x", "y"], ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), ) @@ -18,9 +14,9 @@ if case == 1 || case == 99 f2 = x^3 - y^2 - x I = Singular.Ideal(R, [f1, f2]) - I = Oscar.Singular.std(I, complete_reduction = true) + I = Singular.std(I, complete_reduction = true) - S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y"], ordering = :lex) + S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) @time H = groebnerwalk( I, @@ -61,15 +57,15 @@ if case == 1 || case == 99 ) T0 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) @@ -86,8 +82,8 @@ end if case == 2 || case == 99 - R, (x, y, z) = Oscar.Singular.PolynomialRing( - QQ, + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix([5, 4, 1], :deglex)), ) @@ -96,7 +92,7 @@ if case == 2 || case == 99 f2 = y^2 - x * z - y * z I = Singular.Ideal(R, [f1, f2]) - I = Oscar.Singular.std(I, complete_reduction = true) + I = Singular.std(I, complete_reduction = true) @time H = groebnerwalk( I, @@ -134,23 +130,23 @@ if case == 2 || case == 99 :generic, ) - S, V = Oscar.Singular.PolynomialRing( - QQ, + S, V = Singular.PolynomialRing( + Singular.QQ, ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), ) T0 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) @@ -167,8 +163,8 @@ end if case == 3 || case == 99 - R, (x, y, z, u, v, w) = Oscar.Singular.PolynomialRing( - QQ, + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, ["x", "y", "z", "u", "v", "w"], ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), ) @@ -178,7 +174,7 @@ if case == 3 || case == 99 f2 = 2 * x^2 * y + x^3 * w * u^2 + x f3 = 2 - 3 * x^2 * v * z^4 * w I = Singular.Ideal(R, [f1, f2, f3]) - I = Oscar.Singular.std(I, complete_reduction = true) + I = Singular.std(I, complete_reduction = true) @time H = groebnerwalk( I, @@ -234,38 +230,37 @@ if case == 3 || case == 99 ) - S, V = Oscar.Singular.PolynomialRing( - QQ, + S, V = Singular.PolynomialRing( + Singular.QQ, ["x", "y", "z", "u", "v", "w"], - ordering = Oscar.Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), ) T0 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) -# T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) - +# T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + println(T0) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) #println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) - + println("test generic: ", equal(T4, T0)) - if !(equalitytest(T2, T0) && equalitytest(T3, T4) && equalitytest(T0, T5)) + if !(equalitytest(T2, T0) && equalitytest(T3, T0) && equalitytest(T0, T5) && Singular.equal(T0, T4)) success = false end end if case == 4 || case == 99 - R, (q, c, p, d) = Oscar.Singular.PolynomialRing( - QQ, + R, (q, c, p, d) = Singular.PolynomialRing( + Singular.QQ, ["q", "c", "p", "d"], ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), ) @@ -295,7 +290,7 @@ if case == 4 || case == 99 12 * c * d * q + 12 * c * d * p * q - 12 * c * d I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Oscar.Singular.std(I, complete_reduction = true) + I = Singular.std(I, complete_reduction = true) @time H = groebnerwalk( I, @@ -335,38 +330,38 @@ if case == 4 || case == 99 ) - S, V = Oscar.Singular.PolynomialRing( - QQ, + S, V = Singular.PolynomialRing( + Singular.QQ, ["q", "c", "p", "d"], - ordering = Oscar.Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), ) T0 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal: ", equalitytest(T0, T1)) println("test fractal2: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) + println("test generic: ", Singular.equal(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) + if !(equalitytest(T2, T1) && equalitytest(T3, T0) && equalitytest(T0, T5) && Singular.equal(T0, T4)) success = false end end if case == 5 || case == 99 - R, (x, y, z) = Oscar.Singular.PolynomialRing( - QQ, + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), ) @@ -376,9 +371,9 @@ if case == 5 || case == 99 f3 = -2x^2*y + x* y^4 + y *z^4 - 3 I = Singular.Ideal(R, [f1, f2, f3]) - I = Oscar.Singular.std(I, complete_reduction = true) + I = Singular.std(I, complete_reduction = true) - S, V = Oscar.Singular.PolynomialRing(QQ, ["x", "y", "z"], ordering = :lex) + S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) @time H = groebnerwalk( I, @@ -417,27 +412,27 @@ if case == 5 || case == 99 ordering_as_matrix(:lex, 3), :generic, ) - T1 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) @time T0 = Singular.std( - Oscar.Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T6 = Oscar.Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) + println("test generic: ", Singular.equal(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) + if !(equalitytest(T2, T1) && equalitytest(T3, T0) && equalitytest(T0, T5) && Singular.equal(T0, T4)) success = false end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index c4458d362..73fee2c93 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -1,4 +1,3 @@ -using Oscar include("GroebnerWalkUtilitys.jl") ############################################################### @@ -6,22 +5,22 @@ include("GroebnerWalkUtilitys.jl") ############################################################### function facet_initials( - R::MPolyRing, + R::Singular.PolyRing, G::Singular.sideal, v::Vector{Int64}, - lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, + lm::Vector{spoly{n_Q}}, ) inits = [] count = 1 - for g in gens(G) - inw = MPolyBuildCtx(R) + for g in Singular.gens(G) + inw = Singular.MPolyBuildCtx(R) #V = filter(x -> less_facet(S, x), diff_vectors(G) el = collect(Singular.exponent_vectors(lm[count]))[1] for i = 1:length(g) e = collect(Singular.exponent_vectors(g))[i] if el == e || isparallel(el - e, v) - push_term!(inw, collect(Singular.coefficients(g))[i], e) + Singular.push_term!(inw, collect(Singular.coefficients(g))[i], e) end end @@ -65,17 +64,17 @@ end function liftgeneric( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, - I::Singular.sideal, -) - S = base_ring(G) + Lm::Vector{Singular.spoly{L}}, + H::Singular.sideal, +) where L <: Nemo.RingElem +S = base_ring(G) count = 1 - Newlm = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) - liftArray = Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) - for g in gens(I) + Newlm = Array{Singular.elem_type(R),1}(undef, 0) + liftArray = Array{Singular.elem_type(R),1}(undef, 0) + for g in Singular.gens(H) diff = - subtractTerms(change_ring(g, S), - S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), nvars(S)) + subtractTerms(g, + reducegeneric_recursiv2(g, G, Lm), Singular.nvars(S)) #= println("red 2:", change_ring(g, S) - S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), @@ -85,7 +84,7 @@ function liftgeneric( S(reducegeneric_recursiv(change_ring(g, S), G, Lm)), ) =# if diff != 0 - push!(Newlm, Singular.leading_monomial(g)) + push!(Newlm, Singular.leading_term(g)) push!(liftArray, diff) end end @@ -93,9 +92,9 @@ function liftgeneric( end function check_zeros( - G::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, -) + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, +) where L <: Nemo.RingElem Lm = filter(x -> x != 0, Lm) G = filter(x -> x != 0, G) return G, Lm @@ -103,11 +102,11 @@ end function nextV( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, + Lm::Vector{spoly{L}}, w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, -) +) where L <: Nemo.RingElem V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) #@info "#1 Current V: " V @@ -205,17 +204,16 @@ function less_facet( return false end function reduce_modulo( - p::Singular.spoly{Singular.n_FieldElem{fmpq}}, - lm::Singular.spoly{Singular.n_FieldElem{fmpq}}, - S::MPolyRing, + p::Singular.spoly, + lm::Singular.spoly, + S::Singular.PolyRing, ) a = [] r = 0 div = false newpoly = Singular.MPolyBuildCtx(S) for term in Singular.terms(p) - #println(term, "and p", lm) - (b, c) = Singular.divides(change_ring(term, S), change_ring(lm, S)) + (b, c) = Singular.divides(term, lm) #println("mult ",c) if b #= if c == 1 @@ -246,34 +244,30 @@ end function reducegeneric_recursiv2( p::Singular.spoly, G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, -) where {T<:RingElement} - R = base_ring(G) + Lm::Vector{spoly{L}}, +) where L <: Nemo.RingElem + R = Singular.base_ring(G) + - S, V = Singular.PolynomialRing( - base_ring(R).base_ring, - [String(s) for s in symbols(R)], - ordering = :lex, - ) Gh = [] - for i = 1:ngens(G) - (q, b) = reduce_modulo(change_ring(p, S), change_ring(Lm[i], S), S) + for i in 1:Singular.ngens(G) + (q, b) = reduce_modulo(p, Lm[i], R) if b push!(Gh, (i, q)) break end end if !isempty(Gh) - mul = [x for x in gens(G)] + mul = [x for x in Singular.gens(G)] global changedInReduction = true for (i, q) in Gh - #= println("pretet ", p, "and", q * change_ring(mul[i], S)) + #= println("pretet ", p, "and", q , "and", change_ring(mul[i], S)) println( "test ", subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), - ) =# + )=# return reducegeneric_recursiv2( - subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), + subtractTerms(p, (q * mul[i]), Singular.nvars(R)), G, Lm, ) @@ -282,8 +276,8 @@ function reducegeneric_recursiv2( return p end end -function subtractTerms(p::Singular.spoly, q::Singular.spoly, dim::Int64) - sol = MPolyBuildCtx(R) +function subtractTerms(p::Singular.spoly{L}, q::Singular.spoly{L}, dim::Int64) where L <: Nemo.RingElem + sol = MPolyBuildCtx(parent(p)) ep = collect(Singular.exponent_vectors(p)) eq = collect(Singular.exponent_vectors(q)) cp = collect(Singular.coefficients(p)) @@ -303,7 +297,7 @@ function subtractTerms(p::Singular.spoly, q::Singular.spoly, dim::Int64) if equals diff = cp[j] - cq[k] if diff != 0 - push_term!( + Singular.push_term!( sol, diff, ep[j], @@ -315,22 +309,22 @@ function subtractTerms(p::Singular.spoly, q::Singular.spoly, dim::Int64) end end if !fin - push_term!(sol, cp[j], ep[j]) + Singular.push_term!(sol, cp[j], ep[j]) end end for i in 1:length(eq) if eq[i][1] != -1 - push_term!(sol, - cq[i], eq[i]) + Singular.push_term!(sol, - cq[i], eq[i]) end end - h = finish(sol) + h = Singular.finish(sol) return h end #= function reducegeneric_recursiv( p::T, G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, + Lm::Vector{spoly{n_Q}}, ) where {T<:RingElement} R = base_ring(G) S, V = PolynomialRing( @@ -366,21 +360,21 @@ end =# function interreduce_new( G::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, -) - R = base_ring(G) + Lm::Vector{spoly{L}}, +) where L <: Nemo.RingElem + R = Singular.base_ring(G) gens = collect(Singular.gens(G)) changed = true while changed changed = false - for i = 1:ngens(G) + for i in 1:Singular.ngens(G) #gensrest = filter(x -> x != gens[i], gens) gensrest = - Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + Array{Singular.elem_type(R),1}(undef, 0) Lmrest = - Array{Singular.spoly{Singular.n_FieldElem{fmpq}},1}(undef, 0) + Array{Singular.elem_type(R),1}(undef, 0) ## New function - for j = 1:ngens(G) + for j = 1:Singular.ngens(G) if i != j push!(gensrest, gens[j]) push!(Lmrest, Lm[j]) @@ -404,10 +398,11 @@ function interreduce_new( )) =# if hasChangedInReduction() changed = true - gens[i] = first(Singular.gens(Singular.Ideal(R, change_ring(gen, R)))) + gens[i] = first(Singular.gens(Singular.Ideal(R, gen))) break end end end - return Oscar.Singular.Ideal(R, [R(p) for p in gens]) + + return Singular.Ideal(R, [R(p) for p in gens]) end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 7c1ac6594..3ff660519 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -1,4 +1,3 @@ -using Oscar include("GroebnerWalkUtilitys.jl") include("FractalWalkUtilitys.jl") include("GenericWalkUtilitys.jl") @@ -58,14 +57,14 @@ function groebnerwalk( end ######TODO:Check the parameter##### - R = singular_ring(base_ring(G)) + R = base_ring(G) I = Singular.Ideal(R, [R(x) for x in gens(G)]) Gb = walk(I, S, T) println("Cones crossed: ", getCounter()) S, V = change_order(Gb, T) - return Oscar.Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) + return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end @@ -117,7 +116,7 @@ function standard_step( inwG = initials(S, gens(G), cw) #Initial Ideal IinwG = Singular.std( - Oscar.Singular.Ideal(S, [S(x) for x in inwG]), + Singular.Ideal(S, [S(x) for x in inwG]), complete_reduction = true, ) @@ -125,7 +124,7 @@ function standard_step( Gnew = liftGW(G, IinwG, R, S) #Interreduce - return Oscar.Singular.std(Gnew, complete_reduction = true) + return Singular.std(Gnew, complete_reduction = true) end ############################################################### @@ -137,7 +136,9 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R, V = change_order(G, T) v = nextV(G, [0], S, T) - lm = [Oscar.Singular.leading_monomial(g) for g in gens(G)] + lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + println("GenericWalk results") println("Crossed Cones with facetNormal: ") while !isempty(v) @@ -152,24 +153,24 @@ end function generic_step( G::Singular.sideal, - S::MPolyRing, + S::Singular.PolyRing, v::Vector{Int64}, T::Matrix{Int64}, - lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, -) - R = base_ring(G) + lm::Vector{Singular.spoly{L}}) where L <: Nemo.RingElem + + R = Singular.base_ring(G) facet_Generators = facet_initials(S, G, v, lm) facet_Ideal = Singular.std( - Oscar.Singular.Ideal(S, [S(x) for x in facet_Generators]), + Singular.Ideal(S, [S(x) for x in facet_Generators]), complete_reduction = true, ) liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) - Gnew = Oscar.Singular.Ideal(S, [x for x in liftArray]) + Gnew = Singular.Ideal(S, [x for x in liftArray]) Gnew = interreduce_new(Gnew, Newlm) - Gnew = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) + Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) Gnew.isGB = true return Gnew, Newlm end @@ -202,7 +203,7 @@ function pertubed_walk( else if k == 1 R, V = change_order(Gnew, T) - Gnew = Oscar.Singular.Ideal( + Gnew = Singular.Ideal( R, [change_ring(x, R) for x in gens(Gnew)], ) @@ -359,11 +360,11 @@ function fractal_recursiv2( PVecs::Vector{Vector{Int64}}, p::Int64, ) - R = base_ring(G) + R = Singular.base_ring(G) term = false G.isGB = true if (p == 1) - if !ismonomial(initials(R, gens(G), S.w)) + if !ismonomial(initials(R, Singular.gens(G), S.w)) println("nomonomial") global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:nvars(R)] global firstStepMode = true @@ -392,7 +393,7 @@ function fractal_recursiv2( T.w = w Rn, V = change_order(G, T) Gw = initials(R, gens(G), w) - if p == nvars(R) + if p == Singular.nvars(R) Gnew = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -442,12 +443,12 @@ function fractal_recursiv3( PVecs::Vector{Vector{Int64}}, p::Int64, ) - R = base_ring(G) + R = Singular.base_ring(G) term = false G.isGB = true if (p == 1) - if !ismonomial(initials(R, gens(G), S.w)) - global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:nvars(R)] + if !ismonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:Singular.nvars(R)] global firstStepMode = true end end @@ -473,14 +474,14 @@ function fractal_recursiv3( end return G else - global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:Singular.nvars(R)] continue end end T.w = w Rn, V = change_order(G, T) - Gw = initials(R, gens(G), w) - if p == nvars(R) + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) Gnew = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -530,7 +531,7 @@ function fractal_recursiv_lookahead( PVecs::Vector{Vector{Int64}}, p::Int64, ) - R = base_ring(G) + R = Singular.base_ring(G) term = false G.isGB = true cweight = S.w @@ -552,8 +553,8 @@ function fractal_recursiv_lookahead( end T.w = w Rn, V = change_order(G, T) - Gw = initials(R, gens(G), w) - if (p == nvars(R) || isBinomial(Gw)) + Gw = initials(R, Singular.gens(G), w) + if (p == Singular.nvars(R) || isBinomial(Gw)) Gnew = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -596,7 +597,6 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) term = false while !term w = nextw(G, cweight, tweight) - println(cweight, tweight) if w == tweight if inCone(G, T, cweight) return G diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 870f87763..5a74f76c0 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -1,4 +1,3 @@ -using Oscar ############################################################### #Utilitys for Groebnerwalks ############################################################### @@ -6,10 +5,10 @@ using Oscar #Returns the initials of polynomials w.r.t. a weight vector. #The ordering doesn´t affect this. function initials( - R::MPolyRing, - G::Array{T,1}, - w::Array{K,1}, -) where {T<:RingElement,K<:Number} + R::Singular.PolyRing, + G::Vector{spoly{n_Q}}, + w::Vector{Int64} +) inits = [] for g in G maxw = 0 @@ -28,7 +27,7 @@ function initials( end inw = MPolyBuildCtx(R) for (k, j) in indexw - push_term!(inw, collect(Singular.coefficients(g))[k], j) + Singular.push_term!(inw, collect(Singular.coefficients(g))[k], j) end h = finish(inw) push!(inits, h) @@ -43,8 +42,8 @@ end function diff_vectors( I::Singular.sideal, - Lm::Vector{Singular.spoly{Singular.n_FieldElem{fmpq}}}, -) + Lm::Vector{spoly{L}}, +) where L <: Nemo.RingElem v = [] for i = 1:ngens(I) ltu = Singular.leading_exponent_vector(Lm[i]) @@ -80,11 +79,11 @@ function change_order( R = I.base_ring G = Singular.gens(I.base_ring) Gstrich = string.(G) - S, H = Oscar.Singular.PolynomialRing( + S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Oscar.Singular.ordering_a(cweight) * - Oscar.Singular.ordering_M(T), + ordering = Singular.ordering_a(cweight) * + Singular.ordering_M(T), ) return S, H end @@ -97,28 +96,28 @@ function change_order( R = I.base_ring G = Singular.gens(I.base_ring) Gstrich = string.(G) - S, H = Oscar.Singular.PolynomialRing( + S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Oscar.Singular.ordering_M(M), + ordering = Singular.ordering_M(M), ) #@error("Not implemented yet") return S, H end function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(coefficients(p), exponent_vectors(p)) + cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) M = MPolyBuildCtx(R) for (c, v) in cvzip - push_term!(M, c, v) + Singular.push_term!(M, c, v) end return finish(M) end -function change_ring(p::Singular.spoly, R::MPolyRing) - cvzip = zip(coefficients(p), exponent_vectors(p)) +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) M = MPolyBuildCtx(R) for (c, v) in cvzip - push_term!(M, c, v) + Singular.push_term!(M, c, v) end return finish(M) end @@ -326,8 +325,8 @@ end function tdeg(p::Singular.spoly, n::Int64) max = 0 - for mon in monomials(p) - ev = collect(exponent_vectors(mon)) + for mon in Singular.monomials(p) + ev = collect(Singular.exponent_vectors(mon)) sum = 0 for e in ev for i in 1:n @@ -343,8 +342,8 @@ end function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) R, V = change_order(G, T) - I = Oscar.Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(gens(I), initials(R, gens(I), t)) + I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) return false @@ -356,10 +355,10 @@ end function liftGW(G::Singular.sideal, InG::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) G.isGB = true rest = [ - gen - change_ring(Oscar.Singular.reduce(change_ring(gen, R), G), S) + gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) for gen in gens(InG) ] - Gnew = Oscar.Singular.Ideal(S, [S(x) for x in rest]) + Gnew = Singular.Ideal(S, [S(x) for x in rest]) Gnew.isGB = true return Gnew end @@ -369,7 +368,7 @@ end ############################################# #Use MPolybuildCTX -function vec_sum(p::Vector{fmpq_mpoly}, q::Vector{fmpq_mpoly}) +function vec_sum(p::Vector{spoly{n_Q}}, q::Vector{spoly{n_Q}}) poly = 0 for i = 1:length(p) poly = poly + p[i] * q[i] @@ -395,17 +394,26 @@ end # Singular.isequal depends on order of generators function equalitytest(G::Singular.sideal, K::Singular.sideal) - generators = gens(G) + generators = Singular.gens(G) count = 0 for gen in generators - for r in gens(K) + for r in Singular.gens(K) if gen - r == 0 count = count + 1 end end end - if count == ngens(G) + if count == Singular.ngens(G) return true end return false end + +function dot(v::Vector{Int64}, w::Vector{Int64}) + n = length(v) + sum = 0 + for i in 1:n + sum = sum + v[i] * w[i] + end + return sum +end diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index f8212cff0..a705f49fd 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -1,4 +1,3 @@ -using Oscar include("GroebnerWalkUtilitys.jl") ############################################################### diff --git a/src/Groebnerwalk/TranWalkUtilitys.jl b/src/Groebnerwalk/TranWalkUtilitys.jl index 4119fcc9a..a05cab9c2 100644 --- a/src/Groebnerwalk/TranWalkUtilitys.jl +++ b/src/Groebnerwalk/TranWalkUtilitys.jl @@ -2,7 +2,7 @@ include("GroebnerWalkUtilitys.jl") function representationVector(G::Singular.sideal, T::Matrix{Int64}) - n = Singular.ncols(T) + n = size(T)[1] M = 0 for i in 1:n for j in 1:n @@ -14,7 +14,7 @@ end end d0 = 0 - for g in gens(G) + for g in Singular.gens(G) # println(g, " in tedeg", tdeg(g)) temp = tdeg(g,n) if d0 < temp From 7167e2267ad3dc009e5a2be9d02ce0d8e4131609 Mon Sep 17 00:00:00 2001 From: jwelp Date: Thu, 9 Sep 2021 16:08:32 +0200 Subject: [PATCH 24/85] Refactor: Remove filter!() --- src/Groebnerwalk/GenericWalkUtilitys.jl | 84 +++++++++++++++++-------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index 73fee2c93..e8dba1f43 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -100,6 +100,40 @@ function check_zeros( return G, Lm end +function filter_btz(S::Matrix{Int64}, + V::Vector{Any}) + btz = Set() + for v in V + if bigger_than_zero(S,v) + push!(btz, v) + end + end + return btz +end + +function filter_ltz(S::Matrix{Int64}, + V::Set{Any}) + btz = Set() + for v in V + if less_than_zero(S,v) + push!(btz, v) + end + end + return btz +end +function filter_lf( w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, + V::Set{Any}, +) + btz = Set() + for v in V + if less_facet(w, v, S, T) + push!(btz, v) + end + end + return btz +end function nextV( G::Singular.sideal, Lm::Vector{spoly{L}}, @@ -107,14 +141,14 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) where L <: Nemo.RingElem - V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) + V = sort_btz(S, diff_vectors(G, Lm)) #@info "#1 Current V: " V - filter!(x -> less_than_zero(T, x), V) + V = filter_ltz(T,V) #@info "#2 Current V: " V if (w != [0]) - filter!(x -> less_facet(w, x, S, T), V) + V = filter_lf(w, S, T, V) end #@info "#3 Current V: " V if isempty(V) @@ -122,10 +156,10 @@ function nextV( end - minV = V[1] - for i = 2:length(V) - if less_facet(V[i], minV, S, T) - minV = V[i] + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v end end @@ -138,27 +172,27 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) - V = filter(x -> bigger_than_zero(S, x), diff_vectors(G)) - #@info "#1 Current V: " V +V = sort_btz(S, diff_vectors(G)) +#@info "#1 Current V: " V - filter!(x -> less_than_zero(T, x), V) - #@info "#2 Current V: " V +V = filter_ltz(T,V) +#@info "#2 Current V: " V - if (w != [0]) - filter!(x -> less_facet(w, x, S, T), V) - end - #@info "#3 Current V: " V - if isempty(V) - return V - end +if (w != [0]) + V = filter_lf(w, S, T, V) +end +#@info "#3 Current V: " V +if isempty(V) + return V +end - minV = V[1] - for i = 2:length(V) - if less_facet(V[i], minV, S, T) - minV = V[i] - end +minV = first(V) +for v in V + if less_facet(v, minV, S, T) + minV = v end +end #@info "#4 Current V: " minV return minV @@ -168,7 +202,7 @@ end function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) for i = 1:size(M)[1] d = dot(M[i, :], v) - if (d != 0) + if d != 0 return d > 0 end end @@ -179,7 +213,7 @@ end function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) for i = 1:size(M)[1] d = dot(M[i, :], v) - if (d != 0) + if d != 0 return d < 0 end end From c1370dcbe148e405d32f30274c6332eb48218f83 Mon Sep 17 00:00:00 2001 From: jwelp Date: Thu, 9 Sep 2021 16:08:32 +0200 Subject: [PATCH 25/85] Refactor: Remove filter!() --- src/Groebnerwalk/GenericWalkUtilitys.jl | 84 +++++++++++++++++-------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index 73fee2c93..e8dba1f43 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -100,6 +100,40 @@ function check_zeros( return G, Lm end +function filter_btz(S::Matrix{Int64}, + V::Vector{Any}) + btz = Set() + for v in V + if bigger_than_zero(S,v) + push!(btz, v) + end + end + return btz +end + +function filter_ltz(S::Matrix{Int64}, + V::Set{Any}) + btz = Set() + for v in V + if less_than_zero(S,v) + push!(btz, v) + end + end + return btz +end +function filter_lf( w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, + V::Set{Any}, +) + btz = Set() + for v in V + if less_facet(w, v, S, T) + push!(btz, v) + end + end + return btz +end function nextV( G::Singular.sideal, Lm::Vector{spoly{L}}, @@ -107,14 +141,14 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) where L <: Nemo.RingElem - V = filter(x -> bigger_than_zero(S, x), diff_vectors(G, Lm)) + V = sort_btz(S, diff_vectors(G, Lm)) #@info "#1 Current V: " V - filter!(x -> less_than_zero(T, x), V) + V = filter_ltz(T,V) #@info "#2 Current V: " V if (w != [0]) - filter!(x -> less_facet(w, x, S, T), V) + V = filter_lf(w, S, T, V) end #@info "#3 Current V: " V if isempty(V) @@ -122,10 +156,10 @@ function nextV( end - minV = V[1] - for i = 2:length(V) - if less_facet(V[i], minV, S, T) - minV = V[i] + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v end end @@ -138,27 +172,27 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) - V = filter(x -> bigger_than_zero(S, x), diff_vectors(G)) - #@info "#1 Current V: " V +V = sort_btz(S, diff_vectors(G)) +#@info "#1 Current V: " V - filter!(x -> less_than_zero(T, x), V) - #@info "#2 Current V: " V +V = filter_ltz(T,V) +#@info "#2 Current V: " V - if (w != [0]) - filter!(x -> less_facet(w, x, S, T), V) - end - #@info "#3 Current V: " V - if isempty(V) - return V - end +if (w != [0]) + V = filter_lf(w, S, T, V) +end +#@info "#3 Current V: " V +if isempty(V) + return V +end - minV = V[1] - for i = 2:length(V) - if less_facet(V[i], minV, S, T) - minV = V[i] - end +minV = first(V) +for v in V + if less_facet(v, minV, S, T) + minV = v end +end #@info "#4 Current V: " minV return minV @@ -168,7 +202,7 @@ end function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) for i = 1:size(M)[1] d = dot(M[i, :], v) - if (d != 0) + if d != 0 return d > 0 end end @@ -179,7 +213,7 @@ end function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) for i = 1:size(M)[1] d = dot(M[i, :], v) - if (d != 0) + if d != 0 return d < 0 end end From 85d09e7000a9b9fa20a9d2e487532a5ddfce4ea2 Mon Sep 17 00:00:00 2001 From: jwelp Date: Sat, 11 Sep 2021 16:30:08 +0200 Subject: [PATCH 26/85] Refactor --- src/Groebnerwalk/FractalWalkUtilitys.jl | 1 + src/Groebnerwalk/GenericWalkUtilitys.jl | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index d255d4a60..8f1d6cec4 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -47,6 +47,7 @@ function change_order( end function liftGWfr(G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) + G.isGB = true rest = [ change_ring(gen, S) - change_ring(Singular.reduce(change_ring(gen, R), G), S) for gen in Singular.gens(Gw) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index e8dba1f43..779d11916 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -88,17 +88,30 @@ S = base_ring(G) push!(liftArray, diff) end end - return check_zeros(liftArray, Newlm) + return check_zeros(liftArray, Newlm, S) end function check_zeros( G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, + S::Singular.PolyRing, ) where L <: Nemo.RingElem - Lm = filter(x -> x != 0, Lm) - G = filter(x -> x != 0, G) - return G, Lm + +lmfin = Array{Singular.elem_type(S),1}(undef, 0) +Gfin = Array{Singular.elem_type(S),1}(undef, 0) +for lm in Lm + if lm != 0 + push!(lmfin, lm) + end end +for g in G + if g != 0 + push!(Gfin, g) + end +end + return Gfin, lmfin +end + function filter_btz(S::Matrix{Int64}, V::Vector{Any}) @@ -141,7 +154,7 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) where L <: Nemo.RingElem - V = sort_btz(S, diff_vectors(G, Lm)) + V = filter_btz(S, diff_vectors(G, Lm)) #@info "#1 Current V: " V V = filter_ltz(T,V) @@ -172,7 +185,7 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) -V = sort_btz(S, diff_vectors(G)) +V = filter_btz(S, diff_vectors(G)) #@info "#1 Current V: " V V = filter_ltz(T,V) From 58c270dcc22052d07a4499538d538800f5553bba Mon Sep 17 00:00:00 2001 From: jwelp Date: Sat, 11 Sep 2021 17:42:58 +0200 Subject: [PATCH 27/85] Refactoring --- src/Groebnerwalk/GenericWalkUtilitys.jl | 36 ++++----------------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 40 ++++++++++++++---------- 2 files changed, 30 insertions(+), 46 deletions(-) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index 321a63bcb..2bf7fa99a 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -15,15 +15,13 @@ function facet_initials( for g in Singular.gens(G) inw = Singular.MPolyBuildCtx(R) #V = filter(x -> less_facet(S, x), diff_vectors(G) - el = collect(Singular.exponent_vectors(lm[count]))[1] - - for i = 1:length(g) - e = collect(Singular.exponent_vectors(g))[i] + el = first(Singular.exponent_vectors(lm[count])) + mzip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + for (e, c) in mzip if el == e || isparallel(el - e, v) - Singular.push_term!(inw, collect(Singular.coefficients(g))[i], e) + Singular.push_term!(inw, c, e) end end - #push_term!(inw, collect(Singular.coefficients(lm[count]))[1], collect(Singular.exponent_vectors(lm[count]))[1]) h = finish(inw) push!(inits, h) @@ -124,20 +122,6 @@ function filter_btz(S::Matrix{Int64}, return btz end -<<<<<<< HEAD -======= -function filter_btz(S::Matrix{Int64}, - V::Vector{Any}) - btz = Set() - for v in V - if bigger_than_zero(S,v) - push!(btz, v) - end - end - return btz -end - ->>>>>>> 7167e2267ad3dc009e5a2be9d02ce0d8e4131609 function filter_ltz(S::Matrix{Int64}, V::Set{Any}) btz = Set() @@ -168,11 +152,7 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) where L <: Nemo.RingElem -<<<<<<< HEAD V = filter_btz(S, diff_vectors(G, Lm)) -======= - V = sort_btz(S, diff_vectors(G, Lm)) ->>>>>>> 7167e2267ad3dc009e5a2be9d02ce0d8e4131609 #@info "#1 Current V: " V V = filter_ltz(T,V) @@ -203,11 +183,7 @@ function nextV( S::Matrix{Int64}, T::Matrix{Int64}, ) -<<<<<<< HEAD V = filter_btz(S, diff_vectors(G)) -======= -V = sort_btz(S, diff_vectors(G)) ->>>>>>> 7167e2267ad3dc009e5a2be9d02ce0d8e4131609 #@info "#1 Current V: " V V = filter_ltz(T,V) @@ -290,8 +266,8 @@ function reduce_modulo( else =# push_term!( newpoly, - collect(Singular.coefficients(c))[1], - collect(Singular.exponent_vectors(c))[1], + first(Singular.coefficients(c)), + first(Singular.exponent_vectors(c)), ) # end div = true diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 5a74f76c0..e7cbbae2b 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -13,21 +13,21 @@ function initials( for g in G maxw = 0 indexw = [] - e = collect(Singular.exponent_vectors(g)) - for i = 1:length(g) - tmpw = dot(w, e[i]) + eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + for (e,c) in eczip + tmpw = dot(w, e) if maxw == tmpw - push!(indexw, (i, e[i])) + push!(indexw, (e, c)) #rethink this. gens are preordered elseif maxw < tmpw indexw = [] - push!(indexw, (i, e[i])) + push!(indexw, (e,c)) maxw = tmpw end end inw = MPolyBuildCtx(R) - for (k, j) in indexw - Singular.push_term!(inw, collect(Singular.coefficients(g))[k], j) + for (e, c) in indexw + Singular.push_term!(inw, c, e) end h = finish(inw) push!(inits, h) @@ -47,13 +47,12 @@ function diff_vectors( v = [] for i = 1:ngens(I) ltu = Singular.leading_exponent_vector(Lm[i]) - for e in filter( - x -> ltu != x, - collect(Singular.exponent_vectors(gens(I)[i])), - ) + for e in Singular.exponent_vectors(gens(I)[i]) + if ltu != e push!(v, ltu .- e) - end end +end +end return unique!(v) end @@ -326,7 +325,7 @@ end function tdeg(p::Singular.spoly, n::Int64) max = 0 for mon in Singular.monomials(p) - ev = collect(Singular.exponent_vectors(mon)) + ev = Singular.exponent_vectors(mon) sum = 0 for e in ev for i in 1:n @@ -368,12 +367,21 @@ end ############################################# #Use MPolybuildCTX -function vec_sum(p::Vector{spoly{n_Q}}, q::Vector{spoly{n_Q}}) +function vec_sum(p::Vector{spoly{n_Q}}, q::Vector{spoly{n_Q}}, S::Singular.PolyRing) poly = 0 + fin = Singular.MPolyBuildCtx(S) for i = 1:length(p) - poly = poly + p[i] * q[i] + cp = Singular.coefficients(p[i]) + cq = Singular.coefficients(q[i]) + ep = exponent_vectors(p[i]) + eq = exponent_vectors(q[i]) + for k in 1:length(cp) + for j in 1:length(cq) + push_term!(fin, cp[k] * cq[j], ep[k] + eq[j] ) + end +end end - return poly + return finish(fin) end function ident_matrix(n::Int64) From ccf6bfb1d423d6fc65563d8e2096b580c4091938 Mon Sep 17 00:00:00 2001 From: welpj Date: Tue, 5 Oct 2021 09:14:14 +0200 Subject: [PATCH 28/85] Refactoring and comments --- src/Groebnerwalk/FractalWalkUtilitys.jl | 22 ++- src/Groebnerwalk/GWtest.jl | 78 +++++---- src/Groebnerwalk/GenericWalkUtilitys.jl | 201 ++++++++++++----------- src/Groebnerwalk/GroebnerWalk.jl | 130 ++++++++------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 174 +++++++++++--------- src/Groebnerwalk/StandardWalkUtilitys.jl | 8 +- src/Groebnerwalk/TranWalkUtilitys.jl | 36 ++-- 7 files changed, 358 insertions(+), 291 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index 8f1d6cec4..c82a7876a 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -3,16 +3,15 @@ include("GroebnerWalkUtilitys.jl") #Solves problems with weight vectors of floats. function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int64}() - for i = 1:length(wtemp) push!(w, float(divexact(wtemp[i], gcd(wtemp)))) end return w end - +#Checks if a weight vector t is in the cone of the ordering T w.r.t. an ideal. function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) - R, V = change_order(G, T.t, T.m) + R, V = change_order(G.base_ring, T.t, T.m) I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip @@ -23,12 +22,12 @@ function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64 return true end +#return a copy of the PolynomialRing I, equipped with the ordering represented by T. function change_order( - I::Singular.sideal, + I::Singular.PolyRing, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, ) where {L<:Number,K<:Number} - R = I.base_ring - G = Singular.gens(I.base_ring) + G = Singular.gens(I) Gstrich = string.(G) S, H = Singular.PolynomialRing( R.base_ring, @@ -46,6 +45,7 @@ function change_order( =# end + function liftGWfr(G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) G.isGB = true rest = [ @@ -57,6 +57,7 @@ G.isGB = true return G end +#returns ´true´ if all polynomials of the array are monomials. function ismonomial(Gw::Vector{Any}) for g in Gw if size(collect(Singular.coefficients(g)))[1] > 1 @@ -65,6 +66,8 @@ function ismonomial(Gw::Vector{Any}) end return true end + +#returns ´true´ if all polynomials of the array are binomial. function isBinomial(Gw::Vector{Any}) for g in Gw if size(collect(Singular.coefficients(g)))[1] > 2 @@ -73,6 +76,10 @@ function isBinomial(Gw::Vector{Any}) end return true end + +#= +The version of Cox, O´shea and Fukuda et al. is limited because it returns 1, +if there are no more cones to cross and when the target vector lays on a facet. function nextw_fr( G::Singular.sideal, cweight::Array{T,1}, @@ -102,9 +109,9 @@ end return tweight end w = (1 - t) * cweight + t * tweight - return convertBoundingVector(w) end +=# function diff_vectors_lt(I::Singular.sideal) zip = [] @@ -120,6 +127,7 @@ function diff_vectors_lt(I::Singular.sideal) return zip end +#Computes next weight vector. Version used in Amrhein Gloor. function nextW_2(G::Singular.sideal, w::Array{T,1}, sigma::Array{K,1}, diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 3da6ed31e..f854a4a49 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -1,6 +1,6 @@ include("GroebnerWalk.jl") -case = 3 +case = 5 success = true if case == 1 || case == 99 @@ -56,7 +56,7 @@ if case == 1 || case == 99 :generic, ) - T0 = Singular.std( + @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) @@ -65,7 +65,7 @@ if case == 1 || case == 99 T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) @@ -146,7 +146,7 @@ if case == 2 || case == 99 T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) @@ -182,19 +182,19 @@ if case == 3 || case == 99 ordering_as_matrix(:lex, 6), :standard, ) -#= @time J = fractal_walk( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - ) =# + #= @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + ) =# @time JJ = fractal_walk_lookahead( I, MonomialOrder( @@ -239,12 +239,12 @@ if case == 3 || case == 99 Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) -# T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + # T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println(T0) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) @@ -253,7 +253,12 @@ if case == 3 || case == 99 println("test standard: ", equalitytest(T3, T0)) println("test generic: ", equal(T4, T0)) - if !(equalitytest(T2, T0) && equalitytest(T3, T0) && equalitytest(T0, T5) && Singular.equal(T0, T4)) + if !( + equalitytest(T2, T0) && + equalitytest(T3, T0) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) success = false end @@ -280,7 +285,7 @@ if case == 4 || case == 99 3 * p * q * c + 4 * c f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q f4 = - 4 - 4 * p - 4 * q^2 + 3*c^2 * q^2 - 6 * c^2 * q + + 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + 3 * c^2 + 9 * p^2 * d^2 + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + @@ -335,7 +340,7 @@ if case == 4 || case == 99 ["q", "c", "p", "d"], ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), ) - T0 = Singular.std( + @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) @@ -344,7 +349,7 @@ if case == 4 || case == 99 T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal: ", equalitytest(T0, T1)) @@ -354,7 +359,12 @@ if case == 4 || case == 99 println("test generic: ", Singular.equal(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T0) && equalitytest(T0, T5) && Singular.equal(T0, T4)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T0) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) success = false end @@ -366,20 +376,21 @@ if case == 5 || case == 99 ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), ) - f1 = x^2 +x*y^2 *z - 2x * y +y^4 + y^2 + z^2 - f2 = -x^3 *y^2 + x*y^2 * z + x *y * z^3 -2x*y + y^4 - f3 = -2x^2*y + x* y^4 + y *z^4 - 3 + f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 + f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 + f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 I = Singular.Ideal(R, [f1, f2, f3]) I = Singular.std(I, complete_reduction = true) - S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) + S, V = + Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) @time H = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - ) + ) @time J = fractal_walk( I, @@ -422,7 +433,7 @@ if case == 5 || case == 99 Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T6 = Singular.Ideal(S, [change_ring(x,S) for x in gens(H)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) @@ -432,7 +443,12 @@ if case == 5 || case == 99 println("test generic: ", Singular.equal(T4, T0)) - if !(equalitytest(T2, T1) && equalitytest(T3, T0) && equalitytest(T0, T5) && Singular.equal(T0, T4)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T0) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) success = false end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index 2bf7fa99a..7a24b26d7 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -4,6 +4,7 @@ include("GroebnerWalkUtilitys.jl") #Utilitys for generic_walk ############################################################### +#Return the facet_initials of polynomials w.r.t. a weight vector. function facet_initials( R::Singular.PolyRing, G::Singular.sideal, @@ -17,7 +18,7 @@ function facet_initials( #V = filter(x -> less_facet(S, x), diff_vectors(G) el = first(Singular.exponent_vectors(lm[count])) mzip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - for (e, c) in mzip + for (e, c) in mzip if el == e || isparallel(el - e, v) Singular.push_term!(inw, c, e) end @@ -25,27 +26,27 @@ function facet_initials( #push_term!(inw, collect(Singular.coefficients(lm[count]))[1], collect(Singular.exponent_vectors(lm[count]))[1]) h = finish(inw) push!(inits, h) - count = count + 1 + count += 1 end #@info "Facet Initials: " inits return inits end +# function isparallel(u::Vector{Int64}, v::Vector{Int64}) - #TODO: maybe false this way count = 1 x = 0 for i = 1:length(u) if u[i] == 0 if v[count] == 0 - count = count + 1 + count += +1 else return false end else x = v[count] // u[i] - count = count + 1 + count += 1 break end end @@ -60,27 +61,29 @@ function isparallel(u::Vector{Int64}, v::Vector{Int64}) return true end +#lifting step of the generic_walk function liftgeneric( G::Singular.sideal, Lm::Vector{Singular.spoly{L}}, H::Singular.sideal, -) where L <: Nemo.RingElem -S = base_ring(G) - count = 1 +) where {L<:Nemo.RingElem} + S = base_ring(G) Newlm = Array{Singular.elem_type(R),1}(undef, 0) liftArray = Array{Singular.elem_type(R),1}(undef, 0) for g in Singular.gens(H) - diff = - subtractTerms(g, - reducegeneric_recursiv2(g, G, Lm), Singular.nvars(S)) - #= println("red 2:", - change_ring(g, S) - - S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), + diff = subtractTerms( + g, + reducegeneric_recursiv(g, G, Lm), + Singular.nvars(S), ) - println("red 1:", - change_ring(g, S) - - S(reducegeneric_recursiv(change_ring(g, S), G, Lm)), - ) =# + #= println("red 2:", + change_ring(g, S) - + S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), + ) + println("red 1:", + change_ring(g, S) - + S(reducegeneric_recursiv(change_ring(g, S), G, Lm)), + ) =# if diff != 0 push!(Newlm, Singular.leading_term(g)) push!(liftArray, diff) @@ -89,50 +92,50 @@ S = base_ring(G) return check_zeros(liftArray, Newlm, S) end +#removes polynomials with zero coefficients. function check_zeros( G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, S::Singular.PolyRing, -) where L <: Nemo.RingElem +) where {L<:Nemo.RingElem} -lmfin = Array{Singular.elem_type(S),1}(undef, 0) -Gfin = Array{Singular.elem_type(S),1}(undef, 0) -for lm in Lm - if lm != 0 - push!(lmfin, lm) + lmfin = Array{Singular.elem_type(S),1}(undef, 0) + Gfin = Array{Singular.elem_type(S),1}(undef, 0) + for lm in Lm + if lm != 0 + push!(lmfin, lm) + end end -end -for g in G - if g != 0 - push!(Gfin, g) + for g in G + if g != 0 + push!(Gfin, g) + end end -end return Gfin, lmfin end -function filter_btz(S::Matrix{Int64}, - V::Vector{Any}) +function filter_btz(S::Matrix{Int64}, V::Vector{Any}) btz = Set() for v in V - if bigger_than_zero(S,v) + if bigger_than_zero(S, v) push!(btz, v) end end return btz end -function filter_ltz(S::Matrix{Int64}, - V::Set{Any}) +function filter_ltz(S::Matrix{Int64}, V::Set{Any}) btz = Set() for v in V - if less_than_zero(S,v) + if less_than_zero(S, v) push!(btz, v) end end return btz end -function filter_lf( w::Vector{Int64}, +function filter_lf( + w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, V::Set{Any}, @@ -145,17 +148,19 @@ function filter_lf( w::Vector{Int64}, end return btz end + +#return the next facet_normal. function nextV( G::Singular.sideal, Lm::Vector{spoly{L}}, w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, -) where L <: Nemo.RingElem +) where {L<:Nemo.RingElem} V = filter_btz(S, diff_vectors(G, Lm)) #@info "#1 Current V: " V - V = filter_ltz(T,V) + V = filter_ltz(T, V) #@info "#2 Current V: " V if (w != [0]) @@ -166,7 +171,6 @@ function nextV( return V end - minV = first(V) for v in V if less_facet(v, minV, S, T) @@ -177,39 +181,39 @@ function nextV( #@info "#4 Current V: " minV return minV end + +#return the next facet_normal. function nextV( G::Singular.sideal, w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, ) -V = filter_btz(S, diff_vectors(G)) -#@info "#1 Current V: " V - -V = filter_ltz(T,V) -#@info "#2 Current V: " V + V = filter_btz(S, diff_vectors(G)) + #@info "#1 Current V: " V -if (w != [0]) - V = filter_lf(w, S, T, V) -end -#@info "#3 Current V: " V -if isempty(V) - return V -end + V = filter_ltz(T, V) + #@info "#2 Current V: " V + if (w != [0]) + V = filter_lf(w, S, T, V) + end + #@info "#3 Current V: " V + if isempty(V) + return V + end -minV = first(V) -for v in V - if less_facet(v, minV, S, T) - minV = v + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v + end end -end #@info "#4 Current V: " minV return minV end - function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) for i = 1:size(M)[1] d = dot(M[i, :], v) @@ -220,7 +224,6 @@ function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) return false end - function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) for i = 1:size(M)[1] d = dot(M[i, :], v) @@ -248,6 +251,8 @@ function less_facet( end return false end + +#returns p mod lm function reduce_modulo( p::Singular.spoly, lm::Singular.spoly, @@ -279,6 +284,8 @@ function reduce_modulo( end return (nothing, false) end + +#reducing a poylinomal changedInReduction = false function hasChangedInReduction() global changedInReduction @@ -286,16 +293,14 @@ function hasChangedInReduction() global changedInReduction = false return temp end -function reducegeneric_recursiv2( +function reducegeneric_recursiv( p::Singular.spoly, G::Singular.sideal, Lm::Vector{spoly{L}}, -) where L <: Nemo.RingElem +) where {L<:Nemo.RingElem} R = Singular.base_ring(G) - - - Gh = [] - for i in 1:Singular.ngens(G) + Gh = [] + for i = 1:Singular.ngens(G) (q, b) = reduce_modulo(p, Lm[i], R) if b push!(Gh, (i, q)) @@ -306,12 +311,12 @@ function reducegeneric_recursiv2( mul = [x for x in Singular.gens(G)] global changedInReduction = true for (i, q) in Gh - #= println("pretet ", p, "and", q , "and", change_ring(mul[i], S)) - println( - "test ", - subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), - )=# - return reducegeneric_recursiv2( + #= println("pretet ", p, "and", q , "and", change_ring(mul[i], S)) + println( + "test ", + subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), + )=# + return reducegeneric_recursiv( subtractTerms(p, (q * mul[i]), Singular.nvars(R)), G, Lm, @@ -321,7 +326,11 @@ function reducegeneric_recursiv2( return p end end -function subtractTerms(p::Singular.spoly{L}, q::Singular.spoly{L}, dim::Int64) where L <: Nemo.RingElem +function subtractTerms( + p::Singular.spoly{L}, + q::Singular.spoly{L}, + dim::Int64, +) where {L<:Nemo.RingElem} sol = MPolyBuildCtx(parent(p)) ep = collect(Singular.exponent_vectors(p)) eq = collect(Singular.exponent_vectors(q)) @@ -342,12 +351,8 @@ function subtractTerms(p::Singular.spoly{L}, q::Singular.spoly{L}, dim::Int64) w if equals diff = cp[j] - cq[k] if diff != 0 - Singular.push_term!( - sol, - diff, - ep[j], - ) - end + Singular.push_term!(sol, diff, ep[j]) + end fin = true eq[k] = dummy #delete Vector if equal break @@ -357,10 +362,10 @@ function subtractTerms(p::Singular.spoly{L}, q::Singular.spoly{L}, dim::Int64) w Singular.push_term!(sol, cp[j], ep[j]) end end - for i in 1:length(eq) - if eq[i][1] != -1 - Singular.push_term!(sol, - cq[i], eq[i]) -end + for i = 1:length(eq) + if eq[i][1] != -1 + Singular.push_term!(sol, -cq[i], eq[i]) + end end h = Singular.finish(sol) return h @@ -403,21 +408,19 @@ function reducegeneric_recursiv( end end =# -function interreduce_new( +function interreduce( G::Singular.sideal, Lm::Vector{spoly{L}}, -) where L <: Nemo.RingElem +) where {L<:Nemo.RingElem} R = Singular.base_ring(G) gens = collect(Singular.gens(G)) changed = true while changed changed = false - for i in 1:Singular.ngens(G) + for i = 1:Singular.ngens(G) #gensrest = filter(x -> x != gens[i], gens) - gensrest = - Array{Singular.elem_type(R),1}(undef, 0) - Lmrest = - Array{Singular.elem_type(R),1}(undef, 0) + gensrest = Array{Singular.elem_type(R),1}(undef, 0) + Lmrest = Array{Singular.elem_type(R),1}(undef, 0) ## New function for j = 1:Singular.ngens(G) if i != j @@ -426,21 +429,21 @@ function interreduce_new( end end #Lmrest = filter(x -> x != Lm[i], Lm) - gen = reducegeneric_recursiv2( + gen = reducegeneric_recursiv( gens[i], Singular.Ideal(R, gensrest), Lmrest, ) - #= println("interred 2 :", reducegeneric_recursiv2( - gens[i], - Singular.Ideal(R, gensrest), - Lmrest, - )) - println("interred 1 :", reducegeneric_recursiv( - gens[i], - Singular.Ideal(R, gensrest), - Lmrest, - )) =# + #= println("interred 2 :", reducegeneric_recursiv2( + gens[i], + Singular.Ideal(R, gensrest), + Lmrest, + )) + println("interred 1 :", reducegeneric_recursiv( + gens[i], + Singular.Ideal(R, gensrest), + Lmrest, + )) =# if hasChangedInReduction() changed = true gens[i] = first(Singular.gens(Singular.Ideal(R, gen))) diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 3ff660519..718e02134 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -63,7 +63,7 @@ function groebnerwalk( Gb = walk(I, S, T) println("Cones crossed: ", getCounter()) - S, V = change_order(Gb, T) + S, V = change_order(Gb.base_ring, T) return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end @@ -110,7 +110,7 @@ function standard_step( T::Matrix{Int64}, ) R = base_ring(G) - S, V = change_order(G, cw, T) + S, V = change_order(R, cw, T) #taking initials inwG = initials(S, gens(G), cw) @@ -133,7 +133,7 @@ end function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R, V = change_order(G, T) + R, V = change_order(G.base_ring, T) v = nextV(G, [0], S, T) lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] @@ -156,7 +156,8 @@ function generic_step( S::Singular.PolyRing, v::Vector{Int64}, T::Matrix{Int64}, - lm::Vector{Singular.spoly{L}}) where L <: Nemo.RingElem + lm::Vector{Singular.spoly{L}}, +) where {L<:Nemo.RingElem} R = Singular.base_ring(G) facet_Generators = facet_initials(S, G, v, lm) @@ -168,7 +169,7 @@ function generic_step( liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) Gnew = Singular.Ideal(S, [x for x in liftArray]) - Gnew = interreduce_new(Gnew, Newlm) + Gnew = interreduce(Gnew, Newlm) Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) Gnew.isGB = true @@ -202,11 +203,9 @@ function pertubed_walk( term = true else if k == 1 - R, V = change_order(Gnew, T) - Gnew = Singular.Ideal( - R, - [change_ring(x, R) for x in gens(Gnew)], - ) + R, V = change_order(Gnew.base_ring, T) + Gnew = + Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) Gnew = Singular.std(Gnew, complete_reduction = true) term = true end @@ -217,6 +216,18 @@ function pertubed_walk( return Gnew end +############################################################### +#fractal-walk by Amrhein et al. +#Inlcuding: +#fractal_walk -> standard-version +#fractal_walk2 -> checks if the starting weight is in the inner of a cone. +#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. +# checks if the starting weight is in the inner of a cone. +############################################################### + +######################################## +#Counter for the steps in a fractalwalk +######################################## counterFr = 0 counterFrFin = false function deleteCounterFr() @@ -238,10 +249,10 @@ function raiseCounterFr(std::Bool = false) return true end return false - end - function resetCounterFr() - global counterFrFin = false - end +end +function resetCounterFr() + global counterFrFin = false +end PVecs = [] function checkPvecs() @@ -250,44 +261,46 @@ function checkPvecs() end sigma = [] - +#= function getSigma() global sigma return sigma -end +end =# + + function fractal_walk( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) -global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] -global sigma = S.w -println("FacrtalWalk_standard results") -println("Crossed Cones in: ") -Gb = fractal_recursiv(G, S, T, PVecs, 1) -println("Cones crossed: ", deleteCounterFr(), " and ", getCounter()) -return Gb + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + println("FacrtalWalk_standard results") + println("Crossed Cones in: ") + Gb = fractal_recursiv(G, S, T, S.w, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb end function fractal_recursiv( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + s::Vector{Int64}, PVecs::Vector{Vector{Int64}}, p::Int64, ) R = base_ring(G) term = false G.isGB = true - cweight = getSigma() + cweight = s while !term w = nextW_2(G, cweight, PVecs[p]) if (w == [0]) if inCone(G, T, PVecs[p]) if raiseCounterFr() - println(PVecs[p], " in depth", p) - end + println(PVecs[p], " in depth", p) + end return G else global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] @@ -296,7 +309,7 @@ function fractal_recursiv( end end T.w = w - Rn, V = change_order(G, T) + Rn, V = change_order(R, T) Gw = initials(R, gens(G), w) if p == nvars(R) @@ -314,6 +327,7 @@ function fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), S, T, + s, PVecs, p + 1, ) @@ -321,7 +335,6 @@ function fractal_recursiv( end - global counter = getCounter() + 1 G = liftGWfr(G, Gnew, R, Rn) G = Singular.std(G, complete_reduction = true) @@ -344,13 +357,13 @@ function fractal_walk2( S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) -global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] -global sigma = S.w -println("FractalWalk_withStartorder results") -println("Crossed Cones in: ") -Gb = fractal_recursiv2(G, S, T, PVecs, 1) -println("Cones crossed: ", deleteCounterFr()) -return Gb + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + global sigma = S.w + println("FractalWalk_withStartorder results") + println("Crossed Cones in: ") + Gb = fractal_recursiv2(G, S, T, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb end function fractal_recursiv2( @@ -382,8 +395,8 @@ function fractal_recursiv2( if inCone(G, T, PVecs[p]) if raiseCounterFr() - println(PVecs[p], " in depth", p) - end + println(PVecs[p], " in depth", p) + end return G else global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] @@ -391,7 +404,7 @@ function fractal_recursiv2( end end T.w = w - Rn, V = change_order(G, T) + Rn, V = change_order(R, T) Gw = initials(R, gens(G), w) if p == Singular.nvars(R) Gnew = Singular.std( @@ -428,12 +441,12 @@ function fractal_walk3( S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) -global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] -println("FractalWalk_withStartorderLex results") -println("Crossed Cones in: ") -Gb = fractal_recursiv3(G, S, T, PVecs, 1) -println("Cones crossed: ", deleteCounterFr()) -return Gb + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + println("FractalWalk_withStartorderLex results") + println("Crossed Cones in: ") + Gb = fractal_recursiv3(G, S, T, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb end function fractal_recursiv3( @@ -448,7 +461,8 @@ function fractal_recursiv3( G.isGB = true if (p == 1) if !ismonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:Singular.nvars(R)] + global cwPert = + [pert_Vectors(G, S, S.w, i) for i = 1:Singular.nvars(R)] global firstStepMode = true end end @@ -458,7 +472,7 @@ function fractal_recursiv3( cweight = S.w end -#println(cwPert) + #println(cwPert) while !term w = nextw_fr(G, cweight, PVecs[p]) #println(cweight, w) @@ -470,16 +484,17 @@ function fractal_recursiv3( if inCone(G, T, PVecs[p]) if raiseCounterFr() - println(PVecs[p], " in depth", p) - end + println(PVecs[p], " in depth", p) + end return G else - global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:Singular.nvars(R)] + global PVecs = + [pert_Vectors(G, T, 2, i) for i = 1:Singular.nvars(R)] continue end end T.w = w - Rn, V = change_order(G, T) + Rn, V = change_order(R, T) Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) Gnew = Singular.std( @@ -515,8 +530,8 @@ function fractal_walk_lookahead( S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) -println("FractalWalk_lookahead results") -println("Crossed Cones in: ") + println("FractalWalk_lookahead results") + println("Crossed Cones in: ") global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] Gb = fractal_recursiv_lookahead(G, S, T, PVecs, 1) @@ -536,15 +551,14 @@ function fractal_recursiv_lookahead( G.isGB = true cweight = S.w - while !term w = nextW_2(G, cweight, PVecs[p]) if (w == [0]) if inCone(G, T, PVecs[p]) if raiseCounterFr() - println(PVecs[p], " in depth", p) - end - return G + println(PVecs[p], " in depth", p) + end + return G else global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] #checkPvecs() @@ -552,7 +566,7 @@ function fractal_recursiv_lookahead( end end T.w = w - Rn, V = change_order(G, T) + Rn, V = change_order(R, T) Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isBinomial(Gw)) Gnew = Singular.std( @@ -610,5 +624,5 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) global counter = getCounter() + 1 println(w) cweight = w - end + end end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index e7cbbae2b..1c594c781 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -2,26 +2,21 @@ #Utilitys for Groebnerwalks ############################################################### -#Returns the initials of polynomials w.r.t. a weight vector. -#The ordering doesn´t affect this. -function initials( - R::Singular.PolyRing, - G::Vector{spoly{n_Q}}, - w::Vector{Int64} -) +#Return the initials of polynomials w.r.t. a weight vector. +function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) inits = [] for g in G maxw = 0 indexw = [] eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - for (e,c) in eczip + for (e, c) in eczip tmpw = dot(w, e) if maxw == tmpw push!(indexw, (e, c)) #rethink this. gens are preordered elseif maxw < tmpw indexw = [] - push!(indexw, (e,c)) + push!(indexw, (e, c)) maxw = tmpw end end @@ -34,28 +29,37 @@ function initials( end return inits end -mutable struct MonomialOrder{T<:Matrix{Int64},v<:Vector{Int64}, tv<:Vector{Int64}} +#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) +mutable struct MonomialOrder{ + T<:Matrix{Int64}, + v<:Vector{Int64}, + tv<:Vector{Int64}, +} m::T w::v t::tv end +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. function diff_vectors( I::Singular.sideal, Lm::Vector{spoly{L}}, -) where L <: Nemo.RingElem +) where {L<:Nemo.RingElem} v = [] for i = 1:ngens(I) ltu = Singular.leading_exponent_vector(Lm[i]) - for e in Singular.exponent_vectors(gens(I)[i]) + for e in Singular.exponent_vectors(gens(I)[i]) if ltu != e - push!(v, ltu .- e) + push!(v, ltu .- e) + end + end end -end -end return unique!(v) end +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. function diff_vectors(I::Singular.sideal) v = [] for g in gens(I) @@ -67,38 +71,35 @@ function diff_vectors(I::Singular.sideal) return unique!(v) end -############################################################### -#TODO: Change T instead of using a() -############################################################### +#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) function change_order( - I::Singular.sideal, + I::Singular.PolyRing, cweight::Array{L,1}, T::Matrix{Int64}, ) where {L<:Number,K<:Number} - R = I.base_ring - G = Singular.gens(I.base_ring) + G = Singular.gens(I) Gstrich = string.(G) S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Singular.ordering_a(cweight) * - Singular.ordering_M(T), + ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), + cached = false, ) return S, H end - +#return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) function change_order( - I::Singular.sideal, + I::Singular.PolyRing, M::Matrix{Int64}, ) where {T<:Number,K<:Number} - R = I.base_ring - G = Singular.gens(I.base_ring) + G = Singular.gens(I) Gstrich = string.(G) S, H = Singular.PolynomialRing( R.base_ring, Gstrich, ordering = Singular.ordering_M(M), + cached = false, ) #@error("Not implemented yet") return S, H @@ -181,13 +182,18 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) end end -function pert_Vectors(G::Singular.sideal, Mo::MonomialOrder{Matrix{Int64}}, t::Vector{Int64}, p::Integer) - if t == Mo.m[1,:] - M = Mo.m -else - M = insert_weight_vector(t, Mo.m) -end -m = [] +function pert_Vectors( + G::Singular.sideal, + Mo::MonomialOrder{Matrix{Int64}}, + t::Vector{Int64}, + p::Integer, +) + if t == Mo.m[1, :] + M = Mo.m + else + M = insert_weight_vector(t, Mo.m) + end + m = [] n = size(M)[1] for i = 1:p max = M[i, 1] @@ -201,11 +207,11 @@ m = [] end msum = 0 for i = 2:p - msum = msum + m[i] + msum += m[i] end maxtdeg = 0 for g in gens(G) - td = tdeg(g,n) + td = tdeg(g, n) if (td > maxtdeg) maxtdeg = td end @@ -213,7 +219,7 @@ m = [] e = maxtdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p - w = w + e^(p - i) * M[i, :] + w += e^(p - i) * M[i, :] end return w end @@ -233,11 +239,11 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) end msum = 0 for i = 2:p - msum = msum + m[i] + msum += m[i] end maxtdeg = 0 for g in gens(G) - td = tdeg(g,n) + td = tdeg(g, n) if (td > maxtdeg) maxtdeg = td end @@ -245,17 +251,21 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) e = maxtdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p - w = w + e^(p - i) * M[i, :] + w += e^(p - i) * M[i, :] end return w end -function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, p::Integer) +function pert_Vectors( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + p::Integer, +) m = [] - if T.t == T.m[1,:] - M = T.m -else - M = insert_weight_vector(T.t, T.m) -end + if T.t == T.m[1, :] + M = T.m + else + M = insert_weight_vector(T.t, T.m) + end n = size(M)[1] for i = 1:p max = M[i, 1] @@ -269,11 +279,11 @@ end end msum = 0 for i = 2:p - msum = msum + m[i] + msum += m[i] end maxtdeg = 0 for g in gens(G) - td = tdeg(g,n) + td = tdeg(g, n) if (td > maxtdeg) maxtdeg = td end @@ -281,17 +291,22 @@ end e = maxtdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p - w = w + e^(p - i) * M[i, :] + w += e^(p - i) * M[i, :] end return w end -function pert_Vectors(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, mult::Int64, p::Integer) +function pert_Vectors( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + mult::Int64, + p::Integer, +) m = [] - if T.t == T.m[1,:] - M = T.m -else - M = insert_weight_vector(T.t, T.m) -end + if T.t == T.m[1, :] + M = T.m + else + M = insert_weight_vector(T.t, T.m) + end n = size(M)[1] for i = 1:p max = M[i, 1] @@ -305,11 +320,11 @@ end end msum = 0 for i = 2:p - msum = msum + m[i] + msum += m[i] end maxtdeg = 0 for g in gens(G) - td = tdeg(g,n) + td = tdeg(g, n) if (td > maxtdeg) maxtdeg = td end @@ -317,7 +332,7 @@ end e = maxtdeg * msum + 1 * mult w = M[1, :] * e^(p - 1) for i = 2:p - w = w + e^(p - i) * M[i, :] + w += e^(p - i) * M[i, :] end return w end @@ -328,9 +343,9 @@ function tdeg(p::Singular.spoly, n::Int64) ev = Singular.exponent_vectors(mon) sum = 0 for e in ev - for i in 1:n - sum = e[i] + sum - end + for i = 1:n + sum += e[i] + end end if (max < sum) max = sum @@ -339,8 +354,8 @@ function tdeg(p::Singular.spoly, n::Int64) return max end -function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) - R, V = change_order(G, T) +function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) + R, V = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip @@ -351,11 +366,16 @@ function inCone(G::Singular.sideal, T::Matrix{Int64},t::Vector{Int64}) return true end -function liftGW(G::Singular.sideal, InG::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) +function liftGW( + G::Singular.sideal, + InG::Singular.sideal, + R::Singular.PolyRing, + S::Singular.PolyRing, +) G.isGB = true rest = [ - gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) - for gen in gens(InG) + gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) for + gen in gens(InG) ] Gnew = Singular.Ideal(S, [S(x) for x in rest]) Gnew.isGB = true @@ -367,7 +387,11 @@ end ############################################# #Use MPolybuildCTX -function vec_sum(p::Vector{spoly{n_Q}}, q::Vector{spoly{n_Q}}, S::Singular.PolyRing) +function vec_sum( + p::Vector{spoly{n_Q}}, + q::Vector{spoly{n_Q}}, + S::Singular.PolyRing, +) poly = 0 fin = Singular.MPolyBuildCtx(S) for i = 1:length(p) @@ -375,11 +399,11 @@ function vec_sum(p::Vector{spoly{n_Q}}, q::Vector{spoly{n_Q}}, S::Singular.PolyR cq = Singular.coefficients(q[i]) ep = exponent_vectors(p[i]) eq = exponent_vectors(q[i]) - for k in 1:length(cp) - for j in 1:length(cq) - push_term!(fin, cp[k] * cq[j], ep[k] + eq[j] ) - end -end + for k = 1:length(cp) + for j = 1:length(cq) + push_term!(fin, cp[k] * cq[j], ep[k] + eq[j]) + end + end end return finish(fin) end @@ -407,7 +431,7 @@ function equalitytest(G::Singular.sideal, K::Singular.sideal) for gen in generators for r in Singular.gens(K) if gen - r == 0 - count = count + 1 + count += 1 end end end @@ -420,8 +444,8 @@ end function dot(v::Vector{Int64}, w::Vector{Int64}) n = length(v) sum = 0 - for i in 1:n - sum = sum + v[i] * w[i] + for i = 1:n + sum += v[i] * w[i] end return sum end diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl index a705f49fd..378e3a872 100644 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ b/src/Groebnerwalk/StandardWalkUtilitys.jl @@ -14,6 +14,8 @@ function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} return w end +#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. +#This Version is used by the standard_walk, pertubed_walk and tran_walk. function nextw( G::Singular.sideal, cweight::Array{T,1}, @@ -26,12 +28,12 @@ function nextw( ctw = cw - tw if tw < 0 if ctw != 0 - push!(tv, cw // ctw) - end + push!(tv, cw // ctw) + end end end push!(tv, 1) - filter!(x -> numerator(x)!=0, tv) + filter!(x -> numerator(x) != 0, tv) t = minimum(tv) w = (1 - t) * cweight + t * tweight return convertBoundingVector(w) diff --git a/src/Groebnerwalk/TranWalkUtilitys.jl b/src/Groebnerwalk/TranWalkUtilitys.jl index a05cab9c2..2411a3d78 100644 --- a/src/Groebnerwalk/TranWalkUtilitys.jl +++ b/src/Groebnerwalk/TranWalkUtilitys.jl @@ -4,27 +4,27 @@ include("GroebnerWalkUtilitys.jl") function representationVector(G::Singular.sideal, T::Matrix{Int64}) n = size(T)[1] M = 0 - for i in 1:n - for j in 1:n - temp = T[i,j] - if M < temp - M = temp + for i = 1:n + for j = 1:n + temp = T[i, j] + if M < temp + M = temp + end + end end -end -end d0 = 0 for g in Singular.gens(G) -# println(g, " in tedeg", tdeg(g)) - temp = tdeg(g,n) - if d0 < temp - d0 = temp + # println(g, " in tedeg", tdeg(g)) + temp = tdeg(g, n) + if d0 < temp + d0 = temp + end end -end -d = M * (2*d0^2 + (n + 1)* d0) -w = d^(n-1) * T[1,:] -for i in 2:n - w = w + d^(n-i) * T[i,:] -end -return w + d = M * (2 * d0^2 + (n + 1) * d0) + w = d^(n - 1) * T[1, :] + for i = 2:n + w = w + d^(n - i) * T[i, :] + end + return w end From f39e164338a60127335d33205003c0380e9053a0 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 6 Oct 2021 10:02:20 +0200 Subject: [PATCH 29/85] Refactoring --- src/Groebnerwalk/GWtest.jl | 95 +++++++------- src/Groebnerwalk/GenericWalkUtilitys.jl | 151 +++++------------------ src/Groebnerwalk/GroebnerWalk.jl | 57 ++++++--- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 5 +- src/Groebnerwalk/testwiese | 100 +++++++++++---- 5 files changed, 193 insertions(+), 215 deletions(-) diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index f854a4a49..181877eb4 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -1,7 +1,7 @@ include("GroebnerWalk.jl") -case = 5 -success = true +case = 99 +test_successfull = true if case == 1 || case == 99 R, (x, y) = Singular.PolynomialRing( @@ -24,15 +24,17 @@ if case == 1 || case == 99 ordering_as_matrix(:lex, 2), :tran, ) - @time J = fractal_walk( + @time J = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [1, 0]), + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :fractal ) - @time JJ = fractal_walk_lookahead( + @time JJ = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:degrevlex, 2), [1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 2), [1, 0], [1, 0]), + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :fractal_walk_lookahead, ) @time L = groebnerwalk( @@ -68,7 +70,7 @@ if case == 1 || case == 99 T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) + println("test fractal: ", equalitytest(T0, T5)) println("test fractal: ", equalitytest(T0, T1)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) @@ -76,7 +78,7 @@ if case == 1 || case == 99 if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) - success = false + test_successfull = false end end @@ -100,15 +102,17 @@ if case == 2 || case == 99 ordering_as_matrix([6, 1, 3], :lex), :tran, ) - @time J = fractal_walk( + @time J = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [6, 1, 3]), + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :fractal, ) - @time JJ = fractal_walk_lookahead( + @time JJ = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:deglex, 3), [5, 4, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 3), [6, 1, 3], [6, 1, 3]), + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :fractal_walk_lookahead, ) @time K = groebnerwalk( I, @@ -157,7 +161,7 @@ if case == 2 || case == 99 if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) - success = false + test_successfull = false end end @@ -195,18 +199,11 @@ if case == 3 || case == 99 [1, 0, 0, 0, 0, 0], ), ) =# - @time JJ = fractal_walk_lookahead( + @time JJ = groebnerwalk( I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_walk_lookahead, ) @time K = groebnerwalk( @@ -245,7 +242,7 @@ if case == 3 || case == 99 T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - println(T0) + println("test tran: ", equalitytest(T0, T6)) println("test fractal2: ", equalitytest(T0, T5)) #println("test fractal: ", equalitytest(T0, T1)) @@ -259,7 +256,7 @@ if case == 3 || case == 99 equalitytest(T0, T5) && Singular.equal(T0, T4) ) - success = false + test_successfull = false end end @@ -303,15 +300,17 @@ if case == 4 || case == 99 ordering_as_matrix(:lex, 4), :tran, ) - @time J = fractal_walk( + @time J = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:degrevlex, 4), [1, 1, 1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 4), [1, 0, 0, 0], [1, 0, 0, 0]), + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal, ) - @time JJ = fractal_walk_lookahead( + @time JJ = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:degrevlex, 4), [1, 1, 1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 4), [1, 0, 0, 0], [1, 0, 0, 0]), + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal_walk_lookahead, ) @time K = groebnerwalk( @@ -353,7 +352,7 @@ if case == 4 || case == 99 println("test tran: ", equalitytest(T0, T6)) println("test fractal: ", equalitytest(T0, T1)) - println("test fractal2: ", equalitytest(T0, T1)) + println("test fractal2: ", equalitytest(T0, T5)) println("test pertubed: ", equalitytest(T2, T0)) println("test standard: ", equalitytest(T3, T0)) println("test generic: ", Singular.equal(T4, T0)) @@ -365,10 +364,10 @@ if case == 4 || case == 99 equalitytest(T0, T5) && Singular.equal(T0, T4) ) - success = false + test_successfull = false end - end + if case == 5 || case == 99 R, (x, y, z) = Singular.PolynomialRing( Singular.QQ, @@ -392,15 +391,17 @@ if case == 5 || case == 99 ordering_as_matrix(:lex, 3), ) - @time J = fractal_walk( + @time J = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:degrevlex, 3), [1, 1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 3), [1, 0, 0], [1, 0, 0]), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal, ) - @time JJ = fractal_walk_lookahead( + @time JJ = groebnerwalk( I, - MonomialOrder(ordering_as_matrix(:degrevlex, 3), [1, 1, 1], [0]), - MonomialOrder(ordering_as_matrix(:lex, 3), [1, 0, 0], [1, 0, 0]), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal_walk_lookahead, ) @time L = groebnerwalk( @@ -449,9 +450,9 @@ if case == 5 || case == 99 equalitytest(T0, T5) && Singular.equal(T0, T4) ) - success = false + test_successfull = false end end -println("All tests were: ", success) +println("All tests were: ", test_successfull) diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index 7a24b26d7..5e2896c03 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -15,7 +15,6 @@ function facet_initials( count = 1 for g in Singular.gens(G) inw = Singular.MPolyBuildCtx(R) - #V = filter(x -> less_facet(S, x), diff_vectors(G) el = first(Singular.exponent_vectors(lm[count])) mzip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) for (e, c) in mzip @@ -23,7 +22,6 @@ function facet_initials( Singular.push_term!(inw, c, e) end end - #push_term!(inw, collect(Singular.coefficients(lm[count]))[1], collect(Singular.exponent_vectors(lm[count]))[1]) h = finish(inw) push!(inits, h) count += 1 @@ -71,25 +69,14 @@ function liftgeneric( Newlm = Array{Singular.elem_type(R),1}(undef, 0) liftArray = Array{Singular.elem_type(R),1}(undef, 0) for g in Singular.gens(H) - diff = subtractTerms( - g, - reducegeneric_recursiv(g, G, Lm), - Singular.nvars(S), - ) - #= println("red 2:", - change_ring(g, S) - - S(reducegeneric_recursiv2(change_ring(g, S), G, Lm)), - ) - println("red 1:", - change_ring(g, S) - - S(reducegeneric_recursiv(change_ring(g, S), G, Lm)), - ) =# + r, b = reducegeneric_recursiv(g, gens(G), Lm, S) + diff = g - r if diff != 0 push!(Newlm, Singular.leading_term(g)) push!(liftArray, diff) end end - return check_zeros(liftArray, Newlm, S) + return liftArray, Newlm, S end #removes polynomials with zero coefficients. @@ -258,23 +245,16 @@ function reduce_modulo( lm::Singular.spoly, S::Singular.PolyRing, ) - a = [] - r = 0 div = false newpoly = Singular.MPolyBuildCtx(S) for term in Singular.terms(p) (b, c) = Singular.divides(term, lm) - #println("mult ",c) if b - #= if c == 1 - push_term!(newpoly, 1, zeros(Int64, 1, nvars(S))) - else =# push_term!( newpoly, first(Singular.coefficients(c)), first(Singular.exponent_vectors(c)), ) - # end div = true end end @@ -285,45 +265,33 @@ function reduce_modulo( return (nothing, false) end -#reducing a poylinomal -changedInReduction = false -function hasChangedInReduction() - global changedInReduction - temp = changedInReduction - global changedInReduction = false - return temp -end function reducegeneric_recursiv( p::Singular.spoly, - G::Singular.sideal, + G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, + R::Singular.PolyRing, + c::Bool = false, ) where {L<:Nemo.RingElem} - R = Singular.base_ring(G) - Gh = [] - for i = 1:Singular.ngens(G) + I = 0 + Q = spoly{Nemo.RingElem} + for i = 1:length(G) (q, b) = reduce_modulo(p, Lm[i], R) if b - push!(Gh, (i, q)) + I = i + Q = q break end end - if !isempty(Gh) - mul = [x for x in Singular.gens(G)] - global changedInReduction = true - for (i, q) in Gh - #= println("pretet ", p, "and", q , "and", change_ring(mul[i], S)) - println( - "test ", - subtractTerms(change_ring(p, S), (q * change_ring(mul[i],S)), nvars(S)), - )=# - return reducegeneric_recursiv( - subtractTerms(p, (q * mul[i]), Singular.nvars(R)), - G, - Lm, - ) - end + if I != 0 + r, b = reducegeneric_recursiv( + p - (Q * G[I]), + G, + Lm, + R, + ) + return r, true else - return p + return p, false end end function subtractTerms( @@ -336,29 +304,24 @@ function subtractTerms( eq = collect(Singular.exponent_vectors(q)) cp = collect(Singular.coefficients(p)) cq = collect(Singular.coefficients(q)) - dummy = zeros(Int64, dim) - dummy[1] = -1 for j = 1:length(ep) - fin = false + fin = true for k = 1:length(eq) equals = true - for i = 1:dim - if ep[j][i] != eq[k][i] - equals = false - break - end + if ep[j] != eq[k] + equals = false end if equals diff = cp[j] - cq[k] if diff != 0 Singular.push_term!(sol, diff, ep[j]) end - fin = true - eq[k] = dummy #delete Vector if equal + fin = false + eq[k][1] = -1 #delete Vector if equal break end end - if !fin + if fin Singular.push_term!(sol, cp[j], ep[j]) end end @@ -370,44 +333,7 @@ function subtractTerms( h = Singular.finish(sol) return h end -#= -function reducegeneric_recursiv( - p::T, - G::Singular.sideal, - Lm::Vector{spoly{n_Q}}, -) where {T<:RingElement} - R = base_ring(G) - S, V = PolynomialRing( - base_ring(R).base_ring, - [String(s) for s in symbols(R)], - ordering = :lex, - ) - Gh = [] - for i = 1:ngens(G) - for mon in terms(first(gens(ideal(S, [p])))) - (q, r) = divrem(mon, gens(ideal(S, Lm))[i]) - #printn("q ",q,"r ", r, "mon", mon, "p ", p) - if r == 0 - push!(Gh, (i, q)) - #println(q) - break - end - end - end - mul = gens(ideal(S, gens(G))) - if !isempty(Gh) - for (i, q) in Gh - return reducegeneric_recursiv( - first(gens(ideal(S, [p]))) - (q * mul[i]), - G, - Lm, - ) - end - else - return p - end -end -=# + function interreduce( G::Singular.sideal, Lm::Vector{spoly{L}}, @@ -418,35 +344,18 @@ function interreduce( while changed changed = false for i = 1:Singular.ngens(G) - #gensrest = filter(x -> x != gens[i], gens) gensrest = Array{Singular.elem_type(R),1}(undef, 0) Lmrest = Array{Singular.elem_type(R),1}(undef, 0) - ## New function for j = 1:Singular.ngens(G) if i != j push!(gensrest, gens[j]) push!(Lmrest, Lm[j]) end end - #Lmrest = filter(x -> x != Lm[i], Lm) - gen = reducegeneric_recursiv( - gens[i], - Singular.Ideal(R, gensrest), - Lmrest, - ) - #= println("interred 2 :", reducegeneric_recursiv2( - gens[i], - Singular.Ideal(R, gensrest), - Lmrest, - )) - println("interred 1 :", reducegeneric_recursiv( - gens[i], - Singular.Ideal(R, gensrest), - Lmrest, - )) =# - if hasChangedInReduction() + r, b = reducegeneric_recursiv(gens[i], gensrest, Lmrest, R) + if b changed = true - gens[i] = first(Singular.gens(Singular.Ideal(R, gen))) + gens[i] = r break end end diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 718e02134..01cff899a 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -10,16 +10,9 @@ export groebnerwalk ############################################################### #Implementation of the gröbner walk. -#TODO: Improve pertubed version. -#TODO: Improve GenWalk algorithm -#TODO: Improve fractal version. -############################################################### - -############################################################### -#Top-Level -#TODO: Implement input checks ############################################################### +#for counting the steps of the groebnerwalk. counter = 0 function getCounter() global counter @@ -27,6 +20,8 @@ function getCounter() counter = 0 return temp end + +#Top-level function function groebnerwalk( G::Singular.sideal, S::Matrix{Int64}, @@ -42,18 +37,35 @@ function groebnerwalk( elseif grwalktype == :pertubed walk = (x, y, z) -> pertubed_walk(x, y, z, k) elseif grwalktype == :fractal - walk = (x, y, z) -> fractal_walk(x, y, z) + walk = + (x, y, z) -> fractal_walk( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) elseif grwalktype == :fractal2 - walk = (x, y, z) -> fractal_walk2(x, y, z) + walk = + (x, y, z) -> fractal_walk2( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) elseif grwalktype == :fractal3 - walk = (x, y, z) -> fractal_walk3(x, y, z) - elseif grwalktype == :fractal4 - walk = (x, y, z) -> fractal_walk_lookahead(x, y, z) + walk = + (x, y, z) -> fractal_walk3( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_walk_lookahead + walk = + (x, y, z) -> fractal_walk_lookahead( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) elseif grwalktype == :tran walk = (x, y, z) -> tran_walk(x, y, z) - #error("Choose a strategy from: :generic, :standard ...") - # fill the list or implement a functionality to choose the best - # way w.r.t. the type of the ideal end ######TODO:Check the parameter##### @@ -146,7 +158,8 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) println(v) G, lm = generic_step(G, R, v, T, lm) #@info "Current Gröbnerbase: " G - v = nextV(G, lm, v, S, T) + #println("nextv") + v = nextV(G, lm, v, S, T) end return G end @@ -160,15 +173,21 @@ function generic_step( ) where {L<:Nemo.RingElem} R = Singular.base_ring(G) + + #println("initials") facet_Generators = facet_initials(S, G, v, lm) + #println("std") facet_Ideal = Singular.std( Singular.Ideal(S, [S(x) for x in facet_Generators]), complete_reduction = true, ) + #println("liftgeneric") liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) Gnew = Singular.Ideal(S, [x for x in liftArray]) + + #println("interred") Gnew = interreduce(Gnew, Newlm) Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) @@ -187,8 +206,8 @@ function pertubed_walk( k::Int64, ) p = k - sweight = pert_Vectors(G, S, p) - #sweight = S[1,:] + #sweight = pert_Vectors(G, S, p) + sweight = S[1,:] Gnew = G #loop term = false diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 1c594c781..57b413121 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -164,7 +164,7 @@ end function ordering_as_matrix(ord::Symbol, nvars::Int64) - if ord == :lex || ord == Symbol("Singular(lp)") + if ord == :lex #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] return ident_matrix(nvars) end @@ -174,7 +174,7 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) ident_matrix(nvars)[1:nvars-1, :] ] end - if ord == :degrevlex || ord == Symbol("Singular(dp)") + if ord == :degrevlex return [ ones(Int64, nvars)' anti_diagonal_matrix(nvars)[1:nvars-1, :] @@ -329,6 +329,7 @@ function pert_Vectors( maxtdeg = td end end + #TODO: rethink * mult e = maxtdeg * msum + 1 * mult w = M[1, :] * e^(p - 1) for i = 2:p diff --git a/src/Groebnerwalk/testwiese b/src/Groebnerwalk/testwiese index c7563f199..22cd3b12f 100644 --- a/src/Groebnerwalk/testwiese +++ b/src/Groebnerwalk/testwiese @@ -1,35 +1,83 @@ -using Pkg +include("GroebnerWalk.jl") -using Oscar -import Oscar: MPolyIdeal, singular_ring -import Oscar.Singular: std, Ideal, ordering_ws -import AbstractAlgebra + R, (q, c, p, d) = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ) -S, (x, y) = Oscar.Singular.PolynomialRing( - QQ, - ["x", "y"], - ordering = Oscar.Singular.ordering_wp([1, 1]), -) -R, (x, y) = Oscar.Singular.PolynomialRing( - QQ, - ["x", "y"], - ordering = Oscar.Singular.ordering_wp([100, 17]), -) + f1 = + 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - + 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + + c^2 * q^2 + + 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - 8 * p + + c^2 + + 4 * d^2 - 2 * q + + 10 * p^2 + + 2 + f2 = + 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - + 3 * p * q * c + 4 * c + f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q + f4 = + 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + + 3 * c^2 + + 9 * p^2 * d^2 + + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + + 12 * d^2 + + 4 * p^2 + + 12 * c * d * p + + 12 * c * d * q + + 12 * c * d * p * q - 12 * c * d + I = Singular.Ideal(R, [f1, f2, f3, f4]) + I = Singular.std(I, complete_reduction = true) + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal_walk_lookahead, + ) + @time L = I +#= groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :standard, + )=# + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :generic, + ) -#R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"], ordering =:deglex) + S, V = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) -#R, (x, y) = PolynomialRing(QQ, ["x", "y"], ordering= :degrevlex) -f1 = -x*y^2 + y^6 - y^3 -f2 = x*y^3 - x - y^2 -f3 = x^2 - y^3 -lm = y^6, x*y^3, x^2] -#f1= x*y^3+y^4+y*z^2 -u^2*y*x*w^3 -#f2= 2*x^2*y+x^3*y+2*x*y^2*z + u*x*v^4 -#f3=2 - 3*x^2*y+ w^2*y + v^3 -#I = ideal(R, [f1,f2]); -I = Singular.Ideal(S, f1, f2, f3) + println("test frl: ", equalitytest(T0, T5)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", Singular.equal(T4, T0)) + + + if !( + equalitytest(T3, T0) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) + println(false) + end From bf53d3fc399180a4c86e1dda3ce3a92323bb7539 Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 7 Oct 2021 10:39:09 +0200 Subject: [PATCH 30/85] performance improvements --- src/Groebnerwalk/FractalWalkUtilitys.jl | 16 +++++++++++-- src/Groebnerwalk/GWtest.jl | 11 +++++---- src/Groebnerwalk/GenericWalkUtilitys.jl | 30 ++++++++++-------------- src/Groebnerwalk/GroebnerWalk.jl | 20 ++++++++-------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 15 ++++++------ 5 files changed, 52 insertions(+), 40 deletions(-) diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index c82a7876a..df4ddc63c 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -21,13 +21,25 @@ function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64 end return true end +#= +function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64},c::Vector{Int64}) + R, V = change_order(G.base_ring, t, T.m) + I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), c)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end=# #return a copy of the PolynomialRing I, equipped with the ordering represented by T. function change_order( - I::Singular.PolyRing, + R::Singular.PolyRing, T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, ) where {L<:Number,K<:Number} - G = Singular.gens(I) + G = Singular.gens(R) Gstrich = string.(G) S, H = Singular.PolynomialRing( R.base_ring, diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index 181877eb4..c2a0aa9e4 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -1,7 +1,8 @@ include("GroebnerWalk.jl") -case = 99 -test_successfull = true +function test(case::Int) + + test_successfull = true if case == 1 || case == 99 R, (x, y) = Singular.PolynomialRing( @@ -232,11 +233,11 @@ if case == 3 || case == 99 ["x", "y", "z", "u", "v", "w"], ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), ) - T0 = Singular.std( + @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - # T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) @@ -389,6 +390,7 @@ if case == 5 || case == 99 I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), + :tran ) @time J = groebnerwalk( @@ -456,3 +458,4 @@ if case == 5 || case == 99 end println("All tests were: ", test_successfull) +end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index 5e2896c03..f3b726b6f 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -66,8 +66,8 @@ function liftgeneric( H::Singular.sideal, ) where {L<:Nemo.RingElem} S = base_ring(G) - Newlm = Array{Singular.elem_type(R),1}(undef, 0) - liftArray = Array{Singular.elem_type(R),1}(undef, 0) + Newlm = Array{Singular.elem_type(S),1}(undef, 0) + liftArray = Array{Singular.elem_type(S),1}(undef, 0) for g in Singular.gens(H) r, b = reducegeneric_recursiv(g, gens(G), Lm, S) diff = g - r @@ -212,8 +212,13 @@ function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) end function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - for i = 1:size(M)[1] - d = dot(M[i, :], v) + nrows, ncols = size(M) + for i = 1:nrows + d = 0 + for j = 1:ncols + @inbounds d += M[i, j] * v[j] + #d = dot(M[i, :], v) + end if d != 0 return d < 0 end @@ -258,11 +263,7 @@ function reduce_modulo( div = true end end - if div - np = finish(newpoly) - return (np, true) - end - return (nothing, false) + return (finish(newpoly), div) end function reducegeneric_recursiv( @@ -273,7 +274,7 @@ function reducegeneric_recursiv( c::Bool = false, ) where {L<:Nemo.RingElem} I = 0 - Q = spoly{Nemo.RingElem} + Q = zero(R) for i = 1:length(G) (q, b) = reduce_modulo(p, Lm[i], R) if b @@ -283,12 +284,7 @@ function reducegeneric_recursiv( end end if I != 0 - r, b = reducegeneric_recursiv( - p - (Q * G[I]), - G, - Lm, - R, - ) + r, b = reducegeneric_recursiv(p - (Q * G[I]), G, Lm, R) return r, true else return p, false @@ -334,7 +330,7 @@ function subtractTerms( return h end -function interreduce( +function interreduce_generic( G::Singular.sideal, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 01cff899a..06fbafca9 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -134,7 +134,6 @@ function standard_step( #Lifting to GB of new cone Gnew = liftGW(G, IinwG, R, S) - #Interreduce return Singular.std(Gnew, complete_reduction = true) end @@ -176,7 +175,6 @@ function generic_step( #println("initials") facet_Generators = facet_initials(S, G, v, lm) - #println("std") facet_Ideal = Singular.std( Singular.Ideal(S, [S(x) for x in facet_Generators]), @@ -185,11 +183,11 @@ function generic_step( #println("liftgeneric") liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) + Gnew = Singular.Ideal(S, [x for x in liftArray]) #println("interred") - Gnew = interreduce(Gnew, Newlm) - + Gnew = interreduce_generic(Gnew, Newlm) Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) Gnew.isGB = true return Gnew, Newlm @@ -203,9 +201,8 @@ function pertubed_walk( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, - k::Int64, + p::Int64, ) - p = k #sweight = pert_Vectors(G, S, p) sweight = S[1,:] Gnew = G @@ -215,13 +212,13 @@ function pertubed_walk( println("Crossed Cones in: ") while !term + #test = [pert_Vectors(Gnew, T, i) for i = 1:p] tweight = pert_Vectors(Gnew, T, p) Gnew = standard_walk(Gnew, S, T, sweight, tweight) - if inCone(Gnew, T, tweight) term = true else - if k == 1 + if p == 1 R, V = change_order(Gnew.base_ring, T) Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) @@ -292,6 +289,7 @@ function fractal_walk( S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) +R= base_ring(G) global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] println("FacrtalWalk_standard results") println("Crossed Cones in: ") @@ -316,6 +314,7 @@ function fractal_recursiv( while !term w = nextW_2(G, cweight, PVecs[p]) if (w == [0]) + #Look up if inCone is special for a deeper step if inCone(G, T, PVecs[p]) if raiseCounterFr() println(PVecs[p], " in depth", p) @@ -332,7 +331,7 @@ function fractal_recursiv( Gw = initials(R, gens(G), w) if p == nvars(R) - Gnew = Singular.std( + Gnew = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) @@ -342,7 +341,7 @@ function fractal_recursiv( resetCounterFr() println("up in: ", p, " with: ", w) - Gnew = fractal_recursiv( + Gnew = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), S, T, @@ -551,6 +550,7 @@ function fractal_walk_lookahead( ) println("FractalWalk_lookahead results") println("Crossed Cones in: ") + R = base_ring(G) global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] Gb = fractal_recursiv_lookahead(G, S, T, PVecs, 1) diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 57b413121..7a1cd6893 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -5,9 +5,10 @@ #Return the initials of polynomials w.r.t. a weight vector. function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) inits = [] + indexw = Tuple{Vector{Int}, elem_type(base_ring(R))}[] for g in G + empty!(indexw) maxw = 0 - indexw = [] eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) for (e, c) in eczip tmpw = dot(w, e) @@ -15,7 +16,7 @@ function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) push!(indexw, (e, c)) #rethink this. gens are preordered elseif maxw < tmpw - indexw = [] + empty!(indexw) push!(indexw, (e, c)) maxw = tmpw end @@ -73,11 +74,11 @@ end #return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) function change_order( - I::Singular.PolyRing, + R::Singular.PolyRing, cweight::Array{L,1}, T::Matrix{Int64}, ) where {L<:Number,K<:Number} - G = Singular.gens(I) + G = Singular.gens(R) Gstrich = string.(G) S, H = Singular.PolynomialRing( R.base_ring, @@ -90,10 +91,10 @@ end #return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) function change_order( - I::Singular.PolyRing, + R::Singular.PolyRing, M::Matrix{Int64}, ) where {T<:Number,K<:Number} - G = Singular.gens(I) + G = Singular.gens(R) Gstrich = string.(G) S, H = Singular.PolynomialRing( R.base_ring, @@ -330,7 +331,7 @@ function pert_Vectors( end end #TODO: rethink * mult - e = maxtdeg * msum + 1 * mult + e = maxtdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p w += e^(p - i) * M[i, :] From 4d6b8ec2282a0d273dd81c444061cde8e7f919fe Mon Sep 17 00:00:00 2001 From: welpj Date: Tue, 7 Dec 2021 14:52:39 +0100 Subject: [PATCH 31/85] Zwischenstand --- src/Groebnerwalk/AlternativeAlgorithm.jl | 168 +++++++++++++ src/Groebnerwalk/FractalWalkUtilitys.jl | 46 +++- src/Groebnerwalk/GWtest.jl | 110 ++++++++- src/Groebnerwalk/GenericWalkUtilitys.jl | 50 ++-- src/Groebnerwalk/GroebnerWalk.jl | 60 +++-- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 96 +++++++- src/Groebnerwalk/TranWalkUtilitys.jl | 16 ++ src/Groebnerwalk/examples | 294 +++++++++++++++++++++++ src/Groebnerwalk/testwiese | 194 ++++++++++----- 9 files changed, 918 insertions(+), 116 deletions(-) create mode 100644 src/Groebnerwalk/AlternativeAlgorithm.jl create mode 100644 src/Groebnerwalk/examples diff --git a/src/Groebnerwalk/AlternativeAlgorithm.jl b/src/Groebnerwalk/AlternativeAlgorithm.jl new file mode 100644 index 000000000..3035f65f0 --- /dev/null +++ b/src/Groebnerwalk/AlternativeAlgorithm.jl @@ -0,0 +1,168 @@ +counterFr = 0 +counterFrFin = false +function deleteCounterFr() + global counterFr + temp = counterFr + counterFr = 0 + global counterFrFin = false + return temp +end +function getCounterFr() + global counterFr + return counterFr +end +function raiseCounterFr(std::Bool = false) + global counterFrFin + if !counterFrFin || std + counterFrFin = true + global counterFr = getCounterFr() + 1 + return true + end + return false +end +function resetCounterFr() + global counterFrFin = false +end + +PVecs = [] +P = Singular.sideal +function checkPvecs() + global PVecs + println(PVecs) +end + +sigma = [] +function alternative_algorithm_top( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + println("FractalWalk_lookahead results") + println("Crossed Cones in: ") + R = base_ring(G) + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + + Gb = alternative_algorithm(G, S, T, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end +function alternative_algorithm( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + term = false + G.isGB = true + cweight = S.w + + while !term + println("d") + w = nextW_2(G, cweight, PVecs[p]) + println("e") + if (w == [0]) + if inCone(G, T, PVecs[p]) + println("f") + if raiseCounterFr() + println(PVecs[p], " in depth", p) + end + return G + else + println("g") + global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] + #checkPvecs() + continue + end + end + println("c") + T.w = w + Rn, V = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) + bin = isBinomial(Gw) + if p > 3 || bin + if bin + Gnew = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr(true) + elseif p > 3 + Gnew = generic_walk(Singular.Ideal(R, [x for x in Gw]), S.m, T.m) + println(w, " in depth", p) + raiseCounterFr(true) + end + else + println("up in: ", p, " with: ", w) + resetCounterFr() + Gnew = alternative_algorithm( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PVecs, + p + 1, + ) + end + G = liftGWfr(G, Gnew, R, Rn) + println("k") + G = Singular.std(G, complete_reduction = true) + println("a") + R = Rn + println("b") + S = T + cweight = w + end + return G +end + +function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + R, V = change_order(G.base_ring, T) + + v = nextV(G, [0], S, T) + lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + + println("GenericWalk results") + println("Crossed Cones with facetNormal: ") + while !isempty(v) + global counter = getCounter() + 1 + println(v) + G, lm = generic_step(G, R, v, T, lm) + #@info "Current Gröbnerbase: " G + #println("nextv") + v = nextV(G, lm, v, S, T) + end + return G +end + +function generic_step( + G::Singular.sideal, + S::Singular.PolyRing, + v::Vector{Int64}, + T::Matrix{Int64}, + lm::Vector{Singular.spoly{L}}, +) where {L<:Nemo.RingElem} + + R = Singular.base_ring(G) + + #println("initials") + facet_Generators = facet_initials(S, G, v, lm) + #println("std") + facet_Ideal = Singular.std( + Singular.Ideal(S, [S(x) for x in facet_Generators]), + complete_reduction = true, + ) + + #println("liftgeneric") + liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) + + Gnew = Singular.Ideal(S, [x for x in liftArray]) + + #println("interred") + Gnew = interreduce_generic(Gnew, Newlm) + Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) + Gnew.isGB = true + return Gnew, Newlm +end diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl index df4ddc63c..f088b1acf 100644 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ b/src/Groebnerwalk/FractalWalkUtilitys.jl @@ -70,7 +70,7 @@ return G end #returns ´true´ if all polynomials of the array are monomials. -function ismonomial(Gw::Vector{Any}) +function ismonomial(Gw::Vector{spoly{L}})where {L<:Nemo.RingElem} for g in Gw if size(collect(Singular.coefficients(g)))[1] > 1 return false @@ -79,8 +79,8 @@ function ismonomial(Gw::Vector{Any}) return true end -#returns ´true´ if all polynomials of the array are binomial. -function isBinomial(Gw::Vector{Any}) +#returns ´true´ if all polynomials of the array are binomial or less. +function isBinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if size(collect(Singular.coefficients(g)))[1] > 2 return false @@ -90,7 +90,7 @@ function isBinomial(Gw::Vector{Any}) end #= -The version of Cox, O´shea and Fukuda et al. is limited because it returns 1, +The version of Cox, O´shea and Fukuda et al. is limited because it returns 1 if there are no more cones to cross and when the target vector lays on a facet. function nextw_fr( G::Singular.sideal, @@ -142,9 +142,9 @@ end #Computes next weight vector. Version used in Amrhein Gloor. function nextW_2(G::Singular.sideal, w::Array{T,1}, - sigma::Array{K,1}, + tau::Array{K,1}, ) where {T<:Number,K<:Number} - if (w == sigma) + if (w == tau) return [0] end @@ -154,7 +154,7 @@ t = 0 a = Singular.leading_exponent_vector(g) d = Singular.exponent_vectors(tail(g)) for v in d - frac = (dot(w,a)- dot(w,v) + dot(sigma,v) - dot(sigma, a)) + frac = (dot(w,a)- dot(w,v) + dot(tau,v) - dot(tau, a)) if frac != 0 t = (dot(w,a) - dot(w,v)) // frac end @@ -165,9 +165,39 @@ t = 0 end if tmin <= 1 - w = w + tmin * (sigma - w) + w = w + tmin * (tau - w) else return [0] end return convertBoundingVector(w) end + function nextT(G::Singular.sideal, + w::Array{T,1}, + tau::Array{K,1}, + ) where {T<:Number,K<:Number} + if (w == tau) + return [0] + end + + tmin = 2 + t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w,a)- dot(w,v) + dot(tau,v) - dot(tau, a)) + if frac != 0 + t = (dot(w,a) - dot(w,v)) // frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + + if tmin <= 1 + return tmin + else + return [0] + end + end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl index c2a0aa9e4..2999b3f77 100644 --- a/src/Groebnerwalk/GWtest.jl +++ b/src/Groebnerwalk/GWtest.jl @@ -37,7 +37,6 @@ if case == 1 || case == 99 ordering_as_matrix(:lex, 2), :fractal_walk_lookahead, ) - @time L = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), @@ -58,7 +57,6 @@ if case == 1 || case == 99 ordering_as_matrix(:lex, 2), :generic, ) - @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, @@ -96,7 +94,6 @@ if case == 2 || case == 99 I = Singular.Ideal(R, [f1, f2]) I = Singular.std(I, complete_reduction = true) - @time H = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), @@ -200,13 +197,14 @@ if case == 3 || case == 99 [1, 0, 0, 0, 0, 0], ), ) =# + + @time JJ = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), :fractal_walk_lookahead, ) - @time K = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), @@ -237,6 +235,7 @@ if case == 3 || case == 99 Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) @@ -386,13 +385,13 @@ if case == 5 || case == 99 S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) + @time H = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), :tran ) - @time J = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), @@ -419,7 +418,6 @@ if case == 5 || case == 99 :pertubed, 3, ) - @time M = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), @@ -457,5 +455,105 @@ if case == 5 || case == 99 end + + +if case == 6 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + + f1 = 2*w*y + 2*v*z+u^2 + x^2+x + f2 = 2* w*z+2*v*u+2*y*x+y + f3 = 2*w*u + v^2 + 2*z*x+z+y^2 + f4= 2*w*v + 2*u*x+u+2*z*y + f5= w^2 + 2*v*x + v + 2*u*y + z^2 + f6= 2*w*x + w+2*v*y + 2*u*z + I = Singular.Ideal(R, [f1, f2, f3, f4,f5,f6]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + #= @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + ) =# + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_walk_lookahead, + ) + + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 6, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal2, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + #println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equal(T4, T0)) + println(T3) + println(T5) + println(T0) + + if !( + equalitytest(T2, T0) && + equalitytest(T3, T0) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) + test_successfull = false + end + +end println("All tests were: ", test_successfull) end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl index f3b726b6f..cd5370055 100644 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ b/src/Groebnerwalk/GenericWalkUtilitys.jl @@ -9,15 +9,14 @@ function facet_initials( R::Singular.PolyRing, G::Singular.sideal, v::Vector{Int64}, - lm::Vector{spoly{n_Q}}, -) + lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} inits = [] count = 1 for g in Singular.gens(G) inw = Singular.MPolyBuildCtx(R) el = first(Singular.exponent_vectors(lm[count])) - mzip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - for (e, c) in mzip + for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) if el == e || isparallel(el - e, v) Singular.push_term!(inw, c, e) end @@ -102,8 +101,8 @@ function check_zeros( end -function filter_btz(S::Matrix{Int64}, V::Vector{Any}) - btz = Set() +function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) + btz = Set{Vector{Int64}}() for v in V if bigger_than_zero(S, v) push!(btz, v) @@ -112,8 +111,8 @@ function filter_btz(S::Matrix{Int64}, V::Vector{Any}) return btz end -function filter_ltz(S::Matrix{Int64}, V::Set{Any}) - btz = Set() +function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) + btz = Set{Vector{Int64}}() for v in V if less_than_zero(S, v) push!(btz, v) @@ -125,9 +124,9 @@ function filter_lf( w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, - V::Set{Any}, + V::Set{Vector{Int64}}, ) - btz = Set() + btz = Set{Vector{Int64}}() for v in V if less_facet(w, v, S, T) push!(btz, v) @@ -244,8 +243,8 @@ function less_facet( return false end -#returns p mod lm -function reduce_modulo( +#returns divrem() +function divrem_generic( p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing, @@ -276,7 +275,7 @@ function reducegeneric_recursiv( I = 0 Q = zero(R) for i = 1:length(G) - (q, b) = reduce_modulo(p, Lm[i], R) + (q, b) = divrem_generic(p, Lm[i], R) if b I = i Q = q @@ -356,6 +355,29 @@ function interreduce_generic( end end end - return Singular.Ideal(R, [R(p) for p in gens]) end + #= +function interredLc( + p::Singular.spoly, + lm::Singular.spoly, + S::Singular.PolyRing, +) + newpoly = Singular.MPolyBuildCtx(S) + newpoly2 = Singular.MPolyBuildCtx(S) + c = first(Singular.coefficients(lm)) + if c != 1 + println("after:", c) + for term in Singular.terms(p) + cp = first(Singular.coefficients(term)) + push_term!( + newpoly, + div(cp,c), + first(Singular.exponent_vectors(term)), + ) + end + return finish(newpoly) +end +return p +end +=# diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl index 06fbafca9..b94003ae2 100644 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ b/src/Groebnerwalk/GroebnerWalk.jl @@ -3,6 +3,7 @@ include("FractalWalkUtilitys.jl") include("GenericWalkUtilitys.jl") include("StandardWalkUtilitys.jl") include("TranWalkUtilitys.jl") +include("AlternativeAlgorithm.jl") @@ -66,6 +67,12 @@ function groebnerwalk( ) elseif grwalktype == :tran walk = (x, y, z) -> tran_walk(x, y, z) + elseif grwalktype == :alternative + walk = (x,y,z) -> alternative_algorithm_top( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) end ######TODO:Check the parameter##### @@ -81,7 +88,7 @@ end ############################################################### -#Standard-version of the groebner walk by Collart et al +#Standard-version of the groebner walk by Collart et al. ############################################################### function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] @@ -104,8 +111,8 @@ function standard_walk( term = false while !term G = standard_step(G, cweight, tweight, T) - global counter = getCounter() + 1 println(cweight) + global counter = getCounter() + 1 if cweight == tweight term = true else @@ -126,6 +133,8 @@ function standard_step( #taking initials inwG = initials(S, gens(G), cw) + inwG2 = initials2(R, gens(G), cw) + #Initial Ideal IinwG = Singular.std( Singular.Ideal(S, [S(x) for x in inwG]), @@ -133,7 +142,9 @@ function standard_step( ) #Lifting to GB of new cone - Gnew = liftGW(G, IinwG, R, S) + #Gnew = liftGW(G, IinwG, R, S) + @time Gnew = liftGW2(G,inwG2, IinwG, R, S) + #Interreduce return Singular.std(Gnew, complete_reduction = true) end @@ -156,11 +167,12 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) global counter = getCounter() + 1 println(v) G, lm = generic_step(G, R, v, T, lm) + println(ngens(G)) #@info "Current Gröbnerbase: " G #println("nextv") v = nextV(G, lm, v, S, T) end - return G + return interreduce(G) end function generic_step( @@ -183,7 +195,6 @@ function generic_step( #println("liftgeneric") liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) - Gnew = Singular.Ideal(S, [x for x in liftArray]) #println("interred") @@ -242,7 +253,7 @@ end ############################################################### ######################################## -#Counter for the steps in a fractalwalk +#Counter for the steps in the fractalwalk ######################################## counterFr = 0 counterFrFin = false @@ -271,6 +282,7 @@ function resetCounterFr() end PVecs = [] +P = Singular.sideal function checkPvecs() global PVecs println(PVecs) @@ -312,8 +324,12 @@ function fractal_recursiv( cweight = s while !term - w = nextW_2(G, cweight, PVecs[p]) - if (w == [0]) + if p == 1 + global P = G + end + #w = nextW_2(G, cweight, PVecs[p]) + t = nextT(G,cweight,PVecs[p]) + if (t == [0]) #Look up if inCone is special for a deeper step if inCone(G, T, PVecs[p]) if raiseCounterFr() @@ -321,23 +337,29 @@ function fractal_recursiv( end return G else - global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] + global P + #global PVecs = [pert_Vectors(P, T, 2, i) for i = 1:nvars(R)] + global PVecs = [representationVector(G, T.m) for i = 1:nvars(R)] + println(PVecs) continue end end + w = cweight + t * (PVecs[p] - cweight) + w = convertBoundingVector(w) T.w = w Rn, V = change_order(R, T) - Gw = initials(R, gens(G), w) + Gw = initials(R, gens(G), w) if p == nvars(R) - Gnew = Singular.std( + Gnew = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) println(w, " in depth", p) raiseCounterFr(true) else + println("counter") resetCounterFr() println("up in: ", p, " with: ", w) @@ -352,9 +374,7 @@ function fractal_recursiv( resetCounterFr() end - G = liftGWfr(G, Gnew, R, Rn) - G = Singular.std(G, complete_reduction = true) R = Rn S = T @@ -375,7 +395,7 @@ function fractal_walk2( S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(Singular.base_ring(G))] global sigma = S.w println("FractalWalk_withStartorder results") println("Crossed Cones in: ") @@ -404,7 +424,7 @@ function fractal_recursiv2( if firstStepMode cweight = cwPert[p] else - cweight = getSigma() + cweight = S.w end while !term @@ -459,7 +479,7 @@ function fractal_walk3( S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] + global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(base_ring(G))] println("FractalWalk_withStartorderLex results") println("Crossed Cones in: ") Gb = fractal_recursiv3(G, S, T, PVecs, 1) @@ -485,14 +505,15 @@ function fractal_recursiv3( end end if firstStepMode - cweight = cwPert[p] + #cweight = cwPert[p] + cweight = S.w else cweight = S.w end #println(cwPert) while !term - w = nextw_fr(G, cweight, PVecs[p]) + w = nextW_2(G, cweight, PVecs[p]) #println(cweight, w) if (p == 1 && w == PVecs[p]) @@ -634,10 +655,11 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) if inCone(G, T, cweight) return G else - #TODO: Implement: if in several cones + if inSeveralCones(initials(base_ring(G),gens(G), w)) tweight = representationVector(G, T) continue end + end end G = standard_step(G, w, tweight, T) global counter = getCounter() + 1 diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl index 7a1cd6893..7ebf0e7d3 100644 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ b/src/Groebnerwalk/GroebnerWalkUtilitys.jl @@ -4,8 +4,8 @@ #Return the initials of polynomials w.r.t. a weight vector. function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) - inits = [] - indexw = Tuple{Vector{Int}, elem_type(base_ring(R))}[] + inits = spoly{elem_type(base_ring(R))}[] + indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] for g in G empty!(indexw) maxw = 0 @@ -47,7 +47,7 @@ function diff_vectors( I::Singular.sideal, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} - v = [] + v = Vector{Int}[] for i = 1:ngens(I) ltu = Singular.leading_exponent_vector(Lm[i]) for e in Singular.exponent_vectors(gens(I)[i]) @@ -62,7 +62,7 @@ end #Return the difference of the exponents of the leading terms (Lm) and the #exponent vectors of the tail of all polynomials of the ideal. function diff_vectors(I::Singular.sideal) - v = [] + v = Vector{Int}[] for g in gens(I) ltu = Singular.leading_exponent_vector(g) for e in Singular.exponent_vectors(tail(g)) @@ -138,13 +138,19 @@ function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) ident_matrix(length(w))[1:length(w)-2, :] ] end - if ord == :degrevlex || a.ord == Symbol("Singular(dp)") + if ord == :degrevlex return [ w' ones(Int64, length(w))' anti_diagonal_matrix(length(w))[1:length(w)-2, :] ] end + if ord == :revlex || a.ord == Symbol("Singular(dp)") + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end else error("not implemented yet") end @@ -181,6 +187,12 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) anti_diagonal_matrix(nvars)[1:nvars-1, :] ] end + if ord == :revlex || a.ord == Symbol("Singular(dp)") + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end end function pert_Vectors( @@ -222,6 +234,8 @@ function pert_Vectors( for i = 2:p w += e^(p - i) * M[i, :] end + println(w) + return w end @@ -254,6 +268,7 @@ function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) for i = 2:p w += e^(p - i) * M[i, :] end + println(w) return w end function pert_Vectors( @@ -294,6 +309,8 @@ function pert_Vectors( for i = 2:p w += e^(p - i) * M[i, :] end + println(w) + return w end function pert_Vectors( @@ -336,6 +353,7 @@ function pert_Vectors( for i = 2:p w += e^(p - i) * M[i, :] end + println(w) return w end @@ -384,6 +402,7 @@ function liftGW( return Gnew end + ############################################# # unspecific help functions ############################################# @@ -451,3 +470,70 @@ function dot(v::Vector{Int64}, w::Vector{Int64}) end return sum end + + + + + + + +#####test +function initials2( + R::Singular.PolyRing, + G::Vector{spoly{n_Q}}, + w::Vector{Int64}, +) + inits = spoly{elem_type(base_ring(R))}[] + indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] + for i = 1:length(G) + empty!(indexw) + maxw = 0 + eczip = + zip(Singular.exponent_vectors(G[i]), Singular.coefficients(G[i])) + for (e, c) in eczip + tmpw = dot(w, e) + if maxw == tmpw + push!(indexw, (e, c)) + #rethink this. gens are preordered + elseif maxw < tmpw + empty!(indexw) + push!(indexw, (e, c)) + maxw = tmpw + end + end + inw = MPolyBuildCtx(R) + for (e, c) in indexw + Singular.push_term!(inw, c, e) + end + h = finish(inw) + push!(inits, h) + end + return inits +end + + +function liftGW2( + G::Singular.sideal, + inG::Vector{spoly{L}}, + H::Singular.sideal, + R::Singular.PolyRing, + S::Singular.PolyRing, +) where {L<:Nemo.RingElem} + H.isGB = true + gH = gens(H) + gG = gens(G) + new = [] + for i = 1:length(gH) + rest = R(0) + for j = 1:length(inG) + b, pji = divides(change_ring(gH[i], R), inG[j]) + if b + rest = rest + pji * gG[j] + end + end + push!(new, rest) + end + Gnew = Singular.Ideal(S, [change_ring(x, S) for x in new]) + Gnew.isGB = true + return Gnew +end diff --git a/src/Groebnerwalk/TranWalkUtilitys.jl b/src/Groebnerwalk/TranWalkUtilitys.jl index 2411a3d78..4068651ec 100644 --- a/src/Groebnerwalk/TranWalkUtilitys.jl +++ b/src/Groebnerwalk/TranWalkUtilitys.jl @@ -28,3 +28,19 @@ function representationVector(G::Singular.sideal, T::Matrix{Int64}) end return w end + +function inSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + counter = 0 + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return true + end + if size(collect(Singular.coefficients(g)))[1] == 2 + counter = counter +1 + end +end + if counter > 1 + return true + end + return false +end diff --git a/src/Groebnerwalk/examples b/src/Groebnerwalk/examples new file mode 100644 index 000000000..31feefd5c --- /dev/null +++ b/src/Groebnerwalk/examples @@ -0,0 +1,294 @@ +include("GroebnerWalk.jl") + +function test(case::Int) + + test_successfull = true + +if case == 1 || case == 99 + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + ) + + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = Singular.Ideal(R, [f1, f2]) + + I = Singular.std(I, complete_reduction = true) + + S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :standard, + ) + + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + println("test tran: ", equalitytest(T0, T6)) + + + if !(equalitytest(T6, T0) ) + test_successfull = false + end +end + +if case == 2 || case == 99 + + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([5, 4, 1], :deglex)), + ) + + f1 = x^2 - y + f2 = y^2 - x * z - y * z + I = Singular.Ideal(R, [f1, f2]) + + I = Singular.std(I, complete_reduction = true) + @time H = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :alternative, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), + ) + + + T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + + if !(equalitytest(T0, T6)) + test_successfull = false + end +end + + +if case == 3 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + + f1 = y^4 + y * z^2 - u^2 * w + f2 = 2 * x^2 * y + x^3 * w * u^2 + x + f3 = 2 - 3 * x^2 * v * z^4 * w + I = Singular.Ideal(R, [f1, f2, f3]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :alternative, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + if !( + Singular.equal(T0, T6) + ) + test_successfull = false + end + +end +if case == 4 || case == 99 + R, (q, c, p, d) = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ) + + + f1 = + 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - + 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + + c^2 * q^2 + + 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - 8 * p + + c^2 + + 4 * d^2 - 2 * q + + 10 * p^2 + + 2 + f2 = + 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - + 3 * p * q * c + 4 * c + f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q + f4 = + 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + + 3 * c^2 + + 9 * p^2 * d^2 + + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + + 12 * d^2 + + 4 * p^2 + + 12 * c * d * p + + 12 * c * d * q + + 12 * c * d * p * q - 12 * c * d + I = Singular.Ideal(R, [f1, f2, f3, f4]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :alternative, + ) + + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + + if !( + equalitytest(T6, T0) + ) + test_successfull = false + end +end + +if case == 5 || case == 99 + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 + f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 + f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 + I = Singular.Ideal(R, [f1, f2, f3]) + + I = Singular.std(I, complete_reduction = true) + + S, V = + Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) + + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :alternative, + ) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + + if !( + Singular.equal(T0, T6) + ) + test_successfull = false + end + +end + + + +if case == 6 || case == 99 + R, (v,u,t,z,y,x) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y", "x"], + ordering = Singular.ordering_M(ordering_as_matrix([1,1,1,1,1,1],:lex)), + ) + + f1 = 2*x^2+2*y^2+2*z^2+2*t^2+2*u^2+v^2-v + f2= x*y+y*z+2*z*t+2*t*u+2*u*v-u + f3= 2*x*z+2*y*t+2*z*u+u^2+2*t*v-t + f4= 2*x*t+2*y*u+2*t*u+2*z*v-z + f5= t^2+2*x*v+2*y*v+2*z*v-y + f6= 2*x+2*y+2*z+2*t+2*u+v-1 + + I = Singular.Ideal(R, [f1, f2, f3, f4,f5,f6]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix([1,1,1,1,1,1],:lex), + ordering_as_matrix(:lex, 6), + :pertubed, + 5 + ) + + @time J = groebnerwalk( + I, + ordering_as_matrix([1,1,1,1,1,1],:lex), + ordering_as_matrix(:lex, 6), + :fractal, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y", "x"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + + T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + + #println(interreduce(T0)) + if !( + isequal(T6, T0) + ) + test_successfull = false + end +end +println("All tests were: ", test_successfull) +end diff --git a/src/Groebnerwalk/testwiese b/src/Groebnerwalk/testwiese index 22cd3b12f..e64fe4fa9 100644 --- a/src/Groebnerwalk/testwiese +++ b/src/Groebnerwalk/testwiese @@ -1,83 +1,149 @@ include("GroebnerWalk.jl") +function test() - R, (q, c, p, d) = Singular.PolynomialRing( + R, (x, y) = Singular.PolynomialRing( Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), ) - - f1 = - 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + - c^2 * q^2 + - 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - 8 * p + - c^2 + - 4 * d^2 - 2 * q + - 10 * p^2 + - 2 - f2 = - 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - - 3 * p * q * c + 4 * c - f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q - f4 = - 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + - 3 * c^2 + - 9 * p^2 * d^2 + - 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + - 12 * d^2 + - 4 * p^2 + - 12 * c * d * p + - 12 * c * d * q + - 12 * c * d * p * q - 12 * c * d - I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Singular.std(I, complete_reduction = true) +f1= y^4 -x^2 +x +x^3 +f2= x^4 + I = Singular.Ideal(R, [f1, f2]) + I = Singular.std(I, complete_reduction = true) + println("last", I) @time JJ = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :fractal_walk_lookahead, - ) - - @time L = I -#= groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :standard, - )=# - - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), :generic, ) + println(JJ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), - ) + S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + println(T0) - println("test frl: ", equalitytest(T0, T5)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", Singular.equal(T4, T0)) +end +function test2() - if !( - equalitytest(T3, T0) && - equalitytest(T0, T5) && - Singular.equal(T0, T4) - ) - println(false) + R, (x, y,z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([29,10,40],:revlex)), + ) + + f1= y*z^2 + z*y + f2= y^5*z - z*y + f3= x + y^3*z + f4= z^3 - y^4*z + + + + I = Singular.Ideal(R, [ f1,f3,f2]) + println(I) + I = Singular.std(I, complete_reduction = true) + println("last", I) + @time JJ = groebnerwalk( + I, + ordering_as_matrix([29,10,40],:revlex), + ordering_as_matrix(:lex, 3), + :generic, + 3, + ) + println(JJ) end + function test1() + + R, (x, y,z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([2,3,4],:revlex)), + ) +f1= y^2 + x*z +f2= x*y - x*z +f3= z^3 + x^2 +f4= x*z^2 +f5= x^2*z +f6= x^3 + + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + println(I) + I = Singular.std(I, complete_reduction = true) + println("last", I) + @time JJ = groebnerwalk( + I, + ordering_as_matrix([2,3,4],:revlex), + ordering_as_matrix([3,2,1],:revlex), + :standard, + ) +#= @time JJ = groebnerwalk( + I, + ordering_as_matrix([1,11,8],:lex), + ordering_as_matrix([2,1,1],:lex), + :generic, + 3, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix([1,11,8],:lex), + ordering_as_matrix([2,1,1],:lex), + :fractal_walk_lookahead, + 3, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix([1,4,10],:lex), + ordering_as_matrix([2,1,1],:lex), + :fractal_walk_lookahead, + 3, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix([1,4,10],:lex), + ordering_as_matrix([2,1,1],:lex), + :tran, + 3, + ) + + @time JJ = groebnerwalk( + I, + ordering_as_matrix([1,4,10],:lex), + ordering_as_matrix([2,1,1],:lex), + :generic, + 3, + ) +=# + println(JJ) + end + function test3() + + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:deglex, 2)), + ) + f1 = x^2 + x*y + f2= x*y + f3= 2*y^2 - x + I = Singular.Ideal(R, [f1, f2,f3]) + println(I) + + println(std(I)) + I = Singular.std(I, complete_reduction = true) + println("last", I) + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :generic, + ) + println(JJ) + end From 7c4d98aa836f0cdbdf23cebad745ec9cb302f6b3 Mon Sep 17 00:00:00 2001 From: welpj Date: Tue, 7 Dec 2021 19:09:52 +0100 Subject: [PATCH 32/85] CleanUp --- .../FractalWalkUtilitysFinal.jl | 156 +++++ .../GenericWalkUtilitysFinal.jl | 278 +++++++++ src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 576 ++++++++++++++++++ .../GroebnerWalkUtilitysFinal.jl | 450 ++++++++++++++ .../StandardWalkUtilitysFinal.jl | 37 ++ .../TranWalkUtilitysFinal.jl | 46 ++ src/GroebnerWalkFinal/examplesFinal | 290 +++++++++ 7 files changed, 1833 insertions(+) create mode 100644 src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/GroebnerWalkFinal.jl create mode 100644 src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/examplesFinal diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl new file mode 100644 index 000000000..1abe215db --- /dev/null +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -0,0 +1,156 @@ +include("GroebnerWalkUtilitysFinal.jl") + +#Solves problems with weight vectors of floats. +function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + +#Checks if a weight vector t is in the cone of the ordering T w.r.t. an ideal. +function InCone( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + t::Vector{Int64}, +) + R, V = change_order(G.base_ring, T.t, T.m) + I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) + cvzip = zip(Singular.gens(I), Initials(R, Singular.gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end +#return a copy of the PolynomialRing I, equipped with the ordering represented by T. +function change_order( + R::Singular.PolyRing, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) where {L<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(T.w) * Singular.ordering_M(T.m), + ) +end + +function LiftFractalWalk( + G::Singular.sideal, + Gw::Singular.sideal, + R::Singular.PolyRing, + S::Singular.PolyRing, +) + G.isGB = true + rest = [ + change_ring(gen, S) - + change_ring(Singular.reduce(change_ring(gen, R), G), S) for + gen in Singular.gens(Gw) + ] + G = Singular.Ideal(S, [S(x) for x in rest]) + G.isGB = true + return G +end + +#returns ´true´ if all polynomials of the array are monomials. +function IsMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 1 + return false + end + end + return true +end + +#returns ´true´ if all polynomials of the array are binomial or less. +function IsBinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return false + end + end + return true +end +#= +function diff_vectors_lt(I::Singular.sideal) + zip = [] + v = [] + for g in gens(I) + ltu = Singular.leading_exponent_vector(g) + for e in Singular.exponent_vectors(tail(g)) + push!(v, (ltu .- e)) + end + push!(zip, (unique(v), ltu)) + v = [] + end + return zip +end +=# + +#Computes next weight vector. Version used in Amrhein Gloor. +function NextWeight( + G::Singular.sideal, + w::Array{T,1}, + tau::Array{K,1}, +) where {T<:Number,K<:Number} + if (w == tau) + return [0] + end + + tmin = 2 + t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w, a) - dot(w, v) + dot(tau, v) - dot(tau, a)) + if frac != 0 + t = (dot(w, a) - dot(w, v)) // frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + + if tmin <= 1 + w = w + tmin * (tau - w) + else + return [0] + end + return convertBoundingVector(w) +end +function NextT( + G::Singular.sideal, + w::Array{T,1}, + tau::Array{K,1}, +) where {T<:Number,K<:Number} + if (w == tau) + return [0] + end + tmin = 2 + t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w, a) - dot(w, v) + dot(tau, v) - dot(tau, a)) + if frac != 0 + t = (dot(w, a) - dot(w, v)) // frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + + if tmin <= 1 + return tmin + else + return [0] + end +end diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl new file mode 100644 index 000000000..93e787b45 --- /dev/null +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -0,0 +1,278 @@ +include("GroebnerWalkUtilitysFinal.jl") + +############################################################### +#Utilitys for generic_walk +############################################################### + +#Return the facet_initials of polynomials w.r.t. a weight vector. +function FacetInitials( + R::Singular.PolyRing, + G::Singular.sideal, + v::Vector{Int64}, + lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + inits = [] + count = 1 + for g in Singular.gens(G) + inw = Singular.MPolyBuildCtx(R) + el = first(Singular.exponent_vectors(lm[count])) + for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + if el == e || isParallel(el - e, v) + Singular.push_term!(inw, c, e) + end + end + h = finish(inw) + push!(inits, h) + count += 1 + end + return inits +end + +# +function isParallel(u::Vector{Int64}, v::Vector{Int64}) + count = 1 + x = 0 + for i = 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + if v[i] != x * u[i] + return false + end + end + return true +end + +#lifting step of the generic_walk +function LiftGeneric( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + H::Singular.sideal, +) where {L<:Nemo.RingElem} + S = base_ring(G) + Newlm = Array{Singular.elem_type(S),1}(undef, 0) + liftPolys = Array{Singular.elem_type(S),1}(undef, 0) + for g in Singular.gens(H) + r, b = reduce_recursive(g, gens(G), Lm, S) + diff = g - r + if diff != 0 + push!(Newlm, Singular.leading_term(g)) + push!(liftPolys, diff) + end + end + return liftPolys, Newlm, S +end + +function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) + btz = Set{Vector{Int64}}() + for v in V + if bigger_than_zero(S, v) + push!(btz, v) + end + end + return btz +end + +function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) + btz = Set{Vector{Int64}}() + for v in V + if less_than_zero(S, v) + push!(btz, v) + end + end + return btz +end +function filter_lf( + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, + V::Set{Vector{Int64}}, +) + btz = Set{Vector{Int64}}() + for v in V + if less_facet(w, v, S, T) + push!(btz, v) + end + end + return btz +end + +#return the next facet_normal. +function NextGamma( + G::Singular.sideal, + Lm::Vector{spoly{L}}, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) where {L<:Nemo.RingElem} + V = filter_btz(S, LmMinusV(G, Lm)) + V = filter_ltz(T, V) + if (w != [0]) + V = filter_lf(w, S, T, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v + end + end + return minV +end + +#return the next facet_normal. +function NextGamma( + G::Singular.sideal, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + V = filter_btz(S, LmMinusV(G)) + V = filter_ltz(T, V) + if (w != [0]) + V = filter_lf(w, S, T, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v + end + end + return minV +end + +function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + for i = 1:size(M)[1] + d = dot(M[i, :], v) + if d != 0 + return d > 0 + end + end + return false +end + +function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + nrows, ncols = size(M) + for i = 1:nrows + d = 0 + for j = 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d < 0 + end + end + return false +end + +function less_facet( + u::Vector{Int64}, + v::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + for i = 1:size(T)[1] + for j = 1:size(S)[1] + Tuv = dot(T[i, :], u) * dot(S[j, :], v) + Tvu = dot(T[i, :], v) * dot(S[j, :], u) + if Tuv != Tvu + return Tuv < Tvu + end + end + end + return false +end + +#returns divrem() +function divrem( + p::Singular.spoly, + lm::Singular.spoly, + S::Singular.PolyRing, +) + div = false + newpoly = Singular.MPolyBuildCtx(S) + for term in Singular.terms(p) + (b, c) = Singular.divides(term, lm) + if b + push_term!( + newpoly, + first(Singular.coefficients(c)), + first(Singular.exponent_vectors(c)), + ) + div = true + end + end + return (finish(newpoly), div) +end + +function reduce_recursive( + p::Singular.spoly, + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, + R::Singular.PolyRing, + c::Bool = false, +) where {L<:Nemo.RingElem} + I = 0 + Q = zero(R) + for i = 1:length(G) + (q, b) = divrem(p, Lm[i], R) + if b + I = i + Q = q + break + end + end + if I != 0 + r, b = reduce_recursive(p - (Q * G[I]), G, Lm, R) + return r, true + else + return p, false + end +end + +function interreduce( + G::Singular.sideal, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + R = Singular.base_ring(G) + gens = collect(Singular.gens(G)) + changed = true + while changed + changed = false + for i = 1:Singular.ngens(G) + gensrest = Array{Singular.elem_type(R),1}(undef, 0) + Lmrest = Array{Singular.elem_type(R),1}(undef, 0) + for j = 1:Singular.ngens(G) + if i != j + push!(gensrest, gens[j]) + push!(Lmrest, Lm[j]) + end + end + r, b = reduce_recursive(gens[i], gensrest, Lmrest, R) + if b + changed = true + gens[i] = r + break + end + end + end + return Singular.Ideal(R, [R(p) for p in gens]) +end diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl new file mode 100644 index 000000000..991d9f42c --- /dev/null +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -0,0 +1,576 @@ +include("GroebnerWalkUtilitysFinal.jl") +include("FractalWalkUtilitysFinal.jl") +include("GenericWalkUtilitysFinal.jl") +include("StandardWalkUtilitysFinal.jl") +include("TranWalkUtilitysFinal.jl") + + + +export groebnerwalk + +############################################################### +#Implementation of the gröbner walk. +############################################################### + +#for counting the steps of the groebnerwalk. +counter = 0 +function getCounter() + global counter + temp = counter + counter = 0 + return temp +end + +#Top-level function +#S,T have to be nxn-matrices with full rank +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) + + if grwalktype == :standard + walk = (x, y, z) -> StandardWalk(x, y, z) + elseif grwalktype == :generic + walk = (x, y, z) -> GenericWalk(x, y, z) + elseif grwalktype == :pertubed + walk = (x, y, z) -> PertubedWalk(x, y, z, p) + elseif grwalktype == :fractal + walk = + (x, y, z) -> FractalWalk( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractalStartPertubation + walk = + (x, y, z) -> FractalWalkStartOrder( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractalLex + walk = + (x, y, z) -> FractalWalkLex( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractalLookAhead + walk = + (x, y, z) -> FractalWalkLookAhead( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :tran + walk = (x, y, z) -> TranWalk(x, y, z) + elseif grwalktype == :alternative + walk = + (x, y, z) -> alternative_algorithm_top( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + end + + ######TODO:Check the parameter##### + R = base_ring(G) + I = Singular.Ideal(R, [R(x) for x in gens(G)]) + + Gb = walk(I, S, T) + println("Cones crossed: ", getCounter()) + + S, V = change_order(Gb.base_ring, T) + return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) +end + + +############################################################### +#Standard-version of the groebner walk by Collart et al. +############################################################### +function StandardWalk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + println("Standardwalk results") + println("Crossed Cones in: ") + StandardWalk(G, S, T, S[1, :], T[1, :]) +end + +function StandardWalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, +) + #loop + terminate = false + while !terminate + G = StandardStep(G, cweight, tweight, T) + println(cweight) + global counter = getCounter() + 1 + if cweight == tweight + terminate = true + else + cweight = NextWeight(G, cweight, tweight) + end + end + return G +end + +function StandardStep( + G::Singular.sideal, + cw::Vector{Int64}, + tw::Vector{Int64}, + T::Matrix{Int64}, +) + R = base_ring(G) + S, V = change_order(R, cw, T) + + Gw = Initials(S, gens(G), cw) + + H = Singular.std( + Singular.Ideal(S, [S(x) for x in Gw]), + complete_reduction = true, + ) + + G = Lift(G, H, R, S) + return Singular.std(G, complete_reduction = true) +end + +############################################################### +#Generic-version of the groebner walk by Fukuda et al. (2007) +############################################################### + + +function GenericWalk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + R, V = change_order(G.base_ring, T) + + v = NextGamma(G, [0], S, T) + Lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + + println("GenericWalk results") + println("Crossed Cones with facetNormal: ") + while !isempty(v) + global counter = getCounter() + 1 + println(v) + G, Lm = GenericStep(G, R, v, T, Lm) + v = NextGamma(G, Lm, v, S, T) + end + return Singular.interreduce(G) +end + +function GenericStep( + G::Singular.sideal, + S::Singular.PolyRing, + v::Vector{Int64}, + T::Matrix{Int64}, + Lm::Vector{Singular.spoly{L}}, +) where {L<:Nemo.RingElem} + + R = Singular.base_ring(G) + + facet_Generators = FacetInitials(S, G, v, Lm) + H = Singular.std( + Singular.Ideal(S, [S(x) for x in facet_Generators]), + complete_reduction = true, + ) + H, Lm = LiftGeneric(G, Lm, H) + G = Singular.Ideal(S, [x for x in H]) + G = interreduce(G, Lm) + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + G.isGB = true + return G, Lm +end + + +############################################################### +#Pertubed-version of the groebner walk Amrhein et al. +############################################################### +function PertubedWalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + p::Int64, +) + #sweight = pert_Vectors(G, S, p) + sweight = S[1, :] + terminate = false + println("PertubedWalk results") + println("Crossed Cones in: ") + + while !terminate + tweight = PertubedVector(G, T, p) + G = StandardWalk(G, S, T, sweight, tweight) + if InCone(G, T, tweight) + terminate = true + else + if p == 1 + R, V = change_order(G.base_ring, T) + G = + Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + G = Singular.std(G, complete_reduction = true) + term = true + end + p = p - 1 + sweight = tweight + end + end + return G +end + +############################################################### +#fractal-walk by Amrhein et al. +#Inlcuding: +#fractal_walk -> standard-version +#fractal_walk2 -> checks if the starting weight is in the inner of a cone. +#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. +# checks if the starting weight is in the inner of a cone. +############################################################### + +######################################## +#Counter for the steps in the fractalwalk +######################################## +counterFr = 0 +function deleteCounterFr() + global counterFr + temp = counterFr + counterFr = 0 + return temp +end +function getCounterFr() + global counterFr + return counterFr +end +function raiseCounterFr(std::Bool = false) + global counterFr = getCounterFr() + 1 + +end + +PVecs = [] + +sigma = [] + +function FractalWalk( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(base_ring(G))] + println("FacrtalWalk_standard results") + println("Crossed Cones in: ") + Gb = FractalRecursive(G, S, T, S.w, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function FractalRecursive( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + s::Vector{Int64}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + terminate = false + G.isGB = true + w = s + + while !terminate + #w = nextW_2(G, cweight, PVecs[p]) + t = NextT(G, w, PVecs[p]) + if (t == [0]) + if InCone(G, T, PVecs[p]) + return G + else + global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PVecs[p] - w) + w = convertBoundingVector(w) + T.w = w + Rn, V = change_order(R, T) + Gw = Initials(R, gens(G), w) + if p == nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr(true) + else + println("up in: ", p, " with: ", w) + + H = FractalRecursive( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + s, + PVecs, + p + 1, + ) + end + H = LiftFractalWalk(G, H, R, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + S = T + end + return G +end + +cwPert = [] +firstStepMode = false +function cwpert(p::Int64) + cwPert[p] +end + +function FractalWalkStartOrder( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PVecs = + [PertubedVector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + global sigma = S.w + println("FractalWalk_withStartorder results") + println("Crossed Cones in: ") + Gb = FractalWalkRecursiveStartOrder(G, S, T,S.w, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function FractalWalkRecursiveStartOrder( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + s::Vector{Int64}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !IsMonomial(Initials(R, Singular.gens(G), S.w)) + global cwPert = [PertubedVector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = s + end + + while !terminate + t = NextT(G, w, PVecs[p]) + if t == [0] + if InCone(G, T, PVecs[p]) + println(PVecs[p], " in depth", p) + return G + else + global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PVecs[p] - w) + w = convertBoundingVector(w) + T.w = w + Rn, V = change_order(R, T) + Gw = Initials(R, gens(G), w) + if p == Singular.nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr(true) + else + println("up in: ", p, " with: ", w) + + H = FractalWalkRecursiveStartOrder( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + s, + PVecs, + p + 1, + ) + global firstStepMode = false + end + H = LiftFractalWalk(G, H, R, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + S = T + end + return G +end +function FractalWalkLex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(base_ring(G))] + println("FractalWalkLex results") + println("Crossed Cones in: ") + Gb = FractalWalkRecursiveLex(G, S, T,S.w, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function FractalWalkRecursiveLex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + s::Vector{Int64}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = s + while !terminate + t = NextT(G, w, PVecs[p]) + if t == [0] + if InCone(G, T, PVecs[p]) + return G + else + global PVecs = + [PertubedVector(G, T, i) for i = 1:Singular.nvars(R)] + continue + end + end + w = w + t * (PVecs[p] - w) + w = convertBoundingVector(w) + T.w = w + Rn, V = change_order(R, T) + Gw = Initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr(true) + else + println("up in: ", p, " with: ", w) + + H = FractalWalkRecursiveLex( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + s, + PVecs, + p + 1, + ) + global firstStepMode = false + end + H = LiftFractalWalk(G, H, R, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + S = T + end + return G +end +function FractalWalkLookAhead( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + println("FractalWalkLookAhead results") + println("Crossed Cones in: ") + global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = FractalWalkLookAheadRecursive(G, S, T, PVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function FractalWalkLookAheadRecursive( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + s::Vector{Int64}, + PVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = s + + while !terminate + t = NextT(G, cweight, PVecs[p]) + if t == [0] + if inCone(G, T, PVecs[p]) + return G + else + global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PVecs[p] - w) + w = convertBoundingVector(w) + T.w = w + Rn, V = change_order(R, T) + Gw = Initials(R, Singular.gens(G), w) + if (p == Singular.nvars(R) || IsBinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr(true) + else + println("up in: ", p, " with: ", w) + H = FractalWalkLookAheadRecursive( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + s, + PVecs, + p + 1, + ) + end + H = LiftFractalWalk(G, H, R, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + S = T + end + return G +end + +############################################################### +#Tran-version of the groebner walk by Tran (2002) +############################################################### + +function TranWalk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + cweight = S[1, :] + tweight = T[1, :] + println("Tranwalk results") + println("Crossed Cones in: ") + + #loop + term = false + while !term + w = NextWeight(G, cweight, tweight) + if w == tweight + if InCone(G, T, cweight) + return G + else + if InSeveralCones(Initials(base_ring(G), gens(G), w)) + tweight = RepresentationVector(G, T) + continue + end + end + end + G = StandardStep(G, w, tweight, T) + global counter = getCounter() + 1 + println(w) + cweight = w + end +end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl new file mode 100644 index 000000000..dcf2be5e8 --- /dev/null +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -0,0 +1,450 @@ +############################################################### +#Utilitys for Groebnerwalks +############################################################### + +#Return the initials of polynomials w.r.t. a weight vector. +function Initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) + inits = spoly{elem_type(base_ring(R))}[] + indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] + for g in G + empty!(indexw) + maxw = 0 + eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + for (e, c) in eczip + tmpw = dot(w, e) + if maxw == tmpw + push!(indexw, (e, c)) + #rethink this. gens are preordered + elseif maxw < tmpw + empty!(indexw) + push!(indexw, (e, c)) + maxw = tmpw + end + end + inw = MPolyBuildCtx(R) + for (e, c) in indexw + Singular.push_term!(inw, c, e) + end + h = finish(inw) + push!(inits, h) + end + return inits +end +#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) +mutable struct MonomialOrder{ + T<:Matrix{Int64}, + v<:Vector{Int64}, + tv<:Vector{Int64}, +} + m::T + w::v + t::tv +end + +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. +function LmMinusV( + I::Singular.sideal, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + v = Vector{Int}[] + for i = 1:ngens(I) + ltu = Singular.leading_exponent_vector(Lm[i]) + for e in Singular.exponent_vectors(gens(I)[i]) + if ltu != e + push!(v, ltu .- e) + end + end + end + return unique!(v) +end + +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. +function LmMinusV(I::Singular.sideal) + v = Vector{Int}[] + for g in gens(I) + ltu = Singular.leading_exponent_vector(g) + for e in Singular.exponent_vectors(tail(g)) + push!(v, ltu .- e) + end + end + return unique!(v) +end + +#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) +function change_order( + R::Singular.PolyRing, + cweight::Array{L,1}, + T::Matrix{Int64}, +) where {L<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), + cached = false, + ) + return S, H +end + +#return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) +function change_order( + R::Singular.PolyRing, + M::Matrix{Int64}, +) where {T<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_M(M), + cached = false, + ) + #@error("Not implemented yet") + return S, H +end + +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + Singular.push_term!(M, c, v) + end + return finish(M) +end +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + Singular.push_term!(M, c, v) + end + return finish(M) +end + +function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) + if length(w) > 2 + if ord == :lex || ord == Symbol("Singular(lp)") + return [ + w' + ident_matrix(length(w))[1:length(w)-1, :] + ] + end + if ord == :deglex + return [ + w' + ones(Int64, length(w))' + ident_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :degrevlex + return [ + w' + ones(Int64, length(w))' + anti_diagonal_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :revlex || a.ord == Symbol("Singular(dp)") + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end + else + error("not implemented yet") + end +end + +function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) + return [ + w' + M[2:length(w), :] + ] +end +function insert_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) + return [ + w' + M[1:length(w)-1, :] + ] +end + + +function ordering_as_matrix(ord::Symbol, nvars::Int64) + if ord == :lex + #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int64, nvars)' + ident_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :degrevlex + return [ + ones(Int64, nvars)' + anti_diagonal_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :revlex || a.ord == Symbol("Singular(dp)") + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end +end + +function PertubedVector( + G::Singular.sideal, + Mo::MonomialOrder{Matrix{Int64}}, + t::Vector{Int64}, + p::Integer, +) + if t == Mo.m[1, :] + M = Mo.m + else + M = insert_weight_vector(t, Mo.m) + end + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g, n) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + println(w) + + return w +end + +function PertubedVector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g, n) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + println(w) + return w +end +function PertubedVector( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + p::Integer, +) + m = [] + if T.t == T.m[1, :] + M = T.m + else + M = insert_weight_vector(T.t, T.m) + end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g, n) + if (td > maxtdeg) + maxtdeg = td + end + end + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + println(w) + + return w +end +function PertubedVector( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + mult::Int64, + p::Integer, +) + m = [] + if T.t == T.m[1, :] + M = T.m + else + M = insert_weight_vector(T.t, T.m) + end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxtdeg = 0 + for g in gens(G) + td = tdeg(g, n) + if (td > maxtdeg) + maxtdeg = td + end + end + #TODO: rethink * mult + e = maxtdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + println(w) + return w +end + +function tdeg(p::Singular.spoly, n::Int64) + max = 0 + for mon in Singular.monomials(p) + ev = Singular.exponent_vectors(mon) + sum = 0 + for e in ev + for i = 1:n + sum += e[i] + end + end + if (max < sum) + max = sum + end + end + return max +end + +function InCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) + R, V = change_order(G.base_ring, T) + I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(Singular.gens(I), Initials(R, Singular.gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end + +function Lift( + G::Singular.sideal, + InG::Singular.sideal, + R::Singular.PolyRing, + S::Singular.PolyRing, +) + G.isGB = true + rest = [ + gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) for + gen in gens(InG) + ] + Gnew = Singular.Ideal(S, [S(x) for x in rest]) + Gnew.isGB = true + return Gnew +end + + +############################################# +# unspecific help functions +############################################# + +function ident_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end + +# Singular.isequal depends on order of generators +function equalitytest(G::Singular.sideal, K::Singular.sideal) + generators = Singular.gens(G) + count = 0 + for gen in generators + for r in Singular.gens(K) + if gen - r == 0 + count += 1 + end + end + end + if count == Singular.ngens(G) + return true + end + return false +end + +function dot(v::Vector{Int64}, w::Vector{Int64}) + n = length(v) + sum = 0 + for i = 1:n + sum += v[i] * w[i] + end + return sum +end diff --git a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl new file mode 100644 index 000000000..775920e95 --- /dev/null +++ b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl @@ -0,0 +1,37 @@ +include("GroebnerWalkUtilitysFinal.jl") + +############################################################### +#Utilitys for standard_walk +############################################################### + + +#Solves problems with weight vectors of floats. +function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + +#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. +#This Version is used by the standard_walk, pertubed_walk and tran_walk. +function NextWeight( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + tv = [] + for v in LmMinusV(G) + cw = dot(cweight, v) + tw = dot(tweight, v) + if tw < 0 + push!(tv, cw // (cw - tw)) + end + end + push!(tv, 1) + #filter!(x -> numerator(x) != 0, tv) + t = minimum(tv) + w = (1 - t) * cweight + t * tweight + return convertBoundingVector(w) +end diff --git a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl new file mode 100644 index 000000000..2813cb28c --- /dev/null +++ b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl @@ -0,0 +1,46 @@ +include("GroebnerWalkUtilitysFinal.jl") + + +function RepresentationVector(G::Singular.sideal, T::Matrix{Int64}) + n = size(T)[1] + M = 0 + for i = 1:n + for j = 1:n + temp = T[i, j] + if M < temp + M = temp + end + end + end + + d0 = 0 + for g in Singular.gens(G) + # println(g, " in tedeg", tdeg(g)) + temp = tdeg(g, n) + if d0 < temp + d0 = temp + end + end + d = M * (2 * d0^2 + (n + 1) * d0) + w = d^(n - 1) * T[1, :] + for i = 2:n + w = w + d^(n - i) * T[i, :] + end + return w +end + +function InSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + counter = 0 + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return true + end + if size(collect(Singular.coefficients(g)))[1] == 2 + counter = counter +1 + end +end + if counter > 1 + return true + end + return false +end diff --git a/src/GroebnerWalkFinal/examplesFinal b/src/GroebnerWalkFinal/examplesFinal new file mode 100644 index 000000000..64d439fe2 --- /dev/null +++ b/src/GroebnerWalkFinal/examplesFinal @@ -0,0 +1,290 @@ +include("GroebnerWalkFinal.jl") + +function test(case::Int) + + test_successfull = true + + if case == 1 || case == 99 + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + ) + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = Singular.Ideal(R, [f1, f2]) + I = Singular.std(I, complete_reduction = true) + + S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :standard, + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + println("test tran: ", equalitytest(T0, T6)) + + + if !(equalitytest(T6, T0)) + test_successfull = false + end + end + + + if case == 2 || case == 99 + + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M( + ordering_as_matrix([5, 4, 1], :deglex), + ), + ) + + f1 = x^2 - y + f2 = y^2 - x * z - y * z + I = Singular.Ideal(R, [f1, f2]) + + I = Singular.std(I, complete_reduction = true) + @time H = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :tran, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), + ) + + + T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + + if !(equalitytest(T0, T6)) + test_successfull = false + end + end + + + if case == 3 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + + f1 = y^4 + y * z^2 - u^2 * w + f2 = 2 * x^2 * y + x^3 * w * u^2 + x + f3 = 2 - 3 * x^2 * v * z^4 * w + I = Singular.Ideal(R, [f1, f2, f3]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + if !(Singular.equal(T0, T6)) + test_successfull = false + end + + end + if case == 4 || case == 99 + R, (q, c, p, d) = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ) + + + f1 = + 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - + 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + + c^2 * q^2 + + 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - + 8 * p + + c^2 + + 4 * d^2 - 2 * q + + 10 * p^2 + + 2 + f2 = + 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - + 3 * p * q * c + 4 * c + f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q + f4 = + 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + + 3 * c^2 + + 9 * p^2 * d^2 + + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + + 12 * d^2 + + 4 * p^2 + + 12 * c * d * p + + 12 * c * d * q + + 12 * c * d * p * q - 12 * c * d + I = Singular.Ideal(R, [f1, f2, f3, f4]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :tran, + ) + + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + + if !(equalitytest(T6, T0)) + test_successfull = false + end + end + + if case == 5 || case == 99 + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 + f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 + f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 + I = Singular.Ideal(R, [f1, f2, f3]) + + I = Singular.std(I, complete_reduction = true) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = :lex, + ) + + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :standard, + ) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + + + + if !(Singular.equal(T0, T6)) + test_successfull = false + end + + end + + + + if case == 6 || case == 99 + R, (v, u, t, z, y, x) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y", "x"], + ordering = Singular.ordering_M( + ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), + ), + ) + + f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v + f2 = x * y + y * z + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * x * z + 2 * y * t + 2 * z * u + u^2 + 2 * t * v - t + f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y + f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), + ordering_as_matrix(:lex, 6), + :pertubed, + 5, + ) + + @time J = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), + ordering_as_matrix(:lex, 6), + :generic, + ) + S, V = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y", "x"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + + T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + + if !(isequal(T6, T0)) + test_successfull = false + end + end + println("All tests were: ", test_successfull) +end From a11bd305144aed33655d2a787b34e8dae6629b1c Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 8 Dec 2021 18:04:33 +0100 Subject: [PATCH 33/85] Preparing the final Branch --- .../FractalWalkUtilitysFinal.jl | 72 ++- src/GroebnerWalkFinal/GWtestFinal.jl | 558 ++++++++++++++++++ .../GenericWalkUtilitysFinal.jl | 29 +- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 267 +++++---- .../GroebnerWalkUtilitysFinal.jl | 120 ++-- .../StandardWalkUtilitysFinal.jl | 11 +- .../TranWalkUtilitysFinal.jl | 11 +- src/GroebnerWalkFinal/examplesFinal | 2 +- 8 files changed, 788 insertions(+), 282 deletions(-) create mode 100644 src/GroebnerWalkFinal/GWtestFinal.jl diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 1abe215db..99ec9bc97 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -1,23 +1,34 @@ include("GroebnerWalkUtilitysFinal.jl") - -#Solves problems with weight vectors of floats. -function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} +#= +@doc Markdown.doc""" + convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} +Given a Vector{Number} $v$ this function computes a Vector{Int64} w with w = v*gcd(v). +"""=# +function convert_bounding_vector(v::Vector{T}) where {T<:Number} w = Vector{Int64}() - for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + for i = 1:length(v) + push!(w, float(divexact(v[i], gcd(v)))) end return w end -#Checks if a weight vector t is in the cone of the ordering T w.r.t. an ideal. -function InCone( +#= +@doc Markdown.doc""" +function inCone( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + t::Vector{Int64}, +) +Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. +"""=# +function inCone( G::Singular.sideal, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, t::Vector{Int64}, ) R, V = change_order(G.base_ring, T.t, T.m) I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) - cvzip = zip(Singular.gens(I), Initials(R, Singular.gens(I), t)) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) return false @@ -39,7 +50,7 @@ function change_order( ) end -function LiftFractalWalk( +function lift_fractal_walk( G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, @@ -57,7 +68,7 @@ function LiftFractalWalk( end #returns ´true´ if all polynomials of the array are monomials. -function IsMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} +function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if size(collect(Singular.coefficients(g)))[1] > 1 return false @@ -67,7 +78,7 @@ function IsMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} end #returns ´true´ if all polynomials of the array are binomial or less. -function IsBinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} +function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if size(collect(Singular.coefficients(g)))[1] > 2 return false @@ -75,39 +86,23 @@ function IsBinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} end return true end -#= -function diff_vectors_lt(I::Singular.sideal) - zip = [] - v = [] - for g in gens(I) - ltu = Singular.leading_exponent_vector(g) - for e in Singular.exponent_vectors(tail(g)) - push!(v, (ltu .- e)) - end - push!(zip, (unique(v), ltu)) - v = [] - end - return zip -end -=# #Computes next weight vector. Version used in Amrhein Gloor. -function NextWeight( +function next_weight( G::Singular.sideal, w::Array{T,1}, - tau::Array{K,1}, + tw::Array{K,1}, ) where {T<:Number,K<:Number} - if (w == tau) + if (w == t) return [0] end - tmin = 2 t = 0 for g in gens(G) a = Singular.leading_exponent_vector(g) d = Singular.exponent_vectors(tail(g)) for v in d - frac = (dot(w, a) - dot(w, v) + dot(tau, v) - dot(tau, a)) + frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) if frac != 0 t = (dot(w, a) - dot(w, v)) // frac end @@ -116,20 +111,20 @@ function NextWeight( end end end - if tmin <= 1 - w = w + tmin * (tau - w) + w = w + tmin * (t - w) else return [0] end - return convertBoundingVector(w) + return convert_bounding_vector(w) end -function NextT( + +function nextT( G::Singular.sideal, w::Array{T,1}, - tau::Array{K,1}, + tw::Array{K,1}, ) where {T<:Number,K<:Number} - if (w == tau) + if (w == tw) return [0] end tmin = 2 @@ -138,7 +133,7 @@ function NextT( a = Singular.leading_exponent_vector(g) d = Singular.exponent_vectors(tail(g)) for v in d - frac = (dot(w, a) - dot(w, v) + dot(tau, v) - dot(tau, a)) + frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) if frac != 0 t = (dot(w, a) - dot(w, v)) // frac end @@ -147,7 +142,6 @@ function NextT( end end end - if tmin <= 1 return tmin else diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl new file mode 100644 index 000000000..fbb148b24 --- /dev/null +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -0,0 +1,558 @@ +include("GroebnerWalkFinal.jl") + +function test(case::Int) + + test_successfull = true + + if case == 1 || case == 99 + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + ) + + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = Singular.Ideal(R, [f1, f2]) + + I = Singular.std(I, complete_reduction = true) + + S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :tran, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :fractal, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :fractal_look_ahead, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :standard, + ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :pertubed, + 2, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + :generic, + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal: ", equalitytest(T0, T5)) + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equalitytest(T4, T0)) + + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end + end + if case == 2 || case == 99 + + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M( + ordering_as_matrix([5, 4, 1], :deglex), + ), + ) + + f1 = x^2 - y + f2 = y^2 - x * z - y * z + I = Singular.Ideal(R, [f1, f2]) + + I = Singular.std(I, complete_reduction = true) + @time H = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :tran, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :fractal, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :fractal_look_ahead, + ) + @time K = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :pertubed, + 3, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :standard, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix([5, 4, 1], :deglex), + ordering_as_matrix([6, 1, 3], :lex), + :generic, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), + ) + + T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equalitytest(T4, T0)) + + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end + end + + if case == 3 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + f1 = y^4 + y * z^2 - u^2 * w + f2 = 2 * x^2 * y + x^3 * w * u^2 + x + f3 = 2 - 3 * x^2 * v * z^4 * w + I = Singular.Ideal(R, [f1, f2, f3]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + #= @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + ) =# + + + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_look_ahead, + ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 4, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + #println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equal(T4, T0)) + + if !( + equalitytest(T2, T0) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) + test_successfull = false + end + end + if case == 4 || case == 99 + R, (q, c, p, d) = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ) + + + f1 = + 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - + 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + + c^2 * q^2 + + 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - + 8 * p + + c^2 + + 4 * d^2 - 2 * q + + 10 * p^2 + + 2 + f2 = + 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - + 3 * p * q * c + 4 * c + f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q + f4 = + 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + + 3 * c^2 + + 9 * p^2 * d^2 + + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + + 12 * d^2 + + 4 * p^2 + + 12 * c * d * p + + 12 * c * d * q + + 12 * c * d * p * q - 12 * c * d + I = Singular.Ideal(R, [f1, f2, f3, f4]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :tran, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal_look_ahead, + ) + + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :pertubed, + 4, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal_lex, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :generic, + ) + + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal: ", equalitytest(T0, T1)) + println("test fractal2: ", equalitytest(T0, T5)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", Singular.equal(T4, T0)) + + + if !( + equalitytest(T2, T1) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) + test_successfull = false + end + end + if case == 5 || case == 99 + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 + f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 + f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 + I = Singular.Ideal(R, [f1, f2, f3]) + + I = Singular.std(I, complete_reduction = true) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = :lex, + ) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :tran, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal, + ) + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal_look_ahead, + ) + + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal_lex, + ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :pertubed, + 3, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :generic, + ) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", Singular.equal(T4, T0)) + + if !( + equalitytest(T2, T1) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) + test_successfull = false + end + + end + + + + if case == 6 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + + f1 = 2 * w * y + 2 * v * z + u^2 + x^2 + x + f2 = 2 * w * z + 2 * v * u + 2 * y * x + y + f3 = 2 * w * u + v^2 + 2 * z * x + z + y^2 + f4 = 2 * w * v + 2 * u * x + u + 2 * z * y + f5 = w^2 + 2 * v * x + v + 2 * u * y + z^2 + f6 = 2 * w * x + w + 2 * v * y + 2 * u * z + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + #= @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + ) =# + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_look_ahead, + ) + + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 6, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + #println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equal(T4, T0)) + + if !( + equalitytest(T2, T0) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + Singular.equal(T0, T4) + ) + test_successfull = false + end + + end + println("All tests were: ", test_successfull) +end diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 93e787b45..5274c41e0 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -4,28 +4,29 @@ include("GroebnerWalkUtilitysFinal.jl") #Utilitys for generic_walk ############################################################### -#Return the facet_initials of polynomials w.r.t. a weight vector. -function FacetInitials( +#Return the facet_facet_facet_initials of polynomials w.r.t. a weight vector. +function facet_initials( R::Singular.PolyRing, G::Singular.sideal, v::Vector{Int64}, lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} - inits = [] + initials = [] count = 1 for g in Singular.gens(G) inw = Singular.MPolyBuildCtx(R) el = first(Singular.exponent_vectors(lm[count])) - for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + for (e, c) in + zip(Singular.exponent_vectors(g), Singular.coefficients(g)) if el == e || isParallel(el - e, v) Singular.push_term!(inw, c, e) end end h = finish(inw) - push!(inits, h) + push!(initials, h) count += 1 end - return inits + return initials end # @@ -57,7 +58,7 @@ function isParallel(u::Vector{Int64}, v::Vector{Int64}) end #lifting step of the generic_walk -function LiftGeneric( +function lift_generic( G::Singular.sideal, Lm::Vector{Singular.spoly{L}}, H::Singular.sideal, @@ -111,14 +112,14 @@ function filter_lf( end #return the next facet_normal. -function NextGamma( +function next_gamma( G::Singular.sideal, Lm::Vector{spoly{L}}, w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, ) where {L<:Nemo.RingElem} - V = filter_btz(S, LmMinusV(G, Lm)) + V = filter_btz(S, difference_lead_tail(G, Lm)) V = filter_ltz(T, V) if (w != [0]) V = filter_lf(w, S, T, V) @@ -136,13 +137,13 @@ function NextGamma( end #return the next facet_normal. -function NextGamma( +function next_gamma( G::Singular.sideal, w::Vector{Int64}, S::Matrix{Int64}, T::Matrix{Int64}, ) - V = filter_btz(S, LmMinusV(G)) + V = filter_btz(S, difference_lead_tail(G)) V = filter_ltz(T, V) if (w != [0]) V = filter_lf(w, S, T, V) @@ -202,11 +203,7 @@ function less_facet( end #returns divrem() -function divrem( - p::Singular.spoly, - lm::Singular.spoly, - S::Singular.PolyRing, -) +function divrem(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) div = false newpoly = Singular.MPolyBuildCtx(S) for term in Singular.terms(p) diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 991d9f42c..cc495121b 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -4,8 +4,6 @@ include("GenericWalkUtilitysFinal.jl") include("StandardWalkUtilitysFinal.jl") include("TranWalkUtilitysFinal.jl") - - export groebnerwalk ############################################################### @@ -20,9 +18,28 @@ function getCounter() counter = 0 return temp end - -#Top-level function -#S,T have to be nxn-matrices with full rank +#= +@doc Markdown.doc""" +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) +Given an Ideal $G$ generated by a reduced Groebner Basis w.r.t. the monomial ordering $S$ this function +returns a reduced Groebner Basis w.r.t. the monomial ordering $T$ by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart et al. (1993) +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). +Pertubed Walk (:pertubed, with $p$ = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. +Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that $T$ represents the lex ordering. Pertubes only the target vector. +Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. +"""=# function groebnerwalk( G::Singular.sideal, S::Matrix{Int64}, @@ -30,43 +47,42 @@ function groebnerwalk( grwalktype::Symbol = :standard, p::Int64 = 0, ) - if grwalktype == :standard - walk = (x, y, z) -> StandardWalk(x, y, z) + walk = (x, y, z) -> standard_walk(x, y, z) elseif grwalktype == :generic - walk = (x, y, z) -> GenericWalk(x, y, z) + walk = (x, y, z) -> generic_walk(x, y, z) elseif grwalktype == :pertubed - walk = (x, y, z) -> PertubedWalk(x, y, z, p) + walk = (x, y, z) -> pertubed_walk(x, y, z, p) elseif grwalktype == :fractal walk = - (x, y, z) -> FractalWalk( + (x, y, z) -> fractal_walk( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) - elseif grwalktype == :fractalStartPertubation + elseif grwalktype == :fractal_start_order walk = - (x, y, z) -> FractalWalkStartOrder( + (x, y, z) -> fractal_walk_start_order( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) - elseif grwalktype == :fractalLex + elseif grwalktype == :fractal_lex walk = - (x, y, z) -> FractalWalkLex( + (x, y, z) -> fractal_walk_lex( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) - elseif grwalktype == :fractalLookAhead + elseif grwalktype == :fractal_look_ahead walk = - (x, y, z) -> FractalWalkLookAhead( + (x, y, z) -> fractal_walk_look_ahead( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) elseif grwalktype == :tran - walk = (x, y, z) -> TranWalk(x, y, z) + walk = (x, y, z) -> tran_walk(x, y, z) elseif grwalktype == :alternative walk = (x, y, z) -> alternative_algorithm_top( @@ -88,16 +104,13 @@ function groebnerwalk( end -############################################################### -#Standard-version of the groebner walk by Collart et al. -############################################################### -function StandardWalk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - println("Standardwalk results") +function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + println("standard_walk results") println("Crossed Cones in: ") - StandardWalk(G, S, T, S[1, :], T[1, :]) + standard_walk(G, S, T, S[1, :], T[1, :]) end -function StandardWalk( +function standard_walk( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -107,19 +120,19 @@ function StandardWalk( #loop terminate = false while !terminate - G = StandardStep(G, cweight, tweight, T) + G = standard_step(G, cweight, tweight, T) println(cweight) global counter = getCounter() + 1 if cweight == tweight terminate = true else - cweight = NextWeight(G, cweight, tweight) + cweight = next_weight(G, cweight, tweight) end end return G end -function StandardStep( +function standard_step( G::Singular.sideal, cw::Vector{Int64}, tw::Vector{Int64}, @@ -128,14 +141,14 @@ function StandardStep( R = base_ring(G) S, V = change_order(R, cw, T) - Gw = Initials(S, gens(G), cw) + Gw = initials(S, gens(G), cw) H = Singular.std( Singular.Ideal(S, [S(x) for x in Gw]), complete_reduction = true, ) - G = Lift(G, H, R, S) + G = lift(G, H, R, S) return Singular.std(G, complete_reduction = true) end @@ -143,26 +156,25 @@ end #Generic-version of the groebner walk by Fukuda et al. (2007) ############################################################### - -function GenericWalk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R, V = change_order(G.base_ring, T) - v = NextGamma(G, [0], S, T) + v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - println("GenericWalk results") + println("generic_walk results") println("Crossed Cones with facetNormal: ") while !isempty(v) global counter = getCounter() + 1 println(v) - G, Lm = GenericStep(G, R, v, T, Lm) - v = NextGamma(G, Lm, v, S, T) + G, Lm = generic_step(G, R, v, T, Lm) + v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) end -function GenericStep( +function generic_step( G::Singular.sideal, S::Singular.PolyRing, v::Vector{Int64}, @@ -172,12 +184,12 @@ function GenericStep( R = Singular.base_ring(G) - facet_Generators = FacetInitials(S, G, v, Lm) + facet_Generators = facet_initials(S, G, v, Lm) H = Singular.std( Singular.Ideal(S, [S(x) for x in facet_Generators]), complete_reduction = true, ) - H, Lm = LiftGeneric(G, Lm, H) + H, Lm = lift_generic(G, Lm, H) G = Singular.Ideal(S, [x for x in H]) G = interreduce(G, Lm) G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) @@ -189,7 +201,7 @@ end ############################################################### #Pertubed-version of the groebner walk Amrhein et al. ############################################################### -function PertubedWalk( +function pertubed_walk( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -198,19 +210,18 @@ function PertubedWalk( #sweight = pert_Vectors(G, S, p) sweight = S[1, :] terminate = false - println("PertubedWalk results") + println("pertubed_walk results") println("Crossed Cones in: ") while !terminate - tweight = PertubedVector(G, T, p) - G = StandardWalk(G, S, T, sweight, tweight) - if InCone(G, T, tweight) + tweight = pertubed_vector(G, T, p) + G = standard_walk(G, S, T, sweight, tweight) + if inCone(G, T, tweight) terminate = true else if p == 1 R, V = change_order(G.base_ring, T) - G = - Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) G = Singular.std(G, complete_reduction = true) term = true end @@ -231,7 +242,7 @@ end ############################################################### ######################################## -#Counter for the steps in the fractalwalk +#Counter for the steps in the fractal_walk ######################################## counterFr = 0 function deleteCounterFr() @@ -244,34 +255,31 @@ function getCounterFr() global counterFr return counterFr end -function raiseCounterFr(std::Bool = false) - global counterFr = getCounterFr() + 1 - +function raiseCounterFr() + global counterFr = getCounterFr() + 1 end - -PVecs = [] - +PertVecs = [] sigma = [] -function FractalWalk( +function fractal_walk( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(base_ring(G))] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println("FacrtalWalk_standard results") println("Crossed Cones in: ") - Gb = FractalRecursive(G, S, T, S.w, PVecs, 1) + Gb = fractal_recursiv(G, S, T, S.w, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end -function FractalRecursive( +function fractal_recursiv( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, s::Vector{Int64}, - PVecs::Vector{Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = base_ring(G) @@ -280,41 +288,40 @@ function FractalRecursive( w = s while !terminate - #w = nextW_2(G, cweight, PVecs[p]) - t = NextT(G, w, PVecs[p]) + #w = nextW_2(G, cweight, PertVecs[p]) + t = nextT(G, w, PertVecs[p]) if (t == [0]) - if InCone(G, T, PVecs[p]) + if inCone(G, T, PertVecs[p]) return G else - global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end end - w = w + t * (PVecs[p] - w) - w = convertBoundingVector(w) + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) T.w = w Rn, V = change_order(R, T) - Gw = Initials(R, gens(G), w) + Gw = initials(R, gens(G), w) if p == nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) println(w, " in depth", p) - raiseCounterFr(true) + raiseCounterFr() else println("up in: ", p, " with: ", w) - - H = FractalRecursive( + H = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), S, T, s, - PVecs, + PertVecs, p + 1, ) end - H = LiftFractalWalk(G, H, R, Rn) + H = lift_fractal_walk(G, H, R, Rn) G = Singular.std(H, complete_reduction = true) R = Rn S = T @@ -328,35 +335,35 @@ function cwpert(p::Int64) cwPert[p] end -function FractalWalkStartOrder( +function fractal_walk_start_order( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - global PVecs = - [PertubedVector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] global sigma = S.w - println("FractalWalk_withStartorder results") + println("fractal_walk_withStartorder results") println("Crossed Cones in: ") - Gb = FractalWalkRecursiveStartOrder(G, S, T,S.w, PVecs, 1) + Gb = fractal_walk_recursiv_startorder(G, S, T, S.w, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end -function FractalWalkRecursiveStartOrder( +function fractal_walk_recursiv_startorder( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, s::Vector{Int64}, - PVecs::Vector{Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = Singular.base_ring(G) terminate = false G.isGB = true if (p == 1) - if !IsMonomial(Initials(R, Singular.gens(G), S.w)) - global cwPert = [PertubedVector(G, S, S.w, i) for i = 1:nvars(R)] + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] global firstStepMode = true end end @@ -367,67 +374,67 @@ function FractalWalkRecursiveStartOrder( end while !terminate - t = NextT(G, w, PVecs[p]) + t = nextT(G, w, PertVecs[p]) if t == [0] - if InCone(G, T, PVecs[p]) - println(PVecs[p], " in depth", p) + if inCone(G, T, PertVecs[p]) + println(PertVecs[p], " in depth", p) return G else - global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end end - w = w + t * (PVecs[p] - w) - w = convertBoundingVector(w) + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) T.w = w Rn, V = change_order(R, T) - Gw = Initials(R, gens(G), w) + Gw = initials(R, gens(G), w) if p == Singular.nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) println(w, " in depth", p) - raiseCounterFr(true) + raiseCounterFr() else println("up in: ", p, " with: ", w) - H = FractalWalkRecursiveStartOrder( + H = fractal_walk_recursiv_startorder( Singular.Ideal(R, [x for x in Gw]), S, T, s, - PVecs, + PertVecs, p + 1, ) global firstStepMode = false end - H = LiftFractalWalk(G, H, R, Rn) + H = lift_fractal_walk(G, H, R, Rn) G = Singular.std(H, complete_reduction = true) R = Rn S = T end return G end -function FractalWalkLex( +function fractal_walk_lex( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(base_ring(G))] - println("FractalWalkLex results") + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println("fractal_walk_lex results") println("Crossed Cones in: ") - Gb = FractalWalkRecursiveLex(G, S, T,S.w, PVecs, 1) + Gb = fractal_walk_recursive_lex(G, S, T, S.w, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end -function FractalWalkRecursiveLex( +function fractal_walk_recursive_lex( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, s::Vector{Int64}, - PVecs::Vector{Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = Singular.base_ring(G) @@ -435,67 +442,67 @@ function FractalWalkRecursiveLex( G.isGB = true w = s while !terminate - t = NextT(G, w, PVecs[p]) + t = nextT(G, w, PertVecs[p]) if t == [0] - if InCone(G, T, PVecs[p]) + if inCone(G, T, PertVecs[p]) return G else - global PVecs = - [PertubedVector(G, T, i) for i = 1:Singular.nvars(R)] + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] continue end end - w = w + t * (PVecs[p] - w) - w = convertBoundingVector(w) + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) T.w = w Rn, V = change_order(R, T) - Gw = Initials(R, Singular.gens(G), w) + Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) println(w, " in depth", p) - raiseCounterFr(true) + raiseCounterFr() else println("up in: ", p, " with: ", w) - H = FractalWalkRecursiveLex( + H = fractal_walk_recursive_lex( Singular.Ideal(R, [x for x in Gw]), S, T, s, - PVecs, + PertVecs, p + 1, ) global firstStepMode = false end - H = LiftFractalWalk(G, H, R, Rn) + H = lift_fractal_walk(G, H, R, Rn) G = Singular.std(H, complete_reduction = true) R = Rn S = T end return G end -function FractalWalkLookAhead( +function fractal_walk_look_ahead( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - println("FractalWalkLookAhead results") + println("fractal_walk_look_ahead results") println("Crossed Cones in: ") - global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = FractalWalkLookAheadRecursive(G, S, T, PVecs, 1) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = fractal_walk_look_ahead_recursiv(G, S, T, S.w, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end -function FractalWalkLookAheadRecursive( +function fractal_walk_look_ahead_recursiv( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, s::Vector{Int64}, - PVecs::Vector{Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = Singular.base_ring(G) @@ -504,39 +511,39 @@ function FractalWalkLookAheadRecursive( w = s while !terminate - t = NextT(G, cweight, PVecs[p]) + t = nextT(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PVecs[p]) + if inCone(G, T, PertVecs[p]) return G else - global PVecs = [PertubedVector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end end - w = w + t * (PVecs[p] - w) - w = convertBoundingVector(w) + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) T.w = w Rn, V = change_order(R, T) - Gw = Initials(R, Singular.gens(G), w) - if (p == Singular.nvars(R) || IsBinomial(Gw)) + Gw = initials(R, Singular.gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) println(w, " in depth", p) - raiseCounterFr(true) + raiseCounterFr() else println("up in: ", p, " with: ", w) - H = FractalWalkLookAheadRecursive( + H = fractal_walk_look_ahead_recursiv( Singular.Ideal(R, [x for x in Gw]), S, T, s, - PVecs, + PertVecs, p + 1, ) end - H = LiftFractalWalk(G, H, R, Rn) + H = lift_fractal_walk(G, H, R, Rn) G = Singular.std(H, complete_reduction = true) R = Rn S = T @@ -548,27 +555,27 @@ end #Tran-version of the groebner walk by Tran (2002) ############################################################### -function TranWalk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] tweight = T[1, :] - println("Tranwalk results") + println("tran_walk results") println("Crossed Cones in: ") #loop term = false while !term - w = NextWeight(G, cweight, tweight) + w = next_weight(G, cweight, tweight) if w == tweight - if InCone(G, T, cweight) + if inCone(G, T, cweight) return G else - if InSeveralCones(Initials(base_ring(G), gens(G), w)) - tweight = RepresentationVector(G, T) + if inSeveralCones(initials(base_ring(G), gens(G), w)) + tweight = representation_vector(G, T) continue end end end - G = StandardStep(G, w, tweight, T) + G = standard_step(G, w, tweight, T) global counter = getCounter() + 1 println(w) cweight = w diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index dcf2be5e8..c1bfc960d 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -3,7 +3,7 @@ ############################################################### #Return the initials of polynomials w.r.t. a weight vector. -function Initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) +function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) inits = spoly{elem_type(base_ring(R))}[] indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] for g in G @@ -14,7 +14,6 @@ function Initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) tmpw = dot(w, e) if maxw == tmpw push!(indexw, (e, c)) - #rethink this. gens are preordered elseif maxw < tmpw empty!(indexw) push!(indexw, (e, c)) @@ -43,7 +42,7 @@ end #Return the difference of the exponents of the leading terms (Lm) and the #exponent vectors of the tail of all polynomials of the ideal. -function LmMinusV( +function difference_lead_tail( I::Singular.sideal, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} @@ -61,7 +60,7 @@ end #Return the difference of the exponents of the leading terms (Lm) and the #exponent vectors of the tail of all polynomials of the ideal. -function LmMinusV(I::Singular.sideal) +function difference_lead_tail(I::Singular.sideal) v = Vector{Int}[] for g in gens(I) ltu = Singular.leading_exponent_vector(g) @@ -125,7 +124,7 @@ end function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) if length(w) > 2 - if ord == :lex || ord == Symbol("Singular(lp)") + if ord == :lex return [ w' ident_matrix(length(w))[1:length(w)-1, :] @@ -145,14 +144,14 @@ function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) anti_diagonal_matrix(length(w))[1:length(w)-2, :] ] end - if ord == :revlex || a.ord == Symbol("Singular(dp)") + if ord == :revlex return [ w' anti_diagonal_matrix(length(w))[1:length(w)-1, :] ] end else - error("not implemented yet") + error("not implemented") end end @@ -172,7 +171,6 @@ end function ordering_as_matrix(ord::Symbol, nvars::Int64) if ord == :lex - #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] return ident_matrix(nvars) end if ord == :deglex @@ -187,15 +185,17 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) anti_diagonal_matrix(nvars)[1:nvars-1, :] ] end - if ord == :revlex || a.ord == Symbol("Singular(dp)") + if ord == :revlex return [ w' anti_diagonal_matrix(length(w))[1:length(w)-1, :] ] + else + error("not implemented") end end -function PertubedVector( +function pertubed_vector( G::Singular.sideal, Mo::MonomialOrder{Matrix{Int64}}, t::Vector{Int64}, @@ -222,24 +222,22 @@ function PertubedVector( for i = 2:p msum += m[i] end - maxtdeg = 0 + maxdeg = 0 for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td + td = deg(g, n) + if (td > maxdeg) + maxdeg = td end end - e = maxtdeg * msum + 1 + e = maxdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p w += e^(p - i) * M[i, :] end - println(w) - return w end -function PertubedVector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) +function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) m = [] n = size(M)[1] for i = 1:p @@ -256,67 +254,24 @@ function PertubedVector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) for i = 2:p msum += m[i] end - maxtdeg = 0 + maxdeg = 0 for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td + td = deg(g, n) + if (td > maxdeg) + maxdeg = td end end - e = maxtdeg * msum + 1 + e = maxdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p w += e^(p - i) * M[i, :] end - println(w) return w end -function PertubedVector( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - p::Integer, -) - m = [] - if T.t == T.m[1, :] - M = T.m - else - M = insert_weight_vector(T.t, T.m) - end - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxtdeg = 0 - for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td - end - end - e = maxtdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - println(w) - return w -end -function PertubedVector( +function pertubed_vector( G::Singular.sideal, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - mult::Int64, p::Integer, ) m = [] @@ -340,24 +295,22 @@ function PertubedVector( for i = 2:p msum += m[i] end - maxtdeg = 0 + maxdeg = 0 for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td + td = deg(g, n) + if (td > maxdeg) + maxdeg = td end end - #TODO: rethink * mult - e = maxtdeg * msum + 1 + e = maxdeg * msum + 1 w = M[1, :] * e^(p - 1) for i = 2:p w += e^(p - i) * M[i, :] end - println(w) return w end -function tdeg(p::Singular.spoly, n::Int64) +function deg(p::Singular.spoly, n::Int64) max = 0 for mon in Singular.monomials(p) ev = Singular.exponent_vectors(mon) @@ -374,10 +327,10 @@ function tdeg(p::Singular.spoly, n::Int64) return max end -function InCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) +function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) R, V = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(Singular.gens(I), Initials(R, Singular.gens(I), t)) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) return false @@ -386,23 +339,22 @@ function InCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) return true end -function Lift( +function lift( G::Singular.sideal, - InG::Singular.sideal, + Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing, ) G.isGB = true rest = [ gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) for - gen in gens(InG) + gen in gens(Gw) ] - Gnew = Singular.Ideal(S, [S(x) for x in rest]) - Gnew.isGB = true - return Gnew + G = Singular.Ideal(S, [S(x) for x in rest]) + G.isGB = true + return G end - ############################################# # unspecific help functions ############################################# diff --git a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl index 775920e95..f6c14d115 100644 --- a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl @@ -6,7 +6,7 @@ include("GroebnerWalkUtilitysFinal.jl") #Solves problems with weight vectors of floats. -function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int64}() for i = 1:length(wtemp) push!(w, float(divexact(wtemp[i], gcd(wtemp)))) @@ -16,22 +16,21 @@ end #Computes next weight vector. Version used in Cox O´shea and Fukuda et al. #This Version is used by the standard_walk, pertubed_walk and tran_walk. -function NextWeight( +function next_weight( G::Singular.sideal, cweight::Array{T,1}, tweight::Array{K,1}, ) where {T<:Number,K<:Number} tv = [] - for v in LmMinusV(G) + for v in difference_lead_tail(G) cw = dot(cweight, v) tw = dot(tweight, v) if tw < 0 - push!(tv, cw // (cw - tw)) + push!(tv, cw // (cw - tw)) end end push!(tv, 1) - #filter!(x -> numerator(x) != 0, tv) t = minimum(tv) w = (1 - t) * cweight + t * tweight - return convertBoundingVector(w) + return convert_bounding_vector(w) end diff --git a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl index 2813cb28c..d90f90f43 100644 --- a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl @@ -1,7 +1,7 @@ include("GroebnerWalkUtilitysFinal.jl") -function RepresentationVector(G::Singular.sideal, T::Matrix{Int64}) +function representation_vector(G::Singular.sideal, T::Matrix{Int64}) n = size(T)[1] M = 0 for i = 1:n @@ -12,11 +12,10 @@ function RepresentationVector(G::Singular.sideal, T::Matrix{Int64}) end end end - d0 = 0 for g in Singular.gens(G) # println(g, " in tedeg", tdeg(g)) - temp = tdeg(g, n) + temp = deg(g, n) if d0 < temp d0 = temp end @@ -29,16 +28,16 @@ function RepresentationVector(G::Singular.sideal, T::Matrix{Int64}) return w end -function InSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} +function inSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} counter = 0 for g in Gw if size(collect(Singular.coefficients(g)))[1] > 2 return true end if size(collect(Singular.coefficients(g)))[1] == 2 - counter = counter +1 + counter = counter + 1 end -end + end if counter > 1 return true end diff --git a/src/GroebnerWalkFinal/examplesFinal b/src/GroebnerWalkFinal/examplesFinal index 64d439fe2..0ffaf5d48 100644 --- a/src/GroebnerWalkFinal/examplesFinal +++ b/src/GroebnerWalkFinal/examplesFinal @@ -269,7 +269,7 @@ function test(case::Int) I, ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 6), - :generic, + :fractal_look_ahead, ) S, V = Singular.PolynomialRing( Singular.QQ, From e51eb4768ffa78e2ba83a595756cc99039b24d62 Mon Sep 17 00:00:00 2001 From: welpj Date: Sun, 12 Dec 2021 13:43:49 +0100 Subject: [PATCH 34/85] Stable Version --- .../FractalWalkUtilitysFinal.jl | 163 +++++-- src/GroebnerWalkFinal/GWtestFinal.jl | 6 +- .../GenericWalkUtilitysFinal.jl | 67 +-- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 146 ++++--- .../GroebnerWalkUtilitysFinal.jl | 410 ++++++++---------- .../StandardWalkUtilitysFinal.jl | 31 -- .../TranWalkUtilitysFinal.jl | 1 - src/GroebnerWalkFinal/examplesFinal | 140 ++++-- 8 files changed, 545 insertions(+), 419 deletions(-) diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 99ec9bc97..99cd5ac7d 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -1,4 +1,16 @@ include("GroebnerWalkUtilitysFinal.jl") + +#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) +#Maybe not needed +mutable struct MonomialOrder{ + T<:Matrix{Int64}, + v<:Vector{Int64}, + tv<:Vector{Int64}, +} + m::T + w::v + t::tv +end #= @doc Markdown.doc""" convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} @@ -19,14 +31,14 @@ function inCone( T::MonomialOrder{Matrix{Int64},Vector{Int64}}, t::Vector{Int64}, ) -Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. +Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. """=# function inCone( G::Singular.sideal, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, t::Vector{Int64}, ) - R, V = change_order(G.base_ring, T.t, T.m) + R = change_order(G.base_ring, T.t, T.m) I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip @@ -36,33 +48,30 @@ function inCone( end return true end -#return a copy of the PolynomialRing I, equipped with the ordering represented by T. -function change_order( - R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) where {L<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(T.w) * Singular.ordering_M(T.m), - ) -end +#= +@doc Markdown.doc""" function lift_fractal_walk( G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing, +) +Performs a lifting step in the Groebner Walk. See Fukuda et. al. +"""=# +function lift_fractal_walk( + G::Singular.sideal, + Gw::Singular.sideal, + R::Singular.PolyRing, + Rn::Singular.PolyRing, ) G.isGB = true rest = [ - change_ring(gen, S) - - change_ring(Singular.reduce(change_ring(gen, R), G), S) for + change_ring(gen, Rn) - + change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for gen in Singular.gens(Gw) ] - G = Singular.Ideal(S, [S(x) for x in rest]) + G = Singular.Ideal(Rn, [Rn(x) for x in rest]) G.isGB = true return G end @@ -87,13 +96,13 @@ function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} return true end -#Computes next weight vector. Version used in Amrhein Gloor. -function next_weight( + +function nextT( G::Singular.sideal, w::Array{T,1}, tw::Array{K,1}, ) where {T<:Number,K<:Number} - if (w == t) + if (w == tw) return [0] end tmin = 2 @@ -112,39 +121,105 @@ function next_weight( end end if tmin <= 1 - w = w + tmin * (t - w) + return tmin else return [0] end - return convert_bounding_vector(w) end -function nextT( +function change_order( + R::Singular.PolyRing, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) where {L<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(T.w) * Singular.ordering_M(T.m), + ) + return S +end + +function pertubed_vector( G::Singular.sideal, - w::Array{T,1}, - tw::Array{K,1}, -) where {T<:Number,K<:Number} - if (w == tw) - return [0] + Mo::MonomialOrder{Matrix{Int64}}, + t::Vector{Int64}, + p::Integer, +) + if t == Mo.m[1, :] + M = Mo.m + else + M = insert_weight_vector(t, Mo.m) end - tmin = 2 - t = 0 - for g in gens(G) - a = Singular.leading_exponent_vector(g) - d = Singular.exponent_vectors(tail(g)) - for v in d - frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) - if frac != 0 - t = (dot(w, a) - dot(w, v)) // frac - end - if t > 0 && t < tmin - tmin = t + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp end end + push!(m, max) end - if tmin <= 1 - return tmin + msum = 0 + for i = 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + return w +end + +function pertubed_vector( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + p::Integer, +) + m = [] + if T.t == T.m[1, :] + M = T.m else - return [0] + M = insert_weight_vector(T.t, T.m) + end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + return w end diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl index fbb148b24..afab4be7a 100644 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -306,8 +306,9 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal, + :fractal_lex, ) + @time JJ = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), @@ -326,7 +327,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal_lex, + :fractal, ) @time M = groebnerwalk( I, @@ -336,6 +337,7 @@ function test(case::Int) ) + S, V = Singular.PolynomialRing( Singular.QQ, ["q", "c", "p", "d"], diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 5274c41e0..13f2499d3 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -6,15 +6,15 @@ include("GroebnerWalkUtilitysFinal.jl") #Return the facet_facet_facet_initials of polynomials w.r.t. a weight vector. function facet_initials( - R::Singular.PolyRing, G::Singular.sideal, - v::Vector{Int64}, lm::Vector{spoly{L}}, + v::Vector{Int64}, ) where {L<:Nemo.RingElem} - initials = [] + Rn = base_ring(G) + initials = Array{Singular.elem_type(Rn),1}(undef, 0) count = 1 for g in Singular.gens(G) - inw = Singular.MPolyBuildCtx(R) + inw = Singular.MPolyBuildCtx(Rn) el = first(Singular.exponent_vectors(lm[count])) for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) @@ -29,6 +29,24 @@ function facet_initials( return initials end +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. +function difference_lead_tail( + I::Singular.sideal, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + v = Vector{Int}[] + for i = 1:ngens(I) + ltu = Singular.leading_exponent_vector(Lm[i]) + for e in Singular.exponent_vectors(gens(I)[i]) + if ltu != e + push!(v, ltu .- e) + end + end + end + return unique!(v) +end + # function isParallel(u::Vector{Int64}, v::Vector{Int64}) count = 1 @@ -63,18 +81,18 @@ function lift_generic( Lm::Vector{Singular.spoly{L}}, H::Singular.sideal, ) where {L<:Nemo.RingElem} - S = base_ring(G) - Newlm = Array{Singular.elem_type(S),1}(undef, 0) - liftPolys = Array{Singular.elem_type(S),1}(undef, 0) + Rn = base_ring(G) + Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) + liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) for g in Singular.gens(H) - r, b = reduce_recursive(g, gens(G), Lm, S) + r, b = modulo(g, gens(G), Lm) diff = g - r if diff != 0 push!(Newlm, Singular.leading_term(g)) push!(liftPolys, diff) end end - return liftPolys, Newlm, S + return liftPolys, Newlm end function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) @@ -203,7 +221,7 @@ function less_facet( end #returns divrem() -function divrem(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) +function divremGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) div = false newpoly = Singular.MPolyBuildCtx(S) for term in Singular.terms(p) @@ -220,17 +238,17 @@ function divrem(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) return (finish(newpoly), div) end -function reduce_recursive( +function modulo( p::Singular.spoly, G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, - R::Singular.PolyRing, c::Bool = false, ) where {L<:Nemo.RingElem} I = 0 + R = parent(p) Q = zero(R) for i = 1:length(G) - (q, b) = divrem(p, Lm[i], R) + (q, b) = divremGW(p, Lm[i], R) if b I = i Q = q @@ -238,7 +256,7 @@ function reduce_recursive( end end if I != 0 - r, b = reduce_recursive(p - (Q * G[I]), G, Lm, R) + r, b = modulo(p - (Q * G[I]), G, Lm) return r, true else return p, false @@ -246,30 +264,29 @@ function reduce_recursive( end function interreduce( - G::Singular.sideal, + G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} - R = Singular.base_ring(G) - gens = collect(Singular.gens(G)) + Rn = parent(first(G)) changed = true while changed changed = false - for i = 1:Singular.ngens(G) - gensrest = Array{Singular.elem_type(R),1}(undef, 0) - Lmrest = Array{Singular.elem_type(R),1}(undef, 0) - for j = 1:Singular.ngens(G) + for i = 1:Singular.length(G) + gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) + Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) + for j = 1:length(G) if i != j - push!(gensrest, gens[j]) + push!(gensrest, G[j]) push!(Lmrest, Lm[j]) end end - r, b = reduce_recursive(gens[i], gensrest, Lmrest, R) + r, b = modulo(G[i], gensrest, Lmrest) if b changed = true - gens[i] = r + G[i] = r break end end end - return Singular.Ideal(R, [R(p) for p in gens]) + return G end diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index cc495121b..72d8448e3 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -99,7 +99,7 @@ function groebnerwalk( Gb = walk(I, S, T) println("Cones crossed: ", getCounter()) - S, V = change_order(Gb.base_ring, T) + S = change_order(Gb.base_ring, T) return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end @@ -117,16 +117,19 @@ function standard_walk( cweight::Vector{Int64}, tweight::Vector{Int64}, ) - #loop + R = base_ring(G) + Rn = change_order(R, cweight, T) terminate = false while !terminate - G = standard_step(G, cweight, tweight, T) + G = standard_step(G, R, cweight, Rn) println(cweight) global counter = getCounter() + 1 if cweight == tweight terminate = true else cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) end end return G @@ -134,22 +137,18 @@ end function standard_step( G::Singular.sideal, + R::Singular.PolyRing, cw::Vector{Int64}, - tw::Vector{Int64}, - T::Matrix{Int64}, + Rn::Singular.PolyRing ) - R = base_ring(G) - S, V = change_order(R, cw, T) - - Gw = initials(S, gens(G), cw) - + Gw = initials(Rn, gens(G), cw) H = Singular.std( - Singular.Ideal(S, [S(x) for x in Gw]), + Singular.Ideal(Rn, Gw), complete_reduction = true, ) - - G = lift(G, H, R, S) - return Singular.std(G, complete_reduction = true) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + return Singular.std(H, complete_reduction = true) end ############################################################### @@ -157,18 +156,18 @@ end ############################################################### function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R, V = change_order(G.base_ring, T) - + R = base_ring(G) + Rn = change_order(G.base_ring, T) v = next_gamma(G, [0], S, T) - Lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) println("generic_walk results") println("Crossed Cones with facetNormal: ") while !isempty(v) global counter = getCounter() + 1 println(v) - G, Lm = generic_step(G, R, v, T, Lm) + G, Lm = generic_step(G, Lm, v, T,R) v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) @@ -176,23 +175,22 @@ end function generic_step( G::Singular.sideal, - S::Singular.PolyRing, + Lm::Vector{Singular.spoly{L}}, v::Vector{Int64}, T::Matrix{Int64}, - Lm::Vector{Singular.spoly{L}}, + R::Singular.PolyRing ) where {L<:Nemo.RingElem} - R = Singular.base_ring(G) + Rn = Singular.base_ring(G) - facet_Generators = facet_initials(S, G, v, Lm) + facet_Generators = facet_initials(G,Lm, v) H = Singular.std( - Singular.Ideal(S, [S(x) for x in facet_Generators]), + Singular.Ideal(Rn, facet_Generators), complete_reduction = true, ) H, Lm = lift_generic(G, Lm, H) - G = Singular.Ideal(S, [x for x in H]) - G = interreduce(G, Lm) - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + G = interreduce(H, Lm) + G = Singular.Ideal(Rn, G) G.isGB = true return G, Lm end @@ -207,26 +205,26 @@ function pertubed_walk( T::Matrix{Int64}, p::Int64, ) - #sweight = pert_Vectors(G, S, p) - sweight = S[1, :] + #cweight = pert_Vectors(G, S, p) + cweight = S[1, :] terminate = false println("pertubed_walk results") println("Crossed Cones in: ") while !terminate tweight = pertubed_vector(G, T, p) - G = standard_walk(G, S, T, sweight, tweight) + G = standard_walk(G, S, T, cweight, tweight) if inCone(G, T, tweight) terminate = true else if p == 1 - R, V = change_order(G.base_ring, T) + R = change_order(G.base_ring, T) G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) G = Singular.std(G, complete_reduction = true) - term = true + terminate = true end p = p - 1 - sweight = tweight + cweight = tweight end end return G @@ -267,9 +265,10 @@ function fractal_walk( T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println(PertVecs) println("FacrtalWalk_standard results") println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S, T, S.w, PertVecs, 1) + Gb = fractal_recursiv(G, S,T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -278,20 +277,18 @@ function fractal_recursiv( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - s::Vector{Int64}, PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = base_ring(G) terminate = false G.isGB = true - w = s + w = S.w while !terminate - #w = nextW_2(G, cweight, PertVecs[p]) t = nextT(G, w, PertVecs[p]) if (t == [0]) - if inCone(G, T, PertVecs[p]) + if inCone(G, T,PertVecs[p]) return G else global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] @@ -301,8 +298,8 @@ function fractal_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w - Rn, V = change_order(R, T) - Gw = initials(R, gens(G), w) + Rn = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) if p == nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -316,15 +313,14 @@ function fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), S, T, - s, PertVecs, p + 1, ) end - H = lift_fractal_walk(G, H, R, Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S = T end return G end @@ -345,7 +341,7 @@ function fractal_walk_start_order( global sigma = S.w println("fractal_walk_withStartorder results") println("Crossed Cones in: ") - Gb = fractal_walk_recursiv_startorder(G, S, T, S.w, PertVecs, 1) + Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -354,7 +350,6 @@ function fractal_walk_recursiv_startorder( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - s::Vector{Int64}, PertVecs::Vector{Vector{Int64}}, p::Int64, ) @@ -370,7 +365,7 @@ function fractal_walk_recursiv_startorder( if firstStepMode w = cwPert[p] else - w = s + w = S.w end while !terminate @@ -387,7 +382,7 @@ function fractal_walk_recursiv_startorder( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w - Rn, V = change_order(R, T) + Rn = change_order(R, T) Gw = initials(R, gens(G), w) if p == Singular.nvars(R) H = Singular.std( @@ -403,16 +398,15 @@ function fractal_walk_recursiv_startorder( Singular.Ideal(R, [x for x in Gw]), S, T, - s, PertVecs, p + 1, ) global firstStepMode = false end - H = lift_fractal_walk(G, H, R, Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S = T end return G end @@ -424,7 +418,7 @@ function fractal_walk_lex( global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println("fractal_walk_lex results") println("Crossed Cones in: ") - Gb = fractal_walk_recursive_lex(G, S, T, S.w, PertVecs, 1) + Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -433,14 +427,13 @@ function fractal_walk_recursive_lex( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - s::Vector{Int64}, PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = Singular.base_ring(G) terminate = false G.isGB = true - w = s + w = S.w while !terminate t = nextT(G, w, PertVecs[p]) if t == [0] @@ -449,13 +442,23 @@ function fractal_walk_recursive_lex( else global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] + println(PertVecs) continue end end + if t == 1 && p==1 + return fractal_walk_recursive_lex( + G, + S, + T, + PertVecs, + p + 1, + ) + else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w - Rn, V = change_order(R, T) + Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) H = Singular.std( @@ -466,21 +469,20 @@ function fractal_walk_recursive_lex( raiseCounterFr() else println("up in: ", p, " with: ", w) - H = fractal_walk_recursive_lex( Singular.Ideal(R, [x for x in Gw]), S, T, - s, PertVecs, p + 1, ) global firstStepMode = false end - H = lift_fractal_walk(G, H, R, Rn) + end + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S = T end return G end @@ -492,7 +494,7 @@ function fractal_walk_look_ahead( println("fractal_walk_look_ahead results") println("Crossed Cones in: ") global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv(G, S, T, S.w, PertVecs, 1) + Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -501,14 +503,13 @@ function fractal_walk_look_ahead_recursiv( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - s::Vector{Int64}, PertVecs::Vector{Vector{Int64}}, p::Int64, ) R = Singular.base_ring(G) terminate = false G.isGB = true - w = s + w = S.w while !terminate t = nextT(G, w, PertVecs[p]) @@ -523,7 +524,7 @@ function fractal_walk_look_ahead_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w - Rn, V = change_order(R, T) + Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( @@ -535,18 +536,18 @@ function fractal_walk_look_ahead_recursiv( else println("up in: ", p, " with: ", w) H = fractal_walk_look_ahead_recursiv( - Singular.Ideal(R, [x for x in Gw]), + Singular.Ideal(R, Gw), S, T, - s, PertVecs, p + 1, ) end - H = lift_fractal_walk(G, H, R, Rn) + + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S = T end return G end @@ -560,11 +561,15 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) tweight = T[1, :] println("tran_walk results") println("Crossed Cones in: ") + R = base_ring(G) + if !isMonomial(initials(R, Singular.gens(G), cweight)) + cweight = pertubed_vector(G, S, nvars(R)) + end - #loop - term = false - while !term + terminate = false + while !terminate w = next_weight(G, cweight, tweight) + Rn= change_order(R, w, T) if w == tweight if inCone(G, T, cweight) return G @@ -575,9 +580,10 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) end end end - G = standard_step(G, w, tweight, T) + G = standard_step(G, R, w, Rn) global counter = getCounter() + 1 println(w) + R = Rn cweight = w end end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index c1bfc960d..e307f7cb6 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -2,6 +2,27 @@ #Utilitys for Groebnerwalks ############################################################### +#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. +#This Version is used by the standard_walk, pertubed_walk and tran_walk. +function next_weight( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + tv = [] + for v in difference_lead_tail(G) + cw = dot(cweight, v) + tw = dot(tweight, v) + if tw < 0 + push!(tv, cw // (cw - tw)) + end + end + push!(tv, 1) + t = minimum(tv) + w = (1 - t) * cweight + t * tweight + return convert_bounding_vector(w) +end + #Return the initials of polynomials w.r.t. a weight vector. function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) inits = spoly{elem_type(base_ring(R))}[] @@ -29,34 +50,6 @@ function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) end return inits end -#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) -mutable struct MonomialOrder{ - T<:Matrix{Int64}, - v<:Vector{Int64}, - tv<:Vector{Int64}, -} - m::T - w::v - t::tv -end - -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. -function difference_lead_tail( - I::Singular.sideal, - Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} - v = Vector{Int}[] - for i = 1:ngens(I) - ltu = Singular.leading_exponent_vector(Lm[i]) - for e in Singular.exponent_vectors(gens(I)[i]) - if ltu != e - push!(v, ltu .- e) - end - end - end - return unique!(v) -end #Return the difference of the exponents of the leading terms (Lm) and the #exponent vectors of the tail of all polynomials of the ideal. @@ -71,6 +64,128 @@ function difference_lead_tail(I::Singular.sideal) return unique!(v) end +function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + return w +end + +function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) + R = change_order(G.base_ring, T) + I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end +#Fukuda et al +function lift( + G::Singular.sideal, + R::Singular.PolyRing, + H::Singular.sideal, + Rn::Singular.PolyRing +) + G.isGB = true + rest = [ + gen - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for + gen in gens(H) + ] + G = Singular.Ideal(Rn, [Rn(x) for x in rest]) + G.isGB = true + return G +end +#Amrhein & Gloor +function liftGW2( + G::Singular.sideal, + R::Singular.PolyRing, + inG::Vector{spoly{L}}, + H::Singular.sideal, + Rn::Singular.PolyRing +) where {L<:Nemo.RingElem} + + gH = collect(gens(H)) + gG = collect(gens(G)) + s = length(inG) + for i = 1:length(gH) + q = divalg(change_ring(gH[i], R), [change_ring(x, R) for x in inG], R) + gH[i] = R(0) + for j = 1:s + gH[i] = change_ring(gH[i], R) + q[j] * gG[j] + end + end + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gH]) + G.isGB = true + return G +end + +function divalg( + p::spoly{L}, + f::Vector{spoly{L}}, + R::Singular.PolyRing, +) where {L<:Nemo.RingElem} + s = length(f) + q = Array{Singular.elem_type(R),1}(undef, s) + for i = 1:s + q[i] = R(0) + end + while !isequal(p, R(0)) + i = 1 + div = false + while (div == false && i <= s) + b, m = divides(leading_term(p), leading_term(f[i])) + if b + q[i] = q[i] + m + p = p - (m * f[i]) + div = true + else + i = i + 1 + end + end + if div == false + p = p - leading_term(p) + end + end + return q +end + +#Solves problems with weight vectors of floats. +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + #return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) function change_order( R::Singular.PolyRing, @@ -85,7 +200,7 @@ function change_order( ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), cached = false, ) - return S, H + return S end #return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) @@ -102,7 +217,7 @@ function change_order( cached = false, ) #@error("Not implemented yet") - return S, H + return S end function change_ring(p::Singular.spoly, R::Singular.PolyRing) @@ -122,6 +237,53 @@ function change_ring(p::Singular.spoly, R::Singular.PolyRing) return finish(M) end + +############################################# +# unspecific help functions +############################################# + +function ident_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end + +# Singular.isequal depends on order of generators +function equalitytest(G::Singular.sideal, K::Singular.sideal) + generators = Singular.gens(G) + count = 0 + for gen in generators + for r in Singular.gens(K) + if gen - r == 0 + count += 1 + end + end + end + if count == Singular.ngens(G) + return true + end + return false +end + +function dot(v::Vector{Int64}, w::Vector{Int64}) + n = length(v) + sum = 0 + for i = 1:n + sum += v[i] * w[i] + end + return sum +end + function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) if length(w) > 2 if ord == :lex @@ -195,120 +357,6 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) end end -function pertubed_vector( - G::Singular.sideal, - Mo::MonomialOrder{Matrix{Int64}}, - t::Vector{Int64}, - p::Integer, -) - if t == Mo.m[1, :] - M = Mo.m - else - M = insert_weight_vector(t, Mo.m) - end - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - return w -end - -function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - return w -end - -function pertubed_vector( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - p::Integer, -) - m = [] - if T.t == T.m[1, :] - M = T.m - else - M = insert_weight_vector(T.t, T.m) - end - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - return w -end function deg(p::Singular.spoly, n::Int64) max = 0 @@ -326,77 +374,3 @@ function deg(p::Singular.spoly, n::Int64) end return max end - -function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) - R, V = change_order(G.base_ring, T) - I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end - -function lift( - G::Singular.sideal, - Gw::Singular.sideal, - R::Singular.PolyRing, - S::Singular.PolyRing, -) - G.isGB = true - rest = [ - gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) for - gen in gens(Gw) - ] - G = Singular.Ideal(S, [S(x) for x in rest]) - G.isGB = true - return G -end - -############################################# -# unspecific help functions -############################################# - -function ident_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, n+1-i] = -1 - end - return M -end - -# Singular.isequal depends on order of generators -function equalitytest(G::Singular.sideal, K::Singular.sideal) - generators = Singular.gens(G) - count = 0 - for gen in generators - for r in Singular.gens(K) - if gen - r == 0 - count += 1 - end - end - end - if count == Singular.ngens(G) - return true - end - return false -end - -function dot(v::Vector{Int64}, w::Vector{Int64}) - n = length(v) - sum = 0 - for i = 1:n - sum += v[i] * w[i] - end - return sum -end diff --git a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl index f6c14d115..97e90e9d4 100644 --- a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl @@ -3,34 +3,3 @@ include("GroebnerWalkUtilitysFinal.jl") ############################################################### #Utilitys for standard_walk ############################################################### - - -#Solves problems with weight vectors of floats. -function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int64}() - for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) - end - return w -end - -#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. -#This Version is used by the standard_walk, pertubed_walk and tran_walk. -function next_weight( - G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} - tv = [] - for v in difference_lead_tail(G) - cw = dot(cweight, v) - tw = dot(tweight, v) - if tw < 0 - push!(tv, cw // (cw - tw)) - end - end - push!(tv, 1) - t = minimum(tv) - w = (1 - t) * cweight + t * tweight - return convert_bounding_vector(w) -end diff --git a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl index d90f90f43..d85d13e0a 100644 --- a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl @@ -14,7 +14,6 @@ function representation_vector(G::Singular.sideal, T::Matrix{Int64}) end d0 = 0 for g in Singular.gens(G) - # println(g, " in tedeg", tdeg(g)) temp = deg(g, n) if d0 < temp d0 = temp diff --git a/src/GroebnerWalkFinal/examplesFinal b/src/GroebnerWalkFinal/examplesFinal index 0ffaf5d48..0f452631a 100644 --- a/src/GroebnerWalkFinal/examplesFinal +++ b/src/GroebnerWalkFinal/examplesFinal @@ -21,17 +21,17 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), - :standard, + :tran, ) + + @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test tran: ", equalitytest(T0, T6)) - if !(equalitytest(T6, T0)) test_successfull = false end @@ -48,6 +48,8 @@ function test(case::Int) ), ) + + f1 = x^2 - y f2 = y^2 - x * z - y * z I = Singular.Ideal(R, [f1, f2]) @@ -57,7 +59,8 @@ function test(case::Int) I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), - :tran, + :fractal, + 3, ) S, V = Singular.PolynomialRing( @@ -66,7 +69,6 @@ function test(case::Int) ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), ) - T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, @@ -76,8 +78,6 @@ function test(case::Int) println("test tran: ", equalitytest(T0, T6)) - - if !(equalitytest(T0, T6)) test_successfull = false end @@ -102,9 +102,10 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :standard, + :fractal, ) + S, V = Singular.PolynomialRing( Singular.QQ, ["x", "y", "z", "u", "v", "w"], @@ -117,9 +118,7 @@ function test(case::Int) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - println("test tran: ", equalitytest(T0, T6)) - - + println("test tran: ", Singular.equal(T0, T6)) if !(Singular.equal(T0, T6)) test_successfull = false end @@ -131,8 +130,6 @@ function test(case::Int) ["q", "c", "p", "d"], ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), ) - - f1 = 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + @@ -164,7 +161,8 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :tran, + :fractal, + 3 ) @@ -182,13 +180,10 @@ function test(case::Int) println("test tran: ", equalitytest(T0, T6)) - - if !(equalitytest(T6, T0)) test_successfull = false end end - if case == 5 || case == 99 R, (x, y, z) = Singular.PolynomialRing( Singular.QQ, @@ -214,12 +209,12 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - :standard, + :fractal, + 2, ) T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, @@ -228,8 +223,6 @@ function test(case::Int) println("test tran: ", equalitytest(T0, T6)) - - if !(Singular.equal(T0, T6)) test_successfull = false end @@ -248,8 +241,8 @@ function test(case::Int) ) f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = x * y + y * z + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * x * z + 2 * y * t + 2 * z * u + u^2 + 2 * t * v - t + f2 = 2*x * y +2* y * z + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * x * z + 2 * y * t + 2 * z * u +2* u^2 + 2 * t * v - t f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 @@ -264,27 +257,118 @@ function test(case::Int) :pertubed, 5, ) - @time J = groebnerwalk( I, ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 6), - :fractal_look_ahead, + :fractal, + 5, ) + S, V = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y", "x"], ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), ) - T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) println("test standard: ", equalitytest(T0, T6)) - if !(isequal(T6, T0)) test_successfull = false end end - println("All tests were: ", test_successfull) + + +if case == 7 || case == 99 + R, (v, u, t, z, y) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y"], + ordering = Singular.ordering_M( + ordering_as_matrix([1, 1, 1, 1, 1], :lex), + ), + ) + + f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v + f2 = 2*z*y + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * y * t + 2 * z * u + 2*u^2 + 2 * t * v - t + f4 = 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1], :lex), + ordering_as_matrix(:lex, 5), + :pertubed, + 5, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1], :lex), + ordering_as_matrix(:lex, 5), + :fractal_lex, + 5, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 5)), + ) + T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + if !(isequal(T6, T0)) + test_successfull = false + end +end + +if case == 8 || case == 99 + + #cyclic 9 + R, (z0,z1,z2, z3, z4, z5, z6, z7, z8) = Singular.PolynomialRing( + Singular.QQ, + ["z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], + ordering = Singular.ordering_M( + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1], :lex), + ), + ) + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5,f6,f7,f8,f9]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1], :lex), + ordering_as_matrix(:lex, 9), + :pertubed, + 5, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), + ordering_as_matrix(:lex, 9), + :fractal_lex, + 5, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 9)), + ) + T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + if !(isequal(T6, T0)) + test_successfull = false + end +end + +println("All tests were: ", test_successfull) end From 717753fdb013aa96ac530df5fd215f2d3b4d02db Mon Sep 17 00:00:00 2001 From: welpj Date: Sun, 12 Dec 2021 13:58:09 +0100 Subject: [PATCH 35/85] Refactor --- src/GroebnerWalkFinal/GWtestFinal.jl | 154 +++++++++++++-------------- 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl index afab4be7a..f1e9b0729 100644 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -19,38 +19,38 @@ function test(case::Int) S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) - @time H = groebnerwalk( + @time T = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :tran, ) - @time J = groebnerwalk( + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :fractal, ) - @time JJ = groebnerwalk( + @time FA = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :fractal_look_ahead, ) - @time L = groebnerwalk( + @time St = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :standard, ) - @time K = groebnerwalk( + @time Pe = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), :pertubed, 2, ) - @time M = groebnerwalk( + @time Ge = groebnerwalk( I, ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), @@ -60,19 +60,19 @@ function test(case::Int) Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - println("test tran: ", equalitytest(T0, T6)) - println("test fractal: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) if !( equalitytest(T2, T1) && @@ -97,38 +97,38 @@ function test(case::Int) I = Singular.Ideal(R, [f1, f2]) I = Singular.std(I, complete_reduction = true) - @time H = groebnerwalk( + @time T = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), :tran, ) - @time J = groebnerwalk( + @time F = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), :fractal, ) - @time JJ = groebnerwalk( + @time FA = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), :fractal_look_ahead, ) - @time K = groebnerwalk( + @time Pe = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), :pertubed, 3, ) - @time L = groebnerwalk( + @time St = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), :standard, ) - @time M = groebnerwalk( + @time Ge = groebnerwalk( I, ordering_as_matrix([5, 4, 1], :deglex), ordering_as_matrix([6, 1, 3], :lex), @@ -145,20 +145,19 @@ function test(case::Int) Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) - + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) if !( equalitytest(T2, T1) && equalitytest(T3, T4) && @@ -296,40 +295,40 @@ function test(case::Int) I = Singular.Ideal(R, [f1, f2, f3, f4]) I = Singular.std(I, complete_reduction = true) - @time H = groebnerwalk( + @time T = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), :tran, ) - @time J = groebnerwalk( + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), :fractal_lex, ) - - @time JJ = groebnerwalk( + + @time Fa = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), :fractal_look_ahead, ) - @time K = groebnerwalk( + @time Pe = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), :pertubed, 4, ) - @time L = groebnerwalk( + @time St = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal, + :standard, ) - @time M = groebnerwalk( + @time Ge = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), @@ -347,20 +346,19 @@ function test(case::Int) Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal: ", equalitytest(T0, T1)) - println("test fractal2: ", equalitytest(T0, T5)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", Singular.equal(T4, T0)) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Fa)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) if !( equalitytest(T2, T1) && @@ -391,63 +389,63 @@ function test(case::Int) ordering = :lex, ) - @time H = groebnerwalk( + @time T = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), :tran, ) - @time J = groebnerwalk( + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), :fractal, ) - @time JJ = groebnerwalk( + @time FA = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), :fractal_look_ahead, ) - @time L = groebnerwalk( + @time St = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - :fractal_lex, + :standard, ) - @time K = groebnerwalk( + @time Pe = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), :pertubed, 3, ) - @time M = groebnerwalk( + @time Ge = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), :generic, ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", Singular.equal(T4, T0)) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) if !( equalitytest(T2, T1) && equalitytest(T3, T6) && From 80f2e5bf8f5eadbe5c5978fe06b5ea420245da44 Mon Sep 17 00:00:00 2001 From: welpj Date: Tue, 14 Dec 2021 11:44:02 +0100 Subject: [PATCH 36/85] fixing algorithm --- src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl | 6 ------ src/GroebnerWalkFinal/{examplesFinal => examplesFinal.jl} | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) rename src/GroebnerWalkFinal/{examplesFinal => examplesFinal.jl} (99%) diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 13f2499d3..67cbcc5e9 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -268,9 +268,6 @@ function interreduce( Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} Rn = parent(first(G)) - changed = true - while changed - changed = false for i = 1:Singular.length(G) gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) @@ -282,11 +279,8 @@ function interreduce( end r, b = modulo(G[i], gensrest, Lmrest) if b - changed = true G[i] = r - break end - end end return G end diff --git a/src/GroebnerWalkFinal/examplesFinal b/src/GroebnerWalkFinal/examplesFinal.jl similarity index 99% rename from src/GroebnerWalkFinal/examplesFinal rename to src/GroebnerWalkFinal/examplesFinal.jl index 0f452631a..79ad465f7 100644 --- a/src/GroebnerWalkFinal/examplesFinal +++ b/src/GroebnerWalkFinal/examplesFinal.jl @@ -261,7 +261,7 @@ function test(case::Int) I, ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 6), - :fractal, + :generic, 5, ) @@ -303,13 +303,13 @@ if case == 7 || case == 99 ordering_as_matrix([1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 5), :pertubed, - 5, + 4, ) @time J = groebnerwalk( I, ordering_as_matrix([1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 5), - :fractal_lex, + :tran, 5, ) From 2180410dab57ce4de640ed02ce7e5e3c330bcce5 Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 16 Dec 2021 15:41:57 +0100 Subject: [PATCH 37/85] - --- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 6 +- src/GroebnerWalkFinal/examplesFinal.jl | 96 ++++++++++++++++++---- 2 files changed, 85 insertions(+), 17 deletions(-) diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 72d8448e3..f2bd5e675 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -205,7 +205,7 @@ function pertubed_walk( T::Matrix{Int64}, p::Int64, ) - #cweight = pert_Vectors(G, S, p) + #cweight = pertubed_vector(G, S, p) cweight = S[1, :] terminate = false println("pertubed_walk results") @@ -569,6 +569,10 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) + if tryparse(string(w), Int32) == nothing + println("w bigger than int32") + return G + end Rn= change_order(R, w, T) if w == tweight if inCone(G, T, cweight) diff --git a/src/GroebnerWalkFinal/examplesFinal.jl b/src/GroebnerWalkFinal/examplesFinal.jl index 79ad465f7..e73046f0e 100644 --- a/src/GroebnerWalkFinal/examplesFinal.jl +++ b/src/GroebnerWalkFinal/examplesFinal.jl @@ -161,7 +161,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal, + :generic, 3 ) @@ -281,6 +281,7 @@ function test(case::Int) if case == 7 || case == 99 + #Katsura 5 R, (v, u, t, z, y) = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y"], @@ -302,17 +303,18 @@ if case == 7 || case == 99 I, ordering_as_matrix([1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 5), - :pertubed, - 4, + :fractal_lex, + 5, ) @time J = groebnerwalk( I, ordering_as_matrix([1, 1, 1, 1, 1], :lex), ordering_as_matrix(:lex, 5), - :tran, + :fractal_look_ahead, 5, ) + S, V = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y"], @@ -329,37 +331,46 @@ end if case == 8 || case == 99 - #cyclic 9 - R, (z0,z1,z2, z3, z4, z5, z6, z7, z8) = Singular.PolynomialRing( + #Katsura 7 + R, (x1,x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( Singular.QQ, - ["z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], + ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], ordering = Singular.ordering_M( - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1], :lex), + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), ), ) - I = Singular.Ideal(R, [f1, f2, f3, f4, f5,f6,f7,f8,f9]) + f1=-x1+2*x8^2+2*x7^2+2*x6^2+2*x5^2+2*x4^2+2*x3^2+2*x2^2+x1^2 + f2=-x2+2*x8*x7+2*x7*x6+2*x6*x5+2*x5*x4+2*x4*x3+2*x3*x2+2*x2*x1 + f3= -x3+2*x8*x6+2*x7*x5+2*x6*x4+2*x5*x3+2*x4*x2+2*x3*x1+x2^2 + f4= -x4+2*x8*x5+2*x7*x4+2*x6*x3+2*x5*x2+2*x4*x1+2*x3*x2 + f5= -x5+2*x8*x4+2*x7*x3+2*x6*x2+2*x5*x1+2*x4*x2+x3^2 + f6=-x6+2*x8*x3+2*x7*x2+2*x6*x1+2*x5*x2+2*x4*x3 + f7=-x7+2*x8*x2+2*x7*x1+2*x6*x2+2*x5*x3+x4^2 + f8=-1+2*x8+2*x7+2*x6+2*x5+2*x4+2*x3+2*x2+x1 + I = Singular.Ideal(R, [f1, f2, f3, f4, f5,f6,f7,f8]) I = Singular.std(I, complete_reduction = true) @time H = groebnerwalk( I, - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1], :lex), - ordering_as_matrix(:lex, 9), - :pertubed, + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), + ordering_as_matrix(:lex, 8), + :generic, 5, ) @time J = groebnerwalk( I, ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), - ordering_as_matrix(:lex, 9), - :fractal_lex, + ordering_as_matrix(:lex, 8), + :generic, 5, ) + S, V = Singular.PolynomialRing( Singular.QQ, - ["z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 9)), + ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 8)), ) T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) @@ -370,5 +381,58 @@ if case == 8 || case == 99 end end +if case == 9 || case == 99 + + #eco10 + R, (x0,x1,x2, x3, x4, x5, x6, x7, x8, x9) = Singular.PolynomialRing( + Singular.QQ, + ["x0","x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9"], + ordering = Singular.ordering_M( + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1,1], :lex), + ), + ) + + f1=x0*x1*x9+x1*x2*x9+x2*x3*x9+x3*x4*x9+x4*x5*x9+x5*x6*x9+x6*x7*x9+x7*x8*x9+x0*x9-1 + f2=x0*x2*x9+x1*x3*x9+x2*x4*x9+x3*x5*x9+x4*x6*x9+x5*x7*x9+x6*x8*x9+x1*x9-2 + f3=x0*x3*x9+x1*x4*x9+x2*x5*x9+x3*x6*x9+x4*x7*x9+x5*x8*x9+x2*x9-3 + f4=x0*x4*x9+x1*x5*x9+x2*x6*x9+x3*x7*x9+x4*x8*x9+x3*x9-4 + f5=x0*x5*x9+x1*x6*x9+x2*x7*x9+x3*x8*x9+x4*x9-5 + f6=x0*x6*x9+x1*x7*x9+x2*x8*x9+x5*x9-6 + f7=x0*x7*x9+x1*x8*x9+x6*x9-7 + f8=x0*x8*x9+x7*x9-8 + f9=x8*x9-9 + f10=x0+x1+x2+x3+x4+x5+x6+x7+x8+1 + I = Singular.Ideal(R, [f1, f2, f3, f4, f5,f6,f7,f8,f9,f10]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1,1], :lex), + ordering_as_matrix(:lex, 10), + :generic, + 5, + ) + @time J = groebnerwalk( + I, + ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1,1], :lex), + ordering_as_matrix(:lex, 10), + :generic, + 5, + ) + + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x0","x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 10)), + ) + T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + if !(isequal(T6, T0)) + test_successfull = false + end +end println("All tests were: ", test_successfull) end From 6975abfc781ae24dfd9c041b8cb867e94169822e Mon Sep 17 00:00:00 2001 From: welpj Date: Fri, 17 Dec 2021 17:56:54 +0100 Subject: [PATCH 38/85] feat:combined fractalwalk --- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 94 +++++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index f2bd5e675..dc98e7b17 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -83,9 +83,9 @@ function groebnerwalk( ) elseif grwalktype == :tran walk = (x, y, z) -> tran_walk(x, y, z) - elseif grwalktype == :alternative + elseif grwalktype == :fractal_combined walk = - (x, y, z) -> alternative_algorithm_top( + (x, y, z) -> fractal_combined( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), @@ -552,6 +552,96 @@ function fractal_walk_look_ahead_recursiv( return G end + + + +function fractal_walk_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + println("fractal_walk_withStartorder results") + println("Crossed Cones in: ") + Gb = fractal_walk_combined(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + while !terminate + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + println(PertVecs[p], " in depth", p) + return G + else + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + if t == 1 && p==1 + return fractal_walk_combined( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + Rn = change_order(R, T) + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + H = fractal_walk_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + end + return G +end ############################################################### #Tran-version of the groebner walk by Tran (2002) ############################################################### From da429b9b13537bfa351fd11aa6d590f397daed66 Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 27 Dec 2021 12:32:57 +0100 Subject: [PATCH 39/85] Benchmarking-Tools --- .../Benchmarking/BspEinzeln.jl | 86 + src/GroebnerWalkFinal/Benchmarking/BspVar4.jl | 3439 +++++++++ src/GroebnerWalkFinal/Benchmarking/BspVar5.jl | 6613 +++++++++++++++++ src/GroebnerWalkFinal/Benchmarking/BspVar6.jl | 4334 +++++++++++ .../FractalWalkUtilitysFinal.jl | 225 + .../GenericWalkUtilitysFinal.jl | 286 + .../GroebnerWalkFinalBenchmarkProcedures.jl | 942 +++ .../GroebnerWalkUtilitysFinal.jl | 376 + .../StandardWalkUtilitysFinal.jl | 5 + .../TranWalkUtilitysFinal.jl | 44 + src/GroebnerWalkFinal/Benchmarking/parser.jl | 49 + .../Benchmarking/readWriteHelper.jl | 55 + .../Benchmarking/runbenchmark.jl | 286 + 13 files changed, 16740 insertions(+) create mode 100644 src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar4.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar5.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar6.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/parser.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl new file mode 100644 index 000000000..9f7520db4 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -0,0 +1,86 @@ +include("src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("benchi.jl") +include("parser.jl") +include("runbenchmark.jl") + + +using DataFrames +using CSV +function runAllSingleExample() + cd("/Users/JordiWelp/Results") +#Katsura 5 + dim = 5 + ve = [1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (v,u,t,z,y) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + ideals= [] + + f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v + f2 = 2*z*y + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * y * t + 2 * z * u + 2*u^2 + 2 * t * v - t + f4 = 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5]), complete_reduction=true) + runb("Katsura5", I, S, StartOrd, TarOrd) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, + ) + df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) + savew(df, "correct.txt") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b], c=["Katsura5"]) + savea(df, "correct.txt") + end + + #Katsura6 + + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (v,u,t,z,y,x) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y", "x"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + ideals= [] + f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v + f2 = 2*x * y +2* y * z + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * x * z + 2 * y * t + 2 * z * u +2* u^2 + 2 * t * v - t + f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y + f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + + I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5,f6]), complete_reduction= true) + runb("Katsura6", I, S) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, + ) + df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) + savew(df, "correct.txt") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b], c=["Katsura6"]) + savea(df, "correct.txt") + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl new file mode 100644 index 000000000..ebad1cfe4 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl @@ -0,0 +1,3439 @@ +include(" +src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +") +include("readWriteHelper.jl") +include("parser.jl") +include("runbenchmark.jl") + + +using DataFrames +using CSV + +function benchmarkVar4() + cd("/Users/JordiWelp/Results") + + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + ideals = [] + + push!( + ideals, + Singular.Ideal( + R, + [ + 75 + + 83 * b + + 51 * d^2 + + 33 * c^3 + + 60 * d^3 + + 87 * a^2 * c^2 + + 78 * c^4 + + 48 * b * c^2 * d + + 10 * a * b * d^2 + + 71 * b^2 * d^2 + + 66 * a * d^3 + + 71 * a^5 + + 76 * a^3 * b^2 + + 40 * a * b^2 * c^2 + + 40 * a^3 * d^2 + + 65 * b * c * d^3, + 21 * d + + 18 * b^2 + + 78 * b * d^2 + + 18 * a^3 * b + + 41 * b^4 + + 67 * a * b^2 * d + + 36 * b^3 * d + + 48 * b^2 * c * d + + 28 * a^4 * b + + 8 * a^4 * d + + 11 * a^2 * b^2 * d + + 85 * a * c^3 * d + + 38 * c^4 * d + + 14 * a^2 * b * d^2 + + 63 * d^5, + 37 * a * c + + 85 * a * b^2 + + 68 * a * b * d + + 52 * a * c * d + + 70 * b^4 * c + + 80 * a^3 * c^2 + + 71 * b^3 * c^2 + + 32 * a^4 * d + + 60 * a * c * d^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 18 * c + + 45 * b^2 * d + + 42 * a^2 * b^2 + + 41 * a^2 * b * d + + 60 * a * b * c * d + + 60 * c^2 * d^2 + + 90 * a * b^4 + + 46 * a * b^3 * c + + 62 * a^3 * c^2 + + 47 * a * b^2 * c * d + + 23 * a * c^3 * d + + 37 * c^3 * d^2, + 76 + + 32 * d + + 82 * a * b + + 37 * d^2 + + 79 * a * b^2 + + 22 * b^3 + + 15 * a^2 * c + + 48 * a * b * d + + 37 * b^2 * d + + 75 * a^2 * c^2 + + 7 * a^2 * d^2 + + 59 * a * c * d^2 + + 70 * b * d^3 + + 40 * b * c^4 + + 65 * a^2 * b^2 * d + + 28 * a^2 * c^2 * d + + 44 * c^4 * d + + 60 * b^2 * c * d^2, + 73 * c^2 + + 90 * b^4 + + 13 * a^2 * c^2 + + 19 * b * d^3 + + 17 * a^3 * b * d + + 77 * b^4 * d + + 17 * a^2 * b * d^2 + + 77 * a * b^2 * d^2 + + 67 * a^2 * d^3 + + 29 * a * c * d^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 72 * b^2 + + 71 * a * c + + 88 * a^4 + + 87 * a * b^3 + + 85 * a * c^3 + + 66 * b^3 * d + + 30 * b * c^2 * d + + 8 * a * b * c^3 + + 33 * a^3 * b * d + + 3 * a^2 * b * c * d + + 2 * a^2 * b * d^2 + + 90 * a * d^4 + + 27 * d^5, + 87 + + 49 * a + + 66 * b^2 + + 4 * b * c^2 + + 30 * a^2 * d + + 28 * d^3 + + 48 * a^2 * b^2 + + 87 * a * b * d^2 + + 70 * c * d^3 + + 26 * a^5 + + 83 * a^2 * b^3 + + 30 * b^4 * c + + 21 * a^2 * b * c^2 + + 80 * a^4 * d + + 18 * a^3 * d^2 + + 89 * a * b * d^3 + + 37 * b^2 * d^3, + 53 * b + + 29 * b * c^2 + + 81 * c^2 * d + + 4 * d^3 + + 85 * a^3 * b + + 40 * a^2 * c^2 + + 51 * c * d^3 + + 43 * a^3 * b * c + + 20 * b^2 * c^3 + + 74 * b^2 * d^3, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + end + + push!( + ideals, + Singular.Ideal( + R, + [ + 15 + + 33 * c^2 + + 45 * a * d + + 2 * c * d + + 89 * a * b * c + + 75 * a * c^2 + + 4 * c^3 + + 61 * a^2 * d + + a^3 * b + + 60 * a * b * c^2 + + 5 * a * c^3 + + 6 * b * c^3 + + 25 * c^4 + + 52 * a^2 * b * d + + 22 * b^3 * d + + 29 * b * c^2 * d + + 85 * a * c * d^2 + + 39 * a^5 + + 56 * a^4 * b + + 53 * a^3 * b^2 + + 7 * a * b^2 * c^2 + + 48 * a * b * c^3 + + 58 * b^2 * c^3 + + 89 * a * c^4 + + 8 * b^2 * c^2 * d + + 6 * c^4 * d + + 6 * a * b^2 * d^2 + + 70 * c^3 * d^2 + + 32 * a * b * d^3 + + 3 * b^2 * d^3 + + 50 * d^5, + 73 * b + + 18 * b * c + + 41 * a^2 * c + + 65 * a^2 * d + + 77 * b * d^2 + + 61 * a^2 * c^2 + + 5 * c^4 + + 2 * c^2 * d^2 + + 24 * d^4 + + 67 * a * b^2 * c^2 + + 7 * b^3 * c^2 + + 2 * a^2 * c^3 + + 60 * a * b * c^3 + + 22 * a * b * c^2 * d + + 47 * a * c^3 * d + + 2 * a^3 * d^2 + + 54 * b * c * d^3 + + 48 * b * d^4, + 85 * b + + 61 * d + + 81 * a * b + + 75 * c * d + + 50 * a^3 + + 37 * a^2 * c + + 58 * c^3 + + 16 * a * d^2 + + 88 * c * d^2 + + 50 * a^4 + + 58 * a^2 * b^2 + + 68 * a^2 * c * d + + 72 * a * b * c * d + + 54 * a * c^2 * d + + 8 * a * b * d^2 + + 51 * c^2 * d^2 + + 38 * b * d^3 + + 50 * a^5 + + 56 * a^3 * c^2 + + 31 * a^2 * b * c^2 + + 69 * b^3 * c^2 + + 33 * a^3 * b * d + + 79 * a^2 * c * d^2 + + 30 * a * b * d^3 + + 3 * b^2 * d^3 + + 61 * b * d^4 + + 71 * c * d^4 + + 21 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 44 * b + + 34 * a * c + + 45 * c^2 + + 8 * a * b^2 + + 24 * c^3 + + 14 * a * c * d + + a * b^3 + + 63 * a * c^3 + + 28 * b^2 * c * d + + 41 * a * c * d^2 + + 16 * b * c * d^2 + + 56 * a * d^3 + + 9 * b^3 * c^2 + + 6 * a^2 * c^3 + + 52 * a * b^3 * d + + 15 * a^2 * b * c * d + + 31 * a * b^2 * c * d + + 71 * b^2 * c^2 * d + + 62 * a^3 * d^2 + + 83 * a^2 * c * d^2 + + 10 * b^2 * c * d^2 + + 81 * b^2 * d^3 + + 69 * a * c * d^3, + 64 + + b + + 57 * d + + 25 * a^2 + + 28 * d^2 + + 43 * a^3 + + 50 * a * b * c + + 42 * b^2 * c + + 32 * c^3 + + 58 * a * c * d + + 45 * a * b^2 * c + + 70 * c^4 + + 75 * a * b * c * d + + 45 * b^2 * c * d + + 89 * a * c^2 * d + + 58 * b^2 * d^2 + + 43 * a * c * d^2 + + 43 * b * d^3 + + 60 * c * d^3 + + 33 * b^3 * c^2 + + 29 * a^3 * b * d + + 30 * a^3 * c * d + + 55 * b^3 * c * d + + 7 * a * b * c^2 * d + + 42 * b^2 * c^2 * d + + 70 * b * c^3 * d + + 56 * a * b^2 * d^2 + + 37 * a * d^4, + 76 * a * d + + 22 * d^2 + + 63 * b^2 * c + + 45 * b^2 * d + + 71 * b * c * d + + 6 * d^3 + + 47 * a^3 * c + + 73 * a^2 * c^2 + + 87 * a^3 * d + + 73 * a * b * d^2 + + 19 * a * c * d^2 + + 9 * b * d^3 + + 14 * a^5 + + 13 * a^4 * b + + 59 * a^3 * b^2 + + 34 * a^2 * b^2 * c + + 66 * a * c^4 + + 37 * c^5 + + 39 * a^2 * b^2 * d + + 80 * b^4 * d + + 24 * b^3 * c * d + + 24 * a * b * c^2 * d + + 14 * b * c^3 * d + + 33 * a^3 * d^2 + + 54 * b^2 * c * d^2 + + 44 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 83 + + 15 * c * d + + 78 * d^2 + + 82 * b^3 + + 9 * c^3 + + 74 * a * c * d + + 24 * a^2 * c^2 + + 50 * a * b * c^2 + + 50 * b^2 * c^2 + + 34 * b * c^3 + + 32 * a^2 * b * d + + 3 * a^2 * c * d + + 62 * a * c^2 * d + + 90 * c * d^3 + + 36 * a^5 + + 14 * a^4 * b + + 18 * a^3 * b * c + + 69 * a * c^4 + + 54 * a^2 * c^2 * d + + 28 * b^2 * c^2 * d + + 37 * b^2 * d^3 + + 27 * a * d^4 + + 60 * c * d^4, + 83 * b + + 64 * b * c + + 74 * a * d + + 16 * a^3 + + 83 * b * c * d + + 54 * c^2 * d + + 56 * d^3 + + 84 * a^2 * b^2 + + 76 * a^3 * c + + 13 * a^2 * c^2 + + 39 * a * b * c^2 + + 81 * b^2 * c^2 + + c^4 + + 9 * b * c * d^2 + + 19 * b * d^3 + + 83 * c * d^3 + + 2 * a * b^4 + + 5 * a^3 * c^2 + + 84 * a^2 * b * c^2 + + 21 * a * b * c^3 + + 25 * a^3 * b * d + + 2 * a^2 * c^2 * d + + 82 * b * c^3 * d + + 80 * c^4 * d + + 33 * a^3 * d^2 + + 81 * b^3 * d^2 + + 44 * a^2 * d^3, + 61 * a + + 63 * d + + 52 * a^2 + + 81 * c * d + + 48 * a^2 * d + + 74 * a * b * d + + 2 * a * c * d + + 11 * c^2 * d + + 39 * d^3 + + 50 * a^3 * b + + 71 * a^2 * b * d + + 41 * b * c * d^2 + + 7 * b * d^3 + + 29 * a^5 + + 11 * b^5 + + 25 * b^3 * c^2 + + a * c^4 + + 50 * a^4 * d + + 10 * a^2 * b^2 * d + + 2 * a * b^3 * d + + 49 * b^3 * c * d + + 73 * b^2 * c^2 * d + + 41 * a * c^3 * d + + 35 * a^3 * d^2 + + 75 * a * b * c * d^2 + + 13 * a * c * d^3 + + 28 * c^2 * d^3, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 31 * a + + 61 * b + + 51 * d + + 8 * b * c + + 24 * c^2 + + 11 * a^2 * b + + 52 * a^2 * c + + 15 * a^2 * d + + 52 * a * c * d + + 19 * c^2 * d + + 82 * b * d^2 + + 2 * c * d^2 + + 85 * b^4 + + 13 * a^3 * c + + 34 * b^3 * c + + 88 * a * c^3 + + 13 * a^2 * c * d + + 22 * a * c^2 * d + + 21 * b^2 * d^2 + + 11 * a * c * d^2 + + 58 * a * d^3 + + 63 * c * d^3 + + 33 * d^4 + + 55 * a^2 * b^3 + + 4 * a * b^4 + + 17 * a * b^2 * c^2 + + 28 * a * b * c^3 + + 73 * b^2 * c^3 + + 56 * a * c^4 + + 5 * a^2 * b * c * d + + 15 * a * b^2 * c * d + + 84 * b^3 * c * d + + 29 * a * c^3 * d + + 83 * b * c^3 * d + + 31 * a * b^2 * d^2 + + 16 * b^3 * d^2 + + 75 * a^2 * c * d^2 + + 42 * a * b * c * d^2 + + 77 * b^2 * c * d^2 + + 10 * b * c^2 * d^2 + + 16 * a^2 * d^3, + 32 * c^2 + + 75 * a * d + + 62 * b * d + + 3 * a * b^2 + + 83 * a * b * c + + 70 * a * c^2 + + 34 * c^3 + + 37 * b * d^2 + + 41 * a^3 * b + + 89 * a^2 * c^2 + + 46 * a * c^3 + + 46 * a^2 * b * d + + 56 * c^3 * d + + 82 * a^2 * d^2 + + 43 * a * c * d^2 + + 62 * c * d^3 + + 85 * a^5 + + 24 * a * b^4 + + 61 * a^4 * c + + 49 * a^3 * b * c + + 63 * a^2 * b^2 * c + + 31 * b^4 * c + + 45 * a^2 * c^3 + + 24 * a * b * c^3 + + 72 * c^5 + + 13 * a^4 * d + + 30 * a^2 * b^2 * d + + a^3 * c * d + + 23 * a * b * c^2 * d + + 26 * b^3 * d^2 + + 3 * a^2 * c * d^2 + + 89 * a * b * c * d^2 + + 37 * b^2 * c * d^2 + + 19 * a^2 * d^3 + + 87 * b^2 * d^3 + + 81 * a * c * d^3 + + 67 * c * d^4, + 77 + + 75 * a + + 30 * a^2 + + 67 * c^2 + + 73 * b * d + + 46 * c * d + + 33 * a * b^2 + + 57 * b^3 + + 59 * b^2 * c + + 33 * a * c^2 + + 27 * c^3 + + 82 * c * d^2 + + 78 * a^3 * b + + 43 * a^2 * b^2 + + 78 * a^3 * c + + 24 * a * b * c^2 + + 60 * a^2 * b * d + + 50 * b^3 * d + + 66 * a^2 * c * d + + 42 * a * c^2 * d + + 3 * c^3 * d + + 45 * a^2 * d^2 + + 9 * a * c * d^2 + + 70 * a * d^3 + + 59 * b * d^3 + + 76 * a * b^4 + + 70 * b^5 + + 48 * a * b^2 * c^2 + + 48 * b * c^4 + + 38 * a^4 * d + + 8 * a * c^3 * d + + 50 * c^4 * d + + 82 * a^2 * b * d^2 + + a * b * c * d^2 + + 5 * c^3 * d^2 + + 12 * a * b * d^3 + + 32 * b^2 * d^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 52 + + 40 * c + + 90 * b * c + + 28 * a^2 * c + + 75 * b^2 * c + + 19 * a * c^2 + + 54 * b * c * d + + 81 * a^4 + + 46 * a * b^3 + + 30 * a^2 * b * c + + 19 * a * b^2 * c + + 45 * b^2 * c^2 + + 82 * b * c^3 + + 77 * a^3 * d + + 17 * b^3 * d + + 62 * a * c^2 * d + + 73 * b * c * d^2 + + 55 * c^2 * d^2 + + 60 * a^4 * b + + 7 * b^4 * c + + 82 * a * b^2 * c^2 + + 45 * a^2 * c^3 + + 66 * a * b * c^3 + + 28 * b * c^4 + + 73 * c^5 + + 30 * a^4 * d + + 18 * a * b^3 * d + + 43 * a^3 * c * d + + 25 * a * b * c^2 * d + + 49 * c^4 * d + + 35 * a^3 * d^2 + + 49 * a^2 * b * d^2 + + 23 * b^3 * d^2 + + 27 * a * c^2 * d^2 + + 12 * b * c^2 * d^2 + + 49 * a * b * d^3, + 4 * a + + 64 * b + + 90 * d + + 9 * a^2 + + 36 * a * b + + 83 * b^2 + + 51 * d^2 + + 5 * a^3 + + 10 * b^3 + + 73 * a^2 * c + + 2 * a * c^2 + + 43 * b * c^2 + + 56 * a * b * d + + 81 * c * d^2 + + 52 * a^4 + + 9 * a * b^2 * c + + 55 * a * b * c * d + + 38 * a * c^2 * d + + 20 * c^2 * d^2 + + 54 * a * d^3 + + 81 * b * d^3 + + 41 * a^5 + + 58 * a^2 * b^3 + + 53 * b^5 + + 81 * a^3 * b * c + + 87 * a^2 * b^2 * c + + 44 * a^3 * c^2 + + 74 * a^3 * b * d + + 86 * a * b * c^2 * d + + 42 * a * c^3 * d + + 50 * c^4 * d + + 66 * b^3 * d^2 + + 9 * b^2 * c * d^2 + + 45 * c^3 * d^2 + + 58 * a * b * d^3 + + 81 * b^2 * d^3 + + 48 * b * c * d^3, + 80 * a * b + + 49 * a * c + + 67 * b * d + + 76 * c * d + + 56 * a * b^2 + + 85 * a^2 * c + + 86 * a * b * c + + 26 * a^2 * d + + 48 * a * b * d + + 27 * a * c * d + + 22 * a * d^2 + + 40 * a^3 * c + + 40 * a^2 * c^2 + + 31 * a * b * c^2 + + 19 * b^2 * c^2 + + 76 * a * b^2 * d + + 20 * b^3 * d + + 55 * a^2 * c * d + + 52 * a * b * c * d + + 10 * c^3 * d + + 89 * a^2 * d^2 + + 56 * a * b * d^2 + + 2 * a * c * d^2 + + 76 * c^2 * d^2 + + 33 * a * d^3 + + 83 * a * b^3 * c + + 74 * b^4 * c + + 63 * a * b * c^3 + + 64 * a^3 * b * d + + 69 * a^2 * b * c * d + + 68 * a * b * c^2 * d + + 44 * b^2 * c^2 * d + + 38 * b * c^3 * d + + 10 * a * b^2 * d^2 + + 29 * b^3 * d^2 + + 72 * c^3 * d^2 + + 71 * a * b * d^3 + + 19 * b * c * d^3 + + 58 * c^2 * d^3 + + 46 * a * d^4 + + b * d^4 + + 52 * c * d^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 66 * b + + 33 * a^2 + + 72 * a * d + + 34 * b * d + + 48 * a^2 * c + + 70 * a * b * c + + 17 * b * c^2 + + 55 * c^3 + + 81 * b * d^2 + + 75 * d^3 + + 49 * a^4 + + 89 * a * b^3 + + 28 * b^3 * c + + 50 * a^2 * c^2 + + 52 * a * c^3 + + 72 * b * c^3 + + 60 * c^4 + + 59 * a * b^2 * d + + 36 * b^3 * d + + 39 * a * c^2 * d + + 7 * a * b * d^2 + + 3 * c^2 * d^2 + + 87 * b * d^3 + + 52 * b^5 + + 41 * a^3 * b * c + + 55 * a^2 * b^2 * c + + 70 * a * b^3 * c + + 50 * a^2 * b * c^2 + + 22 * a * b^2 * c^2 + + 41 * b^2 * c^3 + + 54 * a * c^4 + + 47 * a^2 * b^2 * d + + 86 * b^4 * d + + 27 * a^2 * b * c * d + + 15 * b * c^3 * d + + 21 * a^2 * c * d^2 + + 81 * b * c^2 * d^2 + + 89 * a * b * d^3 + + 62 * b * c * d^3 + + 54 * a * d^4 + + 14 * c * d^4, + 87 * b + + 81 * a^2 + + 26 * a * b + + 81 * b * d + + 44 * a * b^2 + + 90 * b^3 + + 11 * a * b * d + + 78 * b^2 * d + + 35 * a^4 + + 27 * a^3 * b + + 85 * a * b^3 + + 30 * b^4 + + 10 * b * c^3 + + 85 * a^2 * b * d + + 41 * b^2 * c * d + + 27 * a^2 * d^2 + + 72 * c^2 * d^2 + + 19 * b * d^3 + + 72 * d^4 + + 40 * a^5 + + 71 * a^2 * b^3 + + 5 * a * b^4 + + 48 * b^5 + + 25 * a^4 * c + + 42 * a^3 * b * c + + 66 * a^2 * b^2 * c + + 48 * b^3 * c^2 + + 87 * b^2 * c^3 + + 6 * a * c^4 + + 87 * a^3 * b * d + + 80 * b^2 * c^2 * d + + 9 * a^2 * b * d^2 + + 14 * b^3 * d^2 + + 87 * a^2 * c * d^2 + + 50 * c^2 * d^3 + + 88 * d^5, + 62 + + 83 * c + + 45 * d + + 38 * b * c + + 34 * c^2 + + 43 * d^2 + + 68 * b^3 + + 61 * a * b * c + + 59 * a * c^2 + + 76 * c^3 + + 69 * a * c * d + + 46 * b * c * d + + 84 * c^2 * d + + 39 * a * d^2 + + 87 * a^4 + + 83 * a^2 * b^2 + + 65 * b^4 + + 69 * a^2 * c^2 + + 67 * b * c^3 + + 2 * a * c^2 * d + + 32 * a * c * d^2 + + 53 * a * d^3 + + 89 * a^4 * b + + 86 * a^4 * c + + 47 * a^3 * b * c + + 76 * a^2 * b^2 * c + + 70 * b^3 * c^2 + + 3 * a^2 * c^3 + + 8 * b^2 * c^3 + + 88 * c^5 + + 65 * a^4 * d + + 9 * a^2 * b^2 * d + + 56 * b^4 * d + + 83 * a^2 * b * c * d + + 8 * a * b^2 * c * d + + 89 * a^2 * b * d^2 + + 87 * b * c * d^3 + + 33 * d^5, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 64 * c + + 52 * b^2 + + 65 * b * d + + 59 * d^2 + + 17 * a * b^2 + + 42 * b^3 + + 21 * a^2 * c + + 67 * a * c^2 + + 50 * a^2 * d + + 23 * a * b * d + + 6 * b^2 * d + + 53 * b * c * d + + 46 * c^2 * d + + 85 * a * d^2 + + 73 * a * b^3 + + 5 * a^3 * c + + 46 * a * b^2 * c + + 89 * a^2 * c^2 + + 8 * a * b * c^2 + + 20 * b^2 * c^2 + + 11 * b * c^3 + + 71 * c^4 + + 76 * a^3 * d + + 66 * a * b^2 * d + + 16 * b^3 * d + + 42 * a * b * c * d + + 89 * a * b * d^2 + + 35 * c * d^3 + + 29 * d^4 + + 32 * a^4 * c + + 53 * a^3 * b * c + + 68 * a^2 * b^2 * c + + 72 * b^4 * c + + 54 * a^3 * c^2 + + 65 * a^2 * b * c^2 + + 29 * a * b^2 * c^2 + + 67 * a^2 * c^3 + + 35 * a * b * c^3 + + 22 * a^3 * c * d + + 40 * b^3 * c * d + + 26 * a * b * c^2 * d + + 24 * b^2 * c^2 * d + + 24 * a * c^3 * d + + 10 * c^4 * d + + 14 * a^2 * c * d^2 + + 2 * a * b * c * d^2 + + 18 * b^2 * c * d^2 + + 78 * c^3 * d^2 + + 77 * c^2 * d^3, + 34 + + 8 * a + + 33 * b + + 85 * c + + 60 * d + + 48 * a^2 + + 44 * a * b + + 25 * a * c + + 81 * a * d + + 56 * b * d + + 17 * a^2 * d + + 77 * a * c * d + + 7 * b * c * d + + 18 * c^2 * d + + 10 * a * d^2 + + b * d^2 + + 76 * c * d^2 + + 39 * a^2 * b * c + + 58 * b * c^3 + + 18 * a^3 * d + + 83 * a * b^2 * d + + 43 * b^3 * d + + 7 * a^2 * c * d + + 51 * a * b * c * d + + 30 * a * c * d^2 + + 78 * b * d^3 + + 71 * c * d^3 + + 74 * d^4 + + 64 * a^5 + + 55 * a * b^4 + + 85 * a^4 * c + + 6 * a^2 * b^2 * c + + 81 * a * b^3 * c + + 65 * a * b * c^3 + + 7 * b * c^4 + + 32 * a^2 * b^2 * d + + 58 * b^4 * d + + 75 * a^3 * c * d + + 35 * a^2 * c^2 * d + + 16 * a * b * c^2 * d + + 14 * b^2 * c * d^2 + + 33 * a * c^2 * d^2 + + 68 * b * c^2 * d^2 + + 54 * c^3 * d^2 + + 77 * a^2 * d^3 + + 59 * a * b * d^3 + + 81 * a * c * d^3 + + 12 * c^2 * d^3 + + 4 * a * d^4 + + b * d^4 + + 39 * c * d^4, + 25 + + 61 * a * b + + 8 * a * c + + 36 * c^2 + + 73 * a * d + + 6 * a^3 + + 44 * a^2 * b + + 19 * a * b^2 + + 22 * b^3 + + 74 * a * c^2 + + 16 * b * c * d + + 9 * c^2 * d + + 78 * a * b^3 + + 20 * b^4 + + 32 * a^2 * b * c + + 52 * b^3 * c + + 65 * a^2 * c^2 + + 4 * a * b * c^2 + + 56 * b^2 * c^2 + + 62 * a * c^3 + + 40 * b * c^3 + + 2 * a^3 * d + + 9 * b^3 * d + + 60 * a * b * c * d + + 33 * a * c^2 * d + + 3 * b * c^2 * d + + 8 * a * b * d^2 + + 7 * a * d^3 + + 7 * a^2 * b^3 + + 56 * a * b^4 + + 53 * a^3 * b * c + + 47 * a^2 * b^2 * c + + 17 * a^3 * c^2 + + 37 * a * b^2 * c^2 + + 4 * b^3 * c^2 + + 79 * a * b * c^3 + + 15 * b^2 * c^3 + + 41 * a * c^4 + + 15 * a * b^3 * d + + 48 * b^4 * d + + 23 * a^3 * c * d + + 78 * b^3 * c * d + + 40 * a^2 * c^2 * d + + 42 * b^2 * c^2 * d + + 14 * a * c^3 * d + + 28 * b * c^3 * d + + 80 * a * c^2 * d^2 + + 67 * b * c^2 * d^2 + + 9 * a * b * d^3 + + 83 * b^2 * d^3 + + 57 * b * c * d^3 + + 3 * c * d^4 + + 68 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 68 + + 21 * a + + 4 * c + + 82 * d + + 68 * b^2 + + 31 * b * c + + 37 * a * d + + 80 * a^3 + + 30 * a * b^2 + + 86 * b^3 + + 23 * a^2 * c + + 10 * a * b * d + + 46 * c^2 * d + + 51 * a * d^2 + + 69 * a * b^2 * c + + 25 * a^2 * c^2 + + 40 * a * c^3 + + 63 * c^4 + + 70 * a^3 * d + + 27 * a^2 * b * d + + 75 * b^3 * d + + 22 * a^2 * c * d + + 6 * a * c^2 * d + + 30 * a * b * d^2 + + 86 * a * c * d^2 + + 70 * c^2 * d^2 + + 35 * a^5 + + 74 * a^3 * b^2 + + 23 * a * b^4 + + 46 * a^3 * b * c + + 73 * b^4 * c + + 74 * a^3 * c^2 + + 57 * a^4 * d + + 40 * a^3 * b * d + + 48 * a^2 * b^2 * d + + 56 * a * b^3 * d + + 60 * a^3 * c * d + + 54 * a^2 * b * c * d + + 33 * a^2 * c^2 * d + + 50 * a * c^3 * d + + 29 * a^3 * d^2 + + 85 * a * b^2 * d^2 + + 90 * a^2 * d^3 + + 21 * a * b * d^3 + + 52 * b^2 * d^3 + + 83 * b * c * d^3 + + 87 * c^2 * d^3 + + 72 * b * d^4 + + 33 * c * d^4, + 28 * d + + 39 * b^2 + + 70 * a * d + + 39 * b * d + + 17 * c * d + + 27 * a^2 * b + + 85 * a^2 * c + + 50 * b^2 * d + + 77 * a * c * d + + 90 * b * c * d + + 47 * c^2 * d + + 41 * a * d^2 + + 4 * b * d^2 + + 64 * d^3 + + 85 * a^4 + + 27 * a * b^3 + + 72 * b^2 * c^2 + + 83 * c^4 + + 29 * a^3 * d + + 31 * b^3 * d + + 31 * a^2 * c * d + + 9 * a * c^2 * d + + 7 * c^3 * d + + 28 * a^2 * d^2 + + 89 * a * b * d^2 + + 82 * b^2 * d^2 + + 88 * a * c * d^2 + + 3 * b * c * d^2 + + 80 * a * d^3 + + 2 * b * d^3 + + 3 * a^2 * b^3 + + 50 * b^5 + + 50 * b^4 * c + + 58 * a^3 * c^2 + + 16 * b^3 * c^2 + + 24 * a^2 * c^3 + + 35 * a * b * c^3 + + 64 * b * c^4 + + 12 * c^5 + + 65 * a^4 * d + + 7 * a^3 * c * d + + 21 * a * b^2 * c * d + + 82 * b^3 * c * d + + 50 * a^2 * c^2 * d + + 63 * b * c^3 * d + + 56 * c^4 * d + + 37 * a^2 * c * d^2 + + 45 * a * c^2 * d^2 + + 29 * b * c^2 * d^2 + + 51 * b^2 * d^3 + + 3 * b * c * d^3 + + 27 * b * d^4, + 9 + + 48 * a + + 23 * a * b + + 42 * b^2 + + 9 * b * c + + 66 * a * d + + 56 * c * d + + 71 * a^3 + + 52 * a^2 * b + + 11 * a * b^2 + + 65 * a * b * c + + 53 * b^2 * c + + 81 * b * c^2 + + 18 * a * c * d + + 76 * a * d^2 + + 35 * b^4 + + 64 * a^3 * c + + 4 * a^2 * c^2 + + 40 * b^2 * c^2 + + 69 * a * c^3 + + 67 * b * c^3 + + 74 * a * b^2 * d + + 84 * b^3 * d + + 27 * a^2 * c * d + + 73 * a * c^2 * d + + 74 * b * c^2 * d + + 5 * a * c * d^2 + + 45 * b * c * d^2 + + 82 * b * d^3 + + 4 * a^4 * b + + 76 * a^3 * b^2 + + 23 * a * b^3 * c + + 75 * b^3 * c^2 + + 3 * a^2 * c^3 + + 24 * a * b * c^3 + + 37 * b^2 * c^3 + + 61 * a * c^4 + + 40 * a^4 * d + + 71 * a^3 * b * d + + 22 * a^3 * c * d + + 73 * a^2 * b * c * d + + 33 * a * b * c^2 * d + + 49 * b^2 * c^2 * d + + 2 * a * c^3 * d + + 39 * b * c^3 * d + + 83 * a^3 * d^2 + + 17 * a^2 * c * d^2 + + 77 * a * b * c * d^2 + + 87 * c^3 * d^2 + + 45 * b^2 * d^3 + + 71 * c^2 * d^3 + + 88 * c * d^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 1 + + 25 * b + + 18 * a * b + + 67 * a * c + + 79 * a * d + + 80 * b * c^2 + + 71 * a * c * d + + 66 * c^2 * d + + 51 * a * d^2 + + 65 * a^4 + + 81 * a^3 * c + + 72 * a * b * c^2 + + 19 * a * c^3 + + 69 * b * c^3 + + 69 * a^3 * d + + 51 * a^2 * b * d + + 33 * a * b^2 * d + + 26 * a * b * c * d + + 4 * c^3 * d + + 34 * a^2 * d^2 + + 46 * a * b * d^2 + + 87 * c * d^3 + + 71 * a^2 * b^3 + + 20 * b^4 * c + + 31 * a^2 * b * c^2 + + 33 * a^2 * c^3 + + 56 * b * c^4 + + 52 * c^5 + + 5 * a^4 * d + + 61 * a^2 * b^2 * d + + 41 * a^2 * b * c * d + + 18 * b^3 * c * d + + 13 * a * c^3 * d + + 6 * b * c^3 * d + + 36 * c^4 * d + + 31 * a^2 * b * d^2 + + 24 * a * b^2 * d^2 + + 43 * a * b * c * d^2 + + 55 * b^2 * c * d^2 + + 50 * c^3 * d^2 + + 42 * a^2 * d^3 + + 76 * b * c * d^3 + + 69 * c^2 * d^3, + 22 * a + + 80 * b + + 77 * c + + 20 * d + + 80 * a * c + + 85 * a * d + + 68 * a * b * c + + 2 * b^2 * c + + 17 * b * c^2 + + 19 * a * b * d + + 40 * b^2 * d + + 43 * c^2 * d + + 9 * c * d^2 + + 50 * a^2 * b^2 + + 79 * a * b^3 + + 6 * b^4 + + 32 * a^3 * c + + 70 * b^3 * c + + 11 * a * c^3 + + 47 * b * c^3 + + 29 * c^4 + + 50 * a^3 * d + + 42 * a * b * c * d + + 31 * a * c^2 * d + + 86 * b * c^2 * d + + 17 * c^3 * d + + 53 * a * b * d^2 + + 13 * a * c * d^2 + + 28 * a^3 * b^2 + + 12 * a^2 * b^3 + + 15 * a * b^4 + + 16 * a^4 * c + + 52 * b^4 * c + + 22 * b^3 * c^2 + + 77 * a^3 * b * d + + 82 * b^4 * d + + 33 * a^2 * b * c * d + + 36 * b^2 * c^2 * d + + 87 * b * c^3 * d + + 84 * a^2 * b * d^2 + + 39 * a * b^2 * d^2 + + 65 * a * b * d^3 + + 53 * a * c * d^3 + + 13 * b * c * d^3 + + 90 * a * d^4 + + 32 * b * d^4 + + 59 * c * d^4, + 75 + + 65 * a * b + + 33 * b^2 + + 38 * a * c + + 79 * c^2 + + 50 * a * d + + 52 * b * d + + 42 * c * d + + 40 * a^2 * b + + 54 * b^3 + + 63 * a^2 * c + + 20 * a * b * c + + 60 * b^2 * c + + 67 * b * c^2 + + 22 * c^3 + + 35 * a^2 * d + + 71 * a * b * d + + 14 * a * c * d + + 33 * c^2 * d + + 80 * c * d^2 + + 48 * d^3 + + 70 * a^2 * b^2 + + 72 * b^4 + + 48 * a^3 * c + + 27 * a^2 * c^2 + + 18 * a * b * c^2 + + 36 * a * c^3 + + b * c^3 + + 63 * c^4 + + 21 * a^2 * b * d + + 18 * b * c^2 * d + + 54 * a^2 * d^2 + + 51 * b^2 * d^2 + + 39 * b * c * d^2 + + 17 * d^4 + + 21 * a^5 + + 51 * a^2 * b^3 + + 80 * a^3 * b * c + + 85 * b^4 * c + + 22 * a * b^2 * c^2 + + 47 * b^3 * c^2 + + 71 * a^2 * c^3 + + 82 * b^2 * c^3 + + 43 * a * c^4 + + 64 * b * c^4 + + 13 * c^5 + + 77 * a^2 * b^2 * d + + 60 * a * b^3 * d + + b^4 * d + + 34 * a * b^2 * c * d + + 12 * b^3 * c * d + + 67 * a * b * c^2 * d + + 37 * b * c^3 * d + + 80 * a^2 * b * d^2 + + 38 * a * b^2 * d^2 + + 82 * a * b * c * d^2 + + 23 * a * c^2 * d^2 + + 9 * b^2 * d^3 + + 11 * a * c * d^3 + + 80 * c^2 * d^3 + + 82 * a * d^4 + + 49 * b * d^4 + + 76 * d^5, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 25 + + 59 * a + + 15 * a^2 + + 87 * a * b + + 83 * c^2 + + 26 * a * d + + 89 * b * d + + 6 * d^2 + + 60 * a^3 + + 7 * a^2 * c + + 75 * a * c^2 + + 74 * b * c^2 + + 34 * c^3 + + 3 * c^2 * d + + 41 * a * d^2 + + 54 * b * d^2 + + 70 * d^3 + + 89 * a * b^3 + + 64 * b^4 + + 62 * a^3 * c + + 86 * a^2 * b * c + + 35 * b^3 * c + + 41 * b^2 * c^2 + + 22 * c^4 + + 40 * a^3 * d + + 47 * a^2 * b * d + + 9 * b^3 * d + + 83 * a^2 * c * d + + 56 * a * c^2 * d + + 26 * b * c^2 * d + + 33 * a^2 * d^2 + + 31 * b^2 * d^2 + + 12 * c^2 * d^2 + + 89 * c * d^3 + + 85 * a^3 * b * c + + 45 * a^3 * c^2 + + 57 * a * b^2 * c^2 + + 40 * b^3 * c^2 + + 30 * a^2 * c^3 + + 63 * a * b * c^3 + + 68 * b^2 * c^3 + + 77 * a * c^4 + + 10 * a^4 * d + + 30 * a^2 * b^2 * d + + 84 * a * b^3 * d + + 52 * a^2 * b * c * d + + 33 * b^2 * c^2 * d + + 25 * a^3 * d^2 + + 27 * a^2 * b * d^2 + + 57 * a * b^2 * d^2 + + 51 * b^3 * d^2 + + 57 * a^2 * c * d^2 + + 12 * a * b * c * d^2 + + a * c^2 * d^2 + + 17 * c^3 * d^2 + + 34 * a * b * d^3 + + 13 * b^2 * d^3 + + 70 * c^2 * d^3 + + 57 * a * d^4 + + 47 * c * d^4 + + 89 * d^5, + 10 * a + + 25 * b + + 59 * d + + 10 * c^2 + + 80 * a * d + + 80 * b * d + + 64 * c * d + + 17 * d^2 + + 84 * b^3 + + 47 * a^2 * c + + 79 * b^2 * c + + 90 * a * c^2 + + 37 * a^2 * d + + b^2 * d + + 15 * a * c * d + + 2 * b * c * d + + 18 * b * d^2 + + 20 * d^3 + + 5 * a^3 * b + + 21 * a^2 * b^2 + + 56 * b^4 + + 62 * a^3 * c + + 70 * a^2 * b * c + + 77 * a * b^2 * c + + 39 * b^3 * c + + 39 * a * b * c^2 + + 51 * c^4 + + 80 * a^3 * d + + 36 * a * b^2 * d + + 67 * a^2 * c * d + + 25 * a * b * c * d + + 52 * b^2 * c * d + + 42 * a * c^2 * d + + 29 * b * c^2 * d + + 37 * a^2 * d^2 + + 52 * a * b * d^2 + + 23 * b^2 * d^2 + + 3 * b * d^3 + + 43 * a^4 * b + + 90 * a * b^4 + + 58 * a^3 * b * c + + 79 * a^2 * b^2 * c + + 44 * a * b^3 * c + + 57 * a^3 * c^2 + + 32 * a * b^2 * c^2 + + 10 * a^2 * c^3 + + 34 * a * b * c^3 + + 55 * b * c^4 + + 60 * a^4 * d + + 62 * a^3 * b * d + + 29 * a^2 * b^2 * d + + 12 * a * b^3 * d + + 56 * b^4 * d + + 76 * a^3 * c * d + + 15 * a^2 * b * c * d + + 30 * a * b^2 * c * d + + 25 * b^3 * c * d + + 35 * a^2 * c^2 * d + + 84 * a * b * c^2 * d + + 23 * b^2 * c^2 * d + + 36 * a * c^3 * d + + 39 * b * c^3 * d + + 87 * c^4 * d + + 84 * a^3 * d^2 + + 54 * a^2 * b * d^2 + + 31 * a * b^2 * d^2 + + 90 * b^3 * d^2 + + 81 * a^2 * c * d^2 + + 17 * a * b * c * d^2 + + 45 * b * c^2 * d^2 + + 47 * c^3 * d^2 + + 29 * a * d^4 + + 42 * b * d^4 + + 31 * d^5, + 5 + + 37 * a + + 66 * c + + 29 * b^2 + + 55 * a * c + + 78 * c * d + + 81 * d^2 + + 11 * a * b^2 + + 4 * a^2 * c + + 80 * a * b * c + + 2 * b^2 * c + + 69 * a * c^2 + + 25 * a^2 * d + + 36 * a * b * d + + 21 * a * c * d + + 19 * b * c * d + + 28 * a * d^2 + + 81 * d^3 + + 77 * a^4 + + 24 * a^3 * b + + 51 * a^2 * b^2 + + 27 * b^3 * c + + 88 * a^2 * c^2 + + 14 * b * c^3 + + 71 * a^3 * d + + 75 * a^2 * b * d + + 2 * a * b^2 * d + + 11 * a * b * c * d + + 53 * b^2 * c * d + + 84 * b * c^2 * d + + 44 * c^3 * d + + 69 * a * c * d^2 + + 11 * b * c * d^2 + + 61 * d^4 + + 82 * a^2 * b^3 + + 62 * a * b^4 + + 31 * a^4 * c + + 69 * a^3 * b * c + + 47 * a * b^3 * c + + 50 * b^4 * c + + 47 * b^3 * c^2 + + 38 * a^2 * c^3 + + 17 * a * b * c^3 + + 70 * b^2 * c^3 + + 90 * b * c^4 + + 15 * b^4 * d + + 26 * a^3 * c * d + + 73 * a^2 * b * c * d + + 49 * a * b^2 * c * d + + 78 * b^3 * c * d + + 53 * a^2 * c^2 * d + + 69 * a^2 * c * d^2 + + 56 * b * c^2 * d^2 + + 2 * a^2 * d^3 + + 44 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 54 + + 80 * a + + 61 * d + + 64 * a * b + + 22 * b^2 + + 42 * a * d + + 60 * c * d + + 76 * d^2 + + 5 * a^3 + + 90 * a^2 * b + + 15 * a^2 * c + + 23 * a * b * c + + 17 * b^2 * c + + 69 * c^3 + + 79 * a^2 * d + + 31 * a * b * d + + 81 * a * c * d + + 34 * b * d^2 + + 10 * a^3 * b + + 11 * a^2 * b^2 + + 44 * a * b^3 + + 50 * b^4 + + 44 * a^2 * b * c + + 65 * a^2 * c^2 + + 68 * a * b * c^2 + + 53 * b^2 * c^2 + + 19 * a * c^3 + + 56 * b * c^3 + + 85 * a^2 * b * d + + 88 * a * b^2 * d + + 15 * b * c^2 * d + + 62 * a^2 * d^2 + + 30 * a * b * d^2 + + 86 * b^2 * d^2 + + 25 * b * c * d^2 + + 38 * c^2 * d^2 + + 15 * a * d^3 + + 45 * b * d^3 + + 13 * c * d^3 + + 38 * d^4 + + 38 * a^4 * b + + 32 * a^4 * c + + 79 * a^2 * b^2 * c + + 81 * b^4 * c + + 53 * a^3 * c^2 + + 42 * a * b^2 * c^2 + + 37 * a^2 * c^3 + + 39 * a * b * c^3 + + 49 * a * c^4 + + 85 * a^4 * d + + 53 * a^3 * b * d + + 77 * a * b^3 * d + + 30 * a^3 * c * d + + 62 * a^2 * b * c * d + + 70 * a * b^2 * c * d + + 6 * b^3 * c * d + + 62 * a^2 * c^2 * d + + 89 * a * b * c^2 * d + + 2 * b * c^3 * d + + 63 * a^3 * d^2 + + 11 * a * b^2 * d^2 + + 62 * a^2 * c * d^2 + + 22 * a * b * c * d^2 + + 26 * b^2 * c * d^2 + + 19 * a * c^2 * d^2 + + 63 * a^2 * d^3 + + 80 * c^2 * d^3 + + 39 * a * d^4, + 51 * a + + 15 * b + + 24 * d + + 16 * c^2 + + 29 * a * d + + 35 * a^2 * b + + 65 * a * b * c + + 86 * b^2 * c + + 46 * a * c^2 + + 52 * b * c^2 + + 18 * a^2 * d + + 15 * b^2 * d + + 68 * a * c * d + + 3 * b * d^2 + + 66 * c * d^2 + + 58 * d^3 + + 44 * a^4 + + 88 * a^3 * c + + 43 * a^2 * b * c + + 84 * a * b^2 * c + + 41 * b^3 * c + + 6 * a * c^3 + + 20 * b * c^3 + + 89 * a^2 * b * d + + 9 * b * c^2 * d + + 34 * a^2 * d^2 + + 76 * b^2 * d^2 + + 46 * a * c * d^2 + + 73 * c^2 * d^2 + + 73 * c * d^3 + + 32 * d^4 + + 40 * a^5 + + 48 * a^4 * b + + 46 * a * b^4 + + 7 * a^3 * b * c + + 80 * a^2 * b^2 * c + + 82 * b^4 * c + + 86 * a^3 * c^2 + + 86 * a^2 * b * c^2 + + 85 * a * b^2 * c^2 + + 84 * b^3 * c^2 + + 55 * a^2 * c^3 + + b^2 * c^3 + + 84 * a * c^4 + + 2 * b * c^4 + + 65 * c^5 + + 14 * a^4 * d + + 28 * a^3 * b * d + + a * b^3 * d + + 44 * b^4 * d + + 80 * a^2 * b * c * d + + 11 * a * b^2 * c * d + + 70 * b^3 * c * d + + 86 * a^2 * c^2 * d + + 43 * b^2 * c^2 * d + + 88 * c^4 * d + + 41 * a^2 * b * d^2 + + 5 * a * b^2 * d^2 + + 18 * a * b * c * d^2 + + 62 * b * c^2 * d^2 + + 35 * a^2 * d^3 + + 27 * a * d^4 + + 56 * b * d^4 + + 2 * d^5, + 31 + + 25 * b + + 81 * a * b + + 62 * b^2 + + 81 * a * c + + 89 * b * c + + 26 * c^2 + + 48 * a * d + + 22 * c * d + + 90 * d^2 + + 19 * b^3 + + 68 * a^2 * c + + 39 * a * b * c + + 11 * b^2 * c + + 5 * a * c^2 + + 23 * a^2 * d + + 82 * a * b * d + + 30 * c^2 * d + + 49 * a * d^2 + + 45 * a^2 * b^2 + + 78 * a^3 * c + + 46 * a^2 * b * c + + 77 * b^3 * c + + a * b * c^2 + + 66 * a^3 * d + + 56 * a^2 * b * d + + 14 * b^3 * d + + 11 * a^2 * c * d + + 2 * a * b * c * d + + 71 * b * c^2 * d + + 66 * a^2 * d^2 + + 41 * b^2 * d^2 + + 5 * b * d^3 + + 78 * c * d^3 + + 84 * d^4 + + 57 * a^5 + + 21 * a^3 * b^2 + + 36 * a^2 * b^3 + + 80 * b^5 + + 85 * a^4 * c + + 19 * a^2 * b^2 * c + + 19 * a * b^3 * c + + 68 * b * c^4 + + 52 * c^5 + + 76 * b^4 * d + + 22 * a^3 * c * d + + 24 * a^2 * b * c * d + + 17 * a * b^2 * c * d + + 25 * b^3 * c * d + + 6 * a * b * c^2 * d + + 43 * b^2 * c^2 * d + + 14 * a^3 * d^2 + + 9 * a * b^2 * d^2 + + 33 * b^2 * c * d^2 + + 45 * b * c^2 * d^2 + + 15 * c^3 * d^2 + + 26 * a^2 * d^3 + + 22 * a * c * d^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 50 + + 55 * a + + 62 * b + + 15 * c + + 75 * b^2 + + 49 * a * c + + 56 * b * c + + 74 * b * d + + 70 * d^2 + + 55 * a^3 + + 5 * a * b^2 + + 3 * b^3 + + 39 * a * c^2 + + 69 * a * c * d + + 52 * a * d^2 + + 62 * d^3 + + a^4 + + 71 * a^2 * b^2 + + 28 * a * b^3 + + 4 * a * b^2 * c + + 34 * b^2 * c^2 + + 23 * a * c^3 + + c^4 + + 46 * a^3 * d + + 52 * a * b^2 * d + + 60 * b^3 * d + + 52 * a * b * c * d + + 77 * b * c^2 * d + + 59 * b^2 * d^2 + + 35 * a * c * d^2 + + 86 * c^2 * d^2 + + 21 * b * d^3 + + 41 * a^5 + + 8 * a^4 * b + + 18 * a^3 * b^2 + + 37 * a^2 * b^3 + + 66 * a^4 * c + + 6 * a^3 * b * c + + 24 * a^2 * b * c^2 + + a * b^2 * c^2 + + 18 * b^2 * c^3 + + 50 * c^5 + + 19 * a^2 * b^2 * d + + 36 * a * b^3 * d + + 23 * b^4 * d + + 27 * a^2 * b * c * d + + 73 * b^3 * c * d + + 6 * a^2 * c^2 * d + + 53 * a * b * c^2 * d + + 55 * c^4 * d + + 6 * a^3 * d^2 + + 10 * a^2 * b * d^2 + + 84 * a * b^2 * d^2 + + 41 * a^2 * d^3 + + 5 * a * b * d^3 + + 57 * b^2 * d^3 + + 55 * b * d^4 + + 5 * c * d^4, + 62 + + 43 * a + + 20 * c + + 47 * a^2 + + 25 * b^2 + + 3 * a * c + + 49 * c^2 + + 53 * d^2 + + 65 * a^2 * b + + 65 * b^3 + + 56 * a * b * c + + 4 * b^2 * c + + 87 * b * c^2 + + 45 * c^3 + + 11 * a^2 * d + + 83 * a * b * d + + 73 * a * c * d + + 36 * b * c * d + + 36 * b * d^2 + + 86 * c * d^2 + + 70 * a^4 + + 20 * a^2 * b^2 + + 35 * a^3 * c + + 52 * a^2 * b * c + + 75 * b^3 * c + + a^2 * c^2 + + 9 * b * c^3 + + 89 * a^2 * b * d + + 44 * a * b^2 * d + + 66 * b^3 * d + + 2 * a^2 * c * d + + 35 * b^2 * c * d + + 55 * a * b * d^2 + + 26 * a * c * d^2 + + 31 * a * d^3 + + 56 * b * d^3 + + 23 * c * d^3 + + 24 * d^4 + + 67 * a^5 + + 36 * a^4 * b + + 8 * a * b^4 + + 86 * a^4 * c + + 29 * a^2 * b^2 * c + + 33 * b^4 * c + + 79 * a^2 * b * c^2 + + 41 * a * b^2 * c^2 + + 73 * b^3 * c^2 + + 74 * b^2 * c^3 + + 59 * a * c^4 + + 29 * b * c^4 + + 81 * a^4 * d + + 36 * a^3 * b * d + + 12 * a * b^3 * d + + 15 * a * b^2 * c * d + + 22 * b^3 * c * d + + 57 * c^4 * d + + 90 * a^3 * d^2 + + 3 * a * b^2 * d^2 + + 37 * b^2 * c * d^2 + + 43 * b * c^2 * d^2 + + 8 * a^2 * d^3 + + 41 * b^2 * d^3 + + 42 * a * c * d^3 + + 26 * c^2 * d^3 + + 8 * c * d^4, + 5 * b + + 48 * b * c + + 25 * c^2 + + 45 * a * d + + 71 * b * d + + 2 * c * d + + 16 * a^2 * b + + 22 * a * b^2 + + 35 * b^3 + + 39 * b^2 * c + + 5 * a * c^2 + + 30 * a^2 * d + + 40 * a * b * d + + 63 * b^2 * d + + 48 * a * c * d + + 17 * b * c * d + + 73 * c * d^2 + + 50 * a^3 * b + + 16 * a^2 * b^2 + + 36 * a * b^3 + + 83 * a^3 * c + + 15 * a^2 * b * c + + 67 * a * b^2 * c + + 9 * a^2 * c^2 + + 59 * b^2 * c^2 + + 29 * a * c^3 + + 28 * b * c^3 + + 39 * c^4 + + 62 * a^2 * c * d + + 72 * b^2 * c * d + + 25 * a * c^2 * d + + 76 * b * c^2 * d + + 33 * a * b * d^2 + + 59 * a * c * d^2 + + 10 * b * c * d^2 + + 83 * d^4 + + 55 * a^4 * b + + 50 * a^3 * b^2 + + 6 * a^2 * b^3 + + 43 * a * b^4 + + 10 * b^5 + + 80 * a^2 * b^2 * c + + 86 * a * b^3 * c + + 49 * b^4 * c + + 33 * a^2 * b * c^2 + + 31 * b * c^4 + + 58 * a^4 * d + + 89 * a^3 * b * d + + 83 * a^2 * b^2 * d + + 19 * a * b^3 * d + + 50 * b^4 * d + + 58 * a^3 * c * d + + 39 * a^2 * b * c * d + + 65 * b^3 * c * d + + 34 * a^2 * c^2 * d + + 59 * a * b * c^2 * d + + b^2 * c^2 * d + + 62 * a * c^3 * d + + 77 * a^3 * d^2 + + 45 * a^2 * b * d^2 + + 74 * a^2 * c * d^2 + + 87 * a * b * c * d^2 + + 10 * c^3 * d^2 + + 63 * a^2 * d^3 + + 80 * b * c * d^3 + + 83 * c^2 * d^3 + + 26 * c * d^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 68 + + 63 * b + + 27 * c + + 83 * d + + 43 * a^2 + + 24 * a * b + + 34 * a * c + + 87 * b * c + + 27 * a * d + + 52 * b * d + + 78 * a^3 + + 22 * a^2 * b + + 28 * b^3 + + 75 * a * b * c + + 8 * a * c^2 + + 64 * a * c * d + + 24 * c^2 * d + + 22 * a * d^2 + + 89 * b * d^2 + + 17 * c * d^2 + + 8 * d^3 + + 81 * a^4 + + 8 * a^2 * b^2 + + 38 * b^4 + + 86 * a^3 * c + + 36 * a^2 * b * c + + 48 * b^3 * c + + 83 * a^2 * c^2 + + 43 * a * c^3 + + 44 * c^4 + + 65 * a * c^2 * d + + 85 * c^3 * d + + 25 * a^2 * d^2 + + 40 * a * b * d^2 + + 49 * a * c * d^2 + + 53 * b * c * d^2 + + 19 * c^2 * d^2 + + 89 * d^4 + + 86 * a^5 + + 34 * a^4 * b + + 88 * a * b^4 + + b^5 + + 89 * a^4 * c + + 31 * b^4 * c + + 70 * a * b^2 * c^2 + + 84 * b^3 * c^2 + + 74 * a * b * c^3 + + 43 * a * c^4 + + 30 * b * c^4 + + 53 * a^4 * d + + 8 * a^3 * b * d + + 2 * a^2 * b^2 * d + + 83 * b^4 * d + + 50 * a^3 * c * d + + 78 * a * b * c^2 * d + + 42 * b^2 * c^2 * d + + 68 * a * c^3 * d + + 31 * b * c^3 * d + + 66 * c^4 * d + + 42 * a^3 * d^2 + + 86 * a^2 * b * d^2 + + 42 * a * b^2 * d^2 + + 74 * a^2 * c * d^2 + + 7 * a * b * c * d^2 + + 67 * a * c^2 * d^2 + + 2 * c^3 * d^2 + + 23 * a * b * d^3 + + 40 * b^2 * d^3 + + 51 * a * c * d^3 + + 23 * a * d^4 + + 44 * c * d^4, + 64 + + 22 * b + + 57 * c + + 49 * a^2 + + 86 * a * b + + 49 * b * c + + 39 * c^2 + + 37 * a * d + + 89 * c * d + + 51 * a^2 * b + + 89 * a^2 * c + + 43 * a * b * c + + 7 * b^2 * c + + 21 * b * c^2 + + 79 * a * c * d + + 13 * b * c * d + + 26 * c^2 * d + + 52 * a * d^2 + + 31 * c * d^2 + + 27 * d^3 + + 12 * a^3 * b + + 36 * a^2 * b^2 + + 8 * a * b^3 + + 4 * b^4 + + 39 * a^3 * c + + 9 * a^2 * b * c + + 81 * a * b^2 * c + + 75 * b^3 * c + + 18 * a^2 * c^2 + + 80 * b^2 * c^2 + + 64 * a * c^3 + + 26 * b * c^3 + + 50 * c^4 + + 15 * a^2 * b * d + + 31 * a * b^2 * d + + 73 * a^2 * c * d + + 45 * a * c^2 * d + + 62 * b * c^2 * d + + 19 * c^3 * d + + 49 * a^2 * d^2 + + 34 * a * b * d^2 + + 50 * b^2 * d^2 + + 36 * c^2 * d^2 + + 18 * a * d^3 + + 84 * d^4 + + 74 * a^5 + + 54 * a^4 * b + + 14 * a^3 * b^2 + + 56 * b^5 + + 71 * a^2 * b^2 * c + + 29 * a * b^3 * c + + 31 * a^3 * c^2 + + 6 * a * b^2 * c^2 + + 67 * a^2 * c^3 + + 82 * c^5 + + 30 * a^4 * d + + 86 * a^3 * b * d + + 46 * a * b^3 * d + + 47 * a^2 * b * c * d + + 4 * a * b^2 * c * d + + 76 * a^2 * c^2 * d + + 86 * a * b * c^2 * d + + b^2 * c^2 * d + + 2 * a * c^3 * d + + 21 * b * c^3 * d + + 34 * a^2 * b * d^2 + + 56 * a^2 * c * d^2 + + 15 * a * b * c * d^2 + + 12 * c^3 * d^2 + + a^2 * d^3 + + 74 * a * b * d^3 + + 29 * b^2 * d^3 + + 8 * c^2 * d^3 + + 34 * a * d^4 + + 24 * b * d^4 + + 79 * c * d^4, + 89 * a + + 87 * c + + 32 * d + + 54 * a^2 + + 20 * b^2 + + 60 * a * c + + 68 * c^2 + + 14 * c * d + + 70 * d^2 + + 54 * a^3 + + 87 * a * b^2 + + 59 * b^3 + + 82 * a^2 * c + + 72 * a * b * c + + 80 * b^2 * c + + 47 * b * c^2 + + 76 * c^3 + + 61 * b^2 * d + + 64 * a * c * d + + 12 * a * d^2 + + 42 * b * d^2 + + 48 * c * d^2 + + 83 * d^3 + + 72 * a^2 * b^2 + + 12 * a * b^2 * c + + 85 * a^2 * c^2 + + 13 * b^2 * c^2 + + 5 * b * c^3 + + 44 * c^4 + + 6 * a^3 * d + + 80 * a^2 * b * d + + 58 * a * b^2 * d + + 52 * b^3 * d + + 12 * a * b * c * d + + 12 * b^2 * c * d + + 66 * a * c^2 * d + + 9 * b * c^2 * d + + 63 * c^3 * d + + 85 * a^2 * d^2 + + 36 * a * c * d^2 + + 15 * b * c * d^2 + + 45 * b * d^3 + + 57 * c * d^3 + + 72 * d^4 + + 78 * a^4 * b + + 13 * a^2 * b^3 + + 38 * a * b^4 + + 59 * a^4 * c + + 60 * a^3 * b * c + + 18 * a * b^3 * c + + 78 * b^4 * c + + 59 * a^3 * c^2 + + 73 * a * b^2 * c^2 + + 89 * b^3 * c^2 + + 48 * a * b * c^3 + + 29 * b^2 * c^3 + + 24 * a * c^4 + + 78 * b * c^4 + + 76 * a^4 * d + + 56 * a^3 * b * d + + 27 * a^2 * b^2 * d + + 58 * b^4 * d + + 71 * a^3 * c * d + + 89 * a^2 * b * c * d + + 48 * a * b^2 * c * d + + 28 * b^3 * c * d + + 15 * a^2 * c^2 * d + + 20 * b^2 * c^2 * d + + 39 * c^4 * d + + 29 * a^3 * d^2 + + 88 * a^2 * b * d^2 + + 39 * a * b^2 * d^2 + + 74 * b^3 * d^2 + + 11 * a * b * c * d^2 + + 13 * b^2 * c * d^2 + + 50 * b * c^2 * d^2 + + 41 * a^2 * d^3 + + 51 * b^2 * d^3 + + 25 * c^2 * d^3 + + 32 * b * d^4 + + 45 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 88 * a + + 73 * c + + 42 * a * b + + 89 * a * c + + 66 * d^2 + + 89 * a^3 + + 21 * a * b^2 + + 6 * a^2 * c + + 34 * a * b * c + + 10 * b^2 * c + + 34 * b * c^2 + + 78 * c^2 * d + + 37 * a * d^2 + + 80 * c * d^2 + + 66 * a^4 + + 86 * a^3 * b + + 89 * a^2 * b^2 + + 90 * b^4 + + 79 * a^3 * c + + 50 * a^2 * b * c + + 54 * b^3 * c + + 26 * a^2 * c^2 + + 15 * a * b * c^2 + + 54 * b^2 * c^2 + + 47 * a * c^3 + + 53 * a^3 * d + + 49 * a^2 * b * d + + 84 * a * b^2 * d + + 25 * b^3 * d + + 88 * a * b * c * d + + 75 * b^2 * c * d + + 68 * a * c^2 * d + + 35 * b * c^2 * d + + 2 * a^2 * d^2 + + 43 * b * c * d^2 + + 61 * c^2 * d^2 + + 66 * d^4 + + 76 * a^5 + + 71 * a^3 * b^2 + + 34 * a * b^4 + + 9 * b^5 + + 89 * a^4 * c + + 80 * a^3 * b * c + + 8 * a * b^3 * c + + 4 * b^4 * c + + 68 * a^3 * c^2 + + 84 * a^2 * b * c^2 + + 46 * a * b^2 * c^2 + + 40 * b^3 * c^2 + + 41 * a^2 * c^3 + + 57 * a * b * c^3 + + 76 * b^2 * c^3 + + 66 * b * c^4 + + 90 * a^4 * d + + 87 * a * b^3 * d + + 31 * b^4 * d + + 71 * b^3 * c * d + + 67 * b^2 * c^2 * d + + 75 * a * c^3 * d + + 64 * b * c^3 * d + + 84 * c^4 * d + + 79 * a^2 * b * d^2 + + 52 * c^3 * d^2 + + 65 * a^2 * d^3 + + 41 * a * b * d^3 + + 12 * b^2 * d^3 + + 7 * b * c * d^3 + + 22 * a * d^4, + 8 + + 73 * b + + 64 * d + + 55 * a^2 + + 10 * a * b + + 77 * b^2 + + 74 * a * c + + b * c + + 82 * c^2 + + 12 * a * d + + 38 * b^3 + + 27 * a^2 * c + + 37 * b * c^2 + + 72 * a^2 * d + + 61 * a * b * d + + 56 * a * c * d + + 29 * b * c * d + + 32 * c^2 * d + + 90 * a * d^2 + + 38 * b * d^2 + + 49 * c * d^2 + + 11 * a^4 + + 71 * a^2 * b^2 + + 25 * a * b^3 + + 57 * b^4 + + 40 * a^2 * b * c + + 19 * b^3 * c + + 87 * a^2 * c^2 + + 23 * a * b * c^2 + + 6 * b^2 * c^2 + + 55 * b * c^3 + + 20 * a^3 * d + + 74 * a^2 * b * d + + 84 * b^3 * d + + 51 * a^2 * c * d + + 12 * a * b * c * d + + 42 * a * c^2 * d + + 57 * c^3 * d + + 83 * a^2 * d^2 + + 60 * b * c * d^2 + + 22 * c^2 * d^2 + + 23 * a^5 + + 44 * a^3 * b^2 + + 80 * a^2 * b^3 + + 88 * a * b^4 + + 18 * b^5 + + 37 * a * b^3 * c + + 59 * a^3 * c^2 + + 47 * a^2 * b * c^2 + + 8 * a * b^2 * c^2 + + 20 * b^3 * c^2 + + 33 * a^4 * d + + 30 * a^3 * b * d + + 49 * a^2 * b^2 * d + + 31 * a * b^3 * d + + 25 * b^4 * d + + 32 * a^2 * b * c * d + + 86 * a * b^2 * c * d + + 36 * b^3 * c * d + + 74 * a * b * c^2 * d + + 86 * b^2 * c^2 * d + + 45 * a * c^3 * d + + 87 * b * c^3 * d + + 47 * c^4 * d + + 40 * a^3 * d^2 + + 10 * a^2 * b * d^2 + + 81 * a * b^2 * d^2 + + 69 * b^3 * d^2 + + 14 * b^2 * c * d^2 + + 44 * b * c^2 * d^2 + + 33 * a^2 * d^3 + + 60 * b^2 * d^3 + + 10 * a * c * d^3 + + 88 * b * c * d^3 + + 68 * c^2 * d^3 + + 55 * a * d^4 + + 16 * b * d^4 + + 62 * d^5, + 31 + + 72 * a + + 75 * b + + 19 * c + + 53 * d + + 54 * a^2 + + 23 * a * b + + 41 * a * c + + 3 * b * c + + 28 * c^2 + + 33 * a * d + + 4 * b * d + + 21 * c * d + + 22 * a^3 + + 21 * a^2 * b + + 54 * a * b^2 + + 47 * a^2 * c + + 30 * b^2 * c + + 19 * a * c^2 + + 71 * c^3 + + 71 * a^2 * d + + 61 * b^2 * d + + 73 * a * c * d + + 18 * b * c * d + + 87 * c^2 * d + + 3 * a * d^2 + + 7 * b * d^2 + + 22 * c * d^2 + + 46 * d^3 + + 80 * b^4 + + 66 * a^3 * c + + 76 * a * b^2 * c + + 43 * b^3 * c + + 52 * a * b * c^2 + + 50 * b^2 * c^2 + + 38 * a * c^3 + + 11 * c^4 + + 59 * a * b^2 * d + + 34 * b^3 * d + + 15 * a^2 * c * d + + 58 * a * b * c * d + + 5 * b^2 * c * d + + 73 * b * c^2 * d + + 88 * c^3 * d + + 42 * a^2 * d^2 + + 82 * a * b * d^2 + + 90 * b^2 * d^2 + + 29 * a * d^3 + + 12 * d^4 + + 8 * a * b^4 + + 61 * b^5 + + 82 * a^3 * b * c + + 20 * a * b^3 * c + + 46 * b^4 * c + + 53 * a^3 * c^2 + + 65 * a * b^2 * c^2 + + 86 * b^3 * c^2 + + 59 * a^2 * c^3 + + 31 * b^2 * c^3 + + 16 * a * c^4 + + 64 * b * c^4 + + 12 * a^3 * b * d + + 20 * a^2 * b^2 * d + + 27 * a^2 * b * c * d + + 85 * a * b^2 * c * d + + 88 * a^2 * c^2 * d + + 85 * a * b * c^2 * d + + 58 * b^2 * c^2 * d + + 85 * a * c^3 * d + + 9 * b * c^3 * d + + 49 * a^2 * b * d^2 + + 90 * a * b^2 * d^2 + + 16 * b^3 * d^2 + + 27 * a^2 * c * d^2 + + 83 * b^2 * c * d^2 + + 73 * a * c^2 * d^2 + + 2 * b * c^2 * d^2 + + 44 * c^3 * d^2 + + 56 * b * c * d^3 + + 79 * c^2 * d^3 + + 88 * a * d^4 + + 3 * c * d^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 72 + + 8 * a + + 37 * b + + 30 * c + + 7 * d + + 73 * a^2 + + 56 * b^2 + + 53 * a * c + + 83 * b * c + + 19 * c^2 + + 33 * b * d + + 57 * a^2 * b + + 8 * b^3 + + 80 * a * b * c + + 33 * a * c^2 + + 53 * a^2 * d + + 65 * a * b * d + + 46 * b^2 * d + + 84 * a * c * d + + 7 * b * c * d + + 53 * c^2 * d + + 83 * b * d^2 + + 16 * a^4 + + 68 * a^3 * b + + 26 * a * b^3 + + 38 * a^2 * b * c + + 79 * a * b^2 * c + + 41 * b^3 * c + + 8 * a^2 * c^2 + + 77 * a * b * c^2 + + 68 * b^2 * c^2 + + 46 * a * c^3 + + 46 * b * c^3 + + 18 * a^2 * b * d + + 31 * b^3 * d + + 62 * a * b * c * d + + 14 * a * c^2 * d + + 58 * a * b * d^2 + + 73 * b * c * d^2 + + 71 * a * d^3 + + 56 * d^4 + + 56 * a^5 + + 25 * a^3 * b^2 + + 74 * a^2 * b^3 + + 63 * b^5 + + 89 * a^3 * b * c + + 43 * a * b^3 * c + + 83 * b^4 * c + + 82 * a^3 * c^2 + + 68 * a^2 * b * c^2 + + 30 * a * b^2 * c^2 + + 44 * b^3 * c^2 + + 30 * a^2 * c^3 + + 46 * a * b * c^3 + + 36 * a * c^4 + + 31 * c^5 + + 64 * a^4 * d + + 49 * a^3 * b * d + + 4 * a^2 * b^2 * d + + 11 * a * b^3 * d + + 32 * a^2 * b * c * d + + 12 * a * b^2 * c * d + + 60 * b^3 * c * d + + 66 * a * b * c^2 * d + + 80 * b^2 * c^2 * d + + 44 * b^3 * d^2 + + 57 * a^2 * c * d^2 + + 28 * b * c^2 * d^2 + + 70 * c^3 * d^2 + + 85 * a^2 * d^3 + + 32 * b * c * d^3, + 46 + + 25 * a + + 50 * a^2 + + 82 * a * b + + 72 * b^2 + + 53 * a * c + + 19 * c^2 + + 67 * a * d + + 67 * b * d + + 21 * a^2 * b + + 70 * a^2 * c + + 49 * a * b * c + + 53 * b^2 * c + + 67 * a * c^2 + + 40 * b * c^2 + + 5 * a^2 * d + + 71 * a * b * d + + 36 * b * c * d + + 50 * c^2 * d + + 72 * a * d^2 + + 24 * b * d^2 + + 78 * c * d^2 + + 42 * a^4 + + 53 * a^2 * b^2 + + 76 * a * b^3 + + 56 * b^4 + + 41 * a^3 * c + + 39 * a^2 * b * c + + 3 * a * b^2 * c + + 85 * a^2 * c^2 + + 32 * a * b * c^2 + + 9 * b^2 * c^2 + + 60 * b * c^3 + + 57 * a^2 * b * d + + 40 * b^3 * d + + 64 * b^2 * c * d + + 2 * a * c^2 * d + + 49 * b * c^2 * d + + 12 * a * b * d^2 + + 18 * a * c * d^2 + + 78 * c^2 * d^2 + + 8 * b * d^3 + + 25 * d^4 + + 35 * a^5 + + 37 * a^4 * b + + 51 * a^2 * b^3 + + 45 * a * b^4 + + 59 * b^5 + + 64 * a^4 * c + + 18 * a^3 * b * c + + 26 * a^2 * b^2 * c + + 60 * b^4 * c + + 85 * a^2 * b * c^2 + + 36 * a^2 * c^3 + + 33 * a * b * c^3 + + b^2 * c^3 + + 71 * a * c^4 + + 82 * a^3 * b * d + + 11 * a * b^3 * d + + 81 * a^3 * c * d + + 82 * a * b^2 * c * d + + 10 * a^2 * c^2 * d + + 75 * b^2 * c^2 * d + + 79 * a * c^3 * d + + 21 * b * c^3 * d + + 72 * c^4 * d + + 60 * a^3 * d^2 + + 13 * a^2 * b * d^2 + + 31 * a * b^2 * d^2 + + 68 * b^3 * d^2 + + 44 * a^2 * c * d^2 + + 69 * a * b * c * d^2 + + 66 * b^2 * c * d^2 + + 78 * b * c^2 * d^2 + + 76 * c^3 * d^2 + + 41 * b^2 * d^3 + + 5 * a * c * d^3 + + 78 * b * c * d^3 + + 80 * c * d^4 + + 5 * d^5, + 58 * a + + 80 * b + + 84 * d + + 11 * a^2 + + 87 * b^2 + + 33 * c^2 + + 36 * b * d + + 3 * c * d + + 8 * a^3 + + 32 * a * b^2 + + 74 * a^2 * c + + 50 * a * b * c + + 47 * b * c^2 + + 25 * c^3 + + 38 * a * b * d + + 77 * a * c * d + + 63 * a * d^2 + + 44 * b * d^2 + + 52 * c * d^2 + + 73 * d^3 + + 77 * a^3 * b + + 69 * a * b^3 + + 35 * a^3 * c + + 74 * a^2 * b * c + + 68 * a * b^2 * c + + 27 * b^3 * c + + 61 * a^2 * c^2 + + 67 * a * b * c^2 + + 50 * b^2 * c^2 + + 84 * a * c^3 + + 88 * b * c^3 + + 76 * c^4 + + 30 * a^3 * d + + 38 * b^2 * c * d + + 87 * a * c^2 * d + + 16 * c^3 * d + + 89 * a^2 * d^2 + + 35 * b^2 * d^2 + + 11 * b * c * d^2 + + 66 * c^2 * d^2 + + 8 * b * d^3 + + 2 * c * d^3 + + 43 * d^4 + + 28 * a^4 * b + + 18 * a * b^4 + + 63 * a^4 * c + + 68 * a^2 * b^2 * c + + 89 * a * b^3 * c + + 75 * a^3 * c^2 + + 78 * a * b^2 * c^2 + + 4 * b^3 * c^2 + + 68 * a^2 * c^3 + + 82 * a * b * c^3 + + 28 * b^2 * c^3 + + 87 * b * c^4 + + 36 * c^5 + + 44 * a^3 * b * d + + 69 * a^2 * b^2 * d + + 52 * a * b^3 * d + + 15 * b^4 * d + + 60 * a^3 * c * d + + 82 * a^2 * b * c * d + + 55 * b^3 * c * d + + 54 * a^2 * c^2 * d + + 18 * a * b * c^2 * d + + 8 * b * c^3 * d + + 64 * c^4 * d + + 66 * a^3 * d^2 + + 33 * b^3 * d^2 + + 45 * a^2 * c * d^2 + + 66 * a * c^2 * d^2 + + 61 * a * b * d^3 + + 57 * a * c * d^3 + + 54 * b * c * d^3 + + 13 * c^2 * d^3 + + 17 * a * d^4 + + 15 * d^5, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 34 + + 16 * b + + 80 * a * b + + 15 * a * c + + 18 * a * d + + 29 * b * d + + 7 * c * d + + 77 * d^2 + + 60 * a^3 + + 44 * a^2 * b + + 41 * a * b^2 + + 8 * b^3 + + 70 * a^2 * c + + 80 * a * b * c + + 42 * b^2 * c + + 60 * b * c^2 + + 3 * c^3 + + 89 * a^2 * d + + 68 * a * b * d + + 65 * b^2 * d + + 12 * a * c * d + + 2 * b * c * d + + 6 * c^2 * d + + 17 * a * d^2 + + 29 * b * d^2 + + 18 * c * d^2 + + 25 * a^4 + + 70 * a^3 * b + + 19 * a^2 * b^2 + + 88 * a * b^3 + + 23 * b^4 + + 17 * a^2 * b * c + + 84 * a * b^2 * c + + 40 * b^3 * c + + 39 * a^2 * c^2 + + 48 * a * b * c^2 + + 18 * a^2 * b * d + + 30 * a * b^2 * d + + 43 * b^3 * d + + 30 * a^2 * c * d + + 74 * b^2 * c * d + + 16 * b * c^2 * d + + 7 * a^2 * d^2 + + 62 * a * b * d^2 + + 79 * b^2 * d^2 + + 67 * a * c * d^2 + + 60 * b * c * d^2 + + 88 * c^2 * d^2 + + 31 * a * d^3 + + 67 * b * d^3 + + 72 * c * d^3 + + 64 * d^4 + + 66 * a^5 + + 43 * a^3 * b^2 + + 90 * a^2 * b^3 + + 49 * b^5 + + 32 * a^4 * c + + 41 * a^3 * b * c + + 66 * a * b^3 * c + + 36 * b^4 * c + + 24 * a^3 * c^2 + + 15 * a^2 * b * c^2 + + 44 * a * b^2 * c^2 + + 47 * b^3 * c^2 + + 81 * a * b * c^3 + + 11 * b^2 * c^3 + + 29 * a * c^4 + + 45 * c^5 + + 22 * a^4 * d + + 50 * a^3 * b * d + + a^2 * b^2 * d + + 59 * b^4 * d + + 15 * a^2 * b * c * d + + 31 * b^3 * c * d + + 74 * a^2 * c^2 * d + + 29 * a * b * c^2 * d + + 44 * b^2 * c^2 * d + + 26 * a * c^3 * d + + 30 * b * c^3 * d + + 18 * c^4 * d + + 78 * a^2 * b * d^2 + + 35 * a * b^2 * d^2 + + 61 * b^2 * c * d^2 + + 24 * a * c^2 * d^2 + + 68 * b * c^2 * d^2 + + 59 * a * b * d^3 + + 54 * b^2 * d^3 + + 21 * a * c * d^3 + + 82 * b * c * d^3 + + 49 * c^2 * d^3 + + 11 * b * d^4 + + 65 * d^5, + 31 + + 6 * a + + 89 * b + + 41 * c + + 62 * d + + 47 * a^2 + + 58 * b^2 + + 31 * b * c + + 62 * c^2 + + 76 * a * d + + 5 * b * d + + 21 * c * d + + 71 * a^3 + + 13 * a^2 * b + + 51 * a * b^2 + + 75 * a^2 * c + + 15 * a * b * c + + 71 * b^2 * c + + 9 * b * c^2 + + 36 * a * c * d + + 89 * c^2 * d + + 70 * a * d^2 + + 88 * b * d^2 + + 35 * d^3 + + 78 * a^4 + + 27 * a^3 * b + + 28 * a^2 * b^2 + + 42 * a * b^3 + + 18 * b^4 + + 40 * a^3 * c + + 34 * b^3 * c + + 61 * a * b * c^2 + + 79 * b^2 * c^2 + + 59 * a^2 * b * d + + 58 * a * c^2 * d + + 19 * b * c^2 * d + + 48 * c^3 * d + + 49 * a * b * d^2 + + 22 * b^2 * d^2 + + 68 * b * c * d^2 + + 60 * c^2 * d^2 + + 77 * a * d^3 + + 25 * b * d^3 + + 49 * c * d^3 + + 8 * d^4 + + 32 * a^5 + + 43 * a^4 * b + + 47 * a^2 * b^3 + + 44 * a * b^4 + + 43 * a^4 * c + + 16 * a^3 * b * c + + 89 * a^2 * b^2 * c + + 16 * a * b^3 * c + + 35 * a^3 * c^2 + + 51 * a^2 * c^3 + + 12 * a * b * c^3 + + 62 * a * c^4 + + 10 * a^4 * d + + 22 * a^3 * b * d + + 60 * a * b^3 * d + + 75 * b^4 * d + + 86 * b^3 * c * d + + 88 * a^2 * c^2 * d + + 34 * a * b * c^2 * d + + 54 * b^2 * c^2 * d + + 80 * a * c^3 * d + + 13 * c^4 * d + + 52 * a^3 * d^2 + + 9 * a^2 * b * d^2 + + 28 * b^3 * d^2 + + 12 * a^2 * c * d^2 + + 86 * a * b * c * d^2 + + 36 * b^2 * c * d^2 + + 8 * a * c^2 * d^2 + + 87 * c^3 * d^2 + + 64 * a * b * d^3 + + 85 * b^2 * d^3 + + 81 * a * c * d^3 + + 2 * b * c * d^3 + + 87 * c^2 * d^3 + + 16 * b * d^4 + + 19 * c * d^4, + 8 + + 52 * a + + 34 * b + + 51 * c + + 34 * d + + 57 * a^2 + + 88 * a * b + + 20 * b^2 + + 32 * c^2 + + 56 * a * d + + 51 * b * d + + 88 * c * d + + 34 * d^2 + + 84 * a^2 * b + + 23 * a * b^2 + + 37 * b * c^2 + + 35 * c^3 + + 41 * a * b * d + + 32 * b^2 * d + + 14 * a * c * d + + 17 * c^2 * d + + 40 * a * d^2 + + 29 * b * d^2 + + 81 * c * d^2 + + 70 * d^3 + + 90 * a^4 + + 57 * a^3 * b + + 83 * a^2 * b^2 + + 64 * a * b^3 + + 41 * b^4 + + 23 * a^3 * c + + 10 * a * b^2 * c + + 87 * b^3 * c + + 88 * a^2 * c^2 + + 74 * a * c^3 + + 23 * a^3 * d + + 20 * a^2 * b * d + + 46 * a * b^2 * d + + 2 * b^3 * d + + 16 * a^2 * c * d + + 31 * a * b * c * d + + 64 * b^2 * c * d + + 64 * a * c^2 * d + + 57 * b * c^2 * d + + 40 * c^3 * d + + 38 * a^2 * d^2 + + 69 * a * b * d^2 + + 18 * b^2 * d^2 + + 18 * b * c * d^2 + + 4 * c^2 * d^2 + + 25 * b * d^3 + + 46 * d^4 + + 72 * a^3 * b^2 + + 67 * a^2 * b^3 + + 32 * a * b^4 + + 13 * b^5 + + 79 * a^4 * c + + 40 * a^3 * b * c + + 2 * b^4 * c + + 18 * a^3 * c^2 + + 77 * a^2 * b * c^2 + + 45 * a * b^2 * c^2 + + 78 * a^2 * c^3 + + 33 * a * b * c^3 + + 48 * a * c^4 + + 32 * b * c^4 + + 38 * c^5 + + 60 * a^4 * d + + 74 * a^3 * b * d + + 25 * a * b^3 * d + + 41 * b^4 * d + + 25 * a^3 * c * d + + 19 * a^2 * b * c * d + + 17 * a * b^2 * c * d + + 27 * a^2 * c^2 * d + + 13 * b^2 * c^2 * d + + 82 * a * c^3 * d + + 10 * b * c^3 * d + + 18 * a * b^2 * d^2 + + 25 * a * b * c * d^2 + + 56 * b^2 * c * d^2 + + 3 * c^3 * d^2 + + 62 * a^2 * d^3 + + 88 * a * b * d^3 + + 39 * b^2 * d^3 + + 80 * a * c * d^3 + + 90 * b * c * d^3 + + 49 * c^2 * d^3 + + 77 * a * d^4 + + 62 * b * d^4 + + 86 * c * d^4 + + 53 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 90 + + 79 * a + + 89 * b + + 65 * c + + 27 * d + + 64 * a * b + + 70 * b^2 + + 8 * b * c + + 58 * c^2 + + 47 * a * d + + 14 * b * d + + 21 * c * d + + 14 * d^2 + + 44 * a^3 + + 79 * a^2 * b + + 63 * a * b^2 + + 87 * b^3 + + 80 * a^2 * c + + 49 * a * b * c + + 89 * b * c^2 + + 33 * a * b * d + + 68 * b^2 * d + + 45 * a * c * d + + 85 * b * c * d + + 69 * c^2 * d + + 16 * b * d^2 + + 85 * c * d^2 + + 83 * d^3 + + 34 * a^4 + + 7 * a^3 * b + + 3 * a^2 * b^2 + + 51 * b^4 + + 78 * a^3 * c + + 50 * a^2 * b * c + + 86 * a * b^2 * c + + 63 * a * c^3 + + 42 * b * c^3 + + 17 * c^4 + + 6 * a^3 * d + + 40 * a^2 * b * d + + 69 * b^3 * d + + 2 * a^2 * c * d + + 90 * a * b * c * d + + 48 * b^2 * c * d + + 38 * a * c^2 * d + + 36 * c^3 * d + + 33 * a^2 * d^2 + + 38 * a * b * d^2 + + 22 * b^2 * d^2 + + 77 * a * c * d^2 + + 27 * c^2 * d^2 + + 40 * a * d^3 + + 80 * b * d^3 + + 23 * d^4 + + 17 * a^5 + + 37 * a^4 * b + + 79 * a^3 * b^2 + + 29 * a^2 * b^3 + + 80 * a * b^4 + + 66 * b^5 + + 5 * a^4 * c + + 53 * a^2 * b^2 * c + + 41 * a * b^3 * c + + 13 * b^4 * c + + 15 * a^3 * c^2 + + 19 * a^2 * b * c^2 + + 19 * a * b^2 * c^2 + + 76 * b^3 * c^2 + + 78 * a^2 * c^3 + + 36 * b^2 * c^3 + + 67 * a^3 * b * d + + 7 * a^2 * b^2 * d + + 38 * a * b^3 * d + + 10 * a^3 * c * d + + 33 * a * b^2 * c * d + + 40 * a * b * c^2 * d + + 71 * a * c^3 * d + + 49 * c^4 * d + + 79 * a^3 * d^2 + + 43 * a^2 * b * d^2 + + 11 * a * b^2 * d^2 + + 87 * b^3 * d^2 + + 20 * a * b * c * d^2 + + 10 * a * c^2 * d^2 + + 89 * b * c^2 * d^2 + + 78 * a^2 * d^3 + + 4 * a * b * d^3 + + 81 * a * c * d^3 + + 70 * c^2 * d^3 + + 60 * a * d^4 + + 68 * b * d^4 + + 30 * c * d^4 + + 62 * d^5, + 67 + + 51 * a + + 90 * c + + 82 * d + + 33 * a * b + + 72 * b^2 + + 70 * b * c + + 10 * a * d + + 68 * c * d + + 35 * a^3 + + 62 * a^2 * b + + 40 * b^3 + + 11 * a * b * c + + 40 * b^2 * c + + 22 * b * c^2 + + 65 * c^3 + + 84 * a^2 * d + + 48 * a * b * d + + 12 * a * c * d + + 19 * b * c * d + + 31 * c^2 * d + + 43 * b * d^2 + + 13 * c * d^2 + + 68 * d^3 + + 27 * a^4 + + 54 * a^3 * b + + 28 * a^2 * b^2 + + 32 * b^4 + + 23 * b^3 * c + + 31 * a^2 * c^2 + + 30 * b^2 * c^2 + + 42 * a * c^3 + + 31 * b * c^3 + + 7 * a^2 * b * d + + 13 * a * b^2 * d + + 31 * b^3 * d + + 49 * a^2 * c * d + + 26 * b^2 * c * d + + 84 * b * c^2 * d + + 64 * c^3 * d + + 42 * a^2 * d^2 + + 67 * a * c * d^2 + + 45 * b * c * d^2 + + 70 * c^2 * d^2 + + 33 * a * d^3 + + 17 * b * d^3 + + 83 * c * d^3 + + 61 * d^4 + + 69 * a^5 + + 5 * a^4 * b + + 76 * a^3 * b^2 + + 38 * a^2 * b^3 + + 31 * b^5 + + 45 * a^3 * b * c + + 76 * a^2 * b^2 * c + + 74 * a * b^3 * c + + 54 * b^4 * c + + 69 * a^3 * c^2 + + 41 * b^3 * c^2 + + 51 * a * b * c^3 + + 41 * a * c^4 + + 25 * b * c^4 + + 58 * c^5 + + 28 * a^4 * d + + 17 * a^2 * b^2 * d + + 62 * a * b^3 * d + + 26 * b^4 * d + + 29 * a^3 * c * d + + 78 * a^2 * b * c * d + + 75 * b^3 * c * d + + 41 * a^2 * c^2 * d + + 78 * a * b * c^2 * d + + 16 * b^2 * c^2 * d + + 33 * a * c^3 * d + + 90 * b * c^3 * d + + 80 * c^4 * d + + 30 * a * b^2 * d^2 + + 84 * b^3 * d^2 + + 59 * a^2 * c * d^2 + + 68 * a * b * c * d^2 + + 9 * c^3 * d^2 + + 80 * a^2 * d^3 + + 89 * a * b * d^3 + + 16 * a * c * d^3 + + 50 * b * c * d^3 + + 44 * c^2 * d^3 + + 38 * a * d^4 + + 90 * b * d^4 + + 72 * c * d^4, + 53 + + 37 * c + + 79 * a^2 + + 43 * a * b + + 83 * a * c + + 27 * b * c + + 11 * c^2 + + 5 * a * d + + b * d + + 83 * d^2 + + 28 * a^3 + + 57 * a^2 * b + + 88 * a * b^2 + + 4 * a * c^2 + + 74 * c^3 + + 35 * a^2 * d + + 5 * a * b * d + + 48 * b * c * d + + 59 * c^2 * d + + 24 * a * d^2 + + 23 * b * d^2 + + 16 * d^3 + + 42 * a^4 + + 86 * a^3 * b + + 39 * a * b^3 + + 79 * a^2 * b * c + + 87 * b^2 * c^2 + + 47 * b * c^3 + + 22 * c^4 + + 32 * a^3 * d + + 46 * a^2 * b * d + + 8 * a^2 * c * d + + 30 * b^2 * c * d + + 20 * b * c^2 * d + + 55 * c^3 * d + + 64 * a^2 * d^2 + + 54 * a * b * d^2 + + 59 * b^2 * d^2 + + 79 * a * c * d^2 + + 6 * b * c * d^2 + + 18 * c^2 * d^2 + + 72 * a * d^3 + + 47 * b * d^3 + + 41 * c * d^3 + + 67 * d^4 + + 42 * a^4 * b + + 25 * a^3 * b^2 + + 61 * a * b^4 + + 28 * a^4 * c + + 40 * a^3 * b * c + + 57 * a * b^3 * c + + 17 * b^4 * c + + 89 * a^2 * b * c^2 + + 32 * a * b^2 * c^2 + + 9 * b^3 * c^2 + + 60 * a^2 * c^3 + + 12 * a * b * c^3 + + 49 * b^2 * c^3 + + 11 * a * c^4 + + 47 * b * c^4 + + 7 * c^5 + + 15 * a^4 * d + + 38 * a^3 * b * d + + 61 * b^4 * d + + 63 * a^3 * c * d + + 8 * a * b^2 * c * d + + a^2 * c^2 * d + + 38 * a * b * c^2 * d + + 43 * b^2 * c^2 * d + + 69 * a * c^3 * d + + 72 * a * b^2 * d^2 + + 18 * b^3 * d^2 + + 75 * a^2 * c * d^2 + + 67 * a * b * c * d^2 + + 58 * b^2 * c * d^2 + + 13 * c^3 * d^2 + + 49 * a^2 * d^3 + + 37 * a * b * d^3 + + 36 * b^2 * d^3 + + 88 * a * c * d^3 + + 32 * b * c * d^3 + + 35 * b * d^4 + + 19 * d^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 45 + + 21 * a + + 90 * b + + 74 * c + + 57 * d + + 36 * a^2 + + 64 * a * b + + 89 * a * c + + 56 * b * c + + 35 * c^2 + + 11 * b * d + + 48 * c * d + + 72 * d^2 + + 70 * a^3 + + 13 * a^2 * b + + 43 * a * b^2 + + 30 * b^3 + + 53 * a^2 * c + + 37 * a * b * c + + 85 * a * c^2 + + 85 * c^3 + + 45 * a^2 * d + + 71 * a * b * d + + 64 * a * c * d + + 72 * b * c * d + + 11 * c^2 * d + + 83 * a * d^2 + + 68 * b * d^2 + + 30 * c * d^2 + + 30 * a^4 + + 79 * a^3 * b + + 54 * b^4 + + 19 * a^2 * b * c + + 68 * b^3 * c + + 52 * a * b * c^2 + + 39 * a * c^3 + + 2 * b * c^3 + + 54 * c^4 + + 65 * a^3 * d + + 43 * a^2 * b * d + + 57 * b^3 * d + + 85 * a^2 * c * d + + 88 * a * b * c * d + + 14 * a * c^2 * d + + 58 * c^3 * d + + 52 * a * c * d^2 + + 86 * b * c * d^2 + + 42 * c^2 * d^2 + + 74 * a * d^3 + + 3 * c * d^3 + + 27 * a^5 + + 41 * a^4 * b + + 22 * a^2 * b^3 + + 40 * a * b^4 + + 35 * b^5 + + 56 * a^4 * c + + 38 * a^3 * b * c + + 10 * a * b^3 * c + + 84 * b^4 * c + + 6 * a^3 * c^2 + + 43 * b^3 * c^2 + + 8 * a^2 * c^3 + + 24 * b^2 * c^3 + + 81 * c^5 + + 11 * a^2 * b^2 * d + + 73 * a * b^3 * d + + 64 * a^3 * c * d + + 58 * a^2 * b * c * d + + 32 * b^3 * c * d + + 47 * b^2 * c^2 * d + + 75 * b * c^3 * d + + 80 * c^4 * d + + 69 * a^3 * d^2 + + 72 * a^2 * b * d^2 + + 74 * b^3 * d^2 + + 75 * a^2 * c * d^2 + + 82 * a * c^2 * d^2 + + 48 * b * c^2 * d^2 + + 5 * c^3 * d^2 + + 54 * a^2 * d^3 + + 33 * a * b * d^3 + + 28 * a * c * d^3 + + 15 * b * c * d^3 + + 73 * c^2 * d^3 + + 37 * a * d^4 + + 9 * b * d^4 + + 39 * c * d^4 + + 19 * d^5, + 4 + + 14 * a + + 58 * b + + 30 * a^2 + + 75 * a * b + + 38 * b^2 + + 34 * a * c + + 81 * b * c + + 34 * c^2 + + 25 * a * d + + 19 * c * d + + 22 * a^3 + + 36 * a^2 * b + + 41 * a * b^2 + + 3 * b^3 + + 9 * a^2 * c + + 86 * b^2 * c + + 7 * a * c^2 + + 59 * a * b * d + + 64 * b^2 * d + + 67 * c^2 * d + + 3 * a * d^2 + + 5 * b * d^2 + + 8 * c * d^2 + + 31 * d^3 + + 84 * a^4 + + 16 * a^2 * b^2 + + 66 * b^4 + + 12 * a^3 * c + + 86 * a^2 * b * c + + 48 * a * b^2 * c + + 17 * b^3 * c + + 65 * a * c^3 + + 28 * c^4 + + 36 * a^3 * d + + 89 * a^2 * b * d + + 15 * b^3 * d + + 84 * a^2 * c * d + + 26 * a * b * c * d + + 3 * b^2 * c * d + + 54 * a * c^2 * d + + 46 * b * c^2 * d + + 80 * c^3 * d + + 71 * a^2 * d^2 + + 62 * a * b * d^2 + + 89 * b^2 * d^2 + + 36 * a * c * d^2 + + 49 * b * c * d^2 + + 71 * c^2 * d^2 + + 56 * a * d^3 + + 90 * b * d^3 + + 21 * d^4 + + 3 * a^3 * b^2 + + 2 * a^2 * b^3 + + 34 * a * b^4 + + 60 * b^5 + + 81 * a^3 * b * c + + 73 * a^2 * b^2 * c + + 32 * b^4 * c + + 60 * a^3 * c^2 + + 67 * a^2 * b * c^2 + + 29 * a * b^2 * c^2 + + 85 * a^2 * c^3 + + 20 * b^2 * c^3 + + 47 * a * c^4 + + 86 * b * c^4 + + 76 * c^5 + + 88 * a^4 * d + + 7 * a^3 * b * d + + 69 * a^2 * b^2 * d + + 57 * a * b^3 * d + + 44 * b^4 * d + + 31 * a^2 * b * c * d + + 63 * a * b^2 * c * d + + 22 * a^2 * c^2 * d + + 65 * a * b * c^2 * d + + 64 * b^2 * c^2 * d + + 59 * b * c^3 * d + + 30 * c^4 * d + + 54 * a^3 * d^2 + + 61 * a^2 * b * d^2 + + 32 * a * b^2 * d^2 + + 67 * b^3 * d^2 + + 68 * a^2 * c * d^2 + + 42 * a * b * c * d^2 + + 3 * a * c^2 * d^2 + + 84 * b * c^2 * d^2 + + 60 * c^3 * d^2 + + 58 * a^2 * d^3 + + 79 * a * b * d^3 + + 28 * a * d^4 + + 24 * b * d^4, + 31 + + 42 * b + + 12 * c + + 7 * d + + 75 * a^2 + + 73 * a * b + + 78 * c^2 + + 49 * a * d + + 13 * b * d + + 44 * a^3 + + 11 * a^2 * b + + 53 * a * b^2 + + 52 * b^3 + + 23 * b^2 * c + + 17 * c^3 + + 46 * a * b * d + + 54 * a * c * d + + 23 * b * c * d + + 17 * a * d^2 + + 53 * b * d^2 + + 59 * c * d^2 + + 89 * a^4 + + 83 * a^3 * b + + 59 * b^4 + + 24 * a^2 * b * c + + 45 * a * b^2 * c + + 74 * b^3 * c + + 76 * a^2 * c^2 + + 10 * a * b * c^2 + + 40 * b^2 * c^2 + + 29 * a * c^3 + + 19 * b * c^3 + + 3 * a^2 * b * d + + 54 * a * b^2 * d + + 14 * a * b * c * d + + 9 * b^2 * c * d + + 88 * a * c^2 * d + + 41 * c^3 * d + + 72 * a^2 * d^2 + + 44 * a * b * d^2 + + 76 * b^2 * d^2 + + 73 * a * c * d^2 + + 19 * b * c * d^2 + + 21 * c^2 * d^2 + + 70 * a * d^3 + + 16 * b * d^3 + + 3 * c * d^3 + + 9 * a^5 + + 57 * a^4 * b + + 75 * a^3 * b^2 + + 76 * a * b^4 + + 59 * a^4 * c + + 84 * a^3 * b * c + + 74 * a^2 * b^2 * c + + 50 * b^4 * c + + 38 * a^3 * c^2 + + 48 * a^2 * b * c^2 + + 30 * b^3 * c^2 + + 6 * a^2 * c^3 + + 89 * a * c^4 + + 64 * b * c^4 + + 86 * c^5 + + 87 * a^3 * b * d + + 7 * a^2 * b^2 * d + + 10 * a * b^3 * d + + 87 * b^4 * d + + 23 * a^2 * b * c * d + + 20 * a * b^2 * c * d + + 84 * b^3 * c * d + + 67 * a * b * c^2 * d + + 57 * b * c^3 * d + + 65 * c^4 * d + + 10 * a^3 * d^2 + + 62 * a^2 * b * d^2 + + 12 * a * b^2 * d^2 + + 17 * b^3 * d^2 + + 58 * a * b * c * d^2 + + 20 * b^2 * c * d^2 + + 37 * a * c^2 * d^2 + + 89 * b * c^2 * d^2 + + 2 * a^2 * d^3 + + 12 * a * b * d^3 + + 51 * b^2 * d^3 + + 65 * a * d^4 + + 9 * b * d^4 + + 84 * c * d^4 + + 41 * d^5, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) + end + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, + ) + df = DataFrame(a = ["test1"], b = ["test2"]) + savew(df, "correct.txt") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b]) + savea(df, "correct.txt") + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl new file mode 100644 index 000000000..2eb5e42ef --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl @@ -0,0 +1,6613 @@ +include( +"src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("readWriteHelper.jl") +include("parser.jl") +include("runbenchmark.jl") + + +using DataFrames +using CSV + +function benchmarkVar5() + cd("/Users/JordiWelp/Results") + + dim = 5 + ve = [1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d, e) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d", "e"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + ideals = [] + + + push!( + ideals, + Singular.Ideal( + R, + [ + 41 + + 3 * a * d + + 12 * d * e + + 87 * a^2 * d + + 75 * b * c * e + + 89 * b * d * e + + 65 * a^3 * b + + 77 * b * c * d^2 + + 25 * c^2 * d^2 + + 41 * c * d^3 + + a * b * d * e + + 81 * c * d^2 * e + + 10 * d * e^3 + + 62 * a * c^4 + + 41 * a * b * c^2 * d + + 59 * b * c^2 * d^2 + + 25 * a * b^2 * c * e + + 26 * a * b * d^2 * e + + 50 * a * b^2 * e^2 + + 20 * a^2 * c * e^2 + + 75 * a * b * c * e^2 + + 68 * a * d^2 * e^2 + + 8 * b^2 * e^3 + + 48 * c * d * e^3, + 35 * a * b^2 + + 68 * b^2 * d + + 54 * d^3 + + 81 * b * c * e + + 53 * a * d * e + + 88 * a^3 * b + + 43 * a * c * d^2 + + 69 * b * c * d^2 + + 35 * c^2 * d * e + + 81 * a^2 * b^2 * c + + 13 * a^4 * d + + 30 * a * c^3 * d + + 27 * b * c * d^3 + + 29 * c * d^4 + + 19 * c^4 * e + + 67 * a * b^2 * d * e + + 45 * a * c * d^2 * e + + 64 * a * b^2 * e^2 + + 83 * a^2 * e^3 + + 68 * b * c * e^3 + + 16 * a * e^4 + + 52 * b * e^4, + 8 * a + + 45 * c + + 74 * a * c + + 36 * b * c + + 75 * a * d + + 56 * a * b * c + + 4 * a * c^2 + + 32 * a^2 * d + + 23 * a^3 * c + + 20 * a * b * c^2 + + 51 * a^2 * d^2 + + 8 * a^2 * b * e + + 60 * a * b * e^2 + + 39 * b^2 * e^2 + + 67 * a * c * e^2 + + 77 * b * c * e^2 + + 32 * d^2 * e^2 + + 77 * e^4 + + 50 * a^4 * b + + 63 * a * b^3 * c + + 77 * a^3 * c^2 + + 39 * a^3 * c * e + + 54 * a^2 * b * c * e + + 19 * b^3 * c * e + + 5 * a^3 * d * e + + 23 * a^2 * b * d * e + + 44 * a * b^2 * d * e + + 27 * a^2 * d^2 * e + + 36 * a * b * d^2 * e + + 34 * a^2 * b * e^2 + + 10 * c^3 * e^2 + + 19 * c^2 * e^3, + ], + ), + ) + + push!( + ideals, + Singular.Ideal( + R, + [ + 87 * c + + 47 * c * d + + 53 * e^2 + + 86 * a * b^2 + + 77 * b^2 * c + + 88 * b * d^2 + + 47 * b * d * e + + 55 * a * b^2 * c + + 71 * c^2 * d^2 + + 70 * a^3 * e + + 61 * a^2 * b * e + + 81 * b * e^3 + + 6 * c * e^3 + + 59 * a^5 + + 26 * a^2 * b^2 * c + + 72 * a^4 * d + + 24 * a^3 * c * d + + 62 * b * c^2 * d^2 + + 82 * a * d^4 + + 88 * a * c^3 * e + + 85 * d^4 * e + + 47 * a * c^2 * e^2 + + 87 * c * d^2 * e^2 + + 53 * b * e^4, + 89 + + 6 * c * e + + 5 * a^2 * c + + 17 * b * c * e + + 83 * c * e^2 + + 18 * a^3 * b + + 21 * a * c^3 + + 56 * b * c^3 + + 61 * a * b * c * d + + 33 * c^3 * e + + 41 * a * d^2 * e + + 70 * c * d^2 * e + + 32 * a * d * e^2 + + 9 * b * e^3 + + 39 * a^5 + + 48 * a^4 * b + + 21 * a^3 * b * c + + 50 * a^3 * b * d + + 76 * b^3 * d^2 + + 59 * b^2 * c * d^2 + + 14 * a * c * d^3 + + 40 * a * d^4 + + 28 * c * d^4 + + 55 * a^2 * b * d * e + + 63 * b * d^3 * e + + 85 * d^4 * e + + 22 * a * b * d * e^2 + + 68 * c * d * e^3, + 43 * e + + 77 * a * e + + 72 * e^2 + + 72 * a^2 * b + + 88 * a^2 * c + + 21 * b^2 * d + + 80 * a * b * e + + 48 * a^4 + + 50 * a * b^2 * d + + 76 * a * d^3 + + 42 * c * d^3 + + 53 * a^3 * e + + 78 * a * e^3 + + 72 * a^5 + + 14 * a^3 * b^2 + + 13 * a^3 * b * c + + 56 * a^2 * b * c * d + + 72 * b^3 * c * d + + 83 * a^2 * c^2 * d + + 50 * b^2 * c^2 * d + + 73 * c^3 * d^2 + + 41 * a * c * d^3 + + 45 * a^2 * b * c * e + + 19 * b^3 * c * e + + 24 * c^3 * e^2 + + 86 * d^3 * e^2, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 89 + + 14 * a * b + + 90 * a * e + + 36 * b * c^2 + + 9 * c^3 + + 67 * a^2 * d + + 16 * a * b * e + + 8 * c^2 * e + + 7 * c * d * e + + 76 * a * b^2 * c + + 16 * c^4 + + 6 * c^3 * d + + b^2 * d^2 + + 54 * a^2 * d * e + + 90 * a * c * d * e + + 47 * b * d^2 * e + + 41 * b^3 * c^2 + + 10 * a^2 * c^3 + + 4 * a * b^3 * d + + 46 * b^4 * d + + 47 * a^2 * c^2 * d + + 65 * b^3 * d^2 + + 74 * a * b * c * d^2 + + 73 * b * c * d^3 + + 50 * a^2 * b^2 * e + + 46 * c^4 * e + + 7 * b^2 * d^2 * e + + 78 * a * c^2 * e^2 + + 45 * b * c * d * e^2 + + 4 * a^2 * e^3 + + 90 * b^2 * e^3 + + 10 * a * e^4, + 41 * a + + 74 * e + + 89 * b^3 + + 20 * b * c^2 + + 14 * b * c * d + + 21 * c^2 * d + + 4 * b^2 * d^2 + + 87 * a^3 * e + + 24 * a * c * e^2 + + 62 * b^2 * c^3 + + 4 * c^5 + + 25 * a * b^3 * d + + 25 * a * c^3 * d + + 84 * a * c * d^3 + + 60 * c^4 * e + + 51 * a^2 * b * d * e + + 17 * a^2 * c * d * e + + 55 * b^2 * c * d * e + + 46 * a * d^3 * e + + 65 * a^2 * e^3 + + 62 * a * d * e^3, + 75 * b * c + + 68 * c * e + + 47 * e^2 + + 57 * b * d^2 + + 23 * a * b^3 + + 14 * a^2 * c^2 + + 81 * a * b^2 * d + + 34 * b * c^2 * d + + 25 * b^2 * d^2 + + 71 * c * d^3 + + 67 * a * b^2 * e + + 17 * a * c^2 * e + + 63 * a^2 * d * e + + 17 * a^2 * e^2 + + 90 * a * d * e^2 + + 84 * a^4 * b + + 29 * a^3 * c^2 + + 28 * a^2 * b * c^2 + + 65 * b^3 * c * d + + 3 * a * b * c * d^2 + + 35 * c^3 * d^2 + + 46 * a^2 * c^2 * e + + 61 * a^2 * d^2 * e + + 29 * a * d^2 * e^2 + + 45 * b^2 * e^3, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 31 * d + + 70 * c * e + + 64 * b^2 * c + + 26 * a * c * d + + 78 * a * d^2 + + 42 * b * d^2 + + 79 * a^3 * c + + 31 * b^3 * c + + 10 * c^4 + + 43 * a^3 * d + + 40 * a * c * d^2 + + a * d^3 + + 83 * d^4 + + 51 * a * c^2 * e + + 67 * a * d^2 * e + + 7 * d * e^3 + + 86 * b^5 + + 21 * a^2 * b^2 * c + + 57 * a * b^3 * c + + 76 * a * b^2 * c^2 + + 17 * a * c^4 + + 84 * c^5 + + 30 * a^3 * b * d + + 48 * a * b^2 * c * d + + 27 * b^2 * c^2 * d + + 16 * a^2 * c * d^2 + + 85 * c^2 * d^3 + + 15 * b * d^4 + + 44 * b * c^3 * e + + 5 * c^4 * e + + 81 * a * b^2 * d * e + + 14 * a * b * c * d * e + + 44 * b^2 * c * d * e + + 23 * a^2 * d^2 * e + + 41 * a^2 * b * e^2 + + 45 * b^3 * e^2 + + 8 * a^2 * c * e^2 + + 62 * a * b * d * e^2 + + 37 * a * d^2 * e^2 + + 17 * b * d^2 * e^2 + + 23 * b * e^4, + 3 * b + + 80 * b^2 + + 12 * b * c + + 80 * c * d + + 9 * b * c^2 + + 65 * c^3 + + 49 * b^2 * d + + 88 * a * d^2 + + 13 * b * c * e + + 38 * d^2 * e + + 86 * a * e^2 + + 64 * c * e^2 + + 9 * a^4 + + 89 * a^2 * b * c + + 23 * b^3 * c + + 83 * a^3 * d + + 47 * b^2 * c * d + + 79 * b^3 * e + + 2 * c * d^2 * e + + 77 * c * d * e^2 + + 14 * a * e^3 + + 48 * d * e^3 + + 30 * a^4 * b + + 86 * a^2 * b^2 * c + + 16 * a^4 * d + + 34 * a^3 * d^2 + + 19 * a^2 * b * d^2 + + 48 * b^3 * d^2 + + 90 * c^3 * d^2 + + 88 * a * d^4 + + 27 * a^4 * e + + 55 * a * b^3 * e + + 77 * a^2 * b * c * e + + 27 * a^2 * c^2 * e + + 21 * a * c^3 * e + + 73 * a^3 * d * e + + 9 * a^2 * b * d * e + + 41 * a * b * c * d * e + + 18 * a * c^2 * d * e + + 14 * a * c * d^2 * e + + 74 * b * d^3 * e + + 36 * a * c^2 * e^2 + + 63 * b * d * e^3 + + 59 * a * e^4 + + 62 * c * e^4 + + 4 * d * e^4, + 48 + + 13 * a + + 72 * a * c + + 65 * b * c + + 50 * b * d + + 11 * a * e + + 76 * c * e + + 20 * a^2 * c + + 43 * b * c * d + + 79 * c * d^2 + + 4 * d^3 + + 3 * a * b * e + + 67 * c^2 * e + + 20 * a * d * e + + 74 * c * e^2 + + 84 * d * e^2 + + 2 * a^2 * b^2 + + 25 * b^4 + + 54 * a^3 * c + + 74 * a * b^2 * c + + 3 * a^2 * c^2 + + 87 * a * b * c^2 + + 38 * c^4 + + 7 * a * c^2 * d + + 49 * b^2 * d^2 + + 21 * b * c * d^2 + + 65 * a^2 * b * e + + 61 * a * b^2 * e + + 61 * b^3 * e + + 86 * a^2 * c * e + + 13 * b^2 * c * e + + 30 * c^3 * e + + 3 * a^2 * d * e + + 50 * c * d^2 * e + + 85 * d^3 * e + + 53 * b * c * e^2 + + 88 * c * e^3 + + 53 * e^4 + + 60 * a^5 + + 84 * a^3 * c^2 + + 14 * a * b^2 * c^2 + + 31 * b^3 * c^2 + + 63 * c^5 + + 38 * b^4 * d + + 72 * a * b^2 * c * d + + 11 * a^2 * b * d^2 + + 21 * a * b^2 * d^2 + + 84 * c^3 * d^2 + + 43 * b^2 * d^3 + + 32 * d^5 + + 44 * a * b^2 * c * e + + 58 * a^2 * c^2 * e + + 44 * b^3 * d * e + + 10 * a * c^2 * d * e + + 71 * c^3 * d * e + + 21 * a^2 * d^2 * e + + 46 * b * c * d^2 * e + + 33 * a * d^3 * e + + 9 * b * d^3 * e + + 62 * a * c^2 * e^2 + + 10 * a^2 * d * e^2 + + 65 * a^2 * e^3 + + 78 * b * c * e^3 + + 22 * b * d * e^3 + + 74 * d * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 77 + + 82 * b + + 74 * a^2 + + 10 * b * c + + 10 * a * d + + 19 * a^3 + + 25 * a^2 * b + + 52 * a * c^2 + + 28 * a^2 * d + + 47 * a * c * d + + 72 * a * d^2 + + 20 * b * d^2 + + 24 * a * d * e + + 72 * a * e^2 + + 38 * d * e^2 + + 21 * a^3 * c + + 57 * a * b^2 * c + + 73 * b^2 * c^2 + + 34 * a * b * c * d + + 19 * c * d^3 + + 25 * a^3 * e + + 14 * a^2 * b * e + + 33 * a * b^2 * e + + 15 * a^2 * d * e + + 57 * b^2 * d * e + + 31 * b * d * e^2 + + 71 * d^2 * e^2 + + 88 * d * e^3 + + 49 * e^4 + + 53 * a^5 + + 2 * a^4 * c + + 24 * a * b^2 * c^2 + + 65 * b^3 * c^2 + + 38 * a * b * c^3 + + 2 * a^4 * d + + 64 * a^3 * b * d + + 87 * a^2 * b^2 * d + + 26 * b^4 * d + + 24 * a^2 * c^2 * d + + 81 * b * c^3 * d + + 14 * a * b^2 * d^2 + + 59 * a * b * c * d^2 + + 44 * a^2 * b * c * e + + 74 * a^2 * c^2 * e + + 3 * c^4 * e + + 13 * a^2 * d^2 * e + + 5 * a * c * d^2 * e + + 73 * b * c * d^2 * e + + 33 * c^2 * d^2 * e + + 66 * a^3 * e^2 + + 60 * a^2 * e^3 + + 79 * c * d * e^3, + 22 * c + + 38 * d + + 32 * a * b + + 31 * b * c + + 87 * c * e + + 33 * a^3 + + 71 * a * b^2 + + 7 * a * d^2 + + 40 * b * d * e + + 38 * d^2 * e + + 29 * a * b^3 + + 56 * b^3 * c + + 87 * b^2 * c * d + + 83 * b * c^2 * d + + 84 * b^2 * d^2 + + 44 * b * d^3 + + 90 * a * b * c * e + + 48 * a^2 * d * e + + 38 * a * b * d * e + + 35 * a * c * d * e + + 29 * d^3 * e + + 69 * b^2 * e^2 + + 68 * d^2 * e^2 + + 52 * a^3 * b^2 + + 88 * a^3 * b * c + + 76 * a^2 * b * c^2 + + a * b^2 * c^2 + + 41 * b^3 * c^2 + + 33 * a^2 * c^3 + + 12 * a * c^4 + + 20 * a^2 * b^2 * d + + 4 * a * c^3 * d + + 8 * b * c^2 * d^2 + + 83 * b^2 * d^3 + + 23 * a * c * d^3 + + 27 * b * c * d^3 + + 61 * b * d^4 + + 79 * d^5 + + 68 * a^3 * b * e + + 49 * a * c^3 * e + + 18 * a * b^2 * d * e + + 61 * b^2 * c * d * e + + 90 * b * c^2 * d * e + + 19 * b * c * d^2 * e + + 37 * a^3 * e^2 + + 55 * a^2 * b * e^2 + + 86 * b * c^2 * e^2 + + 35 * c^3 * e^2 + + 55 * b * c * d * e^2 + + 18 * a * c * e^3 + + 17 * a * d * e^3 + + 62 * e^5, + 4 * a^2 + + 45 * b^2 + + 71 * a * c + + 17 * a * b^2 + + 53 * a * c^2 + + 14 * a * c * d + + 51 * c * d * e + + 35 * d^2 * e + + 42 * c * e^2 + + 70 * a^4 + + 65 * a^2 * b * c + + 46 * b * c^2 * d + + 21 * a * b * d^2 + + 17 * a * c * d^2 + + 3 * a * d^3 + + 8 * b * d^3 + + 10 * a^3 * e + + 25 * b^2 * c * e + + 89 * a * c^2 * e + + 84 * a^2 * d * e + + 17 * a * c * d * e + + 65 * b * c * d * e + + 31 * a * b * e^2 + + 12 * d * e^3 + + 55 * a^3 * b^2 + + 5 * a * b^4 + + 34 * a * b^3 * c + + 34 * b^4 * c + + 74 * a^3 * c^2 + + 72 * a^2 * c^3 + + 34 * b^4 * d + + 82 * a * b^2 * c * d + + 33 * a * b^2 * d^2 + + 69 * a * b * c * d^2 + + 31 * a^4 * e + + 20 * a^3 * b * e + + 3 * a^2 * b^2 * e + + 85 * a^3 * c * e + + 61 * a * b * c * d * e + + 35 * c^2 * d^2 * e + + 30 * a * d^3 * e + + 29 * d^4 * e + + 19 * a^2 * b * e^2 + + 71 * b^3 * e^2 + + 27 * b * d^2 * e^2 + + 63 * a^2 * e^3 + + 4 * a * e^4 + + 43 * d * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 8 * b + + 54 * c + + 3 * b * d + + 42 * d * e + + 81 * a^2 * b + + 39 * a * b * c + + 45 * b^2 * c + + 39 * a * b * d + + 88 * a * c * d + + 88 * c * d^2 + + 8 * d^3 + + 73 * a * b * e + + 62 * a * c * e + + 61 * b * d * e + + 28 * c * d * e + + 34 * e^3 + + 73 * a^4 + + 45 * a^2 * b * c + + 45 * a^3 * d + + a^2 * c * d + + 90 * b^2 * c * d + + 25 * c^3 * d + + 27 * b * c * d^2 + + 48 * c^2 * d^2 + + 13 * a^3 * e + + 43 * a^2 * b * e + + 64 * a * b^2 * e + + 73 * b^3 * e + + 9 * b^2 * c * e + + 47 * a^2 * b^3 + + 85 * a * b^3 * c + + 4 * b^4 * c + + 41 * a^2 * b * c^2 + + 41 * a^2 * b * c * d + + 50 * a * b^2 * c * d + + 44 * b * c^3 * d + + 30 * a^3 * d^2 + + 14 * a * b^2 * d^2 + + 54 * a^2 * d^3 + + 49 * a^2 * b^2 * e + + 16 * b^3 * c * e + + 22 * a * b * c * d * e + + 13 * a * c^2 * d * e + + 70 * c^3 * d * e + + 80 * b * d^3 * e + + 7 * a * b^2 * e^2 + + 59 * a^2 * c * e^2 + + 6 * a^2 * d * e^2 + + 70 * a * b * d * e^2 + + 84 * c^2 * d * e^2 + + 74 * a * d^2 * e^2 + + 64 * a^2 * e^3 + + 90 * a * b * e^3, + 44 * e + + 13 * a * c + + 10 * b * d + + c * d + + 42 * d^2 + + 75 * d * e + + 14 * c^3 + + 69 * b^2 * d + + 56 * c * d * e + + 56 * a * e^2 + + 22 * a^3 * b + + 46 * a^3 * c + + 61 * a * b^2 * c + + 85 * b^2 * c^2 + + 73 * a^3 * d + + 64 * a^2 * b * d + + 13 * a * d^3 + + 42 * a^3 * e + + 15 * a * b * c * e + + 4 * a * d^2 * e + + 55 * a * c * e^2 + + 36 * b * d * e^2 + + 49 * c * e^3 + + 33 * d * e^3 + + 40 * a^5 + + 39 * a^3 * b * c + + 82 * b^4 * c + + 68 * a^3 * c^2 + + 53 * a * b * c^3 + + 67 * a^4 * d + + 36 * a^2 * c^2 * d + + 81 * a * b * c^2 * d + + 71 * a * c^3 * d + + 70 * a^2 * c * d^2 + + b * d^4 + + 65 * a^4 * e + + 6 * a * b^3 * e + + 30 * a^2 * b * c * e + + 74 * a * c^2 * d * e + + 81 * a * b * d^2 * e + + 79 * c^2 * d^2 * e + + 12 * b * d^3 * e + + 7 * d^4 * e + + 27 * a^2 * b * e^2 + + 28 * a * b * c * e^2 + + 51 * c^2 * d * e^2 + + 60 * c^2 * e^3 + + 76 * b * d * e^3 + + 42 * a * e^4 + + 33 * e^5, + 85 + + 28 * b * d + + 12 * d * e + + 84 * a * c^2 + + 70 * c^3 + + 12 * b * c * d + + 53 * b * e^2 + + 48 * d * e^2 + + 4 * b^4 + + 51 * b^3 * c + + 90 * b * c^3 + + a * b * c * d + + 68 * a * c^2 * d + + 75 * b * c^2 * d + + 22 * a^3 * e + + 72 * a * c^2 * e + + 32 * b^2 * d * e + + 36 * a * d^2 * e + + 17 * c * d^2 * e + + 21 * a^2 * e^2 + + 66 * a * b * e^2 + + 65 * c * d * e^2 + + 79 * c * e^3 + + 5 * a^5 + + 52 * a * b^4 + + 22 * a * c^4 + + 80 * c^5 + + 77 * a^4 * d + + 81 * a^3 * b * d + + 60 * a * b^3 * d + + 68 * a * b^2 * c * d + + 25 * b^2 * c^2 * d + + 83 * a^2 * b * d^2 + + 30 * a * b * d^3 + + 13 * b^2 * d^3 + + 4 * c * d^4 + + 49 * a^3 * c * e + + 85 * a * b^2 * c * e + + 23 * b^3 * d * e + + 48 * b * c * d^2 * e + + 16 * c * d^3 * e + + 82 * b^2 * c * e^2 + + 67 * c^3 * e^2 + + 30 * b * c * e^3 + + 39 * c^2 * e^3 + + 35 * a * d * e^3 + + 32 * d^2 * e^3 + + c * e^4 + + 53 * e^5, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 33 * b + + 68 * d + + 5 * e + + 38 * b * c + + 67 * c * d + + 3 * c * e + + 85 * b^3 + + 24 * a * b * c + + 49 * c^3 + + 87 * a^2 * d + + 55 * b * d^2 + + 43 * d^3 + + 28 * b^2 * e + + 64 * a * e^2 + + 26 * b * e^2 + + 2 * c * e^2 + + 79 * d * e^2 + + 83 * a^4 + + 60 * a^2 * c^2 + + 32 * a * c^3 + + 66 * b * c^3 + + 52 * c^4 + + 51 * a * b * c * d + + 6 * b^2 * c * d + + 67 * a * b * d^2 + + 80 * d^4 + + 4 * a^2 * c * e + + 56 * a * c^2 * e + + 59 * b^2 * d * e + + 6 * a * d^2 * e + + 55 * b * d^2 * e + + 11 * c * d^2 * e + + 33 * d^3 * e + + 50 * a * c * e^2 + + 51 * b * c * e^2 + + 9 * c^2 * e^2 + + 15 * b * d * e^2 + + 21 * a * e^3 + + 19 * e^4 + + 82 * a^3 * b^2 + + 15 * a * b^4 + + 26 * a^4 * c + + 81 * a^3 * b * c + + 39 * a^2 * b^2 * c + + 46 * a^3 * c^2 + + 64 * a * b^2 * c^2 + + 78 * a^2 * b^2 * d + + 56 * a * b^3 * d + + 39 * b^4 * d + + 53 * a * b^2 * c * d + + 78 * b^2 * c^2 * d + + 74 * b * c^3 * d + + 22 * c^4 * d + + 5 * b^3 * d^2 + + 53 * a^2 * c * d^2 + + 18 * a^2 * d^3 + + 71 * a * b * d^3 + + 21 * c^2 * d^3 + + 77 * b * d^4 + + 74 * d^5 + + 76 * a * b^3 * e + + 82 * b^4 * e + + 75 * a^2 * c^2 * e + + 9 * b * c^3 * e + + 62 * a * b^2 * d * e + + 88 * a^2 * c * d * e + + 59 * a * b * c * d * e + + 32 * a * c * d^2 * e + + 44 * b * c * d^2 * e + + 24 * a^3 * e^2 + + 48 * b^3 * e^2 + + 34 * a^2 * c * e^2 + + 48 * a * b * c * e^2 + + 13 * b^2 * c * e^2 + + 70 * b * c^2 * e^2 + + 61 * a^2 * d * e^2 + + 21 * a * c * d * e^2 + + 5 * b * c * d * e^2 + + 81 * b * d^2 * e^2 + + 7 * c * d^2 * e^2 + + 53 * b * c * e^3 + + 52 * c^2 * e^3 + + 71 * d * e^4 + + 66 * e^5, + 51 + + 88 * a^2 + + 30 * a * c + + 59 * b * c + + 77 * b * d + + 27 * d^2 + + 86 * c * e + + 37 * a^2 * b + + 73 * a * b^2 + + 61 * a^2 * c + + 72 * b^2 * c + + 20 * a^2 * d + + 29 * b * d^2 + + 76 * a * b * e + + 72 * a * c * e + + 29 * c^2 * e + + 28 * e^3 + + 26 * a^2 * c^2 + + 21 * b^2 * c^2 + + 89 * a^3 * d + + 66 * b^3 * d + + 29 * a * c^2 * d + + 46 * c^3 * d + + 19 * a * b * d^2 + + 63 * b^2 * d^2 + + 73 * a * d^3 + + 78 * b * d^3 + + 53 * a^3 * e + + 66 * a * c^2 * e + + 15 * b * c^2 * e + + 24 * c^3 * e + + 21 * a * c * d * e + + 51 * c * d^2 * e + + 40 * b * c * e^2 + + 56 * c * d * e^2 + + 25 * a * e^3 + + 53 * b * e^3 + + 30 * e^4 + + 80 * b^5 + + 62 * b^3 * c^2 + + 76 * a^2 * c^3 + + 23 * b * c^4 + + 42 * c^5 + + 72 * a * b^3 * d + + 39 * a^2 * b * c * d + + 88 * b^3 * c * d + + 76 * a^2 * c^2 * d + + 68 * a * b * c^2 * d + + 2 * a^3 * d^2 + + 22 * a^2 * b * d^2 + + 50 * a * b^2 * d^2 + + 59 * a^2 * c * d^2 + + 45 * a^2 * d^3 + + 90 * b * d^4 + + 17 * a^2 * b^2 * e + + 89 * b^4 * e + + 31 * a^2 * c * d * e + + 64 * a * b * c * d * e + + 24 * b^2 * c * d * e + + 62 * a * c^2 * d * e + + 25 * a^2 * d^2 * e + + 11 * a^2 * b * e^2 + + 28 * a * b^2 * e^2 + + 39 * b^2 * c * e^2 + + 19 * b * c^2 * e^2 + + 85 * a^2 * d * e^2 + + 39 * a * b * d * e^2 + + 29 * a * c * d * e^2 + + 53 * c * d^2 * e^2 + + 90 * a * c * e^3 + + 38 * c * d * e^3 + + 58 * c * e^4, + 85 * a + + 75 * e + + 80 * a^2 + + 68 * b * d + + 7 * c * d + + 21 * a * e + + 71 * e^2 + + 38 * b^2 * c + + 9 * a^2 * d + + 44 * b^2 * d + + 76 * a * c * d + + 63 * c^2 * d + + 41 * a * d^2 + + 34 * a^2 * e + + 75 * b * c * e + + 16 * c^2 * e + + 19 * b * d * e + + 88 * d^2 * e + + 69 * a^4 + + 76 * a^3 * b + + 15 * a * b^3 + + 19 * b^4 + + 67 * a * b * c^2 + + 27 * b^2 * c^2 + + 47 * a^2 * b * d + + 40 * a * b^2 * d + + a * c^2 * d + + 18 * b * c^2 * d + + 51 * a * c * d^2 + + 40 * a * d^3 + + 3 * b * d^3 + + d^4 + + 65 * a^2 * b * e + + 23 * a^2 * c * e + + 19 * b^2 * c * e + + 66 * b * c^2 * e + + 42 * c^2 * d * e + + 24 * a^2 * e^2 + + 24 * a^4 * b + + 80 * a^4 * c + + 83 * b^3 * c^2 + + 62 * a * b * c^3 + + 4 * b * c^4 + + 34 * a^3 * c * d + + 3 * a * b^2 * c * d + + 9 * a * c^3 * d + + 44 * c^4 * d + + 58 * a^3 * d^2 + + 23 * a^2 * c * d^2 + + 77 * a * b * c * d^2 + + 83 * b^2 * c * d^2 + + 40 * c^3 * d^2 + + 20 * a * c * d^3 + + 35 * a * d^4 + + 12 * b * d^4 + + 12 * a^2 * b^2 * e + + 30 * a^2 * b * c * e + + 79 * b^3 * d * e + + 9 * a * c^2 * d * e + + 10 * a^2 * d^2 * e + + 53 * a * b * d^2 * e + + 13 * b^2 * d^2 * e + + 81 * c^2 * d^2 * e + + 89 * d^4 * e + + 80 * a * b^2 * e^2 + + 58 * c^3 * e^2 + + 63 * a^2 * d * e^2 + + 65 * c * d^2 * e^2 + + 45 * d^3 * e^2 + + 81 * a^2 * e^3 + + 85 * b^2 * e^3 + + 5 * b * c * e^3 + + 67 * d^2 * e^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 86 + + 66 * a + + 27 * c + + 82 * e + + 81 * a * c + + 33 * d * e + + 3 * a^3 + + 66 * a^2 * c + + 59 * b^2 * c + + 60 * b * c^2 + + 37 * a * b * d + + 88 * b^2 * d + + 13 * c^2 * d + + 4 * c * d^2 + + 60 * d^3 + + 78 * a * b * e + + 82 * b^2 * e + + 37 * c^2 * e + + 27 * c * d * e + + 39 * b * e^2 + + 75 * d * e^2 + + 3 * e^3 + + 34 * a^4 + + 6 * a^2 * b^2 + + 77 * b^4 + + 30 * a^3 * c + + 21 * a^2 * b * c + + 27 * a * b * c^2 + + 48 * a * c^3 + + 33 * c^4 + + 4 * a * c^2 * d + + 74 * a * b * d^2 + + 42 * b^2 * d^2 + + 78 * a * d^3 + + 13 * b^3 * e + + 79 * b^2 * c * e + + 21 * c^3 * e + + 34 * a^2 * d * e + + 63 * a * d^2 * e + + 77 * a^2 * e^2 + + 18 * a * d * e^2 + + 60 * c * d * e^2 + + 40 * a^2 * b^2 * c + + 48 * a^2 * b * c^2 + + c^5 + + 79 * a * b^3 * d + + 59 * b * c^3 * d + + 24 * a * b * c * d^2 + + 49 * b * c^2 * d^2 + + 47 * a * b * d^3 + + 32 * b * c * d^3 + + 5 * a * d^4 + + 35 * b * d^4 + + 70 * a^4 * e + + 43 * a^2 * b * c * e + + 71 * a * b^2 * c * e + + 20 * c^4 * e + + 41 * a^3 * d * e + + 3 * a^2 * c * d * e + + 64 * a * b * c * d * e + + 55 * a * c^2 * d * e + + 11 * b * c^2 * d * e + + 31 * b^2 * d^2 * e + + 12 * c^2 * d^2 * e + + 59 * a * d^3 * e + + 26 * d^4 * e + + 8 * a * b^2 * e^2 + + 39 * b^2 * c * e^2 + + 15 * a^2 * d * e^2 + + 27 * a * b * d * e^2 + + 78 * b * d^2 * e^2 + + 86 * d^3 * e^2 + + 83 * d * e^4, + 28 * d + + 26 * a * c + + 2 * c^2 + + 46 * c * d + + 8 * c * e + + 82 * d * e + + 11 * a * b^2 + + 35 * a * b * c + + 61 * c^3 + + 7 * a * c * d + + 83 * d^3 + + 34 * b * c * e + + 18 * c^2 * e + + 13 * b * e^2 + + 35 * a^4 + + 72 * a^3 * b + + 16 * b^4 + + 59 * a^3 * c + + 70 * a^2 * c^2 + + 32 * a * b * c^2 + + 55 * b^2 * c^2 + + 57 * a * c^3 + + 27 * a^2 * c * d + + 20 * c^3 * d + + 31 * a^2 * d^2 + + 81 * a * c * d^2 + + 32 * c^2 * d^2 + + 69 * a * b * c * e + + 32 * b * c^2 * e + + 81 * a * b * d * e + + 47 * a * d^2 * e + + 77 * a * c * e^2 + + 34 * a * d * e^2 + + 58 * c * d * e^2 + + 43 * a * e^3 + + 73 * c * e^3 + + 87 * d * e^3 + + 69 * e^4 + + 14 * a^3 * b^2 + + 19 * a^2 * b^3 + + 20 * a^4 * c + + 64 * a^2 * b^2 * c + + 58 * b^4 * c + + 13 * a^3 * c^2 + + b^2 * c^3 + + 38 * a^4 * d + + 88 * b^3 * c * d + + 32 * a * b * c^2 * d + + a^3 * d^2 + + 87 * a^2 * b * d^2 + + 71 * b^3 * d^2 + + 54 * a * b * c * d^2 + + 52 * b^2 * c * d^2 + + 64 * b * c^2 * d^2 + + 78 * a^2 * d^3 + + 43 * b^2 * d^3 + + 47 * b * c * d^3 + + 84 * c^2 * d^3 + + 10 * b * d^4 + + 14 * a^3 * c * e + + 78 * a^2 * b * c * e + + 10 * a * c^3 * e + + 77 * b * c^3 * e + + 17 * a^3 * d * e + + 75 * a^2 * b * d * e + + 71 * a * b^2 * d * e + + 70 * b^2 * c * d * e + + 31 * b * d^3 * e + + 76 * d^4 * e + + 68 * a^3 * e^2 + + 70 * a * b^2 * e^2 + + 8 * b * c^2 * e^2 + + 60 * b * c * d * e^2 + + 73 * c^2 * d * e^2 + + 12 * a * c * e^3 + + 40 * b * c * e^3 + + 36 * a * d * e^3 + + 9 * c * e^4, + 69 * e + + 21 * a^2 + + 59 * a * c + + 54 * c^2 + + 7 * d^2 + + 81 * a * e + + 28 * b * e + + 82 * e^2 + + 32 * a^2 * c + + 25 * a * c^2 + + 42 * b * c^2 + + b * d^2 + + 31 * a * b * e + + 77 * b^2 * e + + 87 * a * d * e + + 78 * d^2 * e + + 81 * a^3 * b + + 8 * b^2 * c^2 + + b * c^3 + + 59 * a * b^2 * d + + 5 * a * b * c * d + + 84 * c^3 * d + + 35 * b^2 * d^2 + + 18 * c^2 * d^2 + + 23 * b * d^3 + + 46 * d^4 + + 62 * a * b^2 * e + + 41 * b^3 * e + + 70 * b * c^2 * e + + 48 * a^2 * d * e + + 50 * b^2 * d * e + + 18 * a * c * e^2 + + 84 * c^2 * e^2 + + 75 * b * d * e^2 + + 59 * e^4 + + 43 * a^5 + + 44 * a^4 * b + + 42 * a^2 * b^3 + + 33 * a * b^4 + + 13 * a^2 * b^2 * c + + 21 * a^2 * c^3 + + 7 * b^2 * c^3 + + 52 * a^4 * d + + 77 * a^3 * c * d + + 70 * a^2 * b * c * d + + 52 * a^2 * b * d^2 + + 69 * a * b^2 * d^2 + + 29 * a^2 * c * d^2 + + 14 * a * c^2 * d^2 + + 54 * b * c^2 * d^2 + + 87 * a^2 * d^3 + + 90 * b^2 * d^3 + + 84 * a * d^4 + + 4 * d^5 + + 36 * a^4 * e + + 48 * a^2 * b^2 * e + + 8 * a * b^2 * c * e + + 16 * a^2 * c^2 * e + + 17 * a * b * c^2 * e + + 52 * b^2 * c^2 * e + + 88 * c^4 * e + + 86 * a * b^2 * d * e + + 35 * b^2 * c * d * e + + 80 * c^3 * d * e + + 33 * b^2 * d^2 * e + + 87 * c * d^3 * e + + 61 * a^3 * e^2 + + 73 * a * b^2 * e^2 + + 70 * b^3 * e^2 + + 40 * b^2 * c * e^2 + + 5 * a^2 * d * e^2 + + 66 * a * b * d * e^2 + + 19 * b^2 * d * e^2 + + 65 * b * d^2 * e^2 + + 20 * c * d^2 * e^2 + + 12 * a^2 * e^3 + + 68 * b * e^4 + + 80 * e^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 41 + + 17 * a + + 34 * b * c + + 37 * d^2 + + 25 * a^2 * c + + 39 * a * b * c + + 29 * b * c^2 + + 77 * c^3 + + 67 * b^2 * d + + 18 * c * d^2 + + 7 * b^2 * e + + 81 * c^2 * e + + 75 * d^2 * e + + 89 * b * e^2 + + 16 * d * e^2 + + 58 * a^2 * b * c + + 43 * b^3 * c + + 29 * a * b * c^2 + + 82 * a * c^3 + + 87 * a * b^2 * d + + 10 * b^3 * d + + 8 * a * b * d^2 + + 17 * b^2 * d^2 + + 35 * a * c * d^2 + + b * c * d^2 + + 44 * b * d^3 + + 52 * c * d^3 + + 83 * a^2 * c * e + + 6 * a * b * c * e + + 47 * a^2 * d * e + + 10 * c^2 * d * e + + 58 * a * d^2 * e + + 21 * c^2 * e^2 + + 21 * a^4 * b + + 19 * a^2 * b^3 + + 63 * a^3 * b * c + + 75 * a^2 * b^2 * c + + 26 * a * b^3 * c + + 6 * a * c^4 + + 22 * c^5 + + 3 * a^3 * b * d + + 62 * a * b^3 * d + + 80 * b^4 * d + + 75 * a^2 * c^2 * d + + 35 * a * c^3 * d + + 49 * a * b^2 * d^2 + + 78 * a * b * c * d^2 + + 86 * a * c^2 * d^2 + + 86 * a * c * d^3 + + 6 * a^3 * b * e + + 5 * a^2 * b^2 * e + + 19 * b^4 * e + + 73 * a * c^3 * e + + 89 * b * c^3 * e + + 22 * a^3 * d * e + + 74 * a^2 * c * d * e + + 90 * a * b * c * d * e + + 52 * b * c^2 * d * e + + 14 * a^2 * d^2 * e + + 28 * b^2 * d^2 * e + + 28 * b * c * d^2 * e + + 62 * a * d^3 * e + + 69 * d^4 * e + + 66 * a * b^2 * e^2 + + 67 * b * c^2 * e^2 + + 13 * a^2 * d * e^2 + + 24 * a * d^2 * e^2 + + 79 * a * c * e^3 + + 74 * b * c * e^3 + + 6 * a * d * e^3 + + 39 * b * e^4, + 45 * c + + 11 * a^2 + + 84 * b^2 + + 5 * c^2 + + 36 * c * d + + 21 * a * e + + 54 * e^2 + + 35 * a^3 + + 45 * a * b^2 + + 88 * b^3 + + 74 * b^2 * c + + 72 * a^2 * d + + 22 * a * b * e + + 41 * a * c * e + + 54 * a * d * e + + 53 * a * e^2 + + 61 * d * e^2 + + 17 * a^3 * c + + 69 * a * b^2 * c + + 9 * b * c^3 + + 37 * a * c^2 * d + + 52 * b * c^2 * d + + 11 * c^3 * d + + 76 * a * d^3 + + 86 * d^4 + + 13 * a^3 * e + + 78 * a^2 * b * e + + 13 * a * b^2 * e + + 89 * b^3 * e + + 31 * a * b * c * e + + 26 * b^2 * c * e + + 14 * c^3 * e + + 46 * b * c * d * e + + 73 * a * d^2 * e + + 33 * c * d^2 * e + + 42 * a * b * e^2 + + 77 * b^2 * e^2 + + 10 * a * c * e^2 + + 66 * a^3 * b^2 + + 24 * a^3 * c^2 + + 12 * a^2 * b * c^2 + + 54 * a * b^2 * c^2 + + 63 * b^2 * c^3 + + 43 * b^4 * d + + 34 * a^3 * c * d + + 30 * a * b^2 * c * d + + b^3 * c * d + + 54 * b^2 * c^2 * d + + 34 * a * c^3 * d + + 70 * a * b^2 * d^2 + + 4 * b^3 * d^2 + + 61 * a^2 * c * d^2 + + 21 * a * b * c * d^2 + + 46 * b^2 * c * d^2 + + 70 * a^2 * d^3 + + 5 * b^2 * d^3 + + 51 * a^3 * b * e + + 78 * a^2 * b^2 * e + + 64 * a * b^3 * e + + 9 * a^2 * b * c * e + + 69 * a * b^2 * c * e + + 17 * a * b * c^2 * e + + 15 * b^2 * c^2 * e + + 84 * a * c^3 * e + + 11 * b^2 * c * d * e + + 44 * b * c^2 * d * e + + 25 * a * d^3 * e + + 8 * a * b^2 * e^2 + + 30 * b^2 * c * e^2 + + 53 * b * c^2 * e^2 + + 12 * c^3 * e^2 + + 63 * a^2 * d * e^2 + + 19 * b^2 * d * e^2 + + 79 * c^2 * d * e^2 + + 4 * a * d^2 * e^2 + + 15 * c * d^2 * e^2 + + 41 * a^2 * e^3 + + 6 * b^2 * e^3 + + 7 * a * c * e^3 + + 84 * c * d * e^3, + 66 * b + + 54 * c + + 5 * d + + 87 * a * c + + 9 * c^2 + + 16 * c * d + + 69 * d^2 + + 83 * b * e + + 26 * d * e + + 24 * b^3 + + 43 * a * b * c + + 8 * a^2 * d + + 14 * b^2 * d + + 15 * a * c * d + + 44 * a * d^2 + + 59 * a^2 * e + + 17 * a * b * e + + 28 * a * c * e + + 5 * a * d * e + + 32 * e^3 + + 15 * a^3 * b + + 31 * a^2 * b^2 + + 40 * a * b^3 + + 73 * b^3 * c + + 56 * b^2 * c^2 + + 84 * a * c^3 + + 13 * a * b^2 * d + + 17 * a^2 * c * d + + 73 * c^3 * d + + 46 * b^2 * d^2 + + 85 * b * d^3 + + 75 * c * d^3 + + 52 * a * b^2 * e + + 5 * b^2 * c * e + + 58 * c^3 * e + + 78 * a * b * d * e + + 83 * b^2 * d * e + + b * d^2 * e + + 85 * c * d^2 * e + + 30 * a * c * e^2 + + 2 * c^2 * e^2 + + 37 * a * e^3 + + 6 * b * e^3 + + 63 * e^4 + + 7 * a^2 * b^3 + + b^5 + + 40 * b^3 * c^2 + + 10 * a^2 * c^3 + + 7 * b * c^4 + + 81 * a^3 * c * d + + 71 * a^2 * b * c * d + + 33 * a * b * c^2 * d + + 19 * a * c^3 * d + + 4 * a * b * c * d^2 + + 52 * c^3 * d^2 + + 12 * a * d^4 + + 43 * c * d^4 + + 46 * d^5 + + 14 * a^3 * b * e + + 40 * a^2 * b * c * e + + 88 * a^2 * c^2 * e + + 24 * b^2 * c^2 * e + + 9 * b * c^3 * e + + 90 * a^2 * c * d * e + + 38 * a * c^2 * d * e + + 82 * b * c^2 * d * e + + 35 * a * b * c * e^2 + + 10 * b^2 * c * e^2 + + 10 * a * c^2 * e^2 + + 51 * c^3 * e^2 + + 20 * c^2 * d * e^2 + + 46 * d^3 * e^2 + + 42 * a * d * e^3 + + 70 * c * d * e^3 + + 68 * a * e^4 + + 38 * c * e^4 + + 63 * d * e^4 + + 80 * e^5, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 83 * b + + 2 * d + + 75 * e + + 38 * a^2 + + 88 * a * b + + 87 * c^2 + + 11 * b * e + + 33 * c * e + + 68 * e^2 + + 4 * a^2 * b + + 2 * a^2 * c + + 75 * a * b * c + + 56 * b * c^2 + + 13 * a^2 * d + + 19 * a * b * d + + 66 * b^2 * d + + 80 * c^2 * d + + 89 * b * d^2 + + 72 * a * b * e + + 2 * b^2 * e + + 21 * c^2 * e + + 84 * d^2 * e + + 15 * a * e^2 + + 74 * b * e^2 + + 14 * a^3 * b + + 48 * a * b^3 + + 25 * a^3 * c + + 67 * a * b * c^2 + + 74 * a * c^3 + + 63 * c^4 + + 11 * a^3 * d + + 32 * a^2 * b * d + + 83 * a^2 * c * d + + 3 * a * c^2 * d + + 8 * a * c * d^2 + + 46 * b * c * d^2 + + 57 * c^2 * d^2 + + 16 * b * d^3 + + 4 * a^2 * b * e + + 41 * b^3 * e + + 33 * b^2 * c * e + + 50 * b * c^2 * e + + 35 * a * b * d * e + + 55 * a * c * d * e + + 54 * c^2 * d * e + + 54 * b * d^2 * e + + 26 * d^3 * e + + 81 * b^2 * e^2 + + 72 * a * c * e^2 + + 71 * b * c * e^2 + + 37 * a * d * e^2 + + 2 * c * e^3 + + 17 * e^4 + + 50 * a * b^4 + + 39 * b^5 + + 8 * a * b^3 * c + + 69 * a^3 * c^2 + + 21 * a * b^2 * c^2 + + 24 * b^2 * c^3 + + 8 * a * c^4 + + 49 * a^4 * d + + 53 * a * b^3 * d + + 69 * a^2 * c^2 * d + + 23 * a * b * c^2 * d + + 18 * b^2 * c^2 * d + + 32 * b * c^3 * d + + 27 * b^3 * d^2 + + 14 * a * b * c * d^2 + + 12 * a * c^2 * d^2 + + 51 * a^2 * d^3 + + 32 * a * b * d^3 + + 7 * b^2 * d^3 + + 23 * d^5 + + 61 * a^3 * b * e + + 11 * a^3 * c * e + + 78 * b^2 * c^2 * e + + 13 * c^4 * e + + 64 * b^3 * d * e + + 48 * a * b * c * d * e + + 42 * a * c^2 * d * e + + 6 * b * c^2 * d * e + + 30 * b^2 * d^2 * e + + 65 * b * c * d^2 * e + + 64 * a * d^3 * e + + 38 * b * d^3 * e + + 83 * a^3 * e^2 + + 4 * a^2 * b * e^2 + + 7 * a * b * c * e^2 + + 8 * a * c^2 * e^2 + + 79 * b * c^2 * e^2 + + 6 * c^3 * e^2 + + 4 * a^2 * d * e^2 + + 80 * a * c * d * e^2 + + 48 * b^2 * e^3 + + 55 * c^2 * e^3 + + 72 * a * d * e^3 + + 76 * b * d * e^3 + + 33 * b * e^4, + 37 + + 60 * a * b + + 68 * c^2 + + 62 * a * d + + 34 * b * d + + 53 * a * e + + 23 * d * e + + 64 * e^2 + + 20 * a^3 + + 78 * b^3 + + 21 * a^2 * c + + 87 * b^2 * c + + 39 * a * c^2 + + 80 * a^2 * d + + 10 * b * c * d + + 63 * c^2 * d + + 36 * d^3 + + 85 * b^2 * e + + 50 * a * c * e + + 30 * d^2 * e + + 88 * a * e^2 + + 87 * e^3 + + 80 * a^3 * b + + 36 * a^2 * b^2 + + 36 * b^4 + + 67 * b^3 * c + + 77 * a^2 * c^2 + + 43 * a^3 * d + + 41 * a * b^2 * d + + 27 * b^3 * d + + 22 * a * b * c * d + + 87 * b^2 * c * d + + 74 * a * c^2 * d + + 64 * a * b * d^2 + + 69 * a * c * d^2 + + 61 * a * d^3 + + 62 * c * d^3 + + 71 * a^3 * e + + 41 * b * c^2 * e + + 67 * a * c * d * e + + 18 * b * c * d * e + + 51 * a * d^2 * e + + 73 * b * d^2 * e + + 14 * c * d^2 * e + + 82 * a * b * e^2 + + 60 * c^2 * e^2 + + 12 * b * d * e^2 + + 21 * b * e^3 + + 21 * c * e^3 + + 6 * e^4 + + 71 * a^5 + + 16 * a^2 * b^3 + + 6 * a * b^4 + + 65 * a^3 * b * c + + 19 * b^4 * c + + 46 * a^3 * c^2 + + 3 * a^2 * b * c^2 + + 21 * a * b^2 * c^2 + + 51 * a^2 * c^3 + + 36 * b * c^4 + + 32 * a^4 * d + + 33 * a^2 * b^2 * d + + 26 * b^4 * d + + 62 * a^2 * b * c * d + + 42 * b^3 * c * d + + 88 * a^2 * c^2 * d + + 39 * a * b * c^2 * d + + 32 * a^3 * d^2 + + 66 * a^2 * b * d^2 + + 70 * b^3 * d^2 + + 16 * b^2 * c * d^2 + + 12 * a * c^2 * d^2 + + 42 * c^3 * d^2 + + 37 * b^2 * d^3 + + 67 * a * c * d^3 + + 4 * a * d^4 + + 31 * b * d^4 + + 15 * d^5 + + 82 * b^3 * c * e + + 14 * a^2 * c^2 * e + + 56 * a * b * c^2 * e + + 55 * b^2 * c^2 * e + + 70 * b * c^3 * e + + 32 * a^3 * d * e + + 35 * a^2 * b * d * e + + 38 * b^3 * d * e + + 15 * a^2 * c * d * e + + 29 * b^2 * c * d * e + + 30 * c^3 * d * e + + 60 * a * b * d^2 * e + + 82 * b^2 * d^2 * e + + 87 * a * c * d^2 * e + + 16 * c^2 * d^2 * e + + 50 * b * d^3 * e + + 67 * a^3 * e^2 + + b^3 * e^2 + + 68 * a * b * c * e^2 + + 39 * c^3 * e^2 + + 50 * a * b * d * e^2 + + 41 * a * d^2 * e^2 + + 73 * b * d^2 * e^2 + + 46 * c * d^2 * e^2 + + 44 * a * b * e^3 + + 30 * a * c * e^3 + + 43 * c^2 * e^3 + + 33 * b * e^4 + + 26 * c * e^4 + + 46 * e^5, + 44 + + 34 * a + + 72 * c + + 81 * d + + 68 * a^2 + + 56 * a * b + + 3 * b^2 + + 79 * c^2 + + 49 * c * e + + 88 * a^2 * b + + 28 * a * b^2 + + 83 * a^2 * c + + 7 * a * b * c + + 88 * b * c^2 + + 61 * c^3 + + 4 * a * b * d + + 5 * b * d^2 + + 50 * c * d^2 + + 83 * d^3 + + 83 * a^2 * e + + 6 * c * d * e + + 72 * a * e^2 + + 46 * a^3 * c + + 41 * a^2 * b * c + + 17 * a^2 * c^2 + + 50 * a * b * c^2 + + 22 * b * c^3 + + 18 * a^3 * d + + 58 * a^2 * c * d + + 35 * b^2 * c * d + + 35 * b * c^2 * d + + 46 * a^2 * d^2 + + 11 * a * b * d^2 + + 29 * b^2 * d^2 + + 78 * b * c * d^2 + + 3 * c * d^3 + + 58 * a * b^2 * e + + 36 * b^3 * e + + 23 * a^2 * c * e + + 11 * a * c^2 * e + + b * c^2 * e + + 60 * c^3 * e + + 46 * a * c * d * e + + 50 * c * d^2 * e + + 57 * a^2 * e^2 + + 7 * a * c * e^2 + + c * d * e^2 + + 19 * a * e^3 + + 11 * b * e^3 + + 41 * a^3 * b^2 + + 46 * a^2 * b^3 + + 13 * a * b^4 + + 57 * a^3 * b * c + + 23 * a * b^3 * c + + 61 * a^4 * d + + 54 * a^3 * b * d + + 2 * b^4 * d + + 83 * a^2 * b * c * d + + 32 * a^2 * c^2 * d + + 59 * a * b * c^2 * d + + 62 * b^2 * c^2 * d + + 84 * a * c^3 * d + + 85 * b * c^3 * d + + 70 * a^3 * d^2 + + 25 * a^2 * b * d^2 + + 76 * b^2 * c * d^2 + + 57 * a^2 * d^3 + + 89 * a * b * d^3 + + 79 * d^5 + + 56 * b^4 * e + + 83 * a^3 * c * e + + 9 * b^3 * c * e + + 33 * c^4 * e + + 58 * a^2 * b * d * e + + 50 * a * b^2 * d * e + + 60 * a^2 * c * d * e + + 50 * a * b * c * d * e + + 12 * b * c^2 * d * e + + 73 * c^3 * d * e + + 89 * a * c * d^2 * e + + 15 * c^2 * d^2 * e + + 13 * b * d^3 * e + + 38 * c * d^3 * e + + 19 * b^3 * e^2 + + 70 * a * b * d * e^2 + + 48 * b^2 * d * e^2 + + 55 * a * c * d * e^2 + + 29 * b * c * d * e^2 + + 72 * d^3 * e^2 + + 74 * a^2 * e^3 + + 62 * a * b * e^3 + + 43 * b * c * e^3 + + 17 * c^2 * e^3 + + 56 * a * d * e^3 + + 41 * a * e^4 + + 54 * b * e^4 + + 44 * c * e^4 + + 26 * e^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 9 + + 10 * a^2 + + 25 * a * b + + 11 * a * c + + 74 * b * c + + 25 * a * d + + 25 * b * d + + 9 * a * e + + 17 * b * e + + 53 * b^3 + + 15 * a^2 * c + + 23 * c^3 + + 69 * b^2 * d + + 77 * a * c * d + + 11 * b * d^2 + + 79 * c * d^2 + + 79 * d^3 + + 16 * a * b * e + + 46 * c^2 * e + + 88 * b * d * e + + 33 * d * e^2 + + 55 * e^3 + + 32 * a^3 * b + + 26 * a * b^2 * c + + 70 * a^2 * c^2 + + 18 * b * c^3 + + 50 * b^2 * c * d + + 57 * c^3 * d + + 63 * b * c * d^2 + + 15 * c^2 * d^2 + + 25 * b^3 * e + + 37 * a^2 * c * e + + 33 * a * c^2 * e + + 19 * c^3 * e + + 22 * a^2 * d * e + + 2 * a * b * d * e + + 16 * b^2 * d * e + + 47 * b * c * d * e + + 22 * c^2 * d * e + + 89 * b * d^2 * e + + 45 * c * d^2 * e + + 24 * a * c * e^2 + + 55 * a * d * e^2 + + b * d * e^2 + + 29 * c * e^3 + + 73 * d * e^3 + + 83 * a^5 + + 65 * a^4 * b + + 42 * a * b^4 + + 15 * b^5 + + 33 * b^4 * c + + 37 * a^3 * c^2 + + 59 * b * c^4 + + 62 * a^2 * b^2 * d + + 79 * a * b^2 * c * d + + 9 * b^2 * c^2 * d + + 26 * c^4 * d + + 89 * a * b^2 * d^2 + + 60 * a^2 * c * d^2 + + 53 * a * c^2 * d^2 + + 49 * b * c^2 * d^2 + + 58 * a * b * d^3 + + 65 * b * c * d^3 + + 90 * c^2 * d^3 + + 22 * a * d^4 + + 35 * b * d^4 + + 2 * c * d^4 + + 81 * d^5 + + 49 * a^3 * b * e + + 28 * a^2 * b^2 * e + + 20 * a^3 * c * e + + 2 * a * b^2 * c * e + + 85 * b^3 * c * e + + 85 * a * b * c^2 * e + + 20 * a * c^3 * e + + 85 * c^4 * e + + 53 * a^3 * d * e + + 26 * a^2 * b * d * e + + 18 * a^2 * c * d * e + + 45 * a * c^2 * d * e + + 76 * a^2 * d^2 * e + + 72 * a * b * d^2 * e + + 88 * a * c * d^2 * e + + 82 * c * d^3 * e + + 3 * a^2 * b * e^2 + + 89 * a * c^2 * e^2 + + 23 * b * c^2 * e^2 + + 2 * a * c * d * e^2 + + 87 * b * c * d * e^2 + + 13 * c^2 * d * e^2 + + 54 * c * d^2 * e^2 + + 44 * c^2 * e^3 + + 4 * a * d * e^3 + + 54 * b * d * e^3 + + 45 * c * d * e^3 + + 14 * e^5, + 35 * a + + 75 * b + + 23 * b^2 + + a * c + + 52 * c^2 + + 66 * a * d + + 90 * b * d + + 59 * a^3 + + 42 * a^2 * c + + 57 * b^2 * c + + 35 * c^3 + + 86 * a^2 * d + + 46 * a * b * d + + 54 * b^2 * d + + 49 * b * d^2 + + 59 * c * d^2 + + 48 * d^3 + + 2 * a^2 * e + + 12 * b * c * e + + 33 * c * d * e + + 34 * d^2 * e + + 55 * a * e^2 + + 36 * a^2 * b^2 + + 64 * b^4 + + 54 * b^3 * c + + 22 * c^4 + + 25 * a^2 * b * d + + 80 * b^3 * d + + 28 * a^2 * c * d + + 47 * a * c^2 * d + + 24 * a * d^3 + + 73 * b * d^3 + + 40 * c * d^3 + + 82 * d^4 + + 31 * a^2 * b * e + + 52 * a * b^2 * e + + 72 * b^3 * e + + 47 * a^2 * c * e + + 39 * a * b * c * e + + 88 * b^2 * c * e + + 63 * c^3 * e + + 47 * a * b * d * e + + 69 * b^2 * d * e + + 10 * b * c * d * e + + 38 * c^2 * d * e + + 65 * b^2 * e^2 + + 72 * a * d * e^2 + + 11 * b * d * e^2 + + 70 * a * e^3 + + 59 * b * e^3 + + 13 * e^4 + + 89 * a^5 + + 59 * a^2 * b^3 + + 67 * a^3 * b * c + + 14 * a * b^3 * c + + 55 * a^3 * c^2 + + 10 * a * b^2 * c^2 + + 70 * a^2 * c^3 + + 41 * a * b * c^3 + + 33 * b * c^4 + + 59 * a^4 * d + + 23 * b^4 * d + + 19 * a^2 * b * c * d + + 20 * a * b^2 * c * d + + 8 * b^3 * c * d + + 78 * c^4 * d + + 61 * a^3 * d^2 + + 12 * a^2 * b * d^2 + + 6 * a * b^2 * d^2 + + 79 * b * c^2 * d^2 + + 56 * c^3 * d^2 + + 51 * a^2 * d^3 + + 4 * b * c * d^3 + + 18 * c^2 * d^3 + + 21 * a * d^4 + + 10 * d^5 + + 38 * a^2 * b^2 * e + + 11 * b^4 * e + + 3 * a^3 * c * e + + 57 * b^3 * c * e + + 40 * a * c^3 * e + + 78 * b * c^3 * e + + 52 * a^3 * d * e + + 19 * a^2 * b * d * e + + 9 * a * b^2 * d * e + + 54 * b^3 * d * e + + 22 * c^3 * d * e + + 66 * a * b * d^2 * e + + 23 * a * c * d^2 * e + + 47 * b * c * d^2 * e + + 11 * b * d^3 * e + + 59 * a^3 * e^2 + + 72 * a^2 * b * e^2 + + 56 * b^2 * c * e^2 + + 11 * c^3 * e^2 + + 23 * a^2 * d * e^2 + + 4 * a * b * d * e^2 + + 84 * c^2 * d * e^2 + + 41 * b * d^2 * e^2 + + 66 * a^2 * e^3 + + 20 * b * c * e^3 + + 73 * c^2 * e^3 + + 66 * b * e^4 + + 30 * c * e^4, + 60 + + 3 * a + + 12 * c + + 33 * d + + 26 * e + + 49 * a * b + + 64 * b^2 + + 68 * a * c + + 3 * c * d + + 42 * d^2 + + 24 * a^2 * b + + 28 * a^2 * c + + 48 * a * b * c + + 68 * b^2 * c + + 89 * b * c^2 + + 4 * a * b * d + + 13 * b^2 * d + + 23 * c^2 * d + + 54 * a * b * e + + 75 * a * c * e + + 14 * b * d * e + + 8 * c * d * e + + 16 * d^2 * e + + 65 * c * e^2 + + 77 * a^4 + + 47 * a * b^3 + + 21 * b^4 + + 5 * a^3 * c + + 48 * b^3 * c + + 76 * a^2 * c^2 + + 68 * a * b * c^2 + + 8 * a * c^3 + + 3 * c^4 + + 27 * a * b^2 * d + + 30 * a * b * c * d + + 40 * a * c^2 * d + + 61 * a^2 * d^2 + + 74 * a * c * d^2 + + 50 * c^2 * d^2 + + 25 * b * d^3 + + 67 * c * d^3 + + 58 * a^3 * e + + 66 * a^2 * c * e + + 2 * a * b * c * e + + 64 * b^2 * c * e + + 40 * b * c * d * e + + 47 * c^2 * d * e + + 36 * a * d^2 * e + + 38 * c * d^2 * e + + 54 * a^2 * e^2 + + 39 * a * b * e^2 + + 46 * b^2 * e^2 + + 11 * a * c * e^2 + + 82 * a * d * e^2 + + 75 * b * e^3 + + 67 * a^5 + + 35 * a^3 * b^2 + + 90 * a^2 * b^3 + + 26 * a * b^4 + + 8 * a^3 * c^2 + + 13 * b^3 * c^2 + + 5 * a^2 * c^3 + + 65 * b^2 * c^3 + + 45 * b * c^4 + + 65 * c^5 + + 10 * a^4 * d + + 56 * b^3 * c * d + + 29 * a^2 * c^2 * d + + 51 * a^2 * b * d^2 + + 9 * a^2 * c * d^2 + + a * b * d^3 + + 28 * b^2 * d^3 + + 3 * a * c * d^3 + + 48 * b^4 * e + + 4 * a^3 * c * e + + 32 * b^3 * c * e + + 15 * a^2 * c^2 * e + + 9 * a * c^3 * e + + 73 * a^3 * d * e + + 32 * a * b^2 * d * e + + 66 * b^3 * d * e + + 87 * a^2 * c * d * e + + 87 * c^3 * d * e + + 50 * a^2 * d^2 * e + + 10 * a * c * d^2 * e + + 4 * a * d^3 * e + + 63 * b * d^3 * e + + 43 * c * d^3 * e + + 90 * d^4 * e + + 32 * a^2 * b * e^2 + + 5 * a * b^2 * e^2 + + 79 * a^2 * c * e^2 + + 74 * a^2 * d * e^2 + + 50 * b^2 * d * e^2 + + 2 * b * c * d * e^2 + + 31 * c^2 * d * e^2 + + 60 * d^3 * e^2 + + 68 * a^2 * e^3 + + 46 * a * b * e^3 + + 66 * b^2 * e^3 + + 38 * a * c * e^3 + + 47 * b * c * e^3 + + 54 * b * d * e^3 + + 30 * c * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 6 + + 23 * a + + 57 * c + + 19 * a * b + + 36 * b^2 + + 44 * b * d + + c * d + + 78 * d * e + + 69 * e^2 + + 56 * a^3 + + 58 * b * c^2 + + 65 * a * b * d + + 23 * b^2 * d + + 66 * b * c * d + + 12 * a * d^2 + + 60 * d^3 + + 69 * a^2 * e + + 74 * a * c * e + + 36 * a * d * e + + 28 * c * d * e + + 11 * c * e^2 + + 4 * d * e^2 + + 14 * e^3 + + 36 * a^4 + + 72 * a * b^3 + + 29 * b^3 * c + + 37 * a * c^3 + + 63 * b * c^3 + + 39 * a^2 * b * d + + 73 * a * b^2 * d + + 12 * b * c^2 * d + + 60 * b * d^3 + + 79 * a^3 * e + + 8 * a^2 * c * e + + a * b * c * e + + 82 * c^3 * e + + 44 * a * b * d * e + + 88 * a * d^2 * e + + 42 * c * d^2 * e + + 80 * d^3 * e + + 69 * a^2 * e^2 + + 13 * a * b * e^2 + + 40 * a * c * e^2 + + 58 * b * d * e^2 + + 27 * c * d * e^2 + + 8 * d^2 * e^2 + + 15 * c * e^3 + + 86 * e^4 + + 38 * a^5 + + 7 * a^3 * b^2 + + 67 * a^2 * b^3 + + 76 * b^5 + + 51 * a^3 * b * c + + 54 * a^2 * b * c^2 + + 82 * a^2 * c^3 + + 50 * a * b * c^3 + + 70 * b^2 * c^3 + + 67 * a * c^4 + + 49 * b * c^4 + + 8 * a^4 * d + + 35 * a^3 * b * d + + 61 * a^3 * c * d + + 87 * a^2 * c^2 * d + + 89 * a * b * c^2 * d + + 4 * b^2 * c^2 * d + + 40 * b^3 * d^2 + + 22 * a^2 * c * d^2 + + 62 * a * b * c * d^2 + + 55 * b^2 * c * d^2 + + 83 * b * c^2 * d^2 + + 73 * a * b * d^3 + + 65 * b * c * d^3 + + 8 * d^5 + + 73 * a^3 * b * e + + 75 * a^2 * b^2 * e + + 51 * a * b^3 * e + + 5 * a^3 * c * e + + 5 * a^2 * b * c * e + + 4 * a * b^2 * c * e + + 12 * a^2 * c^2 * e + + 48 * a * b * c^2 * e + + 20 * b^2 * c^2 * e + + 26 * c^4 * e + + 29 * b^2 * c * d * e + + 14 * c^3 * d * e + + 7 * a * d^3 * e + + 67 * b * d^3 * e + + 19 * d^4 * e + + 44 * a^3 * e^2 + + 21 * a^2 * b * e^2 + + 84 * b^3 * e^2 + + 85 * b^2 * c * e^2 + + 33 * a * c^2 * e^2 + + 64 * a^2 * d * e^2 + + 29 * b^2 * d * e^2 + + 23 * a * c * d * e^2 + + 79 * c * d^2 * e^2 + + 24 * d^3 * e^2 + + 28 * e^5, + 32 + + 41 * b + + 40 * d + + 56 * c^2 + + 42 * a * d + + 75 * b * d + + 90 * a * e + + 21 * b * e + + 68 * d * e + + 86 * e^2 + + 70 * a^2 * c + + 35 * a * b * c + + 20 * b * c^2 + + 14 * b^2 * d + + 38 * a * c * d + + 61 * b * c * d + + 39 * d^3 + + 66 * a^2 * e + + 42 * a * c * e + + 10 * b * c * e + + 42 * a * d * e + + 65 * b * e^2 + + 37 * a^3 * b + + 49 * a^3 * c + + 59 * a^2 * c^2 + + 17 * a * b * c^2 + + 40 * c^4 + + 41 * a^2 * b * d + + 26 * b^3 * d + + 83 * a^2 * c * d + + 89 * b^2 * c * d + + 8 * a * c^2 * d + + 24 * b * c^2 * d + + 16 * a^2 * d^2 + + 12 * a * c * d^2 + + 10 * a * d^3 + + 22 * c * d^3 + + 26 * d^4 + + 21 * a * b^2 * e + + 55 * a^2 * c * e + + 46 * a * b * c * e + + 37 * b^2 * c * e + + 59 * b^2 * d * e + + 83 * c * d^2 * e + + 25 * a^2 * e^2 + + 58 * c * d * e^2 + + 31 * d^2 * e^2 + + 35 * e^4 + + 79 * a^5 + + 38 * a^3 * b^2 + + 64 * a * b^4 + + 70 * b^5 + + a^2 * b^2 * c + + 54 * b^3 * c^2 + + 73 * a * b * c^3 + + 10 * b^2 * c^3 + + 56 * a * c^4 + + 50 * a * b^3 * d + + 27 * a^3 * c * d + + 80 * a^2 * b * c * d + + 36 * a * b * c^2 * d + + 17 * a * c^3 * d + + 32 * c^4 * d + + 18 * a^2 * c * d^2 + + 30 * a * b * c * d^2 + + 50 * a^2 * d^3 + + 45 * b^2 * d^3 + + 48 * c^2 * d^3 + + 28 * d^5 + + 45 * a^4 * e + + 49 * a * b^3 * e + + 62 * a^3 * c * e + + 64 * a * b^2 * c * e + + 57 * b * c^3 * e + + 24 * a^3 * d * e + + 7 * a * b^2 * d * e + + 22 * a * c^2 * d * e + + 76 * a * b * d^2 * e + + 77 * b^2 * d^2 * e + + 18 * c^2 * d^2 * e + + 46 * c * d^3 * e + + 26 * a^2 * b * e^2 + + 62 * b^3 * e^2 + + 37 * a * b * c * e^2 + + 48 * b^2 * c * e^2 + + 64 * a * c^2 * e^2 + + 35 * c^3 * e^2 + + 84 * a^2 * d * e^2 + + 3 * a * b * d * e^2 + + 5 * c^2 * d * e^2 + + 10 * a * b * e^3 + + 5 * a * c * e^3 + + 25 * c^2 * e^3 + + 81 * a * e^4 + + 75 * c * e^4 + + d * e^4, + 28 * a + + 13 * c + + 85 * a * b + + 50 * b^2 + + 16 * a * c + + 65 * b * d + + 65 * b * e + + 5 * a * b^2 + + 90 * b^3 + + 58 * b^2 * c + + 86 * a * c^2 + + 80 * a * b * d + + 13 * a * c * d + + 61 * b * c * d + + 73 * a * d^2 + + 88 * b * c * e + + 67 * c^2 * e + + 21 * b * d * e + + 82 * c * d * e + + 84 * a * e^2 + + 7 * b * e^2 + + 61 * d * e^2 + + 66 * e^3 + + 31 * a^4 + + 82 * a^2 * b^2 + + 7 * a * b^3 + + 55 * b^4 + + 72 * a^3 * c + + 65 * a^2 * c^2 + + 51 * b * c^3 + + 66 * c^4 + + 5 * a^2 * c * d + + 56 * b^2 * c * d + + 26 * c^3 * d + + 58 * a^2 * d^2 + + 18 * a * b * d^2 + + 14 * a * c * d^2 + + 19 * c^2 * d^2 + + 80 * c * d^3 + + 76 * a^3 * e + + 51 * a^2 * b * e + + 63 * a * b^2 * e + + 20 * a * c^2 * e + + 32 * c^3 * e + + 38 * b^2 * d * e + + 12 * a * c * d * e + + 40 * b * c * d * e + + 60 * a * d^2 * e + + 76 * c * d^2 * e + + 32 * d^3 * e + + 25 * a^2 * e^2 + + 82 * a * c * e^2 + + 26 * b * c * e^2 + + 8 * c^2 * e^2 + + 67 * b * d * e^2 + + 31 * e^4 + + 49 * a^4 * b + + 41 * a^2 * b^3 + + 22 * b^5 + + 69 * a^4 * c + + 8 * b^3 * c^2 + + a^2 * c^3 + + 90 * a * c^4 + + 49 * c^5 + + 50 * a^3 * b * d + + 8 * a * b^3 * d + + 65 * a * b^2 * c * d + + 55 * b^3 * c * d + + 23 * a^2 * c^2 * d + + 55 * b^2 * c^2 * d + + 50 * a * c^3 * d + + 28 * c^4 * d + + 62 * a^3 * d^2 + + 10 * a * b^2 * d^2 + + 34 * b^3 * d^2 + + 3 * a * b * c * d^2 + + 63 * a * c^2 * d^2 + + 6 * c^3 * d^2 + + 40 * a^2 * d^3 + + 17 * b * d^4 + + 72 * a^3 * b * e + + 3 * a * b^2 * d * e + + 24 * b^3 * d * e + + 3 * a^2 * c * d * e + + 35 * c^3 * d * e + + 24 * a * b * d^2 * e + + 54 * b^2 * d^2 * e + + 52 * a * d^3 * e + + 33 * c * d^3 * e + + 21 * a * b^2 * e^2 + + 88 * a * b * c * e^2 + + 50 * c^3 * e^2 + + 86 * a * b * d * e^2 + + 4 * b^2 * d * e^2 + + 25 * c^2 * d * e^2 + + 59 * a * d^2 * e^2 + + 64 * b * d^2 * e^2 + + 12 * c * d^2 * e^2 + + 29 * d^3 * e^2 + + a^2 * e^3 + + 12 * a * b * e^3 + + 2 * b^2 * e^3 + + 28 * a * c * e^3 + + 77 * b * c * e^3 + + 59 * c^2 * e^3 + + 38 * b * d * e^3 + + 4 * c * d * e^3 + + 51 * a * e^4 + + 20 * b * e^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 67 + + 51 * b + + 20 * d + + 40 * a * b + + a * c + + 30 * c * d + + 21 * a * e + + 19 * b * e + + 30 * c * e + + 84 * a^2 * b + + 29 * a * b^2 + + 90 * b^2 * c + + 36 * c^3 + + 65 * a * c * d + + 4 * b * c * d + + 80 * a * b * e + + 23 * a * c * e + + 55 * b * c * e + + 39 * c^2 * e + + 57 * b * d * e + + 59 * d^2 * e + + 76 * a * e^2 + + 83 * d * e^2 + + 37 * e^3 + + 10 * a^3 * b + + 49 * a^2 * b^2 + + 58 * a * b^3 + + 25 * b^4 + + 58 * a^2 * b * c + + 4 * b^3 * c + + 57 * a * c^3 + + 85 * b * c^3 + + 58 * a * b^2 * d + + 62 * a^2 * c * d + + 63 * b^2 * c * d + + 6 * a * c * d^2 + + 57 * a * d^3 + + 15 * b * d^3 + + 2 * c * d^3 + + 31 * b^3 * e + + 80 * a * b * c * e + + 63 * c^3 * e + + 46 * b^2 * d * e + + 5 * c^2 * d * e + + 43 * c * d^2 * e + + 85 * d^3 * e + + 42 * a * b * e^2 + + 6 * b^2 * e^2 + + 59 * a * c * e^2 + + a * d * e^2 + + 86 * b * d * e^2 + + 2 * c * d * e^2 + + 69 * d^2 * e^2 + + 48 * a * e^3 + + 30 * b * e^3 + + 74 * c * e^3 + + 61 * d * e^3 + + 23 * a^5 + + 71 * a^3 * b^2 + + 19 * a^2 * b^3 + + 69 * a * b^4 + + 88 * b^5 + + 90 * b^4 * c + + 46 * a^2 * b * c^2 + + 42 * a * b^2 * c^2 + + 43 * b^3 * c^2 + + 60 * a^2 * c^3 + + 8 * a * b * c^3 + + 17 * b^2 * c^3 + + 76 * a * c^4 + + 79 * b * c^4 + + 26 * c^5 + + 58 * a^4 * d + + 22 * a^3 * b * d + + 15 * a * b^3 * d + + 30 * a^3 * c * d + + 38 * a^2 * b * c * d + + 67 * a * b^2 * c * d + + 13 * a * b * c^2 * d + + 76 * b * c^3 * d + + 57 * c^4 * d + + 77 * a^3 * d^2 + + 29 * a^2 * b * d^2 + + 20 * a * b^2 * d^2 + + 40 * a * c^2 * d^2 + + 41 * a^2 * d^3 + + 84 * b^2 * d^3 + + 6 * a * c * d^3 + + 32 * c^2 * d^3 + + 12 * d^5 + + 45 * a^4 * e + + 59 * a^3 * c * e + + 14 * b^3 * c * e + + 27 * a^2 * c^2 * e + + 17 * a * b * c^2 * e + + 78 * b^2 * c^2 * e + + 15 * a^2 * b * d * e + + 4 * b^3 * d * e + + 7 * a^2 * c * d * e + + a * b * c * d * e + + 82 * b * c * d^2 * e + + 10 * c^2 * d^2 * e + + 38 * a * d^3 * e + + 20 * d^4 * e + + 77 * a^3 * e^2 + + 80 * a^2 * c * e^2 + + 83 * a * c^2 * e^2 + + 12 * b * c^2 * e^2 + + 56 * a * c * d * e^2 + + 70 * c^2 * d * e^2 + + 83 * a * d^2 * e^2 + + 43 * c * d^2 * e^2 + + 85 * d^3 * e^2 + + 14 * a * b * e^3 + + 77 * b^2 * e^3 + + 59 * a * c * e^3 + + 29 * b * c * e^3 + + 89 * c^2 * e^3 + + 63 * a * d * e^3 + + 38 * b * d * e^3 + + 49 * d^2 * e^3 + + 76 * a * e^4 + + 18 * c * e^4 + + 69 * d * e^4, + 17 * a + + 79 * c + + 73 * e + + 73 * a * b + + 68 * b^2 + + 5 * a * c + + 18 * b * c + + 90 * a * d + + 29 * b * d + + 63 * d^2 + + 86 * b * e + + 25 * c * e + + 53 * d * e + + 10 * a^3 + + 24 * a * b^2 + + 53 * b^3 + + 13 * a^2 * c + + 32 * a * b * c + + 64 * b^2 * c + + 86 * b * c^2 + + 27 * c^3 + + 37 * a^2 * d + + 43 * a * d^2 + + 52 * c * d^2 + + 14 * a^2 * e + + 44 * a * b * e + + 75 * a * c * e + + 54 * b * c * e + + 90 * c^2 * e + + 25 * d^2 * e + + 86 * a * e^2 + + 77 * d * e^2 + + 10 * a^4 + + 6 * a^3 * b + + 38 * a^2 * b^2 + + 14 * a * b^3 + + 29 * b^4 + + 67 * a^2 * b * c + + 71 * b^3 * c + + 36 * b^2 * c^2 + + 49 * a^2 * b * d + + 63 * a * b^2 * d + + 65 * b^3 * d + + 24 * a^2 * c * d + + 76 * a * c^2 * d + + 56 * c^3 * d + + 79 * a^2 * d^2 + + 19 * b^2 * d^2 + + 79 * a * c * d^2 + + 44 * b * d^3 + + 8 * c * d^3 + + 62 * a^2 * b * e + + 86 * a * b^2 * e + + 17 * a * b * c * e + + a * c^2 * e + + 63 * b * c^2 * e + + 70 * a * b * d * e + + 65 * b^2 * d * e + + 63 * a * c * d * e + + 73 * c * d^2 * e + + 71 * a^2 * e^2 + + 33 * a * b * e^2 + + 85 * b^2 * e^2 + + 14 * a * c * e^2 + + 56 * b * c * e^2 + + 36 * c^2 * e^2 + + 25 * b * d * e^2 + + 84 * d^2 * e^2 + + 38 * b * e^3 + + 28 * d * e^3 + + 24 * a^2 * b^3 + + 85 * a^4 * c + + 39 * a^2 * b^2 * c + + 18 * a * b^3 * c + + 52 * b^4 * c + + 50 * a^3 * c^2 + + 49 * a^2 * b * c^2 + + 28 * a * b * c^3 + + 52 * a^4 * d + + 90 * b^4 * d + + 17 * a^2 * b * c * d + + 43 * a * b^2 * c * d + + 80 * a^2 * c^2 * d + + 86 * a * c^3 * d + + 75 * a^2 * b * d^2 + + 70 * a^2 * c * d^2 + + 33 * a * b * c * d^2 + + 4 * b^2 * c * d^2 + + 6 * a * c^2 * d^2 + + 15 * b * c^2 * d^2 + + 10 * a * b * d^3 + + 85 * b^2 * d^3 + + 8 * a * c * d^3 + + 74 * b * d^4 + + 32 * d^5 + + 33 * a^3 * b * e + + 12 * a * b^3 * e + + 23 * a^3 * c * e + + 9 * a^2 * b * c * e + + 10 * a * b^2 * c * e + + 74 * a * b * c^2 * e + + 21 * b^2 * c^2 * e + + 78 * a^3 * d * e + + 50 * a^2 * c * d * e + + 14 * b * c^2 * d * e + + 67 * c^3 * d * e + + 38 * b^2 * d^2 * e + + 31 * a * c * d^2 * e + + 35 * a * d^3 * e + + 51 * b * d^3 * e + + 85 * c * d^3 * e + + 50 * a^2 * b * e^2 + + 89 * a^2 * c * e^2 + + 17 * b^2 * c * e^2 + + b * c^2 * e^2 + + 89 * c^3 * e^2 + + 29 * a * c * d * e^2 + + 11 * a * d^2 * e^2 + + 30 * c * d^2 * e^2 + + 62 * d^3 * e^2 + + 67 * a^2 * e^3 + + 90 * a * b * e^3 + + 75 * b^2 * e^3 + + 47 * c * d * e^3 + + 16 * a * e^4 + + 2 * b * e^4 + + 65 * c * e^4 + + 49 * e^5, + 79 + + 81 * c + + 45 * d + + 2 * e + + 41 * b^2 + + 70 * a * c + + 60 * c^2 + + a * d + + 88 * a * e + + 19 * b * e + + 23 * e^2 + + a^3 + + 85 * a * b^2 + + 17 * a * b * c + + 20 * a * c^2 + + 38 * b * c^2 + + 67 * c^3 + + 6 * a^2 * d + + 40 * a * b * d + + 2 * a * c * d + + 9 * b * d^2 + + 65 * a^2 * e + + 20 * a * b * e + + 89 * b^2 * e + + 42 * b * c * e + + 55 * c^2 * e + + 73 * a * d * e + + 28 * b * d * e + + 70 * b * e^2 + + c * e^2 + + 17 * a^4 + + 88 * a^3 * b + + 44 * b^4 + + 41 * a^3 * c + + a^2 * b * c + + 53 * a * b^2 * c + + 89 * a * b * c^2 + + 83 * a * c^3 + + 84 * c^4 + + 24 * a^3 * d + + 67 * a^2 * b * d + + 20 * a^2 * c * d + + 36 * b * c^2 * d + + 24 * a * b * d^2 + + 18 * a * d^3 + + 41 * b * d^3 + + 12 * c * d^3 + + 29 * a^2 * b * e + + 73 * b^3 * e + + 19 * a * b * c * e + + 27 * b^2 * c * e + + 15 * b * c^2 * e + + 61 * c^3 * e + + 40 * a * b * d * e + + 61 * b^2 * d * e + + 67 * c^2 * d * e + + 14 * a * d^2 * e + + 11 * a^2 * e^2 + + 51 * a * b * e^2 + + 85 * b * c * e^2 + + 19 * c * d * e^2 + + 7 * a * e^3 + + 88 * b * e^3 + + 36 * d * e^3 + + 51 * a^5 + + 17 * a^4 * b + + 59 * a^3 * b^2 + + 85 * a * b^4 + + 83 * a^3 * b * c + + 76 * a^2 * b^2 * c + + 33 * b^4 * c + + 42 * a^2 * c^3 + + 32 * b^2 * c^3 + + 42 * a * c^4 + + 25 * b * c^4 + + 78 * a^4 * d + + 29 * a^3 * b * d + + 18 * a^2 * b^2 * d + + 49 * b^4 * d + + 48 * a^3 * c * d + + 81 * a^2 * c^2 * d + + 55 * b^2 * c^2 * d + + 71 * a * c^3 * d + + 9 * a^2 * b * d^2 + + 69 * a * b * c * d^2 + + 47 * b * c^2 * d^2 + + 52 * a * b * d^3 + + 39 * b^2 * d^3 + + 16 * b * c * d^3 + + 50 * c^2 * d^3 + + 10 * a * d^4 + + 19 * a^4 * e + + 14 * a^2 * b^2 * e + + 14 * b^4 * e + + 63 * a^3 * c * e + + 57 * a^2 * b * c * e + + 60 * b^3 * c * e + + 80 * a * b * c^2 * e + + 21 * a^2 * b * d * e + + 22 * b^3 * d * e + + 73 * a * b * c * d * e + + 43 * a * c^2 * d * e + + 49 * b * c^2 * d * e + + 61 * c^3 * d * e + + 73 * a^2 * d^2 * e + + 24 * a * b * d^2 * e + + 84 * a * c * d^2 * e + + 39 * b * c * d^2 * e + + 18 * c^2 * d^2 * e + + 61 * a * d^3 * e + + 84 * c * d^3 * e + + 51 * d^4 * e + + 50 * a^2 * c * e^2 + + 57 * a * c^2 * e^2 + + 59 * b * c^2 * e^2 + + 4 * c^3 * e^2 + + 48 * a^2 * d * e^2 + + 22 * b * c * d * e^2 + + 33 * c^2 * d * e^2 + + a * b * e^3 + + 76 * b^2 * e^3 + + 34 * b * c * e^3 + + 59 * a * d * e^3 + + 7 * b * d * e^3 + + 27 * d^2 * e^3 + + 79 * a * e^4 + + 7 * c * e^4 + + 39 * e^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 83 * a + + 51 * c + + 76 * d + + 52 * e + + 25 * a * b + + 31 * b * c + + 48 * c^2 + + 61 * a * d + + 75 * c * d + + 27 * d^2 + + 13 * a * e + + 4 * d * e + + 57 * e^2 + + 64 * a * b^2 + + 19 * a * c^2 + + 52 * c^3 + + 11 * a * b * d + + 42 * b^2 * d + + 72 * b * c * d + + 51 * c * d^2 + + 16 * d^3 + + 13 * b^2 * e + + 31 * a * c * e + + 28 * c^2 * e + + 50 * b * d * e + + c * d * e + + 82 * b * e^2 + + 67 * c * e^2 + + 53 * d * e^2 + + 17 * e^3 + + 32 * a^3 * b + + 14 * a * b^3 + + 84 * b^4 + + 6 * a^2 * c^2 + + 19 * a * c^3 + + 2 * c^4 + + 75 * a^3 * d + + 64 * a * b^2 * d + + 45 * b^3 * d + + 43 * a * c^2 * d + + 39 * b * c^2 * d + + 57 * c^3 * d + + 46 * a * b * d^2 + + 27 * c^2 * d^2 + + 86 * a * d^3 + + 31 * c * d^3 + + 88 * d^4 + + 46 * a^3 * e + + 88 * a^2 * c * e + + 65 * a * b * c * e + + 33 * b^2 * c * e + + 69 * a * c^2 * e + + 15 * c^3 * e + + 58 * b^2 * d * e + + 26 * b * c * d * e + + 83 * a * b * e^2 + + 60 * b^2 * e^2 + + 40 * b * c * e^2 + + 83 * c^2 * e^2 + + 27 * b * d * e^2 + + 3 * d * e^3 + + 18 * e^4 + + 45 * a^5 + + 80 * a^4 * b + + 45 * a^4 * c + + 75 * a * b^3 * c + + 40 * b^4 * c + + 30 * a^3 * c^2 + + 66 * a^2 * c^3 + + 54 * a * b * c^3 + + 2 * b^2 * c^3 + + 71 * b * c^4 + + 88 * a^4 * d + + 61 * a * b^3 * d + + 38 * a^3 * c * d + + 49 * b^3 * c * d + + 39 * a^2 * c^2 * d + + 26 * b * c^3 * d + + 86 * a^3 * d^2 + + 72 * a^2 * b * d^2 + + 65 * a * b^2 * d^2 + + 56 * b^3 * d^2 + + 43 * b^2 * c * d^2 + + 24 * a * c^2 * d^2 + + 38 * c^3 * d^2 + + 3 * a^2 * d^3 + + 2 * a * c * d^3 + + 14 * b * c * d^3 + + 67 * c^2 * d^3 + + 76 * a * d^4 + + 65 * c * d^4 + + 3 * a^4 * e + + 14 * a^3 * b * e + + 6 * a^3 * c * e + + 31 * b^3 * c * e + + 40 * a * b * c^2 * e + + 24 * a * c^3 * e + + 48 * c^4 * e + + 86 * a * b * c * d * e + + 9 * a * c^2 * d * e + + 55 * b * c^2 * d * e + + 27 * c^3 * d * e + + 62 * a * b * d^2 * e + + 78 * a * c * d^2 * e + + 39 * c^2 * d^2 * e + + 50 * b * d^3 * e + + 55 * a^2 * b * e^2 + + 37 * a^2 * c * e^2 + + 73 * a * b * c * e^2 + + 48 * b^2 * c * e^2 + + 29 * b * c^2 * e^2 + + 61 * a * b * d * e^2 + + 66 * a * c * d * e^2 + + 27 * b * c * d * e^2 + + 18 * b * d^2 * e^2 + + 45 * c * d^2 * e^2 + + 31 * a^2 * e^3 + + 59 * b^2 * e^3 + + 27 * a * d * e^3 + + 66 * b * d * e^3 + + 3 * c * d * e^3 + + 70 * a * e^4 + + 77 * b * e^4, + 24 + + b + + 26 * e + + 14 * a^2 + + 84 * a * c + + 73 * c^2 + + 54 * a * e + + 88 * b * e + + 60 * c * e + + 87 * d * e + + 5 * a^3 + + 35 * b^3 + + 53 * b^2 * c + + 87 * a * c^2 + + 13 * b * c^2 + + 19 * a^2 * d + + 53 * b^2 * d + + 73 * a * c * d + + 70 * b * c * d + + 49 * b * d^2 + + 64 * d^3 + + 69 * a * b * e + + 62 * b^2 * e + + 63 * a * c * e + + 16 * b * c * e + + 39 * c^2 * e + + 88 * a * d * e + + 54 * c * d * e + + 49 * b * e^2 + + 63 * c * e^2 + + 45 * d * e^2 + + 56 * a^3 * b + + 65 * a * b^3 + + 42 * a^3 * c + + 48 * a^2 * b * c + + 5 * b^3 * c + + 76 * a^2 * c^2 + + 77 * b^2 * c^2 + + 39 * a * c^3 + + 41 * b * c^3 + + 72 * c^4 + + 49 * a^3 * d + + 5 * a^2 * b * d + + 42 * b^3 * d + + 73 * a^2 * c * d + + 9 * a * b * c * d + + 72 * b^2 * c * d + + 11 * a * c^2 * d + + 58 * b * c^2 * d + + 60 * a * b * d^2 + + 3 * b^2 * d^2 + + 58 * a * c * d^2 + + 23 * a^3 * e + + 54 * a^2 * b * e + + 51 * b^3 * e + + 12 * a^2 * c * e + + 69 * b^2 * c * e + + 12 * a * b * d * e + + 42 * a * c * d * e + + 87 * b * c * d * e + + 62 * c^2 * d * e + + 35 * c * d^2 * e + + 44 * a^2 * e^2 + + 15 * a * b * e^2 + + 43 * a * c * e^2 + + 6 * b * c * e^2 + + 14 * c * d * e^2 + + 8 * d^2 * e^2 + + 74 * a * e^3 + + 42 * d * e^3 + + 31 * a^5 + + 49 * a^4 * b + + 41 * a^3 * b^2 + + 83 * a * b^4 + + 41 * b^5 + + 81 * a^3 * b * c + + 64 * a^2 * b^2 * c + + 12 * a * b^3 * c + + 31 * a^3 * c^2 + + 64 * a^2 * b * c^2 + + 33 * b^3 * c^2 + + 43 * b^2 * c^3 + + 15 * b * c^4 + + 49 * c^5 + + 48 * a^4 * d + + 4 * a^3 * b * d + + 38 * a^3 * c * d + + 80 * a * b^2 * c * d + + 37 * b^3 * c * d + + 58 * b * c^3 * d + + 67 * a^2 * b * d^2 + + 58 * a * b^2 * d^2 + + 19 * b^3 * d^2 + + 33 * a^2 * c * d^2 + + 24 * a * b * c * d^2 + + 4 * b^2 * c * d^2 + + 18 * a * c^2 * d^2 + + 74 * c^3 * d^2 + + 64 * a^2 * d^3 + + 4 * b^2 * d^3 + + 24 * b * c * d^3 + + 20 * b * d^4 + + 14 * d^5 + + 20 * a^2 * b^2 * e + + 78 * a * b^3 * e + + 67 * a^3 * c * e + + 22 * a^2 * c^2 * e + + 4 * a * b * c^2 * e + + 79 * a * c^3 * e + + 52 * b * c^3 * e + + 76 * a * b^2 * d * e + + 39 * b^3 * d * e + + 26 * a^2 * c * d * e + + 46 * a * b * c * d * e + + 47 * b * c^2 * d * e + + 31 * c^3 * d * e + + 85 * a^2 * d^2 * e + + 3 * b^2 * d^2 * e + + 37 * a * c * d^2 * e + + 58 * b * c * d^2 * e + + 55 * a * d^3 * e + + 83 * b * d^3 * e + + 85 * c * d^3 * e + + 12 * b^3 * e^2 + + 15 * a^2 * c * e^2 + + 16 * a * b * c * e^2 + + 74 * a * c^2 * e^2 + + 69 * a * b * d * e^2 + + 19 * a * d^2 * e^2 + + 48 * b * d^2 * e^2 + + 45 * b^2 * e^3 + + 26 * b * d * e^3, + 31 + + 59 * c + + 41 * e + + 17 * a * b + + 51 * a * d + + 72 * b * d + + 80 * c * d + + 57 * b * e + + 81 * d * e + + 23 * e^2 + + 79 * a^3 + + 20 * a * b^2 + + 6 * a^2 * c + + 6 * b^2 * c + + 15 * a * c * d + + 88 * c^2 * d + + 4 * d^3 + + 42 * a^2 * e + + 68 * b * c * e + + 42 * c^2 * e + + 35 * b * d * e + + 82 * c * d * e + + 38 * d^2 * e + + 65 * a * e^2 + + 69 * b * e^2 + + 58 * a^4 + + 63 * a^2 * b^2 + + 18 * b^3 * c + + 48 * b^2 * c^2 + + 83 * a * c^3 + + 47 * b * c^3 + + 67 * a^2 * b * d + + 59 * a^2 * c * d + + 48 * a * b * c * d + + 6 * a * c^2 * d + + 64 * b * c^2 * d + + 2 * c^3 * d + + 70 * a^2 * d^2 + + 26 * a * b * d^2 + + 45 * b * c * d^2 + + 29 * c^2 * d^2 + + 11 * a * d^3 + + 45 * c * d^3 + + 89 * a^3 * e + + 57 * a^2 * b * e + + 80 * a * b^2 * e + + 5 * a * b * c * e + + 76 * c^3 * e + + 5 * a^2 * d * e + + 49 * d^3 * e + + 16 * a * b * e^2 + + 83 * a * c * e^2 + + 64 * b * c * e^2 + + 5 * c^2 * e^2 + + 37 * b * d * e^2 + + 81 * c * d * e^2 + + 73 * d^2 * e^2 + + 32 * c * e^3 + + 4 * d * e^3 + + 47 * a^5 + + 56 * a^4 * b + + 20 * b^5 + + 38 * a^3 * b * c + + 69 * a^2 * b^2 * c + + 27 * a * b^3 * c + + 31 * a^3 * c^2 + + 27 * a^2 * b * c^2 + + 22 * a * b^2 * c^2 + + 80 * b^3 * c^2 + + 76 * a^2 * c^3 + + 11 * a * b * c^3 + + 75 * a * c^4 + + 12 * b * c^4 + + 24 * c^5 + + 7 * a^4 * d + + 17 * a^3 * b * d + + 79 * a^2 * b^2 * d + + 80 * a * b^3 * d + + 45 * a^3 * c * d + + 45 * a^2 * b * c * d + + 6 * a * b * c^2 * d + + 64 * a * c^3 * d + + 49 * b * c^3 * d + + 15 * c^4 * d + + 90 * b^3 * d^2 + + 69 * a * c^2 * d^2 + + 66 * c^3 * d^2 + + 26 * b^2 * d^3 + + 28 * b * c * d^3 + + 77 * b * d^4 + + 52 * c * d^4 + + 32 * d^5 + + 3 * a^3 * b * e + + 42 * a^3 * c * e + + 41 * b^3 * c * e + + 46 * a * b * c^2 * e + + a * b^2 * d * e + + 72 * b^3 * d * e + + 13 * a^2 * c * d * e + + 47 * a * b * c * d * e + + 56 * a * c^2 * d * e + + 66 * c^3 * d * e + + 68 * a^2 * d^2 * e + + 15 * a * b * d^2 * e + + 58 * a * c * d^2 * e + + 36 * c * d^3 * e + + 57 * d^4 * e + + 90 * b^3 * e^2 + + 90 * a * b * c * e^2 + + 7 * b^2 * c * e^2 + + 67 * a * c^2 * e^2 + + 71 * c^3 * e^2 + + 46 * a^2 * d * e^2 + + 32 * b * c * d * e^2 + + 36 * c^2 * d * e^2 + + 43 * a * d^2 * e^2 + + 78 * c * d^2 * e^2 + + 16 * a * b * e^3 + + 49 * b^2 * e^3 + + 64 * a * c * e^3 + + 59 * a * d * e^3 + + 20 * d^2 * e^3 + + 72 * a * e^4 + + 36 * b * e^4 + + 70 * c * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 41 + + 30 * a + + b + + 56 * d + + 75 * a^2 + + 39 * b * c + + 86 * b * d + + 51 * c * d + + 37 * a * e + + c * e + + 23 * d * e + + 49 * e^2 + + 12 * a^3 + + 41 * a^2 * b + + 55 * a^2 * c + + 57 * a * b * c + + 8 * a * b * d + + 44 * b * c * d + + 38 * a * d^2 + + 81 * d^3 + + 75 * a^2 * e + + 83 * a * b * e + + 55 * b^2 * e + + 69 * a * c * e + + 34 * b * c * e + + 86 * c^2 * e + + 11 * a * d * e + + 46 * b * d * e + + 28 * c * d * e + + 55 * d^2 * e + + 57 * a * e^2 + + 83 * b * e^2 + + 19 * c * e^2 + + 54 * e^3 + + a^3 * b + + 86 * a^2 * b^2 + + 59 * a * b^3 + + 74 * a^2 * c^2 + + 73 * c^4 + + 66 * a^3 * d + + 38 * a^2 * b * d + + 70 * a * b^2 * d + + 45 * a * b * c * d + + 38 * a * c^2 * d + + 47 * b * c^2 * d + + 81 * a^2 * d^2 + + 14 * b^2 * d^2 + + 72 * c^2 * d^2 + + 22 * a^3 * e + + 90 * b^3 * e + + 44 * a^2 * c * e + + 20 * a * c^2 * e + + 44 * a * b * d * e + + 24 * b^2 * d * e + + 63 * a * c * d * e + + 37 * c^2 * d * e + + 17 * c * d^2 * e + + 2 * d^3 * e + + 18 * a^2 * e^2 + + 53 * c^2 * e^2 + + 76 * c * d * e^2 + + 81 * d^2 * e^2 + + 20 * a * e^3 + + 16 * d * e^3 + + 62 * a^5 + + 18 * a * b^4 + + 62 * b^5 + + 49 * a^3 * b * c + + 29 * b^4 * c + + 30 * a^2 * b * c^2 + + 22 * b^3 * c^2 + + 40 * a^2 * c^3 + + 85 * a^3 * b * d + + 29 * b^4 * d + + 45 * a^2 * b * c * d + + 74 * a * b^2 * c * d + + 34 * a^2 * c^2 * d + + 83 * a^3 * d^2 + + 15 * b^2 * c * d^2 + + 67 * b * c^2 * d^2 + + 33 * a * b * d^3 + + 89 * b^2 * d^3 + + 49 * a * c * d^3 + + 30 * b * c * d^3 + + 81 * c^2 * d^3 + + 6 * b * d^4 + + 76 * c * d^4 + + 57 * d^5 + + 35 * a^4 * e + + 26 * a^3 * b * e + + 40 * a^3 * c * e + + 18 * b^3 * c * e + + 61 * a^2 * c^2 * e + + 40 * b^2 * c^2 * e + + 66 * c^4 * e + + 11 * a^3 * d * e + + 67 * a^2 * b * d * e + + 78 * a * b^2 * d * e + + 67 * b^3 * d * e + + 15 * a^2 * c * d * e + + 85 * a * b * c * d * e + + 67 * a * c^2 * d * e + + 4 * b * c^2 * d * e + + 43 * b * c * d^2 * e + + 32 * a * d^3 * e + + 64 * d^4 * e + + 17 * a^3 * e^2 + + 79 * a^2 * b * e^2 + + 42 * a * b^2 * e^2 + + 32 * a^2 * c * e^2 + + 43 * a * b * c * e^2 + + 59 * b^2 * c * e^2 + + 49 * b * c^2 * e^2 + + 6 * c^3 * e^2 + + 22 * b^2 * d * e^2 + + 77 * a * d^2 * e^2 + + 43 * c * d^2 * e^2 + + 44 * b^2 * e^3 + + 83 * a * c * e^3 + + b * c * e^3 + + 70 * c^2 * e^3 + + 29 * a * d * e^3 + + 12 * b * d * e^3 + + 54 * e^5, + 17 * b + + 29 * c + + 32 * e + + 54 * a * c + + 2 * b * c + + 32 * a * d + + 7 * c * d + + 15 * a * e + + 78 * b * e + + 10 * d * e + + 49 * e^2 + + 17 * b^3 + + 37 * a * b * c + + 11 * c^3 + + 20 * a^2 * d + + 67 * a * b * d + + 40 * a * c * d + + 53 * a * d^2 + + 62 * c * d^2 + + 43 * d^3 + + 8 * a * c * e + + 54 * a * d * e + + 27 * d^2 * e + + 6 * a * e^2 + + 55 * d * e^2 + + 29 * e^3 + + 89 * a^2 * b^2 + + 41 * a * b^3 + + 46 * b^4 + + 77 * a^3 * c + + 70 * a^2 * b * c + + 12 * b^3 * c + + 15 * a * b * c^2 + + 80 * b * c^3 + + 15 * c^4 + + 32 * a^2 * b * d + + 63 * b^3 * d + + 81 * a * b * c * d + + 5 * b * c^2 * d + + 55 * a * b * d^2 + + 54 * b^2 * d^2 + + 16 * a * c * d^2 + + 6 * b * c * d^2 + + 82 * a * d^3 + + 16 * c * d^3 + + 32 * d^4 + + 79 * a^3 * e + + 45 * a * b^2 * e + + 34 * b^3 * e + + 66 * a^2 * c * e + + 50 * b * c^2 * e + + 24 * c^3 * e + + 7 * b^2 * d * e + + 35 * a * c * d * e + + 73 * a * d^2 * e + + 51 * b * d^2 * e + + 61 * b^2 * e^2 + + 47 * a * c * e^2 + + 23 * b * c * e^2 + + 73 * a * d * e^2 + + 76 * b * d * e^2 + + 55 * b * e^3 + + 70 * c * e^3 + + 30 * d * e^3 + + 66 * e^4 + + 17 * a^4 * c + + 12 * a * b^3 * c + + 37 * a^3 * c^2 + + 35 * a^2 * b * c^2 + + 8 * a * b^2 * c^2 + + 12 * b^3 * c^2 + + 78 * a^2 * c^3 + + 29 * a * b * c^3 + + 72 * b^2 * c^3 + + 12 * a * c^4 + + 83 * b * c^4 + + 16 * b^4 * d + + 17 * b^3 * c * d + + 50 * b^2 * c^2 * d + + 37 * a * c^3 * d + + 55 * c^4 * d + + 67 * a^2 * c * d^2 + + 67 * a * b * c * d^2 + + 34 * b^2 * c * d^2 + + 2 * c^3 * d^2 + + 33 * a^2 * d^3 + + 52 * a * b * d^3 + + 78 * b^2 * d^3 + + 74 * a * c * d^3 + + 10 * b * c * d^3 + + 22 * c^2 * d^3 + + 17 * b * d^4 + + 22 * c * d^4 + + 80 * a^3 * b * e + + 85 * b^4 * e + + 60 * a^3 * c * e + + 72 * a^2 * b * c * e + + 21 * b^3 * c * e + + 28 * a * b * c^2 * e + + 79 * a^3 * d * e + + 14 * a^2 * b * d * e + + 25 * b^2 * c * d * e + + 55 * a * c^2 * d * e + + 41 * c^3 * d * e + + 54 * a^2 * d^2 * e + + 9 * a * b * d^2 * e + + 51 * b^2 * d^2 * e + + 49 * a * c * d^2 * e + + 36 * a * d^3 * e + + 77 * b * d^3 * e + + 44 * c * d^3 * e + + 78 * d^4 * e + + 86 * a^3 * e^2 + + 80 * b^3 * e^2 + + 39 * b^2 * c * e^2 + + 90 * c^3 * e^2 + + 10 * a^2 * d * e^2 + + 71 * b^2 * d * e^2 + + 20 * b * c * d * e^2 + + 61 * a * d^2 * e^2 + + 70 * b * d^2 * e^2 + + 5 * a * b * e^3 + + 21 * b^2 * e^3 + + 64 * a * d * e^3 + + 84 * c * e^4 + + 34 * d * e^4 + + 76 * e^5, + 35 + + 14 * a + + 43 * e + + 71 * a * b + + 28 * b * c + + 33 * b * d + + 90 * a * e + + 61 * b * e + + 51 * c * e + + 80 * d * e + + 20 * a^2 * b + + 11 * a * b^2 + + 76 * b^2 * c + + 86 * a * c^2 + + 11 * a^2 * d + + 36 * b^2 * d + + 12 * b * c * d + + 2 * c * d^2 + + 29 * d^3 + + 35 * a^2 * e + + 49 * a * c * e + + 22 * c^2 * e + + 43 * d^2 * e + + 75 * a * e^2 + + 52 * c * e^2 + + 22 * e^3 + + 62 * a^4 + + 88 * a^3 * b + + 9 * a * b^3 + + 5 * b^4 + + 46 * a^3 * c + + 7 * a^2 * b * c + + 52 * a * b * c^2 + + 64 * b * c^3 + + 33 * c^4 + + 63 * a^3 * d + + 50 * a^2 * b * d + + 76 * a * b^2 * d + + 47 * a * b * c * d + + 30 * b^2 * c * d + + 53 * a * c^2 * d + + 17 * a^2 * d^2 + + 20 * b^2 * d^2 + + 40 * b * c * d^2 + + 11 * a * d^3 + + 32 * c * d^3 + + 21 * d^4 + + 16 * a^3 * e + + 89 * a^2 * b * e + + 23 * a * b * c * e + + 60 * b^2 * c * e + + 29 * b * c^2 * e + + 11 * c^3 * e + + 71 * a^2 * d * e + + 45 * a * c * d * e + + 37 * c^2 * d * e + + 33 * c * d^2 * e + + 2 * a * c * e^2 + + 41 * a * d * e^2 + + 57 * b * d * e^2 + + 36 * c * d * e^2 + + 49 * d^2 * e^2 + + 23 * a^3 * b^2 + + 72 * a^2 * b^3 + + 19 * b^5 + + 13 * a^4 * c + + 45 * a^2 * b^2 * c + + 77 * a * b^3 * c + + 88 * b^4 * c + + 19 * a^2 * b * c^2 + + 33 * a * b^2 * c^2 + + 65 * a * b * c^3 + + 14 * b^2 * c^3 + + 24 * c^5 + + 13 * a^4 * d + + 37 * a * b^3 * d + + 67 * b^4 * d + + 85 * a^3 * c * d + + 30 * a^2 * b * c * d + + 2 * a * b^2 * c * d + + 22 * a^2 * c^2 * d + + 73 * a * b * c^2 * d + + 22 * b^2 * c^2 * d + + 56 * b * c^3 * d + + 7 * a * b^2 * d^2 + + 22 * b^3 * d^2 + + 2 * a^2 * c * d^2 + + 45 * a * c^2 * d^2 + + 33 * a^2 * d^3 + + 19 * b * d^4 + + 67 * a^4 * e + + 87 * a^3 * b * e + + 41 * a^2 * b^2 * e + + 58 * a * b^3 * e + + 19 * b^4 * e + + 36 * b^2 * c^2 * e + + 60 * b * c^3 * e + + 22 * c^4 * e + + 59 * a^2 * b * d * e + + 17 * a * b^2 * d * e + + 82 * b^2 * c * d * e + + 9 * b * c^2 * d * e + + 59 * a^2 * d^2 * e + + 72 * a * b * d^2 * e + + 55 * b^2 * d^2 * e + + 47 * b * c * d^2 * e + + 12 * c^2 * d^2 * e + + 32 * c * d^3 * e + + 40 * d^4 * e + + 77 * a^3 * e^2 + + 35 * a^2 * b * e^2 + + 29 * a * b^2 * e^2 + + 13 * a^2 * c * e^2 + + 4 * a * b * c * e^2 + + 5 * a * c^2 * e^2 + + 59 * b * c^2 * e^2 + + 89 * c^3 * e^2 + + 14 * b^2 * d * e^2 + + 55 * a * c * d * e^2 + + 50 * a * d^2 * e^2 + + 65 * d^3 * e^2 + + 33 * a^2 * e^3 + + 21 * a * b * e^3 + + 82 * a * c * e^3 + + 7 * a * d * e^3 + + 48 * c * d * e^3 + + 43 * b * e^4 + + 62 * c * e^4 + + 37 * d * e^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 59 + + 64 * a + + 76 * b + + 16 * c + + 66 * d + + 4 * a^2 + + 72 * b^2 + + 34 * b * c + + 12 * c^2 + + 26 * a * d + + 87 * c * d + + 63 * d^2 + + 52 * a * e + + 7 * b * e + + 45 * a^3 + + 70 * a^2 * b + + 89 * a^2 * c + + 7 * a * b * c + + 79 * b * c^2 + + 19 * c^3 + + 61 * a * b * d + + 74 * a * c * d + + 77 * b * c * d + + 47 * c^2 * d + + 66 * a * d^2 + + 62 * b^2 * e + + 8 * a * c * e + + 47 * b * c * e + + 21 * a * d * e + + 86 * b * d * e + + 81 * c * d * e + + 6 * d^2 * e + + 40 * a * e^2 + + 33 * b * e^2 + + 84 * d * e^2 + + 90 * a^4 + + 82 * a^2 * b^2 + + 64 * a * b^3 + + 87 * a^3 * c + + 14 * a * b^2 * c + + 20 * a^2 * c^2 + + 23 * a * c^3 + + 70 * a^3 * d + + 10 * a^2 * c * d + + 29 * a * b * c * d + + 62 * b^2 * c * d + + 50 * a * b * d^2 + + 25 * b * c * d^2 + + 78 * a * d^3 + + 33 * c * d^3 + + 27 * d^4 + + 16 * a^3 * e + + 81 * a^2 * b * e + + 20 * a^2 * c * e + + a * c^2 * e + + 71 * b * c^2 * e + + 52 * c^3 * e + + 48 * a * b * d * e + + 83 * b^2 * d * e + + 73 * c^2 * d * e + + 82 * a * d^2 * e + + 58 * b * d^2 * e + + 57 * d^3 * e + + 89 * a * b * e^2 + + 45 * a * c * e^2 + + 40 * c^2 * e^2 + + 74 * a * d * e^2 + + 37 * b * d * e^2 + + 83 * c * d * e^2 + + 5 * d^2 * e^2 + + 74 * b * e^3 + + 62 * c * e^3 + + 45 * d * e^3 + + 89 * e^4 + + 85 * a^3 * b^2 + + 27 * b^5 + + 37 * a^4 * c + + 23 * a^3 * b * c + + 40 * a^2 * b^2 * c + + 27 * b^4 * c + + 49 * a^3 * c^2 + + 14 * a^2 * b * c^2 + + 16 * a * b^2 * c^2 + + 10 * a * b * c^3 + + 41 * b^2 * c^3 + + 39 * a * c^4 + + 44 * a^4 * d + + 52 * a^2 * b^2 * d + + 36 * b^4 * d + + 6 * a^3 * c * d + + 12 * a^2 * b * c * d + + 48 * b^2 * c^2 * d + + 89 * b * c^3 * d + + 18 * c^4 * d + + 33 * a^2 * b * d^2 + + 34 * b^3 * d^2 + + 9 * a^2 * c * d^2 + + 27 * a * b * c * d^2 + + 72 * c^3 * d^2 + + 11 * a^2 * d^3 + + 63 * a * b * d^3 + + 65 * b^2 * d^3 + + 26 * a * c * d^3 + + 65 * b * c * d^3 + + 4 * a * d^4 + + 81 * c * d^4 + + 66 * a^4 * e + + 60 * a^3 * b * e + + 72 * a * b^3 * e + + 48 * a * b^2 * c * e + + 38 * a^2 * c^2 * e + + 38 * a * b * c^2 * e + + 67 * b^2 * c^2 * e + + 39 * b * c^3 * e + + 85 * c^4 * e + + 28 * a^3 * d * e + + 90 * a^2 * b * d * e + + 73 * b^3 * d * e + + 89 * a * b * c * d * e + + 31 * a * c^2 * d * e + + 79 * b * c^2 * d * e + + 83 * c^3 * d * e + + 51 * a^2 * d^2 * e + + 76 * a * b * d^2 * e + + 43 * b^2 * d^2 * e + + 74 * a * c * d^2 * e + + 44 * c^2 * d^2 * e + + 4 * b * d^3 * e + + 13 * c * d^3 * e + + 61 * d^4 * e + + 49 * a^2 * b * e^2 + + 22 * a * b^2 * e^2 + + 33 * b^3 * e^2 + + 71 * a^2 * c * e^2 + + 53 * a * b * c * e^2 + + 62 * b^2 * c * e^2 + + 3 * a * c^2 * e^2 + + 79 * b * c^2 * e^2 + + 12 * a^2 * d * e^2 + + 79 * a * b * d * e^2 + + 43 * b^2 * d * e^2 + + 55 * a * c * d * e^2 + + 43 * b * c * d * e^2 + + 70 * a * d^2 * e^2 + + 80 * b * d^2 * e^2 + + 69 * d^3 * e^2 + + 52 * a^2 * e^3 + + 26 * b^2 * e^3 + + 63 * c^2 * e^3 + + 29 * a * d * e^3 + + 88 * b * d * e^3 + + 7 * a * e^4 + + 40 * c * e^4 + + 70 * e^5, + 9 + + 86 * a + + 59 * c + + 19 * d + + 61 * e + + 26 * a^2 + + 72 * b^2 + + a * c + + 62 * a * d + + 80 * d^2 + + 81 * a * e + + 31 * c * e + + 5 * d * e + + 26 * a^3 + + 39 * a^2 * b + + 73 * a * b^2 + + 44 * a * b * c + + 26 * b * c^2 + + 65 * b^2 * d + + 43 * b * c * d + + 21 * c^2 * d + + 30 * a * d^2 + + 81 * b * d^2 + + 44 * c * d^2 + + 76 * d^3 + + 55 * a * c * e + + 71 * b * c * e + + 81 * c^2 * e + + 79 * a * d * e + + 44 * b * d * e + + 63 * c * d * e + + 46 * a * e^2 + + 47 * c * e^2 + + 85 * d * e^2 + + 77 * e^3 + + 24 * a^3 * b + + 52 * a^2 * b^2 + + 12 * b^4 + + 51 * a * b^2 * c + + 17 * b^3 * c + + 64 * a^2 * c^2 + + 87 * a * c^3 + + 54 * b * c^3 + + 72 * a^2 * c * d + + 24 * a * b * c * d + + 43 * b^2 * c * d + + 29 * a * c^2 * d + + 51 * c^3 * d + + 68 * a * b * d^2 + + 49 * b^2 * d^2 + + 84 * b * c * d^2 + + 52 * c^2 * d^2 + + 31 * a * d^3 + + 15 * c * d^3 + + 6 * d^4 + + 54 * a^3 * e + + 28 * a^2 * b * e + + 88 * b^3 * e + + 44 * a * b * c * e + + 9 * a * c^2 * e + + 58 * b * c^2 * e + + 4 * c^3 * e + + 47 * a * b * d * e + + 6 * b^2 * d * e + + 9 * a * c * d * e + + 27 * c^2 * d * e + + 72 * a * d^2 * e + + 61 * b * d^2 * e + + 64 * c * d^2 * e + + 5 * a^2 * e^2 + + 32 * a * b * e^2 + + 56 * b^2 * e^2 + + 30 * b * c * e^2 + + 48 * c^2 * e^2 + + 64 * a * d * e^2 + + 70 * c * d * e^2 + + 16 * d^2 * e^2 + + 90 * a * e^3 + + 22 * b * e^3 + + 90 * c * e^3 + + 15 * d * e^3 + + 20 * e^4 + + 66 * a^5 + + 74 * a^4 * b + + 87 * a^3 * b^2 + + 88 * a * b^4 + + 14 * b^5 + + 47 * a^4 * c + + 57 * a^3 * b * c + + 34 * a^2 * b^2 * c + + 45 * b^3 * c^2 + + 38 * a^2 * c^3 + + 42 * a * b * c^3 + + 69 * a * c^4 + + 57 * c^5 + + 78 * a^3 * b * d + + 61 * a * b^3 * d + + 48 * b^4 * d + + 14 * a^3 * c * d + + 4 * b^3 * c * d + + 11 * a * b * c^2 * d + + 14 * b^2 * c^2 * d + + 57 * a * c^3 * d + + 87 * a^2 * b * d^2 + + 41 * a * b^2 * d^2 + + 36 * b^3 * d^2 + + 54 * b^2 * c * d^2 + + 20 * a * c^2 * d^2 + + 88 * c^3 * d^2 + + 20 * a^2 * d^3 + + 23 * a * b * d^3 + + 13 * a * c * d^3 + + 49 * b * c * d^3 + + 5 * a * d^4 + + 55 * b * d^4 + + 14 * c * d^4 + + 38 * d^5 + + 87 * a^3 * b * e + + 4 * b^4 * e + + 18 * a^2 * b * c * e + + 4 * a * b^2 * c * e + + 39 * a * b * c^2 * e + + 89 * b^2 * c^2 * e + + 43 * a * c^3 * e + + 46 * c^4 * e + + 19 * a * b^2 * d * e + + 18 * b^3 * d * e + + 49 * a * b * c * d * e + + 14 * b^2 * c * d * e + + 7 * a * c^2 * d * e + + 6 * b * c * d^2 * e + + 74 * b * d^3 * e + + 89 * c * d^3 * e + + 58 * a^3 * e^2 + + 50 * a * b^2 * e^2 + + 38 * b^3 * e^2 + + 42 * a * c^2 * e^2 + + 12 * b * c^2 * e^2 + + 57 * a^2 * d * e^2 + + 18 * a * b * d * e^2 + + 70 * a * c * d * e^2 + + 11 * b * c * d * e^2 + + 75 * c^2 * d * e^2 + + 78 * a * d^2 * e^2 + + 52 * b * d^2 * e^2 + + 20 * c * d^2 * e^2 + + 81 * d^3 * e^2 + + 8 * a^2 * e^3 + + 31 * a * b * e^3 + + 36 * b^2 * e^3 + + 19 * b * c * e^3 + + 10 * c^2 * e^3 + + 63 * a * d * e^3 + + 44 * c * d * e^3 + + 19 * b * e^4 + + 80 * c * e^4, + 54 * a + + 27 * a^2 + + 8 * a * b + + 82 * b^2 + + 48 * a * c + + 26 * b * c + + 43 * c^2 + + 27 * b * d + + 68 * c * d + + 27 * d^2 + + 37 * d * e + + 70 * a^2 * b + + 21 * a * b^2 + + 78 * b^3 + + 2 * a * b * c + + 52 * b^2 * c + + 67 * a * c^2 + + 31 * a^2 * d + + 34 * a * b * d + + 31 * b^2 * d + + 69 * a * c * d + + 82 * b * c * d + + 46 * b * d^2 + + 19 * c * d^2 + + 59 * a^2 * e + + 62 * b * c * e + + 33 * c * d * e + + 77 * a * e^2 + + 72 * b * e^2 + + 6 * d * e^2 + + 63 * e^3 + + 60 * a^3 * b + + 5 * b^4 + + 12 * a^3 * c + + 68 * a * b^2 * c + + 80 * a^2 * c^2 + + 45 * a * b * c^2 + + 25 * a * c^3 + + 63 * a^2 * b * d + + 55 * a * b^2 * d + + 43 * b^3 * d + + 54 * b^2 * c * d + + 43 * a * c^2 * d + + 52 * b * c^2 * d + + 82 * c^3 * d + + 45 * a^2 * d^2 + + 18 * c^2 * d^2 + + 69 * b * d^3 + + 39 * c * d^3 + + 62 * d^4 + + 48 * a^3 * e + + 73 * a^2 * b * e + + 60 * a * b^2 * e + + 82 * b^3 * e + + a^2 * c * e + + 72 * a * b * c * e + + 27 * a^2 * d * e + + 58 * a * b * d * e + + 62 * c^2 * d * e + + 80 * a * d^2 * e + + 86 * b * d^2 * e + + 85 * a^2 * e^2 + + 55 * a * b * e^2 + + 10 * b^2 * e^2 + + 54 * b * c * e^2 + + 18 * a * d * e^2 + + 79 * d^2 * e^2 + + 38 * a * e^3 + + 35 * c * e^3 + + 74 * d * e^3 + + 27 * e^4 + + 19 * a^5 + + 84 * a^4 * b + + 42 * a^3 * b^2 + + 32 * a * b^4 + + 54 * b^5 + + 85 * a^4 * c + + 59 * a^3 * b * c + + 58 * b^4 * c + + 25 * a^2 * b * c^2 + + 16 * a * b^2 * c^2 + + 84 * b^3 * c^2 + + 2 * a * b * c^3 + + 71 * a * c^4 + + 32 * b * c^4 + + 63 * c^5 + + 39 * a^3 * b * d + + 70 * a * b^3 * d + + 83 * a^2 * b * c * d + + 62 * a * c^3 * d + + 17 * c^4 * d + + 39 * a * b^2 * d^2 + + 89 * b^3 * d^2 + + 55 * a * b * c * d^2 + + 37 * b * c^2 * d^2 + + 19 * a^2 * d^3 + + 40 * b^2 * d^3 + + 27 * a * c * d^3 + + 65 * b * c * d^3 + + 15 * a * d^4 + + 59 * c * d^4 + + 61 * a^4 * e + + 50 * a^2 * b^2 * e + + 7 * b^4 * e + + 17 * a^3 * c * e + + 84 * a^2 * b * c * e + + 62 * a * b^2 * c * e + + 87 * a^2 * c^2 * e + + 35 * a * b * c^2 * e + + 10 * a * c^3 * e + + 21 * b * c^3 * e + + 88 * c^4 * e + + 47 * a^2 * b * d * e + + 29 * b^3 * d * e + + 66 * a * b * c * d * e + + 34 * b * c^2 * d * e + + 27 * c^3 * d * e + + 89 * a^2 * d^2 * e + + 38 * a * b * d^2 * e + + 67 * b^2 * d^2 * e + + 60 * c^2 * d^2 * e + + 37 * a * d^3 * e + + 50 * b * d^3 * e + + 72 * c * d^3 * e + + 26 * d^4 * e + + 2 * a^2 * b * e^2 + + 21 * a * b^2 * e^2 + + 6 * a^2 * c * e^2 + + 31 * a * b * c * e^2 + + 28 * b^2 * c * e^2 + + 52 * a * c^2 * e^2 + + 45 * b^2 * d * e^2 + + 77 * c^2 * d * e^2 + + 79 * a * d^2 * e^2 + + 63 * b * d^2 * e^2 + + 34 * a^2 * e^3 + + 44 * a * b * e^3 + + 4 * a * c * e^3 + + 47 * c^2 * e^3 + + 88 * b * d * e^3 + + 30 * c * d * e^3 + + 25 * d^2 * e^3 + + 40 * a * e^4 + + 44 * d * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 84 * a + + 17 * b + + 4 * d + + 33 * a^2 + + 82 * a * b + + 11 * b^2 + + 51 * b * d + + 33 * a * e + + 14 * b * e + + 87 * d * e + + 53 * a^3 + + 16 * a^2 * b + + 42 * a * b^2 + + 78 * a^2 * c + + 10 * a * b * c + + 63 * a * c^2 + + 74 * c^3 + + 13 * a^2 * d + + 26 * b * c * d + + 32 * c^2 * d + + 59 * a * d^2 + + 64 * b * d^2 + + 56 * c * d^2 + + 86 * d^3 + + 35 * a^2 * e + + 85 * a * b * e + + 80 * b^2 * e + + 52 * a * c * e + + 25 * b * d * e + + 54 * b * e^2 + + 42 * c * e^2 + + 42 * d * e^2 + + 63 * e^3 + + 71 * a^4 + + 27 * a^2 * b^2 + + 22 * a * b^3 + + 65 * b^4 + + 68 * a^3 * c + + 13 * a * b^2 * c + + 22 * b^2 * c^2 + + 25 * a * c^3 + + 72 * b * c^3 + + 45 * a^2 * b * d + + 75 * b^3 * d + + 20 * a * b * c * d + + 6 * a * c^2 * d + + 22 * b * c^2 * d + + 19 * c^3 * d + + 54 * a * b * d^2 + + 45 * b^2 * d^2 + + 22 * c^2 * d^2 + + a * d^3 + + 26 * c * d^3 + + 26 * d^4 + + 82 * a^3 * e + + 3 * a^2 * b * e + + 63 * b^3 * e + + 10 * b^2 * c * e + + 32 * b * c^2 * e + + 61 * c^3 * e + + 65 * a * b * d * e + + 49 * b^2 * d * e + + 72 * a * c * d * e + + 62 * b * c * d * e + + 78 * c^2 * d * e + + 11 * a * d^2 * e + + 26 * a^2 * e^2 + + 63 * a * b * e^2 + + 56 * b^2 * e^2 + + 44 * a * c * e^2 + + 87 * b * c * e^2 + + 29 * a * d * e^2 + + 70 * b * d * e^2 + + 49 * c * d * e^2 + + 2 * a * e^3 + + 52 * b * e^3 + + 17 * c * e^3 + + 45 * d * e^3 + + 57 * a^3 * b^2 + + 43 * a^2 * b^3 + + 88 * b^5 + + 3 * a^4 * c + + 18 * b^4 * c + + 48 * a^3 * c^2 + + 49 * a^2 * b * c^2 + + 79 * a * b^2 * c^2 + + 77 * b^3 * c^2 + + 42 * a * c^4 + + 15 * b * c^4 + + 18 * b^4 * d + + 5 * a^2 * b * c * d + + 22 * a * b^2 * c * d + + 45 * b^3 * c * d + + 7 * a * b * c^2 * d + + 30 * b^2 * c^2 * d + + 6 * a * c^3 * d + + 34 * b * c^3 * d + + 86 * a^3 * d^2 + + 59 * a^2 * b * d^2 + + 8 * a * b^2 * d^2 + + 77 * b^3 * d^2 + + 20 * a^2 * c * d^2 + + 22 * a * c^2 * d^2 + + 64 * c^3 * d^2 + + 55 * a * b * d^3 + + 29 * c^2 * d^3 + + 48 * b * d^4 + + 45 * a^4 * e + + 11 * a^2 * b^2 * e + + 22 * a * b^3 * e + + 81 * a^3 * c * e + + 28 * a^2 * b * c * e + + 66 * a * b^2 * c * e + + 7 * b^2 * c^2 * e + + 76 * b * c^3 * e + + 18 * a^3 * d * e + + 60 * a^2 * b * d * e + + 16 * a * b^2 * d * e + + 23 * b^3 * d * e + + 62 * a^2 * c * d * e + + 3 * a * b * c * d * e + + 17 * b * c^2 * d * e + + 16 * c^3 * d * e + + 59 * a^2 * d^2 * e + + 62 * b^2 * d^2 * e + + 85 * a * c * d^2 * e + + 51 * b * c * d^2 * e + + 54 * a * d^3 * e + + 17 * a^3 * e^2 + + 28 * a^2 * b * e^2 + + 8 * b^3 * e^2 + + 64 * a^2 * c * e^2 + + 88 * a * b * c * e^2 + + 63 * c^3 * e^2 + + 19 * a^2 * d * e^2 + + 18 * a * d^2 * e^2 + + 89 * b * d^2 * e^2 + + 59 * b * c * e^3 + + 59 * c^2 * e^3 + + 87 * a * d * e^3 + + 79 * c * d * e^3 + + 84 * b * e^4 + + 43 * c * e^4 + + 79 * e^5, + 49 + + 43 * a + + 65 * b + + 33 * c + + 75 * a^2 + + 53 * a * b + + 31 * a * c + + 27 * b * c + + 37 * c^2 + + 40 * a * d + + 14 * b * d + + 69 * d^2 + + 45 * a * e + + 51 * b * e + + 60 * e^2 + + 49 * a^3 + + 53 * a^2 * b + + 10 * b^3 + + 38 * b^2 * c + + 72 * a^2 * d + + 21 * a * b * d + + 71 * b^2 * d + + 57 * a * c * d + + 26 * b * c * d + + 5 * c^2 * d + + 56 * b * d^2 + + 83 * c * d^2 + + 10 * c^2 * e + + 35 * a * d * e + + 19 * c * d * e + + 5 * d^2 * e + + 83 * a * e^2 + + 87 * b * e^2 + + 36 * c * e^2 + + 53 * d * e^2 + + 10 * e^3 + + 32 * a^3 * b + + 25 * a^2 * b^2 + + 64 * b^4 + + 57 * a^3 * c + + 88 * a^2 * b * c + + 28 * a^2 * c^2 + + 55 * b * c^3 + + 39 * a^2 * b * d + + 44 * a * b^2 * d + + 44 * a^2 * c * d + + 80 * a * b * c * d + + 59 * b^2 * c * d + + 18 * a * c^2 * d + + 56 * b * c^2 * d + + 64 * c^3 * d + + 27 * a * b * d^2 + + 88 * b * c * d^2 + + 70 * c^2 * d^2 + + 7 * a * d^3 + + 5 * d^4 + + 49 * a^3 * e + + 76 * a^2 * b * e + + 19 * b^3 * e + + 51 * a^2 * c * e + + 30 * a * b * c * e + + 49 * b^2 * c * e + + 68 * a * c^2 * e + + 24 * b * c^2 * e + + 52 * a^2 * d * e + + 71 * a * b * d * e + + 6 * b^2 * d * e + + 79 * b * c * d * e + + 43 * c^2 * d * e + + 32 * b * d^2 * e + + 30 * c * d^2 * e + + 35 * b^2 * e^2 + + 51 * a * c * e^2 + + 12 * b * c * e^2 + + 59 * a * d * e^2 + + 78 * b * d * e^2 + + 46 * c * d * e^2 + + 63 * a * e^3 + + 89 * d * e^3 + + 51 * a^5 + + 17 * a^4 * b + + 84 * a^3 * b^2 + + 89 * a^4 * c + + 27 * a^3 * b * c + + 51 * a^2 * b^2 * c + + 79 * a * b^3 * c + + 8 * b^4 * c + + 85 * a^3 * c^2 + + 55 * a^2 * b * c^2 + + 30 * a * b^2 * c^2 + + 25 * b^2 * c^3 + + 59 * a^4 * d + + 41 * a^2 * b^2 * d + + 37 * a * b^3 * d + + 73 * b^4 * d + + 22 * a^3 * c * d + + 7 * a * b^2 * c * d + + 80 * b^3 * c * d + + 62 * a^2 * c^2 * d + + 12 * b^2 * c^2 * d + + 60 * b * c^3 * d + + 18 * a^2 * b * d^2 + + 45 * a * b * c * d^2 + + 90 * b^2 * c * d^2 + + 88 * a * c^2 * d^2 + + 82 * a^2 * d^3 + + 76 * b^2 * d^3 + + 25 * a * c * d^3 + + 7 * c * d^4 + + 19 * d^5 + + 65 * a^3 * b * e + + 66 * a^2 * b^2 * e + + 43 * a * b^3 * e + + 33 * b^4 * e + + 26 * a^2 * b * c * e + + 68 * a * b * c^2 * e + + 46 * b^2 * c^2 * e + + 7 * a * c^3 * e + + 65 * b * c^3 * e + + 62 * a^3 * d * e + + 35 * a * b^2 * d * e + + 87 * a^2 * c * d * e + + 6 * a * b * c * d * e + + 67 * b^2 * c * d * e + + 39 * a * c^2 * d * e + + 47 * b * c^2 * d * e + + 61 * c^3 * d * e + + 19 * a^2 * d^2 * e + + 73 * a * c * d^2 * e + + 84 * c^2 * d^2 * e + + 56 * c * d^3 * e + + 39 * d^4 * e + + 88 * a^3 * e^2 + + 21 * a^2 * b * e^2 + + 50 * b^3 * e^2 + + 21 * a^2 * c * e^2 + + 86 * b * c^2 * e^2 + + 80 * c^3 * e^2 + + 54 * a^2 * d * e^2 + + 63 * a * b * d * e^2 + + 41 * b^2 * d * e^2 + + 59 * a * c * d * e^2 + + 45 * b * c * d * e^2 + + 68 * a * d^2 * e^2 + + 11 * c * d^2 * e^2 + + 60 * d^3 * e^2 + + 86 * a^2 * e^3 + + 79 * a * b * e^3 + + 56 * b * c * e^3 + + 82 * c^2 * e^3 + + 44 * a * d * e^3 + + 54 * b * d * e^3 + + 48 * c * d * e^3 + + 90 * d^2 * e^3 + + 58 * a * e^4 + + 25 * b * e^4 + + 59 * c * e^4 + + 29 * e^5, + 54 + + 16 * a + + 21 * c + + 44 * e + + 44 * a^2 + + 40 * b^2 + + 29 * a * c + + 3 * b * c + + 83 * c * d + + 65 * d^2 + + 43 * b * e + + 62 * c * e + + 34 * e^2 + + 63 * a^3 + + 33 * a * c^2 + + 32 * a^2 * d + + 44 * b^2 * d + + 47 * a * d^2 + + 83 * b * d^2 + + 42 * c * d^2 + + 82 * d^3 + + 11 * a^2 * e + + 82 * a * b * e + + 6 * a * c * e + + 70 * b * c * e + + 27 * c^2 * e + + 54 * c * d * e + + 34 * d^2 * e + + 68 * b * e^2 + + 38 * c * e^2 + + 46 * d * e^2 + + 53 * e^3 + + 90 * a^4 + + 47 * a^3 * b + + 59 * a^2 * b^2 + + 50 * a * b^3 + + 12 * b^4 + + 79 * a^2 * b * c + + 39 * a^2 * c^2 + + 21 * b^2 * c^2 + + 10 * a * c^3 + + 62 * b * c^3 + + 40 * c^4 + + 41 * a^2 * b * d + + 27 * a * b^2 * d + + 67 * a^2 * c * d + + 68 * a * b * c * d + + 43 * b^2 * c * d + + 22 * b * c^2 * d + + 77 * c^3 * d + + 76 * a^2 * d^2 + + 30 * b^2 * d^2 + + 89 * a * c * d^2 + + 14 * c^2 * d^2 + + 76 * b * d^3 + + 3 * c * d^3 + + 17 * a^2 * b * e + + 65 * b^3 * e + + 63 * a^2 * c * e + + 49 * a * b * c * e + + 17 * a * c^2 * e + + 60 * c^2 * d * e + + 18 * b * d^2 * e + + 74 * a^2 * e^2 + + 22 * c^2 * e^2 + + 33 * a * d * e^2 + + 22 * b * d * e^2 + + 90 * d^2 * e^2 + + 82 * a * e^3 + + 12 * d * e^3 + + 70 * a * b^4 + + 36 * b^5 + + 71 * a^4 * c + + 8 * a^2 * b^2 * c + + 25 * a * b^3 * c + + 13 * a^3 * c^2 + + 21 * a^2 * b * c^2 + + 53 * b^3 * c^2 + + 69 * a^2 * c^3 + + 43 * a * b * c^3 + + 53 * a * c^4 + + 16 * b * c^4 + + 41 * a^2 * b^2 * d + + 20 * a * b^3 * d + + 40 * b^4 * d + + 84 * a^2 * c^2 * d + + 52 * a * b * c^2 * d + + 58 * b^2 * c^2 * d + + 85 * a * c^3 * d + + 41 * a^2 * b * d^2 + + 34 * a * b^2 * d^2 + + 53 * b^3 * d^2 + + 17 * a * b * c * d^2 + + 68 * b^2 * c * d^2 + + 16 * a * c^2 * d^2 + + 39 * b * c^2 * d^2 + + 6 * a * b * d^3 + + 88 * a * c * d^3 + + 34 * b * c * d^3 + + 65 * c^2 * d^3 + + 38 * a * d^4 + + 47 * b * d^4 + + c * d^4 + + 56 * d^5 + + 29 * a^4 * e + + 12 * a^3 * b * e + + 54 * a * b^3 * e + + 7 * a^3 * c * e + + 83 * a^2 * b * c * e + + 75 * a * b^2 * c * e + + 87 * a^2 * c^2 * e + + 66 * a * b * c^2 * e + + 14 * a * c^3 * e + + 44 * b * c^3 * e + + 78 * a^3 * d * e + + 9 * a * b^2 * d * e + + 89 * b^3 * d * e + + 27 * a * b * c * d * e + + 28 * b^2 * c * d * e + + 27 * a * c^2 * d * e + + 75 * b * c^2 * d * e + + 83 * c^3 * d * e + + 4 * a^2 * d^2 * e + + 31 * a * b * d^2 * e + + 88 * b^2 * d^2 * e + + 24 * a * c * d^2 * e + + 72 * b * c * d^2 * e + + 7 * c^2 * d^2 * e + + 37 * b * d^3 * e + + 3 * c * d^3 * e + + 38 * a^3 * e^2 + + 10 * a * b^2 * e^2 + + 57 * b^3 * e^2 + + 66 * a^2 * c * e^2 + + 61 * a * b * c * e^2 + + 28 * a * c^2 * e^2 + + 84 * b * c^2 * e^2 + + 66 * a^2 * d * e^2 + + 42 * a * c * d * e^2 + + 44 * b * c * d * e^2 + + 47 * a * d^2 * e^2 + + 26 * c * d^2 * e^2 + + 50 * d^3 * e^2 + + 59 * a * b * e^3 + + 83 * a * c * e^3 + + 57 * c^2 * e^3 + + 53 * a * d * e^3 + + 34 * b * d * e^3 + + 48 * c * d * e^3 + + 42 * a * e^4 + + 87 * b * e^4 + + 57 * d * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 34 * a + + 68 * d + + 49 * a^2 + + 11 * b^2 + + 12 * c^2 + + 26 * b * d + + 20 * b * e + + 17 * c * e + + 34 * e^2 + + 76 * a^2 * b + + 67 * b^3 + + 69 * a^2 * c + + 63 * a * b * c + + 69 * b^2 * c + + 14 * a * c^2 + + 62 * b^2 * d + + 46 * a * c * d + + 56 * c^2 * d + + 61 * c * d^2 + + 13 * a * b * e + + 64 * b^2 * e + + 25 * b * d * e + + 27 * c * d * e + + 8 * d^2 * e + + 29 * a * e^2 + + 5 * c * e^2 + + 57 * e^3 + + a^4 + + 75 * a^2 * b^2 + + 9 * a * b^3 + + 34 * b^4 + + 73 * a^2 * b * c + + 15 * a * b^2 * c + + 11 * a^2 * c^2 + + 40 * a * b * c^2 + + 69 * a * c^3 + + 69 * c^4 + + 81 * a^3 * d + + 38 * a^2 * b * d + + 50 * a * b^2 * d + + 89 * a^2 * c * d + + 30 * b^2 * c * d + + 70 * a * c^2 * d + + 74 * a^2 * d^2 + + 25 * a * b * d^2 + + 7 * a * c * d^2 + + 55 * b * c * d^2 + + 90 * c^2 * d^2 + + 71 * a * d^3 + + 85 * a * b^2 * e + + 82 * b^3 * e + + 14 * a^2 * c * e + + 72 * a * b * c * e + + 2 * b^2 * c * e + + 25 * c^3 * e + + 84 * a * c * d * e + + 31 * b * c * d * e + + 39 * c^2 * d * e + + 18 * d^3 * e + + 28 * a * b * e^2 + + 76 * b^2 * e^2 + + 49 * a * c * e^2 + + 61 * b * c * e^2 + + 59 * c * d * e^2 + + 86 * d^2 * e^2 + + 9 * a * e^3 + + 65 * b * e^3 + + 40 * c * e^3 + + 6 * d * e^3 + + 16 * e^4 + + 6 * a^4 * b + + 64 * b^5 + + 68 * a^2 * b^2 * c + + 28 * b^4 * c + + 86 * a^3 * c^2 + + 71 * a * b^2 * c^2 + + 63 * a * b * c^3 + + 15 * b^2 * c^3 + + 55 * a * c^4 + + 81 * c^5 + + 2 * a^4 * d + + 38 * a^3 * b * d + + 34 * a^2 * b^2 * d + + 69 * b^4 * d + + 17 * b^3 * c * d + + 45 * b^2 * c^2 * d + + 87 * a * c^3 * d + + 40 * b * c^3 * d + + 29 * a^3 * d^2 + + 81 * a * b^2 * d^2 + + 62 * b^3 * d^2 + + 4 * a^2 * c * d^2 + + 25 * b^2 * c * d^2 + + 75 * a * c^2 * d^2 + + 45 * b * c^2 * d^2 + + 36 * c^3 * d^2 + + 44 * a * b * d^3 + + 65 * c^2 * d^3 + + 52 * a * d^4 + + 19 * b * d^4 + + 58 * a^4 * e + + 72 * a^2 * b^2 * e + + 38 * a * b^3 * e + + 15 * b^4 * e + + 62 * a^3 * c * e + + 88 * a * b^2 * c * e + + 86 * b^3 * c * e + + 37 * a^2 * c^2 * e + + 70 * a * b * c^2 * e + + 25 * c^4 * e + + 89 * a^3 * d * e + + 5 * a^2 * b * d * e + + 37 * a * b^2 * d * e + + 39 * b^3 * d * e + + 43 * a^2 * c * d * e + + 81 * a * b * c * d * e + + 61 * a * c^2 * d * e + + 59 * c^3 * d * e + + 89 * a^2 * d^2 * e + + 23 * a * b * d^2 * e + + 48 * b^2 * d^2 * e + + 9 * a * c * d^2 * e + + 14 * c^2 * d^2 * e + + 48 * a * d^3 * e + + 53 * b * d^3 * e + + 76 * c * d^3 * e + + 69 * a^2 * b * e^2 + + 89 * a * b^2 * e^2 + + 23 * b^3 * e^2 + + 79 * b^2 * c * e^2 + + 43 * a * c^2 * e^2 + + 18 * b * c^2 * e^2 + + 57 * c^3 * e^2 + + 22 * a^2 * d * e^2 + + 23 * b^2 * d * e^2 + + 44 * b * c * d * e^2 + + 66 * c^2 * d * e^2 + + 46 * a * d^2 * e^2 + + 63 * a * c * e^3 + + 62 * c^2 * e^3 + + 4 * a * d * e^3 + + 15 * b * d * e^3 + + 27 * c * d * e^3 + + 24 * d^2 * e^3 + + 67 * a * e^4 + + 33 * b * e^4 + + 21 * d * e^4, + 31 + + 18 * a + + 47 * c + + 29 * d + + 17 * e + + 52 * a^2 + + 10 * a * b + + 74 * a * c + + 36 * b * c + + 53 * b * d + + 51 * c * d + + 70 * d^2 + + 75 * a * e + + 52 * b * e + + 70 * c * e + + 2 * e^2 + + 81 * a^3 + + 17 * a^2 * b + + 73 * a * b^2 + + 79 * b^3 + + 27 * a^2 * c + + 75 * a * b * c + + 25 * b^2 * c + + 86 * b * c^2 + + 5 * c^3 + + 42 * a * b * d + + 16 * b^2 * d + + 80 * b * c * d + + 49 * c^2 * d + + 85 * b * d^2 + + 28 * c * d^2 + + 64 * a^2 * e + + 27 * b^2 * e + + 15 * a * c * e + + 38 * b * c * e + + 85 * c^2 * e + + 35 * a * d * e + + 14 * b * d * e + + 19 * c * d * e + + 17 * a * e^2 + + 57 * b * e^2 + + 71 * e^3 + + 5 * a^3 * b + + 18 * a * b^3 + + 44 * b^4 + + 84 * a^3 * c + + 48 * a * b^2 * c + + 46 * b^3 * c + + 80 * a^2 * c^2 + + 63 * b^2 * c^2 + + 52 * a * c^3 + + 15 * b * c^3 + + 19 * c^4 + + 32 * a^3 * d + + 27 * a^2 * b * d + + 12 * a * b * c * d + + 16 * a * c^2 * d + + 47 * b * c^2 * d + + 61 * c^3 * d + + 11 * a^2 * d^2 + + 10 * b^2 * d^2 + + 25 * a * c * d^2 + + 32 * b * c * d^2 + + 50 * c^2 * d^2 + + 12 * b * d^3 + + 52 * c * d^3 + + 51 * a^3 * e + + 50 * a^2 * b * e + + 17 * b^2 * c * e + + 23 * a * c^2 * e + + 9 * b * c^2 * e + + 11 * c^3 * e + + 80 * a * b * d * e + + 49 * b^2 * d * e + + 24 * b * c * d * e + + 8 * a * d^2 * e + + 39 * b * d^2 * e + + 5 * d^3 * e + + 62 * b^2 * e^2 + + 9 * a * c * e^2 + + 75 * a * d * e^2 + + 83 * c * d * e^2 + + 11 * d^2 * e^2 + + 16 * a * e^3 + + 5 * c * e^3 + + 56 * a^4 * b + + a^3 * b^2 + + 2 * a^2 * b^3 + + 10 * a * b^4 + + 4 * a^2 * b^2 * c + + a * b^3 * c + + 74 * b^4 * c + + 68 * a^3 * c^2 + + 25 * b^3 * c^2 + + 6 * a * b * c^3 + + 87 * b * c^4 + + 36 * a^3 * b * d + + 68 * a^2 * b^2 * d + + 83 * a * b^3 * d + + 34 * b^4 * d + + 23 * a^3 * c * d + + 85 * a * b^2 * c * d + + 14 * b^3 * c * d + + 72 * a^2 * c^2 * d + + 11 * b^2 * c^2 * d + + 74 * a * c^3 * d + + 21 * a^3 * d^2 + + 66 * b^3 * d^2 + + 24 * a * b * c * d^2 + + 46 * a * c^2 * d^2 + + 43 * c^3 * d^2 + + 39 * a^2 * d^3 + + 76 * a * b * d^3 + + 69 * b^2 * d^3 + + 61 * a * d^4 + + 78 * c * d^4 + + 82 * d^5 + + 72 * a^3 * b * e + + 42 * b^4 * e + + 16 * a^2 * b * c * e + + 17 * a * b^2 * c * e + + 52 * b^2 * c^2 * e + + 13 * a * c^3 * e + + 8 * b * c^3 * e + + 62 * a^3 * d * e + + 26 * b^3 * d * e + + 50 * a^2 * c * d * e + + 18 * a * b * c * d * e + + 77 * a * c^2 * d * e + + 86 * b * c^2 * d * e + + 56 * a^2 * d^2 * e + + 65 * a * b * d^2 * e + + 48 * a * c * d^2 * e + + 57 * b * c * d^2 * e + + 88 * c^2 * d^2 * e + + 49 * a * d^3 * e + + 63 * b * d^3 * e + + 33 * c * d^3 * e + + a * b^2 * e^2 + + 65 * b^3 * e^2 + + 58 * a^2 * c * e^2 + + 21 * a * c^2 * e^2 + + 64 * c^3 * e^2 + + 31 * a^2 * d * e^2 + + 11 * a * b * d * e^2 + + 69 * b * c * d * e^2 + + 41 * c^2 * d * e^2 + + 13 * a * d^2 * e^2 + + 26 * c * d^2 * e^2 + + 56 * d^3 * e^2 + + 25 * a * b * e^3 + + 79 * c * d * e^3 + + 20 * d^2 * e^3 + + 56 * b * e^4 + + 47 * c * e^4, + 71 + + 32 * a + + 70 * d + + 25 * e + + 9 * a^2 + + 90 * a * b + + 34 * b^2 + + 18 * b * c + + 75 * a * d + + 41 * c * d + + 14 * b * e + + 50 * c * e + + 55 * e^2 + + 76 * b^3 + + 41 * a * b * c + + 73 * b^2 * c + + 22 * a * c^2 + + 3 * b * c^2 + + 77 * a * b * d + + 47 * b^2 * d + + 79 * a * c * d + + 36 * b * c * d + + 76 * c^2 * d + + 81 * a * d^2 + + 67 * c * d^2 + + 53 * b^2 * e + + 16 * a * c * e + + 69 * b * c * e + + 42 * c * d * e + + 67 * c * e^2 + + 15 * d * e^2 + + 7 * e^3 + + 58 * a * b^3 + + 5 * b^4 + + 43 * a^3 * c + + 87 * a^2 * b * c + + 51 * b^3 * c + + 87 * a * c^3 + + 84 * b * c^3 + + 45 * c^4 + + 54 * a^3 * d + + 73 * a^2 * b * d + + 75 * a * b^2 * d + + 28 * b^3 * d + + 6 * a * b * c * d + + 13 * b^2 * c * d + + 68 * c^3 * d + + 55 * a * b * d^2 + + 40 * b^2 * d^2 + + a * c * d^2 + + 17 * b * c * d^2 + + 30 * c^2 * d^2 + + 89 * a * d^3 + + 47 * b * d^3 + + 54 * d^4 + + 33 * b^3 * e + + 48 * a^2 * c * e + + 60 * b^2 * c * e + + 88 * a * c^2 * e + + b * c^2 * e + + 37 * a^2 * d * e + + 21 * a * b * d * e + + a * c * d * e + + 45 * c^2 * d * e + + 40 * c * d^2 * e + + 41 * d^3 * e + + 28 * a * b * e^2 + + 80 * b * c * e^2 + + 33 * c^2 * e^2 + + 73 * c * d * e^2 + + 33 * d^2 * e^2 + + 56 * a * e^3 + + 53 * a^4 * b + + 84 * a^3 * b^2 + + 59 * a * b^4 + + a^4 * c + + 3 * a * b^3 * c + + 60 * a^3 * c^2 + + 21 * a * b^2 * c^2 + + 70 * b^3 * c^2 + + 57 * a^2 * c^3 + + 65 * a * b * c^3 + + 78 * b * c^4 + + 87 * c^5 + + 25 * a^3 * b * d + + 39 * a * b^3 * d + + 75 * b^4 * d + + 36 * a^3 * c * d + + 56 * a^2 * b * c * d + + 31 * a * b^2 * c * d + + 56 * a * b * c^2 * d + + 72 * a * c^3 * d + + 66 * b * c^3 * d + + 85 * c^4 * d + + 56 * a^2 * b * d^2 + + 26 * b^3 * d^2 + + 60 * a^2 * c * d^2 + + 70 * a * b * c * d^2 + + 54 * b^2 * c * d^2 + + 16 * b * c^2 * d^2 + + 72 * c^3 * d^2 + + 26 * a * b * d^3 + + 53 * a * c * d^3 + + 77 * b * c * d^3 + + 63 * a * d^4 + + 61 * b * d^4 + + 43 * c * d^4 + + 86 * d^5 + + 88 * a^3 * b * e + + 78 * a^2 * b^2 * e + + 7 * a * b^3 * e + + 60 * a^3 * c * e + + 51 * a^2 * b * c * e + + 27 * b^3 * c * e + + a^2 * c^2 * e + + 36 * a * b * c^2 * e + + 31 * b^2 * c^2 * e + + 23 * a * c^3 * e + + 62 * b * c^3 * e + + 47 * c^4 * e + + 57 * a^3 * d * e + + 72 * a * b^2 * d * e + + 45 * b^3 * d * e + + 73 * b^2 * c * d * e + + 66 * a * c^2 * d * e + + 34 * c^3 * d * e + + 39 * a^2 * d^2 * e + + 71 * a * b * d^2 * e + + b^2 * d^2 * e + + 85 * a * c * d^2 * e + + 14 * a * d^3 * e + + 48 * b * d^3 * e + + 67 * c * d^3 * e + + 79 * d^4 * e + + 83 * a^3 * e^2 + + 50 * a^2 * b * e^2 + + 66 * b^3 * e^2 + + 61 * b * c^2 * e^2 + + 22 * c^3 * e^2 + + 21 * a * b * d * e^2 + + 85 * b^2 * d * e^2 + + 41 * a * c * d * e^2 + + 30 * c^2 * d * e^2 + + 76 * a * d^2 * e^2 + + 83 * b * d^2 * e^2 + + 52 * a^2 * e^3 + + 89 * b^2 * e^3 + + 43 * b * c * e^3 + + 13 * c^2 * e^3 + + 27 * a * d * e^3 + + 88 * b * e^4 + + 52 * c * e^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + end + push!( + ideals, + Singular.Ideal( + R, + [ + 12 + + 33 * a + + 64 * b + + 43 * c + + 81 * d + + 24 * a * b + + 7 * a * c + + 78 * b * c + + 68 * c^2 + + 36 * b * d + + 69 * d^2 + + 17 * a * e + + 74 * b * e + + e^2 + + 62 * a^3 + + 16 * a^2 * b + + 82 * a * b^2 + + 24 * a^2 * c + + 60 * a * b * c + + 20 * a * c^2 + + 32 * c^3 + + 27 * b^2 * d + + 59 * a * c * d + + 28 * c^2 * d + + 27 * a * d^2 + + 18 * b * d^2 + + 13 * a^2 * e + + 15 * b * c * e + + 25 * c^2 * e + + 67 * a * d * e + + 19 * b * d * e + + 72 * c * d * e + + 45 * d^2 * e + + 78 * a * e^2 + + 34 * c * e^2 + + 40 * d * e^2 + + 11 * e^3 + + 40 * a^3 * b + + 55 * a * b^3 + + 59 * b^4 + + 2 * a^3 * c + + 28 * a^2 * b * c + + 87 * a * b^2 * c + + 36 * b^3 * c + + 87 * a^2 * c^2 + + 3 * b^2 * c^2 + + 30 * a * c^3 + + 41 * b * c^3 + + 88 * a * b^2 * d + + 41 * a^2 * c * d + + 39 * a * b * c * d + + 88 * b^2 * c * d + + 81 * a * c^2 * d + + 86 * c^3 * d + + 36 * a * b * d^2 + + 76 * b^2 * d^2 + + 56 * a * c * d^2 + + 32 * b * c * d^2 + + 26 * c^2 * d^2 + + 14 * a * d^3 + + 75 * b * d^3 + + 43 * c * d^3 + + 82 * d^4 + + 19 * a^2 * b * e + + 60 * b^3 * e + + 88 * a^2 * c * e + + 56 * a * b * c * e + + 13 * b^2 * c * e + + 71 * b * c^2 * e + + 21 * c^3 * e + + 18 * a^2 * d * e + + 40 * a * b * d * e + + 66 * b^2 * d * e + + 78 * a * c * d * e + + 83 * b * c * d * e + + 89 * c^2 * d * e + + 36 * d^3 * e + + 17 * a^2 * e^2 + + 11 * a * b * e^2 + + 30 * b^2 * e^2 + + 65 * b * c * e^2 + + 12 * b * d * e^2 + + 19 * c * d * e^2 + + 82 * d^2 * e^2 + + 3 * b * e^3 + + 54 * c * e^3 + + 89 * d * e^3 + + e^4 + + a^3 * b^2 + + 69 * a^2 * b^3 + + 5 * b^5 + + a^4 * c + + 59 * a^2 * b^2 * c + + 73 * a * b^3 * c + + 36 * b^4 * c + + 77 * a^2 * b * c^2 + + 21 * b^3 * c^2 + + 4 * a^2 * c^3 + + 83 * a * b * c^3 + + 18 * a * c^4 + + 82 * b * c^4 + + 66 * c^5 + + 39 * a^4 * d + + 20 * a^2 * b^2 * d + + 43 * a * b^3 * d + + 79 * b^4 * d + + 23 * a^3 * c * d + + 19 * a^2 * b * c * d + + 61 * b^3 * c * d + + 27 * a^2 * c^2 * d + + 58 * b^2 * c^2 * d + + 63 * b * c^3 * d + + 14 * a^3 * d^2 + + 6 * b^3 * d^2 + + 65 * a^2 * c * d^2 + + 32 * a * b * c * d^2 + + 62 * b^2 * c * d^2 + + 11 * b * c^2 * d^2 + + 4 * a^2 * d^3 + + 83 * a * c * d^3 + + 70 * b * c * d^3 + + 63 * c^2 * d^3 + + 8 * a * d^4 + + 26 * b * d^4 + + 32 * c * d^4 + + 78 * a^4 * e + + 13 * a^3 * b * e + + 8 * a^2 * b^2 * e + + 66 * a * b^3 * e + + 49 * b^4 * e + + 4 * a * b^2 * c * e + + 75 * b^3 * c * e + + 33 * b^2 * c^2 * e + + 43 * a * c^3 * e + + 32 * b * c^3 * e + + 79 * c^4 * e + + 6 * a^3 * d * e + + 38 * a * b^2 * d * e + + 22 * b^3 * d * e + + 56 * a^2 * c * d * e + + 49 * b^2 * c * d * e + + 47 * a * c^2 * d * e + + 85 * c^3 * d * e + + 5 * a^2 * d^2 * e + + 80 * a * b * d^2 * e + + 44 * a * c * d^2 * e + + 50 * b * c * d^2 * e + + 34 * c^2 * d^2 * e + + 13 * b * d^3 * e + + 17 * c * d^3 * e + + 41 * d^4 * e + + 43 * a^2 * b * e^2 + + 46 * a * b^2 * e^2 + + 41 * b^3 * e^2 + + b^2 * c * e^2 + + 44 * a * c^2 * e^2 + + 71 * c^3 * e^2 + + 10 * a * b * d * e^2 + + 66 * b^2 * d * e^2 + + 77 * a * c * d * e^2 + + 69 * b * c * d * e^2 + + 2 * a * d^2 * e^2 + + 33 * b * d^2 * e^2 + + 39 * c * d^2 * e^2 + + 69 * d^3 * e^2 + + 25 * a^2 * e^3 + + 36 * a * b * e^3 + + 56 * b^2 * e^3 + + 54 * a * c * e^3 + + 30 * c^2 * e^3 + + 4 * a * d * e^3 + + 73 * b * d * e^3 + + 30 * d^2 * e^3 + + 78 * c * e^4 + + 20 * e^5, + 40 + + 25 * b + + 73 * c + + 44 * d + + 4 * a * b + + 48 * b^2 + + 66 * a * c + + 15 * b * c + + 77 * b * d + + 36 * c * d + + 35 * c * e + + 84 * d * e + + 14 * e^2 + + 45 * a^3 + + 14 * a * b * c + + 86 * b^2 * c + + 15 * a * c^2 + + 76 * b * c^2 + + 67 * a^2 * d + + 59 * b^2 * d + + 8 * b * c * d + + 72 * c^2 * d + + 55 * a * d^2 + + 23 * b * d^2 + + 71 * c * d^2 + + 44 * d^3 + + a * b * e + + 40 * a * c * e + + 81 * c^2 * e + + 20 * a * d * e + + 79 * c * d * e + + 37 * d^2 * e + + 19 * b * e^2 + + 51 * c * e^2 + + 80 * d * e^2 + + 47 * a^3 * b + + 7 * a^3 * c + + 18 * a^2 * c^2 + + 48 * b^2 * c^2 + + 45 * b * c^3 + + 82 * c^4 + + 89 * a^3 * d + + 5 * a^2 * b * d + + 36 * a * b^2 * d + + 84 * a^2 * c * d + + 87 * b^2 * c * d + + 70 * a * c^2 * d + + 84 * b * c^2 * d + + 16 * c^3 * d + + 25 * a * b * d^2 + + 67 * a * c * d^2 + + 29 * b * c * d^2 + + 68 * c^2 * d^2 + + 72 * c * d^3 + + 65 * a^2 * b * e + + 10 * a * b^2 * e + + 13 * b^3 * e + + 72 * a^2 * c * e + + 36 * a * b * c * e + + 36 * b^2 * c * e + + 18 * a * c^2 * e + + 9 * b * c^2 * e + + 81 * c^3 * e + + 47 * a^2 * d * e + + 26 * a * b * d * e + + 61 * b^2 * d * e + + 78 * a * c * d * e + + 57 * b * c * d * e + + 40 * c^2 * d * e + + 23 * a * d^2 * e + + 82 * b * d^2 * e + + 65 * d^3 * e + + 87 * a^2 * e^2 + + 56 * a * b * e^2 + + 65 * b^2 * e^2 + + 54 * b * c * e^2 + + 90 * c^2 * e^2 + + 57 * a * d * e^2 + + 33 * b * d * e^2 + + 73 * c * d * e^2 + + 27 * d^2 * e^2 + + 43 * a * e^3 + + 12 * b * e^3 + + 88 * d * e^3 + + 69 * a^4 * b + + 25 * a^3 * b^2 + + 76 * a^2 * b^3 + + 2 * a * b^4 + + 35 * a^4 * c + + 70 * a * b^3 * c + + 48 * b^4 * c + + 29 * a^3 * c^2 + + 34 * a * b^2 * c^2 + + 29 * b^3 * c^2 + + 76 * a * b * c^3 + + 82 * a * c^4 + + 24 * b * c^4 + + 13 * a^4 * d + + 82 * b^4 * d + + 80 * a^2 * b * c * d + + 67 * a * b^2 * c * d + + 30 * b^3 * c * d + + 24 * a^2 * c^2 * d + + 89 * a * b * c^2 * d + + 6 * b^2 * c^2 * d + + 47 * a * c^3 * d + + 49 * b * c^3 * d + + 64 * c^4 * d + + 3 * a^2 * b * d^2 + + 15 * b^3 * d^2 + + 60 * a^2 * c * d^2 + + 24 * a * b * c * d^2 + + 68 * b * c^2 * d^2 + + 75 * c^3 * d^2 + + 54 * a^2 * d^3 + + 70 * a * b * d^3 + + 52 * b^2 * d^3 + + 90 * a * c * d^3 + + 83 * b * c * d^3 + + 76 * a * d^4 + + 80 * c * d^4 + + 69 * d^5 + + 71 * a^4 * e + + 79 * a^3 * b * e + + 41 * a^3 * c * e + + 85 * b^3 * c * e + + 75 * a^2 * c^2 * e + + 68 * a * b * c^2 * e + + 79 * a * c^3 * e + + 87 * c^4 * e + + 62 * a^3 * d * e + + 57 * a * b^2 * d * e + + 59 * a^2 * c * d * e + + 40 * a * b * c * d * e + + 71 * a * c^2 * d * e + + 70 * c^3 * d * e + + 19 * a^2 * d^2 * e + + 90 * b^2 * d^2 * e + + 38 * a * c * d^2 * e + + 7 * b * c * d^2 * e + + 25 * c^2 * d^2 * e + + 17 * a * d^3 * e + + 30 * b * d^3 * e + + 56 * d^4 * e + + 40 * a^2 * b * e^2 + + 80 * b^3 * e^2 + + a^2 * c * e^2 + + 34 * a * b * c * e^2 + + 52 * b^2 * c * e^2 + + 76 * b * c^2 * e^2 + + 40 * c^3 * e^2 + + 59 * a^2 * d * e^2 + + 69 * b * c * d * e^2 + + 42 * c^2 * d * e^2 + + 65 * b * d^2 * e^2 + + 61 * c * d^2 * e^2 + + 22 * d^3 * e^2 + + 76 * a^2 * e^3 + + 69 * a * b * e^3 + + 21 * b^2 * e^3 + + a * c * e^3 + + 2 * b * c * e^3 + + 9 * c^2 * e^3 + + 75 * a * d * e^3 + + 70 * b * d * e^3 + + 27 * d^2 * e^3 + + 71 * a * e^4 + + 63 * b * e^4, + 28 + + 6 * a + + 90 * c + + 55 * d + + 36 * e + + b^2 + + 24 * a * c + + 70 * b * c + + 62 * c^2 + + 29 * a * d + + 56 * b * d + + 40 * c * d + + 90 * d^2 + + 31 * a * e + + 28 * b * e + + 7 * c * e + + 78 * d * e + + 18 * e^2 + + 40 * a^3 + + 29 * a^2 * b + + 23 * b^3 + + 24 * b^2 * c + + 18 * a * c^2 + + 74 * c^3 + + 32 * a * b * d + + 57 * b^2 * d + + 81 * a * c * d + + 12 * b * c * d + + 16 * c^2 * d + + 53 * a * d^2 + + 81 * b * d^2 + + 25 * c * d^2 + + 28 * d^3 + + 22 * a^2 * e + + 6 * a * b * e + + 51 * b^2 * e + + 27 * a * c * e + + 16 * b * c * e + + 80 * c^2 * e + + 61 * a * d * e + + 59 * b * d * e + + 11 * c * d * e + + 76 * d^2 * e + + 85 * a * e^2 + + 43 * b * e^2 + + 39 * c * e^2 + + 56 * e^3 + + 48 * a^4 + + 33 * a^3 * b + + 90 * a^2 * b^2 + + 67 * a * b^3 + + 20 * a^3 * c + + 87 * a^2 * b * c + + 8 * a * b^2 * c + + 86 * b^3 * c + + 18 * a^2 * c^2 + + 46 * a * b * c^2 + + 72 * a * c^3 + + 75 * b * c^3 + + 71 * c^4 + + 74 * a^3 * d + + 59 * a^2 * b * d + + 34 * a * b^2 * d + + 13 * b^3 * d + + 34 * a^2 * c * d + + 70 * a * b * c * d + + 23 * b^2 * c * d + + 49 * a * c^2 * d + + 13 * b * c^2 * d + + 80 * c^3 * d + + 46 * a^2 * d^2 + + 39 * a * b * d^2 + + 78 * b^2 * d^2 + + 37 * a * c * d^2 + + 40 * c^2 * d^2 + + 81 * b * d^3 + + 85 * a * b^2 * e + + 31 * a * b * c * e + + 90 * b^2 * c * e + + 24 * b * c^2 * e + + 19 * c^3 * e + + 86 * b^2 * d * e + + 33 * a * c * d * e + + 65 * b * c * d * e + + 42 * a * d^2 * e + + 62 * a^2 * e^2 + + 50 * a * b * e^2 + + 48 * a * c * e^2 + + 70 * b * d * e^2 + + 77 * c * d * e^2 + + 8 * d^2 * e^2 + + 30 * b * e^3 + + 58 * c * e^3 + + 20 * d * e^3 + + 14 * a^5 + + 51 * a^4 * b + + 28 * a^3 * b^2 + + 34 * a^2 * b^3 + + 60 * a * b^4 + + 58 * a^4 * c + + 49 * b^4 * c + + 17 * a^3 * c^2 + + 13 * a^2 * b * c^2 + + 59 * a * b^2 * c^2 + + 31 * a^2 * c^3 + + 48 * a * b * c^3 + + 12 * b^2 * c^3 + + 55 * a * c^4 + + 8 * b * c^4 + + 23 * c^5 + + 34 * a^4 * d + + 52 * a^3 * b * d + + 21 * a^2 * b^2 * d + + a * b^3 * d + + 40 * a^2 * b * c * d + + 56 * a * b^2 * c * d + + 22 * b^3 * c * d + + 8 * a^2 * c^2 * d + + 55 * a * b * c^2 * d + + 89 * b^2 * c^2 * d + + 65 * a * c^3 * d + + 30 * b * c^3 * d + + 58 * c^4 * d + + 30 * a^3 * d^2 + + 64 * a^2 * b * d^2 + + 44 * a * b^2 * d^2 + + 81 * b^3 * d^2 + + 71 * a^2 * c * d^2 + + 77 * a * b * c * d^2 + + 78 * a * c^2 * d^2 + + 33 * b * c^2 * d^2 + + 29 * c^3 * d^2 + + 11 * b^2 * d^3 + + 31 * a * c * d^3 + + 56 * b * c * d^3 + + 62 * c^2 * d^3 + + 77 * a * d^4 + + 12 * c * d^4 + + 69 * d^5 + + 84 * a^4 * e + + 11 * a^3 * b * e + + 42 * a^2 * b^2 * e + + 58 * a * b^3 * e + + 82 * b^4 * e + + 34 * a^2 * b * c * e + + 69 * b^3 * c * e + + 63 * a^2 * c^2 * e + + 89 * a * b * c^2 * e + + 55 * a^2 * b * d * e + + 83 * a^2 * c * d * e + + 86 * b^2 * c * d * e + + 80 * a * c^2 * d * e + + 15 * b * c^2 * d * e + + 26 * a^2 * d^2 * e + + 44 * a * b * d^2 * e + + 71 * a * c * d^2 * e + + 35 * c^2 * d^2 * e + + 40 * a * d^3 * e + + 72 * b * d^3 * e + + 87 * c * d^3 * e + + 60 * d^4 * e + + 31 * a^2 * b * e^2 + + 25 * a * b^2 * e^2 + + 15 * b^3 * e^2 + + 39 * a^2 * c * e^2 + + 26 * a * b * c * e^2 + + 60 * b^2 * c * e^2 + + 12 * b * c^2 * e^2 + + 39 * c^3 * e^2 + + 82 * a^2 * d * e^2 + + 59 * b^2 * d * e^2 + + 72 * a * c * d * e^2 + + 13 * b * c * d * e^2 + + 47 * c^2 * d * e^2 + + 38 * a * d^2 * e^2 + + 75 * b * d^2 * e^2 + + 61 * c * d^2 * e^2 + + 58 * a^2 * e^3 + + 46 * a * b * e^3 + + 33 * b^2 * e^3 + + 13 * c^2 * e^3 + + 41 * a * d * e^3 + + 57 * b * d * e^3 + + 62 * a * e^4 + + 47 * b * e^4 + + 63 * c * e^4 + + 60 * d * e^4 + + 45 * e^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 77 + + 84 * a + + 85 * b + + 55 * c + + 37 * d + + 29 * a^2 + + 3 * a * b + + 86 * b^2 + + 54 * b * c + + 13 * c^2 + + 58 * a * d + + 63 * c * d + + 83 * a * e + + 52 * c * e + + 70 * d * e + + 3 * e^2 + + 50 * a * b^2 + + 70 * b^3 + + 31 * a^2 * c + + 78 * a * b * c + + 25 * a * c^2 + + 76 * b * c^2 + + 70 * c^3 + + a^2 * d + + 71 * a * b * d + + 74 * b^2 * d + + 55 * a * c * d + + 40 * b * c * d + + 17 * b * d^2 + + 23 * d^3 + + 21 * a^2 * e + + 2 * a * b * e + + 77 * b^2 * e + + 3 * a * c * e + + 41 * c^2 * e + + 16 * b * d * e + + 31 * c * d * e + + 89 * a * e^2 + + 63 * c * e^2 + + 64 * d * e^2 + + 80 * a^4 + + 78 * a^3 * b + + 19 * a^2 * b^2 + + 73 * a * b^3 + + 55 * a * b^2 * c + + 20 * a^2 * c^2 + + 23 * a * b * c^2 + + 88 * b^2 * c^2 + + 55 * a * c^3 + + 12 * b * c^3 + + 56 * c^4 + + 68 * a^3 * d + + 12 * a^2 * b * d + + 75 * b^3 * d + + 39 * a^2 * c * d + + 64 * b^2 * c * d + + 27 * a * c^2 * d + + 45 * b * c^2 * d + + 10 * a^2 * d^2 + + 60 * a * b * d^2 + + 14 * a * c * d^2 + + 85 * b * c * d^2 + + 42 * c^2 * d^2 + + 10 * a * d^3 + + 49 * c * d^3 + + 25 * a^3 * e + + 42 * a^2 * b * e + + 90 * a * b^2 * e + + 44 * a^2 * c * e + + 25 * a * b * c * e + + 53 * b^2 * c * e + + 71 * a * c^2 * e + + 89 * b * c^2 * e + + 49 * c^3 * e + + 38 * a^2 * d * e + + 54 * b^2 * d * e + + 32 * a * c * d * e + + 21 * b * c * d * e + + 60 * c^2 * d * e + + 89 * a * d^2 * e + + 65 * c * d^2 * e + + 2 * d^3 * e + + 63 * a^2 * e^2 + + 49 * a * b * e^2 + + 4 * b^2 * e^2 + + 87 * a * c * e^2 + + 34 * b * c * e^2 + + 83 * c^2 * e^2 + + 62 * a * d * e^2 + + 86 * c * d * e^2 + + 61 * d^2 * e^2 + + 19 * a * e^3 + + 6 * b * e^3 + + 24 * c * e^3 + + 62 * d * e^3 + + 39 * e^4 + + 28 * a^5 + + 36 * a^3 * b^2 + + 78 * a^2 * b^3 + + 61 * a^4 * c + + 41 * a^3 * b * c + + 49 * a^2 * b^2 * c + + 82 * a * b^3 * c + + 16 * a^3 * c^2 + + 25 * a^2 * b * c^2 + + 80 * b^3 * c^2 + + 21 * a^2 * c^3 + + 77 * b^2 * c^3 + + 76 * a * c^4 + + 55 * b * c^4 + + 44 * c^5 + + 50 * a^4 * d + + 59 * a^3 * b * d + + 42 * a^2 * b^2 * d + + 68 * a * b^3 * d + + 57 * b^4 * d + + 15 * a^3 * c * d + + 45 * a^2 * b * c * d + + 85 * a * b^2 * c * d + + 2 * a * b * c^2 * d + + 56 * a * c^3 * d + + 78 * c^4 * d + + 6 * a^3 * d^2 + + 13 * a * b^2 * d^2 + + 59 * b^3 * d^2 + + 65 * a^2 * c * d^2 + + 67 * b^2 * c * d^2 + + 82 * b * c^2 * d^2 + + 71 * c^3 * d^2 + + 40 * a^2 * d^3 + + 48 * a * b * d^3 + + 83 * b^2 * d^3 + + 41 * a * c * d^3 + + 75 * b * c * d^3 + + 45 * c^2 * d^3 + + 35 * a * d^4 + + 54 * b * d^4 + + 12 * c * d^4 + + a^3 * b * e + + 32 * a * b^3 * e + + 79 * a^2 * b * c * e + + 73 * a^2 * c^2 * e + + 27 * a * b * c^2 * e + + 54 * a * c^3 * e + + 66 * b * c^3 * e + + 66 * c^4 * e + + 69 * a^3 * d * e + + 22 * a^2 * b * d * e + + 64 * a^2 * c * d * e + + 59 * b^2 * c * d * e + + 35 * a * c^2 * d * e + + 75 * b * c^2 * d * e + + 30 * c^3 * d * e + + 75 * a^2 * d^2 * e + + 61 * a * b * d^2 * e + + 32 * a * c * d^2 * e + + 36 * b * c * d^2 * e + + 89 * a * d^3 * e + + 39 * c * d^3 * e + + 46 * a^3 * e^2 + + 74 * a^2 * b * e^2 + + 50 * a * b^2 * e^2 + + 5 * b^3 * e^2 + + 2 * a^2 * c * e^2 + + 5 * a * b * c * e^2 + + 61 * a * c^2 * e^2 + + 89 * b * c^2 * e^2 + + 69 * c^3 * e^2 + + 27 * a^2 * d * e^2 + + 57 * b^2 * d * e^2 + + 50 * a * c * d * e^2 + + 18 * c^2 * d * e^2 + + 81 * a * d^2 * e^2 + + 2 * c * d^2 * e^2 + + 71 * d^3 * e^2 + + a^2 * e^3 + + 34 * a * b * e^3 + + 27 * b^2 * e^3 + + 48 * a * c * e^3 + + 88 * c^2 * e^3 + + 71 * a * d * e^3 + + 49 * b * d * e^3 + + 54 * c * d * e^3 + + 55 * d^2 * e^3 + + 21 * b * e^4 + + 17 * c * e^4 + + 2 * e^5, + 87 + + 18 * a + + 10 * b + + 51 * d + + 36 * e + + 15 * a^2 + + 40 * a * b + + 82 * b^2 + + 35 * a * c + + 81 * b * c + + 44 * a * d + + 51 * b * d + + 23 * c * d + + 78 * d^2 + + 41 * a * e + + 71 * d * e + + 52 * a^3 + + 25 * a * b * c + + 34 * b^2 * c + + 90 * b * c^2 + + 71 * c^3 + + 26 * a * b * d + + 4 * b^2 * d + + 81 * b * c * d + + 68 * c^2 * d + + 61 * a * d^2 + + 65 * b * d^2 + + 53 * c * d^2 + + 44 * a^2 * e + + 50 * a * b * e + + 58 * b^2 * e + + 31 * c^2 * e + + 85 * c * d * e + + 84 * d^2 * e + + 64 * a * e^2 + + 47 * b * e^2 + + 27 * c * e^2 + + 35 * d * e^2 + + 17 * e^3 + + 48 * a^3 * b + + 3 * a^2 * b^2 + + 37 * b^4 + + 62 * a^2 * b * c + + 35 * a * b^2 * c + + 18 * b^3 * c + + 29 * a * b * c^2 + + 56 * b^2 * c^2 + + 55 * b * c^3 + + 88 * a^3 * d + + 73 * a^2 * b * d + + 49 * b^3 * d + + 53 * a^2 * c * d + + 67 * a * b * c * d + + 47 * b^2 * c * d + + 7 * a * c^2 * d + + 14 * a * b * d^2 + + 49 * a * c * d^2 + + 72 * c^2 * d^2 + + 33 * a * d^3 + + 31 * b * d^3 + + 81 * c * d^3 + + 49 * a^3 * e + + 24 * b^3 * e + + 54 * b * c^2 * e + + 12 * a * b * d * e + + 32 * a * c * d * e + + 12 * b * c * d * e + + 45 * c^2 * d * e + + 46 * a * d^2 * e + + 52 * b * d^2 * e + + 36 * d^3 * e + + 32 * a^2 * e^2 + + 15 * b * c * e^2 + + 83 * c^2 * e^2 + + 68 * a * d * e^2 + + 51 * c * d * e^2 + + 75 * d^2 * e^2 + + 43 * a * e^3 + + 68 * b * e^3 + + 63 * c * e^3 + + 84 * d * e^3 + + 49 * e^4 + + 11 * a^5 + + 33 * a^4 * b + + 8 * a^3 * b^2 + + 35 * a^2 * b^3 + + 7 * b^5 + + 23 * a^3 * b * c + + 74 * a * b^3 * c + + 78 * b^4 * c + + 73 * a^3 * c^2 + + 90 * a^2 * b * c^2 + + 30 * a * b^2 * c^2 + + 86 * b^2 * c^3 + + 85 * a * c^4 + + 22 * b * c^4 + + 55 * c^5 + + 10 * a^4 * d + + 15 * a^3 * b * d + + 82 * a * b^3 * d + + 12 * b^4 * d + + 39 * a^3 * c * d + + 79 * b^3 * c * d + + 72 * a * b * c^2 * d + + 44 * b^2 * c^2 * d + + 36 * a * c^3 * d + + 10 * a * b^2 * d^2 + + 73 * b^3 * d^2 + + 83 * a^2 * c * d^2 + + 61 * a * c^2 * d^2 + + 74 * c^3 * d^2 + + 22 * a^2 * d^3 + + 5 * b^2 * d^3 + + 38 * a * c * d^3 + + 84 * c^2 * d^3 + + 55 * a * d^4 + + 38 * b * d^4 + + 66 * a^4 * e + + 40 * a^2 * b^2 * e + + 62 * a * b^3 * e + + 46 * b^4 * e + + 68 * a^3 * c * e + + 25 * a * b^2 * c * e + + 57 * b^3 * c * e + + 62 * a^2 * c^2 * e + + 23 * a * b * c^2 * e + + 39 * b^2 * c^2 * e + + 29 * a * c^3 * e + + 84 * b * c^3 * e + + 52 * c^4 * e + + 38 * a^3 * d * e + + 50 * b^3 * d * e + + 4 * a^2 * c * d * e + + 5 * a * b * c * d * e + + 40 * b^2 * c * d * e + + 10 * a^2 * d^2 * e + + 52 * a * b * d^2 * e + + 86 * b^2 * d^2 * e + + 5 * a * c * d^2 * e + + 70 * b * c * d^2 * e + + 57 * b * d^3 * e + + 32 * c * d^3 * e + + 66 * d^4 * e + + 75 * a^3 * e^2 + + 28 * a^2 * b * e^2 + + 33 * a * b^2 * e^2 + + 69 * b^3 * e^2 + + 31 * a^2 * c * e^2 + + 21 * a * b * c * e^2 + + 65 * b^2 * c * e^2 + + 43 * a * c^2 * e^2 + + 16 * a^2 * d * e^2 + + 66 * a * b * d * e^2 + + 76 * b^2 * d * e^2 + + 44 * c^2 * d * e^2 + + 28 * a * d^2 * e^2 + + 89 * b * d^2 * e^2 + + 82 * c * d^2 * e^2 + + 10 * a^2 * e^3 + + 8 * a * b * e^3 + + 15 * b^2 * e^3 + + 35 * a * c * e^3 + + 78 * b * c * e^3 + + 73 * c^2 * e^3 + + 51 * a * d * e^3 + + 21 * c * d * e^3 + + 26 * d^2 * e^3 + + 66 * b * e^4 + + 34 * d * e^4 + + 75 * e^5, + 15 + + 54 * c + + 66 * e + + 67 * a * c + + 59 * b * c + + 49 * c^2 + + 72 * a * d + + 35 * b * d + + 74 * c * d + + 39 * d^2 + + 19 * b * e + + 90 * c * e + + 5 * e^2 + + 84 * a^3 + + 12 * a^2 * b + + 42 * a * b^2 + + 51 * b^3 + + 16 * b^2 * c + + 8 * a * c^2 + + 73 * b * c^2 + + 80 * a * b * d + + 69 * b * c * d + + 39 * c^2 * d + + 16 * a * d^2 + + 18 * b * d^2 + + 83 * c * d^2 + + 21 * d^3 + + 55 * a^2 * e + + 4 * b^2 * e + + 90 * a * c * e + + 12 * b * c * e + + 61 * c^2 * e + + 66 * a * d * e + + 55 * b * d * e + + 84 * d^2 * e + + 30 * a * e^2 + + 14 * b * e^2 + + 8 * c * e^2 + + 82 * d * e^2 + + 13 * e^3 + + 5 * a^4 + + 59 * a * b^2 * c + + 58 * b^3 * c + + 62 * a^2 * c^2 + + 30 * b^2 * c^2 + + 4 * a * c^3 + + 60 * b * c^3 + + 5 * a^3 * d + + 75 * a^2 * b * d + + 47 * a * b^2 * d + + 61 * b^3 * d + + 9 * a * b * c * d + + 58 * b^2 * c * d + + 85 * c^3 * d + + 48 * a * b * d^2 + + 73 * b^2 * d^2 + + 3 * a * c * d^2 + + 20 * b * c * d^2 + + 47 * c^2 * d^2 + + 41 * c * d^3 + + 69 * d^4 + + 89 * a^3 * e + + 58 * a^2 * b * e + + 55 * a * b^2 * e + + 2 * b^3 * e + + 39 * a^2 * c * e + + 4 * a * b * c * e + + 75 * a * c^2 * e + + 68 * b * c^2 * e + + 64 * c^3 * e + + 13 * a^2 * d * e + + 24 * a * b * d * e + + 58 * b^2 * d * e + + 65 * a * c * d * e + + 82 * b * c * d * e + + 55 * a * d^2 * e + + 2 * a^2 * e^2 + + 9 * b^2 * e^2 + + 42 * a * c * e^2 + + 89 * b * c * e^2 + + 77 * c^2 * e^2 + + 2 * a * d * e^2 + + 80 * b * d * e^2 + + 74 * c * d * e^2 + + 39 * d^2 * e^2 + + 2 * a * e^3 + + 8 * b * e^3 + + 73 * c * e^3 + + 9 * a^5 + + 15 * a^4 * b + + 21 * a^3 * b^2 + + 86 * a^2 * b^3 + + 72 * b^5 + + 19 * a^4 * c + + 81 * a^2 * b^2 * c + + 10 * a * b^3 * c + + 56 * b^4 * c + + 30 * a^3 * c^2 + + 21 * a^2 * b * c^2 + + 80 * a * b^2 * c^2 + + 60 * a^2 * c^3 + + 8 * b^2 * c^3 + + 78 * a * c^4 + + 18 * b * c^4 + + 67 * c^5 + + 20 * a^4 * d + + 13 * a^3 * b * d + + 71 * a * b^3 * d + + 79 * b^4 * d + + 15 * a^3 * c * d + + 46 * b^3 * c * d + + 11 * a^2 * c^2 * d + + 57 * a * b * c^2 * d + + 81 * b^2 * c^2 * d + + 47 * a * c^3 * d + + 64 * b * c^3 * d + + 30 * a^3 * d^2 + + 24 * a^2 * b * d^2 + + 90 * b^3 * d^2 + + 11 * a * b * c * d^2 + + 73 * b * c^2 * d^2 + + 84 * a^2 * d^3 + + 41 * b * c * d^3 + + 28 * c^2 * d^3 + + 55 * b * d^4 + + 35 * c * d^4 + + 57 * d^5 + + 24 * a^4 * e + + 42 * a^3 * b * e + + 50 * a * b^3 * e + + 2 * a^3 * c * e + + 34 * a^2 * b * c * e + + 81 * a * b^2 * c * e + + 43 * a^2 * c^2 * e + + 29 * a * b * c^2 * e + + 86 * b^2 * c^2 * e + + 62 * b * c^3 * e + + 42 * a^2 * b * d * e + + 51 * a * b^2 * d * e + + 83 * a^2 * c * d * e + + 5 * a * b * c * d * e + + 33 * b^2 * c * d * e + + 17 * a * c^2 * d * e + + 63 * b * c^2 * d * e + + 72 * c^3 * d * e + + 41 * a^2 * d^2 * e + + 82 * a * b * d^2 * e + + 14 * b^2 * d^2 * e + + 50 * b * c * d^2 * e + + 81 * a * d^3 * e + + 44 * b * d^3 * e + + 7 * c * d^3 * e + + 22 * d^4 * e + + 17 * a^3 * e^2 + + 77 * a^2 * b * e^2 + + 89 * b^3 * e^2 + + 52 * a * c^2 * e^2 + + 50 * b * c^2 * e^2 + + 88 * a^2 * d * e^2 + + 7 * a * b * d * e^2 + + 57 * b^2 * d * e^2 + + 66 * b * c * d * e^2 + + 58 * c^2 * d * e^2 + + 34 * a * d^2 * e^2 + + 74 * b * d^2 * e^2 + + 88 * d^3 * e^2 + + 16 * a * b * e^3 + + 36 * b * c * e^3 + + 56 * c^2 * e^3 + + 54 * b * d * e^3 + + 64 * d^2 * e^3 + + 47 * c * e^4 + + 83 * d * e^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 65 + + 47 * a + + 18 * b + + 58 * a^2 + + 90 * a * b + + 66 * a * c + + 64 * b * c + + 40 * c^2 + + 36 * b * d + + 76 * c * d + + 39 * d^2 + + 58 * b * e + + 38 * e^2 + + 53 * a^2 * b + + 30 * a * b^2 + + 2 * b^3 + + 42 * b^2 * c + + 82 * b * c^2 + + 70 * c^3 + + 43 * a * b * d + + 57 * b^2 * d + + 78 * b * c * d + + 23 * b * d^2 + + 22 * c * d^2 + + 69 * d^3 + + 23 * a^2 * e + + 58 * a * c * e + + 33 * c^2 * e + + 51 * a * d * e + + 32 * b * d * e + + 70 * d^2 * e + + 55 * a * e^2 + + 57 * b * e^2 + + 89 * e^3 + + 62 * a^4 + + 7 * a^3 * b + + 30 * a^2 * b^2 + + 49 * a * b^3 + + 21 * b^4 + + 67 * a^3 * c + + 85 * a^2 * b * c + + 44 * b^3 * c + + 23 * a^2 * c^2 + + 64 * a * b * c^2 + + 11 * b^2 * c^2 + + 81 * a^3 * d + + 36 * a^2 * b * d + + 55 * b^3 * d + + 66 * a^2 * c * d + + 75 * a * b * c * d + + 22 * a * c^2 * d + + b * c^2 * d + + 72 * c^3 * d + + 8 * a^2 * d^2 + + 51 * a * b * d^2 + + 39 * b^2 * d^2 + + 13 * a * c * d^2 + + 24 * b * c * d^2 + + 87 * a * d^3 + + 21 * b * d^3 + + 26 * c * d^3 + + 16 * d^4 + + 81 * a^2 * b * e + + 67 * a * b^2 * e + + 59 * b^3 * e + + 90 * b^2 * c * e + + 51 * c^3 * e + + 20 * a^2 * d * e + + 35 * a * b * d * e + + 47 * c^2 * d * e + + 88 * a * d^2 * e + + 43 * b * d^2 * e + + 31 * c * d^2 * e + + 86 * a * b * e^2 + + 24 * b^2 * e^2 + + 17 * b * c * e^2 + + 2 * c^2 * e^2 + + 31 * b * d * e^2 + + 46 * c * d * e^2 + + 27 * d^2 * e^2 + + 74 * a * e^3 + + 88 * b * e^3 + + 73 * c * e^3 + + 50 * d * e^3 + + 60 * e^4 + + 56 * a^5 + + 32 * a^4 * b + + 84 * a^3 * b^2 + + 33 * a^2 * b^3 + + 15 * a * b^4 + + 80 * a^4 * c + + 27 * a^3 * b * c + + 55 * a^2 * b^2 * c + + 76 * b^4 * c + + 15 * a^3 * c^2 + + 33 * a^2 * b * c^2 + + 51 * a * b^2 * c^2 + + 70 * b^3 * c^2 + + 78 * a^2 * c^3 + + 33 * a * b * c^3 + + 63 * b^2 * c^3 + + 87 * a * c^4 + + 28 * b * c^4 + + 83 * c^5 + + 83 * a^3 * b * d + + 50 * a * b^3 * d + + 39 * b^4 * d + + 14 * a * b^2 * c * d + + 29 * a * b * c^2 * d + + 20 * b^2 * c^2 * d + + 71 * a * c^3 * d + + b * c^3 * d + + 28 * c^4 * d + + 49 * a^3 * d^2 + + 35 * a^2 * b * d^2 + + 17 * a * b^2 * d^2 + + 27 * b^3 * d^2 + + 75 * a^2 * c * d^2 + + 16 * a * b * c * d^2 + + 33 * b^2 * c * d^2 + + 32 * a * c^2 * d^2 + + 64 * b * c^2 * d^2 + + 18 * a^2 * d^3 + + 69 * a * b * d^3 + + 66 * b^2 * d^3 + + 21 * a * c * d^3 + + 32 * b * c * d^3 + + 22 * a * d^4 + + 43 * b * d^4 + + 48 * d^5 + + 69 * a^4 * e + + 59 * a^2 * b^2 * e + + 83 * a * b^3 * e + + 9 * a^2 * c^2 * e + + 11 * a * b * c^2 * e + + 38 * b^2 * c^2 * e + + 15 * a * c^3 * e + + 46 * c^4 * e + + 73 * a^2 * b * d * e + + 8 * a * b^2 * d * e + + 20 * b^3 * d * e + + 53 * a^2 * c * d * e + + 45 * a * b * c * d * e + + 22 * a * c^2 * d * e + + 24 * b * c^2 * d * e + + 29 * c^3 * d * e + + 19 * a^2 * d^2 * e + + 46 * a * b * d^2 * e + + 11 * b^2 * d^2 * e + + 68 * c^2 * d^2 * e + + 77 * a * d^3 * e + + 59 * b * d^3 * e + + 57 * c * d^3 * e + + 30 * d^4 * e + + 55 * a^3 * e^2 + + 10 * a^2 * b * e^2 + + 15 * a * b^2 * e^2 + + 85 * a^2 * c * e^2 + + 7 * b^2 * c * e^2 + + 44 * a * c^2 * e^2 + + 85 * a^2 * d * e^2 + + 76 * a * b * d * e^2 + + 75 * b^2 * d * e^2 + + 75 * b * c * d * e^2 + + 17 * c^2 * d * e^2 + + 57 * a * d^2 * e^2 + + 18 * c * d^2 * e^2 + + 21 * d^3 * e^2 + + 76 * c^2 * e^3 + + 42 * a * d * e^3 + + 32 * b * d * e^3 + + 49 * d^2 * e^3 + + 58 * d * e^4 + + 35 * e^5, + 61 + + 22 * a + + 31 * b + + 37 * c + + 9 * d + + 76 * a * b + + 67 * b^2 + + 59 * a * c + + 21 * b * c + + 13 * a * d + + 16 * c * d + + 26 * d^2 + + 57 * b * e + + 58 * c * e + + 66 * e^2 + + 65 * a * b^2 + + 67 * b^3 + + 54 * a * b * c + + 9 * b^2 * c + + 26 * a * c^2 + + 53 * a^2 * d + + 30 * a * b * d + + 63 * b^2 * d + + 8 * a * c * d + + 4 * c^2 * d + + 40 * b * d^2 + + 77 * c * d^2 + + 55 * d^3 + + 53 * a^2 * e + + 38 * a * b * e + + 23 * a * c * e + + 64 * b * c * e + + 90 * a * d * e + + 20 * b * d * e + + 57 * c * d * e + + 49 * d^2 * e + + 76 * a * e^2 + + 41 * b * e^2 + + 46 * c * e^2 + + 39 * d * e^2 + + 73 * e^3 + + 31 * a^4 + + 71 * a^3 * b + + 41 * a^2 * b^2 + + 73 * a * b^3 + + 36 * b^4 + + 65 * b^3 * c + + 43 * a * b * c^2 + + 88 * b^2 * c^2 + + 64 * a * c^3 + + 83 * b * c^3 + + 47 * c^4 + + 56 * a^3 * d + + 51 * a^2 * b * d + + 20 * b^3 * d + + 65 * a * b * c * d + + 42 * b^2 * c * d + + 36 * a * c^2 * d + + 70 * a^2 * d^2 + + 65 * a * b * d^2 + + 77 * b^2 * d^2 + + 80 * b * c * d^2 + + 47 * c^2 * d^2 + + 3 * b * d^3 + + 15 * c * d^3 + + 83 * d^4 + + 6 * a^3 * e + + 50 * b^3 * e + + 72 * a^2 * c * e + + 36 * a * c^2 * e + + 72 * c^3 * e + + 85 * a * b * d * e + + 83 * b^2 * d * e + + 16 * a * c * d * e + + 26 * b * c * d * e + + 82 * c^2 * d * e + + 83 * b * d^2 * e + + 27 * c * d^2 * e + + 25 * d^3 * e + + 90 * a^2 * e^2 + + 2 * a * b * e^2 + + 42 * b^2 * e^2 + + 66 * a * c * e^2 + + 54 * c^2 * e^2 + + 62 * a * d * e^2 + + 78 * b * d * e^2 + + 42 * c * d * e^2 + + 6 * d^2 * e^2 + + 46 * a * e^3 + + 60 * c * e^3 + + 12 * a^5 + + 64 * a^4 * b + + 17 * a^3 * b^2 + + 61 * a^2 * b^3 + + 22 * a^3 * b * c + + 26 * a^2 * b^2 * c + + 74 * b^4 * c + + 51 * a^3 * c^2 + + 83 * a^2 * b * c^2 + + 21 * a * b^2 * c^2 + + 79 * b^3 * c^2 + + 34 * a^2 * c^3 + + 86 * a * b * c^3 + + 73 * b^2 * c^3 + + 57 * b * c^4 + + 66 * c^5 + + 65 * a^4 * d + + 11 * a^3 * b * d + + 10 * a * b^3 * d + + 71 * b^4 * d + + 4 * a^3 * c * d + + 53 * a^2 * b * c * d + + 11 * a * b^2 * c * d + + 68 * b^3 * c * d + + 45 * a^2 * c^2 * d + + 21 * a * b * c^2 * d + + 33 * c^4 * d + + 39 * a^3 * d^2 + + 59 * b^3 * d^2 + + 63 * a^2 * c * d^2 + + 6 * a * b * c * d^2 + + 32 * b^2 * c * d^2 + + 55 * b * c^2 * d^2 + + 33 * a * b * d^3 + + 8 * b^2 * d^3 + + 16 * a * c * d^3 + + 49 * a * d^4 + + 33 * c * d^4 + + 57 * d^5 + + 5 * a^3 * b * e + + 83 * b^4 * e + + 89 * a^2 * b * c * e + + 75 * a * b^2 * c * e + + 2 * b^3 * c * e + + 88 * a^2 * c^2 * e + + 26 * a * b * c^2 * e + + 13 * b^2 * c^2 * e + + 40 * b * c^3 * e + + 14 * c^4 * e + + 67 * a^3 * d * e + + 7 * a^2 * b * d * e + + 63 * a * b^2 * d * e + + 9 * b^3 * d * e + + 78 * a^2 * c * d * e + + 77 * a * b * c * d * e + + 77 * b * c^2 * d * e + + 37 * c^3 * d * e + + 49 * a^2 * d^2 * e + + 29 * a * b * d^2 * e + + 23 * b^2 * d^2 * e + + 39 * a * c * d^2 * e + + 45 * c^2 * d^2 * e + + 17 * a * d^3 * e + + 33 * b * d^3 * e + + 21 * a^3 * e^2 + + 86 * a * b^2 * e^2 + + 32 * a * b * c * e^2 + + 25 * b^2 * c * e^2 + + 35 * a * c^2 * e^2 + + 75 * a * b * d * e^2 + + 70 * b^2 * d * e^2 + + 86 * c^2 * d * e^2 + + 35 * a * d^2 * e^2 + + 56 * b * d^2 * e^2 + + 43 * c * d^2 * e^2 + + 15 * d^3 * e^2 + + 87 * a^2 * e^3 + + 50 * a * b * e^3 + + 52 * b^2 * e^3 + + 60 * b * c * e^3 + + 69 * c^2 * e^3 + + 52 * b * d * e^3 + + 33 * c * d * e^3 + + 43 * a * e^4 + + 28 * b * e^4 + + 60 * c * e^4 + + 81 * d * e^4 + + 59 * e^5, + 28 * a + + 70 * b + + 84 * c + + 3 * e + + 10 * a^2 + + 51 * a * b + + 74 * b^2 + + 54 * a * c + + 43 * b * c + + c^2 + + 55 * a * d + + 77 * d^2 + + 69 * a * e + + 15 * b * e + + 30 * c * e + + 80 * e^2 + + 87 * a^3 + + 18 * a^2 * b + + 7 * a * b^2 + + 24 * a^2 * c + + 50 * a * b * c + + 66 * b^2 * c + + 29 * a * c^2 + + 11 * b * c^2 + + 58 * c^3 + + 11 * a^2 * d + + a * b * d + + 40 * b^2 * d + + 30 * b * c * d + + 72 * c^2 * d + + 80 * b * d^2 + + 60 * d^3 + + 59 * a^2 * e + + 32 * a * b * e + + 19 * b^2 * e + + 89 * a * c * e + + 55 * b * c * e + + 11 * a * d * e + + 78 * b * d * e + + 81 * a * e^2 + + 84 * b * e^2 + + 41 * d * e^2 + + 83 * e^3 + + 49 * a^4 + + a^3 * b + + 3 * a * b^3 + + 43 * a * b^2 * c + + 62 * b^3 * c + + 61 * a * b * c^2 + + 48 * b^2 * c^2 + + 37 * a * c^3 + + 32 * c^4 + + 14 * a^3 * d + + 5 * a^2 * b * d + + 61 * b^3 * d + + 6 * a^2 * c * d + + 16 * a * b * c * d + + 29 * b^2 * c * d + + 40 * a * c^2 * d + + 81 * b * c^2 * d + + 32 * c^3 * d + + 82 * a * b * d^2 + + 45 * b^2 * d^2 + + 35 * b * c * d^2 + + 55 * c^2 * d^2 + + 3 * b * d^3 + + 2 * c * d^3 + + 80 * d^4 + + 24 * a^3 * e + + 76 * a^2 * b * e + + 18 * a * b^2 * e + + 64 * a^2 * c * e + + 61 * b * c^2 * e + + 57 * c^3 * e + + 66 * a^2 * d * e + + 73 * a * b * d * e + + 18 * b^2 * d * e + + 63 * a * c * d * e + + 3 * c^2 * d * e + + 9 * a * d^2 * e + + 3 * b * d^2 * e + + 86 * c * d^2 * e + + 58 * d^3 * e + + 73 * a * c * e^2 + + 19 * a * d * e^2 + + 36 * b * d * e^2 + + 65 * c * d * e^2 + + 64 * d^2 * e^2 + + d * e^3 + + 87 * e^4 + + 58 * a^5 + + 23 * a^3 * b^2 + + 89 * a^2 * b^3 + + 5 * a * b^4 + + 15 * a^2 * b^2 * c + + 11 * a * b^3 * c + + 53 * b^4 * c + + 44 * a^2 * b * c^2 + + 11 * a * b^2 * c^2 + + 43 * b^3 * c^2 + + 23 * a^2 * c^3 + + 37 * a * b * c^3 + + 32 * a * c^4 + + 43 * b * c^4 + + 26 * c^5 + + 48 * a^4 * d + + 88 * a^2 * b^2 * d + + 53 * b^4 * d + + 38 * a^3 * c * d + + 40 * b^3 * c * d + + 58 * a^2 * c^2 * d + + 31 * a * b * c^2 * d + + 55 * b^2 * c^2 * d + + 68 * c^4 * d + + 57 * a^3 * d^2 + + 29 * a * b^2 * d^2 + + 73 * b^3 * d^2 + + 79 * a * b * c * d^2 + + 62 * b^2 * c * d^2 + + 16 * a * c^2 * d^2 + + 19 * b * c^2 * d^2 + + 29 * c^3 * d^2 + + 37 * a^2 * d^3 + + 16 * a * b * d^3 + + 30 * b * c * d^3 + + 65 * a * d^4 + + 13 * b * d^4 + + 39 * c * d^4 + + 17 * d^5 + + 82 * a^4 * e + + 43 * a^2 * b^2 * e + + 45 * a * b^3 * e + + 87 * a^3 * c * e + + 68 * a^2 * b * c * e + + 12 * b^3 * c * e + + 65 * a * b * c^2 * e + + 25 * b^2 * c^2 * e + + 64 * a^3 * d * e + + 31 * a^2 * b * d * e + + 39 * a * b^2 * d * e + + 80 * a^2 * c * d * e + + 17 * a * b * c * d * e + + 85 * b * c^2 * d * e + + 61 * c^3 * d * e + + 66 * a^2 * d^2 * e + + 62 * a * b * d^2 * e + + 41 * b^2 * d^2 * e + + 29 * a * c * d^2 * e + + 75 * b * c * d^2 * e + + 76 * b * d^3 * e + + 43 * c * d^3 * e + + 33 * d^4 * e + + 22 * a^3 * e^2 + + 8 * a^2 * b * e^2 + + 12 * a * b^2 * e^2 + + 55 * a^2 * c * e^2 + + 39 * a * b * c * e^2 + + 18 * a * c^2 * e^2 + + 18 * a^2 * d * e^2 + + 72 * a * b * d * e^2 + + 83 * a * c * d * e^2 + + 26 * a * d^2 * e^2 + + 54 * b * d^2 * e^2 + + 75 * c * d^2 * e^2 + + 32 * d^3 * e^2 + + 25 * a^2 * e^3 + + 70 * a * b * e^3 + + 44 * b^2 * e^3 + + 72 * a * c * e^3 + + 21 * b * c * e^3 + + 7 * c^2 * e^3 + + 46 * a * d * e^3 + + 32 * d^2 * e^3 + + 45 * a * e^4 + + 86 * b * e^4 + + 61 * c * e^4 + + 56 * d * e^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) + end + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, + ) + df = DataFrame(a = ["test1"], b = ["test2"]) + savew(df, "correct.txt") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b]) + savea(df, "correct.txt") + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl new file mode 100644 index 000000000..d3b0af6bf --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl @@ -0,0 +1,4334 @@ +include( +"src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("readWriteHelper.jl") +include("parser.jl") +include("runbenchmark.jl") + + +using DataFrames +using CSV + +function var6() + cd("/Users/JordiWelp/Results") + + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d, e, f) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d", "e", "f"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 80 + + 24 * f + + 33 * a^2 + + 51 * a * c + + 2 * b^2 * d + + 37 * d^3 + + 40 * a^2 * e + + 78 * a * c * e + + 37 * b * c * e + + 15 * c * d * f + + 70 * d^2 * f + + 10 * c * e * f + + 82 * a^2 * b * d + + 58 * a * b^2 * d + + 53 * a^3 * e + + 49 * c^3 * e + + 49 * b^2 * d * e + + 64 * a^2 * e^2 + + 57 * d * e^3 + + 53 * e^4 + + 47 * a^2 * c * f + + 76 * a^2 * d * f + + 49 * b * d^2 * f + + 30 * a * b * e * f + + 49 * b^2 * f^2 + + 33 * c * e * f^2 + + 84 * a^3 * b^2 + + 72 * c^5 + + 36 * a * b^2 * c * d + + 20 * c^4 * d + + 74 * a^2 * b * d^2 + + 4 * c^3 * d^2 + + 89 * b * d^4 + + 61 * a^4 * e + + 21 * a * b^3 * e + + 22 * b^3 * c * e + + 50 * a * c^3 * e + + 85 * c^4 * e + + 17 * a * b * c * e^2 + + 78 * b * c^2 * e^2 + + 89 * b * d^2 * e^2 + + 88 * c * d^2 * e^2 + + 51 * a * b * e^3 + + 84 * c * e^4 + + 75 * a * c^3 * f + + 83 * b^2 * c * d * f + + 58 * b * c^2 * d * f + + 63 * b * c * d^2 * f + + 81 * a^3 * e * f + + 28 * a * c * d * e * f + + 10 * a * c * e^2 * f + + 52 * b * e^3 * f + + 45 * a^2 * c * f^2, + 69 * d^2 + + 68 * a * b^2 + + 77 * b * c^2 + + 65 * c * d^2 + + 89 * b^2 * c * d + + 62 * a^2 * b * e + + 66 * a * b * c * e + + 9 * c * d^2 * e + + 22 * b * d * e^2 + + 74 * a^3 * f + + 74 * a * d^2 * f + + 74 * b * d^2 * f + + 76 * b^2 * e * f + + 6 * c * e^2 * f + + 63 * a^2 * f^2 + + 2 * a * c * f^2 + + 28 * c * e * f^2 + + 48 * a * b^4 + + 57 * a * c^3 * d + + 9 * c^4 * d + + 25 * b * c^2 * d^2 + + 61 * a * d^4 + + 4 * b^4 * e + + 22 * b^2 * c^2 * e + + 83 * b^2 * c * d * e + + 48 * a * c * d^2 * e + + 8 * c^2 * d^2 * e + + 76 * a^2 * b * e^2 + + 65 * b^3 * e^2 + + 81 * a * b * c^2 * f + + 29 * c^3 * d * f + + 11 * b * d^3 * f + + 55 * b * e^3 * f + + 71 * a^2 * f^3 + + 35 * a * c * f^3 + + 51 * c * e * f^3, + 73 * d + + 54 * a * e + + 82 * e^2 + + 50 * c * f + + 37 * d * f + + 46 * b * c^2 + + 23 * a^2 * d + + 8 * d^3 + + 56 * b^2 * e + + 57 * a^2 * f + + 24 * d^2 * f + + 61 * a^3 * b + + 5 * b^2 * c^2 + + 36 * b^3 * d + + 3 * a * c * d^2 + + 35 * b * d * e^2 + + 29 * b * e^3 + + 76 * a * b * e * f + + 58 * b * c * e * f + + 9 * c * e * f^2 + + 83 * c * f^3 + + 10 * d * f^3 + + 53 * a^5 + + 63 * b^5 + + 64 * a^3 * c^2 + + 6 * a^4 * d + + 78 * a^3 * b * d + + 80 * a * b * c^2 * d + + 32 * c^4 * d + + 26 * b^3 * d^2 + + 25 * b^2 * c * d^2 + + 17 * b * c^2 * d^2 + + 38 * c^3 * d^2 + + 12 * b^2 * d^3 + + 84 * a * c * d^3 + + 16 * a^4 * e + + 3 * a^3 * b * e + + 51 * b^3 * c * e + + 35 * a * c^2 * d * e + + 59 * a * c * d^2 * e + + 50 * c * d^3 * e + + 86 * d^4 * e + + 71 * c^2 * d * e^2 + + 75 * d^2 * e^3 + + 82 * a * c^2 * e * f + + 23 * a^2 * e^2 * f + + 27 * d^2 * e^2 * f + + 14 * d * e^3 * f + + 63 * a * e^2 * f^2 + + 88 * a * f^4 + + 76 * b * f^4 + + 89 * d * f^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 16 * d + + 81 * a * f + + 69 * c * f + + 22 * b^3 + + 48 * a^2 * d + + 13 * d^3 + + 47 * a * c * e + + 85 * b * c * e + + 53 * b * d * e + + 47 * b * c * f + + 29 * a * d * f + + 89 * c * d * f + + 44 * a^3 * d + + 76 * a * c^2 * e + + 72 * a * c * e^2 + + 73 * a^2 * b * f + + 16 * a * b * c * f + + 48 * a * c * d * f + + 20 * c * d^2 * f + + 84 * d^3 * f + + 55 * b * d * e * f + + 66 * a^2 * f^2 + + 2 * b^2 * f^2 + + 10 * b * e * f^2 + + 68 * a * c^4 + + 13 * a^2 * b^2 * d + + 65 * b^3 * c * d + + 10 * a * b * c^2 * d + + 84 * a^3 * d^2 + + 15 * a * b * d^3 + + 48 * b * c * d^3 + + 3 * a * d^4 + + 57 * b * c^3 * e + + 4 * a * b^2 * d * e + + 25 * b^3 * e^2 + + 76 * a * b * c^2 * f + + 50 * b^2 * c^2 * f + + 77 * a * b^2 * d * f + + 85 * c^2 * d^2 * f + + 74 * b * c^2 * e * f + + 88 * b * c * d * e * f + + 80 * a^3 * f^2 + + 50 * a * b^2 * f^2 + + 43 * a * b * c * f^2 + + 67 * a * c * d * f^2 + + 15 * b * c * e * f^2 + + 67 * c * e^2 * f^2 + + 62 * d * e^2 * f^2 + + 15 * b * e * f^3, + 77 + + 74 * a * d + + 34 * b * e + + 74 * d * e + + 36 * d * f + + 79 * c * d^2 + + 18 * d^2 * e + + 49 * a * e * f + + 90 * b * f^2 + + 42 * a * b^3 + + 79 * b^2 * c^2 + + 4 * a * c^3 + + 15 * b * d^3 + + 80 * a^3 * f + + 50 * a * b^2 * f + + 17 * c^3 * f + + 37 * a * b * e * f + + 61 * a * b * f^2 + + 60 * b * c * f^2 + + 70 * a^2 * b * c^2 + + 22 * a^2 * c^3 + + 69 * a^3 * c * d + + 34 * c^4 * d + + 2 * b^2 * c * d^2 + + 18 * c^3 * d^2 + + 68 * a * b * d^3 + + 18 * b * c * d^3 + + 23 * c * d^4 + + 5 * a^2 * d * e^2 + + 8 * a * c * d * e^2 + + 45 * d^2 * e^3 + + 62 * d * e^4 + + 21 * a^2 * b^2 * f + + 15 * b^2 * c^2 * f + + 11 * a^3 * d * f + + 34 * c^3 * e * f + + 20 * a * b * e^2 * f + + 55 * c * e^3 * f + + 8 * a^2 * c * f^2 + + 77 * b^2 * c * f^2 + + 7 * b * c^2 * f^2 + + 57 * d^2 * f^3 + + 84 * b * f^4 + + 4 * f^5, + 43 * c + + 46 * a^2 + + 84 * a^2 * b + + 15 * b * c * d + + 34 * a^2 * e + + 29 * c^2 * f + + 82 * a^3 * b + + 51 * a * b^3 + + 12 * a^3 * c + + 63 * a^3 * d + + 43 * a * b^2 * d + + 3 * a^2 * d * e + + 22 * d^3 * e + + 28 * a^2 * c * f + + 80 * c^3 * f + + 28 * a^2 * d * f + + 6 * b^2 * d * f + + 32 * b * d^2 * f + + 27 * a^2 * e * f + + 73 * b * c * e * f + + 36 * c^2 * e * f + + 41 * e^2 * f^2 + + 47 * a^3 * b * c + + 68 * a^3 * c * d + + 35 * a^3 * d^2 + + 23 * a * b^2 * d^2 + + 5 * a * b * c * d^2 + + 42 * a * c^2 * d^2 + + 78 * a * c * d^3 + + 80 * a * c^3 * e + + 52 * b^2 * c * d * e + + 53 * a^3 * e^2 + + 86 * a^2 * b * e^2 + + 44 * a * d^2 * e^2 + + 73 * b * d^2 * e^2 + + 88 * b^2 * e^3 + + 72 * e^5 + + 67 * a^2 * c * d * f + + 2 * b^2 * c * e * f + + 70 * c^3 * e * f + + 33 * b * d * e^2 * f + + 49 * a * b^2 * f^2 + + 23 * c * d * e * f^2 + + 86 * a * d * f^3 + + 55 * b * d * f^3 + + 15 * a * e * f^3 + + 8 * c * e * f^3 + + 78 * a * f^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 37 * c * e + + 44 * e^2 + + 49 * a * f + + 57 * b * f + + 39 * a^2 * d + + 79 * a^2 * e + + 22 * b * e^2 + + 38 * a^2 * f + + 71 * b * c * f + + 9 * d * f^2 + + 28 * b^3 * d + + 22 * c * d^3 + + 11 * a * c * d * e + + 44 * a * d^2 * e + + 77 * a * b * e^2 + + 40 * e^4 + + 44 * b * c * d * f + + 32 * b * c * e * f + + 67 * b * d * e * f + + 86 * e^3 * f + + 61 * b * c * f^2 + + 53 * a * f^3 + + 58 * a * b^3 * c + + 23 * a * b * c^3 + + 54 * b * d^4 + + 71 * c * d^4 + + 79 * a^3 * b * e + + 64 * a * b^2 * c * e + + 4 * b^3 * c * e + + 6 * a^2 * b * d * e + + 41 * d^4 * e + + 62 * b * c^2 * e^2 + + 45 * a^2 * d * e^2 + + b^2 * e^3 + + 22 * d * e^4 + + 39 * c^4 * f + + 53 * b^3 * d * f + + 23 * c^2 * d^2 * f + + 10 * a^3 * e * f + + 9 * b^2 * c * e * f + + 86 * a * c^2 * e * f + + 80 * a * b * d * e * f + + 72 * c * d^2 * e * f + + 4 * b * d * e^2 * f + + 7 * b^2 * c * f^2 + + 87 * c^3 * f^2 + + 48 * c^2 * d * f^2 + + 63 * a * e^2 * f^2 + + 44 * b * e^2 * f^2 + + 5 * c^2 * f^3 + + 85 * a * e * f^3 + + 3 * b * e * f^3 + + 30 * b * f^4 + + 82 * f^5, + 25 * b + + 13 * f + + 25 * b * d + + 34 * e^2 + + 23 * a * b^2 + + 76 * c * d^2 + + 71 * b * d * e + + 55 * b * d * f + + 31 * a^3 * c + + 65 * b^3 * c + + 88 * a^2 * b * d + + 84 * a * b * d * e + + 53 * a * c * e^2 + + 55 * a^3 * f + + 87 * b * c * e * f + + 34 * c * d * e * f + + 79 * b * d * f^2 + + 9 * b * f^3 + + 15 * a * b^3 * c + + 67 * a^2 * b * c * d + + 57 * a^3 * d^2 + + 11 * b * c^2 * d^2 + + 53 * c^4 * e + + 15 * c^3 * d * e + + 77 * a * c * d^2 * e + + 86 * a * b * c * e^2 + + 74 * a * b * d * e^2 + + 61 * b * c * d * e^2 + + 90 * c^2 * d * e^2 + + 37 * a * b * e^3 + + 88 * c^2 * e^3 + + 59 * a * e^4 + + 26 * a^4 * f + + 15 * b^3 * c * f + + 16 * a * b * c * d * f + + 68 * b * c * d^2 * f + + 20 * a * b * c * e * f + + 15 * b * c * e^2 * f + + 8 * a * c^2 * f^2 + + 88 * a^2 * d * f^2 + + 24 * b * e * f^3 + + 70 * a * f^4 + + 37 * f^5, + 54 + + 60 * c * f + + 59 * a * b^2 + + 51 * b^3 + + 30 * a^2 * e + + 58 * a^2 * f + + 14 * a * b * f + + 40 * a * d * f + + 38 * d^2 * f + + 28 * a^3 * c + + 89 * b * c^2 * d + + 90 * b^2 * c * e + + 53 * b * c * d * e + + 65 * b * d^2 * e + + 58 * d^3 * e + + 29 * b * d * e^2 + + 79 * a * e^3 + + 28 * b * d^2 * f + + 80 * a * b * e * f + + 9 * b * d * e * f + + 24 * d * e^2 * f + + 52 * b * c * f^2 + + 43 * a * d * f^2 + + 38 * b * f^3 + + 17 * e * f^3 + + 11 * a * b^2 * c * d + + 60 * b * c^3 * d + + 78 * a * b * c * d^2 + + 45 * a * b * c * d * e + + 60 * a * c^2 * d * e + + 49 * c^3 * d * e + + 28 * b^2 * d^2 * e + + 83 * a^2 * b * e^2 + + 72 * b * c^2 * e^2 + + 28 * a^3 * b * f + + 26 * a * b^3 * f + + 86 * b^3 * e * f + + 13 * a^2 * d * e * f + + 82 * a * d * e^2 * f + + 2 * a * c^2 * f^2 + + 45 * b * d^2 * f^2 + + 12 * d^3 * f^2 + + 85 * a * b * e * f^2 + + 63 * d * f^4, + ], + ), + ) + + for i in ideals + runb("sparseid(3,0,5,100-(1*10),90)", i, S) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 9 * c + + 28 * f + + 49 * c^2 + + 53 * c * d + + 19 * b * e + + 82 * e^2 + + 62 * c * f + + 30 * a^3 + + 45 * a^2 * c + + 38 * a * c^2 + + 49 * a^2 * d + + 67 * a * b * d + + 71 * b^2 * d + + 43 * c^2 * d + + 10 * a * d * e + + 73 * b * e^2 + + 54 * c^2 * f + + 61 * a * d * f + + 63 * d * e * f + + 53 * b * f^2 + + 35 * a * b^3 + + 69 * b^3 * c + + 63 * a * b^2 * d + + 84 * a * c^2 * d + + 63 * a * c * d^2 + + 10 * c * d^3 + + 19 * a^2 * b * e + + 56 * c^3 * e + + 77 * a * b * d * e + + 17 * c^2 * d * e + + 23 * c * d^2 * e + + 61 * a * b * e^2 + + 45 * a * c * e^2 + + 85 * b * e^3 + + 23 * a^2 * b * f + + 15 * a * b^2 * f + + 65 * a * b * d * f + + 49 * a * d^2 * f + + 5 * c * d * e * f + + 90 * d * e * f^2 + + 46 * c * f^3 + + 90 * a^4 * c + + 79 * b^4 * c + + 47 * a^3 * c^2 + + 2 * a * b^2 * c^2 + + 8 * a * b * c^3 + + 70 * b * c^4 + + 21 * c^5 + + 87 * a^4 * d + + 23 * a^3 * c * d + + 82 * b^2 * c^2 * d + + 4 * a^2 * b * d^2 + + 44 * c^3 * d^2 + + 69 * a^2 * b * d * e + + 60 * a * b * c * d * e + + 47 * a * b * d^2 * e + + 33 * b * d^3 * e + + 40 * a * b^2 * e^2 + + 8 * a * c^2 * e^2 + + 80 * b^2 * d * e^2 + + 62 * d^3 * e^2 + + 72 * a * b * e^3 + + 80 * b * d * e^3 + + 6 * a * e^4 + + 47 * a^3 * d * f + + 3 * a^2 * b * d * f + + 30 * a * b * c * d * f + + 60 * c^3 * d * f + + a^2 * d^2 * f + + 88 * b * c * d^2 * f + + 43 * d^4 * f + + 21 * a^3 * e * f + + 72 * b^3 * e * f + + 64 * b^2 * d * e * f + + 41 * a^2 * e^2 * f + + 30 * b * c * e^2 * f + + 11 * c * d * e^2 * f + + 17 * d * e^3 * f + + 62 * a * b^2 * f^2 + + 74 * a * c * d * f^2 + + 18 * b^2 * e * f^2 + + 2 * b * d * e * f^2 + + 43 * a^2 * f^3 + + 3 * a * c * f^3 + + b * c * f^3 + + 78 * d^2 * f^3 + + 69 * d * e * f^3 + + 76 * c * f^4, + 13 + + 90 * a * d + + 82 * b * d + + 71 * c * f + + 29 * a * b * d + + 28 * a * c * d + + 50 * c^2 * d + + 48 * c * d * e + + 51 * a * b * f + + 31 * b^2 * f + + 13 * b * d * f + + 44 * b * e * f + + 84 * d * e * f + + 31 * c * f^2 + + 31 * a^4 + + 80 * a^2 * b * c + + 17 * b^2 * c^2 + + 18 * a^3 * d + + 72 * a * b * c * d + + 85 * b^2 * d^2 + + 24 * a^2 * b * e + + 75 * b^2 * c * e + + 49 * a^2 * d * e + + 77 * b^2 * d * e + + 25 * c^2 * d * e + + 79 * a * b * e^2 + + 61 * c * d * e^2 + + 13 * b * e^3 + + 15 * c * e^3 + + 40 * d * e^3 + + 55 * b^3 * f + + 87 * a^2 * c * f + + 82 * a^2 * e * f + + a * b * e * f + + 9 * a * c * e * f + + 70 * c * e^2 * f + + 66 * d * e^2 * f + + 34 * a * b * f^2 + + 50 * a * c * f^2 + + 64 * d^2 * f^2 + + 8 * b * e * f^2 + + 22 * e^2 * f^2 + + 16 * b * f^3 + + 84 * a^4 * b + + 62 * a * b^4 + + 89 * a^4 * d + + 2 * b^4 * d + + 25 * a * b^2 * c * d + + 74 * a * c^3 * d + + 21 * b * c^3 * d + + 53 * a^3 * d^2 + + 58 * a^2 * b * d^2 + + 29 * a^3 * b * e + + 39 * b^4 * e + + 55 * a^2 * c^2 * e + + 3 * a * b * c^2 * e + + 73 * a^2 * b * d * e + + 86 * a * b^2 * d * e + + 6 * c^3 * d * e + + 20 * a * c * d^2 * e + + 85 * b^3 * e^2 + + 72 * a^2 * c * e^2 + + 19 * b * c^2 * e^2 + + 88 * c^2 * d * e^2 + + 76 * c * d^2 * e^2 + + 46 * a * d * e^3 + + 82 * b * d * e^3 + + 65 * d^2 * e^3 + + 60 * d * e^4 + + 76 * e^5 + + 81 * a^3 * c * f + + 39 * b^3 * c * f + + 86 * a^2 * c * d * f + + 16 * a * b * c * d * f + + 65 * a^2 * d^2 * f + + 41 * b^2 * d^2 * f + + 24 * b * c * d^2 * f + + 64 * b * d^3 * f + + 23 * d^4 * f + + 5 * a^2 * b * e * f + + 28 * b * c^2 * e * f + + 36 * b * d^2 * e * f + + 83 * a^2 * e^2 * f + + 7 * c * d * e^2 * f + + 53 * b^3 * f^2 + + 81 * b^2 * d * f^2 + + 86 * a * c * d * f^2 + + 4 * b * c * d * f^2 + + 25 * c^2 * d * f^2 + + 2 * a * d^2 * f^2 + + 49 * a * b * e * f^2 + + 21 * c * d * e * f^2 + + 45 * a * e * f^3 + + 61 * b * f^4 + + 68 * c * f^4 + + 23 * f^5, + 43 * a + + 44 * c + + 45 * a * d + + 40 * b * d + + 24 * c * d + + d^2 + + 36 * d * f + + b^2 * c + + 88 * a * c^2 + + 61 * a * b * d + + 85 * a * c * d + + 18 * c * d^2 + + 8 * d^3 + + 19 * b^2 * e + + 33 * b * c * e + + 29 * c^2 * e + + 56 * a * e^2 + + 40 * b^2 * f + + 81 * a^2 * b^2 + + 8 * b^4 + + 2 * a^3 * c + + 36 * c^4 + + 85 * a^2 * c * d + + 75 * b^2 * c * d + + 53 * a * d^3 + + 57 * a^2 * c * e + + 26 * a * b * c * e + + 46 * a * c^2 * e + + 12 * b * c * d * e + + 11 * a^2 * e^2 + + 17 * b^2 * e^2 + + 56 * a * d * e^2 + + 59 * b * e^3 + + 26 * c * e^3 + + 40 * d * e^3 + + 75 * a^2 * b * f + + 18 * a * c^2 * f + + 67 * a * d^2 * f + + 54 * a * d * e * f + + 24 * a * b * f^2 + + 62 * b * c * f^2 + + 87 * b * d * f^2 + + 67 * a * f^3 + + 44 * b * f^3 + + 49 * a * b^4 + + 62 * a * b^2 * c^2 + + 14 * b^3 * c^2 + + 68 * c^5 + + 20 * a^4 * d + + 30 * a^3 * c * d + + 27 * a * b * c^2 * d + + 38 * b * c^3 * d + + 70 * a^2 * b * d^2 + + 76 * a^2 * c * d^2 + + 11 * a * b * d^3 + + 38 * a * c * d^3 + + 24 * b * c * d^3 + + 51 * a * d^4 + + 15 * b * d^4 + + 33 * d^5 + + 86 * a^3 * b * e + + 65 * a^3 * c * e + + 60 * a^2 * b * c * e + + 55 * c^4 * e + + 22 * a * c^2 * d * e + + 78 * b * c^2 * d * e + + 13 * c * d^3 * e + + 44 * d^4 * e + + 20 * b^2 * c * e^2 + + 7 * a * c * e^3 + + 14 * c^2 * e^3 + + 78 * c * d * e^3 + + 86 * a * e^4 + + 28 * a^2 * b * c * f + + 29 * b^3 * c * f + + 39 * b * d^3 * f + + 56 * c * d^3 * f + + 11 * a^2 * d * e * f + + 6 * a * c * d * e * f + + 15 * c^2 * d * e * f + + 3 * c^2 * e^2 * f + + 90 * c * d * e^2 * f + + 85 * a^2 * c * f^2 + + 46 * b * c^2 * f^2 + + 80 * a^2 * d * f^2 + + 49 * a * c * e * f^2 + + 11 * b * e^2 * f^2 + + 34 * d * e^2 * f^2 + + 29 * a * b * f^3 + + 62 * c * d * f^3 + + 58 * d^2 * f^3 + + 34 * a * e * f^3 + + 58 * b * e * f^3 + + 84 * c * e * f^3 + + e * f^4 + + 6 * f^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 48 + + 57 * b + + 78 * e + + 46 * b^2 + + 39 * a * e + + 65 * c * e + + 24 * d * e + + 11 * b^2 * c + + 81 * a * b * d + + 52 * a * c * d + + 4 * a * d^2 + + 48 * a * c * e + + 77 * a * d * e + + 59 * c * d * e + + 33 * c * e^2 + + 85 * d * e^2 + + 8 * c^2 * f + + 65 * c * f^2 + + 50 * e * f^2 + + 81 * a^2 * b^2 + + 22 * b^4 + + 46 * a^2 * c^2 + + 13 * a * b * c^2 + + 88 * b * c^3 + + 20 * b * c^2 * d + + 25 * b * d^3 + + 42 * a^2 * d * e + + 26 * b^2 * d * e + + 21 * c^2 * e^2 + + 5 * c * e^3 + + 16 * a^2 * c * f + + 67 * b^2 * c * f + + 48 * b * c * d * f + + 30 * a * d^2 * f + + 82 * c * e^2 * f + + 56 * a * f^3 + + 28 * b * f^3 + + 41 * e * f^3 + + 51 * b^2 * c^3 + + 57 * b^4 * d + + 59 * b^3 * c * d + + 10 * a * c^3 * d + + 70 * b^3 * d^2 + + 39 * b^2 * c * d^2 + + 63 * c * d^4 + + 20 * d^5 + + a^3 * b * e + + 54 * b^4 * e + + 5 * a * c^3 * e + + 24 * a^2 * c * d * e + + 40 * c^3 * d * e + + 15 * a^2 * b * e^2 + + 38 * b * c * d * e^2 + + 13 * b * d^2 * e^2 + + 87 * c * d^2 * e^2 + + 81 * a^2 * e^3 + + 86 * a * b * e^3 + + 61 * c * e^4 + + 17 * a * b^2 * c * f + + 41 * a^2 * c^2 * f + + 27 * a * b * c^2 * f + + 66 * b^3 * d * f + + 71 * a * c^2 * d * f + + 8 * c * d^3 * f + + 52 * d^4 * f + + 14 * b * c * d * e * f + + 42 * c * d^2 * e * f + + 25 * a * b * e^2 * f + + 82 * c * e^3 * f + + 48 * a^3 * f^2 + + 69 * a^2 * b * f^2 + + 87 * a * b^2 * f^2 + + 58 * b^2 * c * f^2 + + 2 * a * c^2 * f^2 + + 77 * b * c^2 * f^2 + + 29 * c^2 * d * f^2 + + 44 * d^3 * f^2 + + 13 * a * d * e * f^2 + + 28 * d^2 * e * f^2 + + 65 * a * e^2 * f^2 + + 74 * a * b * f^3 + + 68 * a * f^4, + 23 * f + + 17 * a^2 + + 17 * b * c + + 70 * a * e + + 73 * c * e + + 57 * c * f + + 50 * e * f + + 88 * a^2 * b + + 57 * b^3 + + 11 * a^2 * c + + 86 * c^2 * d + + 44 * a * c * e + + 56 * b * d * e + + 8 * c * d * e + + 30 * b * e^2 + + 40 * e^3 + + 87 * a * b * f + + 81 * c * e * f + + 76 * d * e * f + + 70 * a * b^3 + + 15 * a^2 * b * c + + 18 * a^2 * c^2 + + 48 * a * b * c^2 + + 59 * b^2 * c^2 + + 83 * c^4 + + 53 * a^2 * d^2 + + 35 * a * b^2 * e + + 66 * a^2 * c * e + + 33 * a * c^2 * e + + 9 * c^2 * d * e + + 5 * a^2 * e^2 + + 40 * a * b * e^2 + + 59 * a * c * e^2 + + 27 * a * d * e^2 + + 90 * b * d * e^2 + + 76 * c * e^3 + + 6 * b * c^2 * f + + 86 * c^3 * f + + 12 * d * e^2 * f + + 49 * a^2 * f^2 + + 40 * a * d * f^2 + + 20 * b * f^3 + + 36 * d * f^3 + + 2 * e * f^3 + + 64 * a^4 * c + + 19 * a^3 * b * c + + a * b^2 * c^2 + + 25 * a^2 * b^2 * d + + 20 * a^3 * c * d + + 9 * a * b * c^2 * d + + 78 * a * c^3 * d + + 87 * a^2 * c * d^2 + + 58 * a * c^2 * d^2 + + 90 * b * c^2 * d^2 + + 71 * c^2 * d^3 + + 32 * c * d^4 + + 69 * a^3 * b * e + + 34 * a * b^2 * c * e + + 19 * b * c^3 * e + + 65 * b * c^2 * d * e + + 8 * a * c * d^2 * e + + 66 * a * b * c * e^2 + + 70 * c^3 * e^2 + + 85 * c * d * e^3 + + 86 * b * e^4 + + 12 * b^4 * f + + 37 * a^3 * c * f + + 48 * a^2 * b * c * f + + 14 * b^3 * c * f + + 8 * a^2 * b * d * f + + 70 * a * b * c * d * f + + 87 * b^2 * c * d * f + + 29 * b * c^2 * d * f + + 7 * a^2 * d^2 * f + + 79 * a * d^3 * f + + 66 * a * c^2 * e * f + + 32 * c^3 * e * f + + 17 * a^3 * f^2 + + 51 * b^3 * f^2 + + 90 * a * b * d * f^2 + + 11 * b * c * d * f^2 + + 11 * a * d^2 * f^2 + + 48 * a^2 * e * f^2 + + 21 * c^2 * e * f^2 + + 36 * a * d * e * f^2 + + 30 * b * d * e * f^2 + + c * d * e * f^2 + + 48 * d^2 * e * f^2 + + 17 * b * e^2 * f^2 + + 71 * c^2 * f^3 + + 59 * a * d * f^3 + + 82 * d * e * f^3 + + 85 * a * f^4 + + 34 * e * f^4, + 19 * f + + 17 * b^2 + + 87 * a * d + + 75 * a * e + + 17 * b^3 + + 27 * a * c^2 + + 52 * c^3 + + 42 * a^2 * d + + 83 * a * c * d + + 18 * a * b * e + + 75 * a * c * e + + 45 * c^2 * e + + 56 * b * d * e + + 66 * d * f^2 + + 83 * b^4 + + 66 * a * b^2 * d + + 85 * b^3 * d + + 42 * b * c^2 * d + + 7 * a^2 * d^2 + + 62 * b * c * d^2 + + 37 * c * d^3 + + 50 * a * b^2 * e + + 56 * a * c^2 * e + + 50 * c^2 * d * e + + 73 * c * d^2 * e + + 9 * d^3 * e + + 7 * c^2 * e^2 + + 12 * a * d * e^2 + + 58 * b * d * e^2 + + 72 * c * d * e^2 + + 11 * a * e^3 + + 63 * d * e^3 + + 67 * a^2 * c * f + + 54 * a * b * c * f + + 49 * a * b * d * f + + 72 * b^2 * d * f + + 70 * a^2 * e * f + + 46 * a * b * e * f + + 73 * b * d * e * f + + 45 * c * d * e * f + + 55 * c^2 * f^2 + + 82 * a * e * f^2 + + 20 * b * e * f^2 + + 44 * a * f^3 + + 42 * c * f^3 + + 59 * d * f^3 + + 10 * a^4 * c + + 75 * a^2 * b^2 * c + + 82 * a^2 * b * c^2 + + 25 * b^2 * c^3 + + 32 * a * c^4 + + 22 * a^3 * b * d + + 86 * a^2 * b^2 * d + + 12 * b^3 * c * d + + 79 * a * b * c^2 * d + + 75 * c^3 * d^2 + + 25 * a * c * d^3 + + 68 * a^3 * c * e + + 67 * a * c^3 * e + + 70 * a^2 * b * d * e + + 86 * a * b^2 * d * e + + 76 * b^3 * d * e + + 55 * a^2 * c * d * e + + 41 * b^2 * d^2 * e + + 22 * a * d^3 * e + + 90 * a * b^2 * e^2 + + 58 * a^2 * c * e^2 + + 3 * a * b * c * e^2 + + 13 * c^3 * e^2 + + 19 * a^2 * d * e^2 + + 84 * b^2 * d * e^2 + + 17 * c^2 * d * e^2 + + 29 * c * d^2 * e^2 + + 68 * d^3 * e^2 + + a^2 * e^3 + + 64 * c * d * e^3 + + 75 * d * e^4 + + 66 * a^3 * b * f + + 80 * a^3 * c * f + + 68 * a^2 * b * c * f + + 34 * b * c^3 * f + + 23 * a^3 * d * f + + 54 * a^2 * b * d * f + + 32 * a * b^2 * d * f + + 42 * b^3 * d * f + + 6 * a * b * c * d * f + + 4 * a^2 * b * e * f + + 26 * a^2 * c * e * f + + 61 * b * c^2 * e * f + + 84 * a * b * d * e * f + + 21 * a * b * e^2 * f + + 4 * b * c * e^2 * f + + 39 * c^2 * e^2 * f + + 57 * a * d * e^2 * f + + 39 * c * d * e^2 * f + + 35 * a * e^3 * f + + 25 * a^2 * c * f^2 + + 15 * a * d^2 * f^2 + + 45 * b^2 * e * f^2 + + 48 * c^2 * e * f^2 + + 37 * c * d * e * f^2 + + 10 * b * d * f^3 + + 53 * d * e * f^3 + + 71 * b * f^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 39 * a + + 57 * a * c + + 5 * a * d + + 47 * b * e + + 85 * a * f + + 56 * b * f + + 16 * a * b^2 + + 50 * b^2 * c + + 83 * a * c^2 + + 82 * a * b * d + + 86 * b * c * d + + 7 * b * d^2 + + 72 * c * d^2 + + 73 * b * c * e + + 5 * c^2 * e + + c * e^2 + + 13 * a * d * f + + 64 * a * e * f + + 76 * c * f^2 + + 83 * d * f^2 + + 2 * c^4 + + 68 * b^3 * d + + 79 * b * c^2 * d + + 60 * a^3 * e + + 61 * b * c^2 * e + + 53 * b^2 * d * e + + 58 * a * b * e^2 + + 77 * b^2 * c * f + + 17 * b^2 * d * f + + 26 * b^2 * e * f + + 3 * a * c * e * f + + 75 * c * d * e * f + + 64 * b * e^2 * f + + 8 * d * e^2 * f + + 62 * e^3 * f + + 25 * c * d * f^2 + + 42 * f^4 + + 35 * a^3 * b^2 + + 40 * a^4 * c + + 65 * b^2 * c^3 + + 89 * a * b^3 * d + + 90 * a * c^3 * d + + 68 * b * c^2 * d^2 + + 3 * a * b * d^3 + + 32 * c * d^4 + + 27 * a^3 * c * e + + 2 * b^2 * c * d * e + + 12 * a * c^2 * d * e + + 72 * b * c^2 * d * e + + 34 * b^2 * d^2 * e + + 43 * a * c * d^2 * e + + 23 * c^2 * d^2 * e + + 77 * d^4 * e + + 67 * a^2 * d * e^2 + + 55 * c^2 * d * e^2 + + 90 * b * d^2 * e^2 + + 86 * a * b * e^3 + + 88 * a^2 * b^2 * f + + 38 * b^4 * f + + 3 * a * b^2 * c * f + + 75 * b * c^3 * f + + 34 * a^3 * e * f + + 63 * b^2 * c * e * f + + 60 * a * b * d * e * f + + 58 * a * c * d * e * f + + 53 * c^2 * d * e * f + + 19 * c * d^2 * e * f + + 37 * a * b * e^2 * f + + 57 * b * c * e^2 * f + + 24 * a * d * e^2 * f + + 73 * b * d * e^2 * f + + 83 * e^4 * f + + 32 * a^2 * c * f^2 + + 30 * a * b * d * f^2 + + 31 * b^2 * e * f^2 + + 31 * c^2 * e * f^2 + + 80 * b * d * f^3 + + 79 * c * d * f^3 + + 27 * b * e * f^3 + + 61 * a * f^4 + + 83 * b * f^4 + + 86 * c * f^4, + 39 * a + + f + + 81 * c * d + + 62 * c * e + + 60 * c * f + + 54 * f^2 + + 31 * b^2 * c + + 10 * b * d^2 + + 8 * c * d^2 + + 61 * b * c * e + + 87 * c^2 * e + + 88 * d^2 * e + + 69 * d^2 * f + + 82 * c * f^2 + + 56 * a^2 * b * c + + 71 * a * b^2 * c + + 49 * a^2 * c^2 + + 2 * b^2 * c^2 + + 30 * a^3 * d + + 22 * a^2 * d^2 + + 19 * d^4 + + 20 * c * d^2 * e + + 60 * d^3 * e + + 47 * c * e^3 + + 90 * d * e^3 + + 19 * a * b^2 * f + + 37 * b^3 * f + + 59 * b^2 * d * f + + 33 * a * c * d * f + + 82 * c^2 * d * f + + 30 * a * b * e * f + + 60 * b^2 * e * f + + 14 * a * e^2 * f + + 20 * e^3 * f + + 19 * a * c * f^2 + + 10 * c * d * f^2 + + 65 * d * e * f^2 + + 80 * a * f^3 + + 44 * f^4 + + 63 * a^2 * c^3 + + 56 * a * b * c^3 + + 31 * a^3 * b * d + + 81 * a^2 * b^2 * d + + 22 * a * b^3 * d + + 58 * a * b^2 * c * d + + 47 * a^2 * c^2 * d + + 79 * b^2 * c^2 * d + + 17 * a^2 * b * d^2 + + 15 * a * b * d^3 + + 76 * a^4 * e + + 75 * a^3 * b * e + + 9 * a^2 * b^2 * e + + 63 * a^2 * c^2 * e + + 89 * a * b * c^2 * e + + 74 * b^2 * c^2 * e + + 62 * a * c^2 * d * e + + 5 * b * c * d^2 * e + + 79 * a * d^3 * e + + 2 * c * d^3 * e + + 81 * d^4 * e + + 12 * a^3 * e^2 + + 18 * a * b^2 * e^2 + + 26 * b^3 * e^2 + + 11 * b^2 * c * e^2 + + 82 * c^3 * e^2 + + 43 * c * d^2 * e^2 + + 61 * a^2 * e^3 + + 80 * a * c * e^3 + + 65 * b * c * e^3 + + 53 * a * d * e^3 + + 80 * a * e^4 + + a^2 * b^2 * f + + 69 * b * c^3 * f + + 21 * a^3 * d * f + + 44 * a^2 * b * d * f + + 88 * b^3 * d * f + + 20 * b * c^2 * d * f + + 17 * c^3 * d * f + + 71 * a^2 * d^2 * f + + 74 * c * d^3 * f + + 6 * a^3 * e * f + + 29 * a * b^2 * e * f + + 23 * b^2 * c * e * f + + 89 * a * b * d * e * f + + 2 * a * b * e^2 * f + + 16 * b * c * e^2 * f + + 57 * c * d * e^2 * f + + 53 * a^2 * b * f^2 + + 50 * a^2 * d * f^2 + + 83 * a * b * d * f^2 + + 16 * a * c * d * f^2 + + 59 * d^3 * f^2 + + 13 * a^2 * e * f^2 + + 16 * b * c * e * f^2 + + 26 * b * d * e * f^2 + + 27 * b * c * f^3 + + 67 * d^2 * f^3 + + 23 * a * f^4, + 71 + + 41 * e + + 42 * b * d + + 42 * c * d + + 12 * b * e + + 32 * c * f + + 5 * b^3 + + 43 * a^2 * c + + 71 * a^2 * d + + 72 * a * b * d + + 76 * a * b * e + + 54 * a * d * e + + 61 * d^2 * e + + 32 * e^3 + + 89 * b^2 * f + + 82 * c * d * f + + 82 * b * f^2 + + 56 * f^3 + + 47 * a^2 * b^2 + + 43 * c^4 + + 32 * a^3 * d + + 80 * a^2 * b * d + + 8 * b^3 * d + + 49 * a^2 * c * d + + 57 * a * c^2 * d + + 42 * b * c^2 * d + + 58 * a^2 * d^2 + + 89 * a * b * d^2 + + 52 * a^3 * e + + 49 * a^2 * b * e + + 15 * a * b * c * e + + 29 * a * c^2 * e + + 83 * a * b * d * e + + 24 * c^2 * d * e + + 55 * c * d^2 * e + + 16 * b * d * e^2 + + 68 * d^2 * e^2 + + 12 * b * e^3 + + 83 * b^3 * f + + 14 * a^2 * c * f + + 3 * b^2 * c * f + + 65 * a^2 * d * f + + 79 * b^2 * d * f + + 70 * c^2 * d * f + + 29 * c * d * e * f + + 77 * a * e^2 * f + + 28 * e^3 * f + + 65 * a * b * f^2 + + 30 * b^2 * f^2 + + 76 * a * c * f^2 + + 83 * e^2 * f^2 + + 73 * f^4 + + 41 * a^2 * b * c^2 + + 40 * b^3 * c^2 + + 73 * a^3 * c * d + + 60 * a^2 * b * c * d + + 42 * b * c^3 * d + + 11 * a^2 * c * d^2 + + 75 * b^2 * d^3 + + 54 * a * d^4 + + 29 * c * d^4 + + 25 * d^5 + + 15 * a^4 * e + + 5 * a^2 * b * c * e + + 46 * a * b^2 * c * e + + 66 * a * b * c^2 * e + + 75 * b^2 * c^2 * e + + 67 * a * c^3 * e + + 4 * a^2 * d^2 * e + + 50 * a * b * d^2 * e + + 30 * a * d^3 * e + + 75 * a^3 * e^2 + + 82 * b^3 * e^2 + + 46 * a * c * d * e^2 + + 72 * b * d^2 * e^2 + + 64 * a * b * e^3 + + b^2 * e^3 + + 61 * d^2 * e^3 + + 67 * a^3 * c * f + + 71 * a * b^2 * c * f + + 85 * a * b * c^2 * f + + 42 * a * b^2 * d * f + + 25 * a^2 * c * d * f + + 62 * c^2 * d^2 * f + + 51 * a^3 * e * f + + 70 * a * b * c * e * f + + 2 * b * c * d * e * f + + 11 * b^2 * e^2 * f + + 69 * c * d * e^2 * f + + 77 * c * e^3 * f + + 2 * a * b^2 * f^2 + + 51 * a^2 * d * f^2 + + 8 * b * c * d * f^2 + + 87 * c * d^2 * f^2 + + 47 * d^3 * f^2 + + 21 * a * b * e * f^2 + + 71 * b * d * e * f^2 + + 2 * e^2 * f^3 + + 48 * b * f^4 + + 68 * e * f^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(2*10),90)", i, S) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 40 + + 45 * b + + 43 * f + + 53 * a^2 + + 16 * c^2 + + 46 * a * d + + 63 * d^2 + + 26 * d * e + + 75 * e^2 + + 70 * a * f + + 45 * c * f + + 76 * d * f + + 43 * f^2 + + 43 * a^2 * b + + 7 * a * b^2 + + 20 * a^2 * c + + 51 * b^2 * c + + 84 * a * c^2 + + 24 * b * c^2 + + 75 * a * b * d + + 71 * a * c * e + + 10 * c^2 * e + + 80 * c * d * e + + 32 * a * b * f + + b * c * f + + 25 * c^2 * f + + 61 * a * d * f + + 55 * d * e * f + + 29 * f^3 + + 37 * a^2 * b^2 + + 43 * a * b^3 + + 10 * a^3 * c + + 11 * a^2 * b * c + + 27 * a * b^2 * c + + 19 * b * c^3 + + 41 * a^2 * b * d + + 61 * b^2 * c * d + + 68 * b^2 * d^2 + + 44 * b * d^3 + + 42 * a^3 * e + + 11 * a^2 * b * e + + 70 * a * b^2 * e + + 32 * a * b * d * e + + 66 * b^2 * d * e + + 79 * b * c * d * e + + 36 * d^3 * e + + 73 * b * c * e^2 + + 71 * c^2 * e^2 + + 5 * d^2 * e^2 + + 46 * a * e^3 + + 14 * b * e^3 + + 38 * c * e^3 + + 32 * d * e^3 + + 88 * a^2 * b * f + + 66 * a * b^2 * f + + 24 * b^3 * f + + 35 * b^2 * d * f + + 68 * a * c * d * f + + 34 * d^3 * f + + 66 * a^2 * e * f + + a * b * e * f + + 23 * a * c * e * f + + 86 * c * d * e * f + + 86 * d * e^2 * f + + 16 * a^2 * f^2 + + 65 * b^2 * f^2 + + 37 * a^5 + + 51 * a * b^4 + + 87 * a^4 * c + + 57 * a^3 * b * c + + 87 * a * b^3 * c + + 54 * a^3 * c^2 + + 67 * a^2 * b * c^2 + + 85 * b^3 * c^2 + + 23 * a^2 * c^3 + + 36 * a * b * c^3 + + 22 * a^4 * d + + 44 * a * b^3 * d + + 43 * a^2 * b * d^2 + + 39 * b^3 * d^2 + + 85 * a * c^2 * d^2 + + 81 * a * c * d^3 + + 89 * b * c * d^3 + + 27 * c^2 * d^3 + + 80 * a * d^4 + + 6 * a^2 * b^2 * e + + 88 * a * b^3 * e + + 85 * a^3 * c * e + + 46 * b^3 * c * e + + 71 * a^3 * d * e + + 88 * a * b^2 * d * e + + 67 * a * b * d^2 * e + + 43 * b^2 * d^2 * e + + 76 * c^2 * d^2 * e + + 85 * a * d^3 * e + + 8 * c * d^3 * e + + 8 * d^4 * e + + 14 * a * c^2 * e^2 + + 33 * b^2 * d * e^2 + + 14 * b * c * d * e^2 + + a * c * e^3 + + b * c * e^3 + + 80 * a * d * e^3 + + 2 * b * e^4 + + 79 * d * e^4 + + 7 * a^3 * b * f + + 2 * a * b^2 * c * f + + 30 * b^3 * c * f + + 56 * a * b * c^2 * f + + 53 * b^2 * c^2 * f + + 38 * b^3 * d * f + + 64 * b^2 * c * d * f + + 47 * a * b * d^2 * f + + 39 * c^2 * d^2 * f + + 9 * c * d^3 * f + + 72 * b^3 * e * f + + 44 * b^2 * c * e * f + + 79 * b^2 * d * e * f + + 60 * a * d^2 * e * f + + 18 * a^2 * e^2 * f + + 26 * a * b * e^2 * f + + 27 * a * c * e^2 * f + + 26 * b * c * e^2 * f + + 25 * a^3 * f^2 + + 53 * b^3 * f^2 + + 77 * a * c^2 * f^2 + + 36 * c^2 * d * f^2 + + 32 * b * d^2 * f^2 + + 57 * c * d^2 * f^2 + + 4 * d^3 * f^2 + + 22 * a * b * e * f^2 + + 47 * a * d * e * f^2 + + 72 * d^2 * e * f^2 + + 56 * a * e^2 * f^2 + + 35 * e^3 * f^2 + + 30 * b^2 * f^3 + + 34 * b * c * f^3 + + 50 * c^2 * f^3 + + 74 * c * d * f^3 + + 40 * d^2 * f^3 + + 12 * b * e * f^3 + + 23 * e * f^4, + 85 * c + + 58 * f + + 2 * a * d + + 76 * c * d + + 89 * e^2 + + 69 * a * b^2 + + 64 * b^3 + + 4 * a^2 * c + + 5 * a * c^2 + + 26 * c^3 + + a * b * d + + 48 * b^2 * d + + 86 * a * c * d + + 11 * c^2 * d + + 37 * c^2 * e + + 4 * a * d * e + + 7 * b * e^2 + + c * e^2 + + 84 * d * e^2 + + 59 * e^3 + + 63 * a * e * f + + 19 * e^2 * f + + 88 * b * f^2 + + 65 * c * f^2 + + 51 * d * f^2 + + 60 * a^2 * b^2 + + 47 * a^3 * c + + 36 * a^2 * b * c + + 2 * b^3 * c + + 33 * a^2 * c^2 + + 79 * a * c^3 + + 49 * a^3 * d + + 21 * c^3 * d + + 89 * a^2 * d^2 + + 54 * a * b * d^2 + + 64 * c^2 * d^2 + + 75 * d^4 + + 42 * a^3 * e + + 35 * a^2 * b * e + + 54 * b^3 * e + + 13 * a^2 * c * e + + 7 * b^2 * c * e + + 77 * c^3 * e + + 72 * a^2 * d * e + + 31 * a * b * d * e + + 20 * d^3 * e + + 17 * a^2 * e^2 + + 86 * a * c * e^2 + + 42 * b * d * e^2 + + 65 * c * d * e^2 + + 16 * b * e^3 + + 6 * d * e^3 + + 37 * a^2 * b * f + + 84 * b^2 * c * f + + 25 * c^3 * f + + 42 * d^3 * f + + 5 * c^2 * e * f + + 73 * d^2 * e * f + + 30 * a^2 * f^2 + + 37 * a * c * f^2 + + 29 * b * d * f^2 + + 60 * d^2 * f^2 + + 31 * b * e * f^2 + + 63 * a * f^3 + + 81 * a^5 + + 24 * a^3 * b^2 + + 85 * a^2 * b^3 + + 58 * a * b^4 + + 72 * b^5 + + 75 * b^4 * c + + 38 * a^3 * c^2 + + 87 * a^2 * b * c^2 + + 25 * a^2 * c^3 + + 50 * a * b * c^3 + + 36 * b^2 * c^3 + + 29 * a^4 * d + + 21 * a^2 * b^2 * d + + 70 * a^3 * c * d + + 70 * a^2 * c^2 * d + + 65 * c^4 * d + + 90 * a * b^2 * d^2 + + 3 * b^3 * d^2 + + 76 * a * b * c * d^2 + + 87 * a * c^2 * d^2 + + 5 * c^3 * d^2 + + 29 * a^2 * d^3 + + 11 * a * b * d^3 + + 21 * b * d^4 + + 70 * d^5 + + 4 * a * b^3 * e + + 45 * a^3 * c * e + + 89 * a * c^3 * e + + 19 * a * c * d^2 * e + + 8 * c^2 * d^2 * e + + 2 * c * d^3 * e + + 61 * a^3 * e^2 + + 53 * b^2 * d * e^2 + + 69 * a * b * e^3 + + 55 * c * d * e^3 + + 46 * d^2 * e^3 + + 61 * e^5 + + 83 * a * b^3 * f + + 4 * b^3 * c * f + + 60 * c^4 * f + + 4 * a^3 * d * f + + 30 * b^2 * c * d * f + + 55 * b * c^2 * d * f + + 7 * b * c * d^2 * f + + 29 * b * d^3 * f + + 36 * c * d^3 * f + + 81 * d^4 * f + + 39 * a^3 * e * f + + 73 * a^2 * b * e * f + + 81 * a * b * c * e * f + + 19 * b^2 * c * e * f + + 87 * a^2 * d * e * f + + 37 * b * c * d * e * f + + 45 * a * d^2 * e * f + + 37 * d^3 * e * f + + 83 * a^2 * e^2 * f + + 19 * a * e^3 * f + + 89 * b * e^3 * f + + 28 * a^3 * f^2 + + 66 * a * b * c * f^2 + + 73 * b^2 * c * f^2 + + 27 * a * c^2 * f^2 + + 47 * a * d^2 * f^2 + + 76 * c * d^2 * f^2 + + 24 * d^3 * f^2 + + 53 * a^2 * e * f^2 + + 84 * a * c * e * f^2 + + 25 * c^2 * e * f^2 + + 39 * b * e^2 * f^2 + + 9 * a * b * f^3 + + 49 * b * c * f^3 + + 66 * a * d * f^3 + + 73 * a * e * f^3 + + 25 * b * f^4 + + 45 * c * f^4 + + 27 * e * f^4, + 31 * d + + 56 * f + + 22 * a^2 + + 62 * b * e + + 29 * c * e + + 76 * d * f + + 43 * e * f + + 84 * f^2 + + 74 * a * b^2 + + 90 * b^3 + + 43 * b * d^2 + + 13 * a * b * e + + 82 * a * d * e + + 83 * b * d * e + + 53 * d^2 * e + + 70 * d * e^2 + + 84 * b^2 * f + + 70 * b * c * f + + 4 * c^2 * f + + 19 * c * d * f + + 51 * d^2 * f + + 6 * a * f^2 + + 54 * b * f^2 + + 50 * a^4 + + 75 * a^2 * b * c + + 30 * b^2 * c^2 + + 55 * c^4 + + 82 * a^3 * d + + 74 * a^2 * b * d + + 87 * a * b^2 * d + + 74 * b^3 * d + + 55 * a * b * c * d + + 2 * a * c^2 * d + + 28 * a^2 * d^2 + + 57 * a^3 * e + + 10 * a^2 * b * e + + 64 * a^2 * c * e + + 81 * a * b * c * e + + 79 * b * c^2 * e + + 32 * d^3 * e + + 59 * a * b * e^2 + + 43 * a * c * e^2 + + 15 * b * d * e^2 + + 4 * a * e^3 + + 7 * a^2 * c * f + + 21 * a * c^2 * f + + 57 * b * c^2 * f + + 80 * a^2 * d * f + + 17 * b^2 * d * f + + 58 * a * c * d * f + + 72 * c^2 * d * f + + 13 * d^3 * f + + 79 * b^2 * e * f + + 8 * a * e^2 * f + + 71 * b * e^2 * f + + 18 * b * c * f^2 + + 3 * b * d * f^2 + + 88 * d^2 * f^2 + + 77 * a * e * f^2 + + 34 * b * e * f^2 + + 54 * f^4 + + 27 * a^3 * b^2 + + 5 * a^2 * b^3 + + 63 * a^4 * c + + 51 * a^3 * b * c + + 26 * b^3 * c^2 + + 19 * a^4 * d + + 75 * a^3 * b * d + + 14 * a^2 * b^2 * d + + 34 * a * b^3 * d + + 69 * b^2 * c^2 * d + + 61 * a * c^3 * d + + 18 * b * c^3 * d + + 35 * a^3 * d^2 + + 61 * b^3 * d^2 + + 16 * a * b * c * d^2 + + 58 * c^2 * d^3 + + 58 * b * d^4 + + 44 * d^5 + + 15 * a^3 * b * e + + 44 * a^3 * c * e + + 14 * a^2 * c^2 * e + + 50 * b^2 * c^2 * e + + 31 * b * c^3 * e + + 77 * b^3 * d * e + + 2 * b^2 * c * d * e + + 34 * a * c^2 * d * e + + 62 * b^2 * d^2 * e + + 74 * b * c * d^2 * e + + 89 * a * d^3 * e + + 8 * c * d^3 * e + + 64 * a * b^2 * e^2 + + 15 * a * b * d * e^2 + + 70 * b^2 * d * e^2 + + 79 * a * c * d * e^2 + + 19 * b * c * d * e^2 + + 65 * c^2 * d * e^2 + + 30 * b * d^2 * e^2 + + 81 * d^3 * e^2 + + 75 * b * d * e^3 + + 85 * d^2 * e^3 + + 59 * a^4 * f + + 3 * a * b^3 * f + + 54 * a^2 * b * c * f + + 78 * a^2 * c^2 * f + + 63 * a^3 * d * f + + 79 * a * b^2 * d * f + + 21 * b^3 * d * f + + a * b * c * d * f + + 21 * b^2 * d^2 * f + + 18 * a * d^3 * f + + 42 * b * d^3 * f + + 56 * d^4 * f + + 2 * b^3 * e * f + + 21 * c^3 * e * f + + 13 * a * b * d * e * f + + 90 * b^2 * d * e * f + + 2 * c^2 * d * e * f + + 75 * a^2 * e^2 * f + + 82 * a * c * e^2 * f + + 9 * c^2 * e^2 * f + + 74 * d^2 * e^2 * f + + 56 * a * e^3 * f + + 7 * d * e^3 * f + + 24 * a^2 * b * f^2 + + 36 * a * b^2 * f^2 + + 4 * a * d^2 * f^2 + + 76 * b * d^2 * f^2 + + 42 * c * d^2 * f^2 + + 48 * a * b * e * f^2 + + 38 * b^2 * e * f^2 + + 23 * a * c * e * f^2 + + 17 * b * c * e * f^2 + + 28 * a^2 * f^3 + + 11 * b * c * f^3 + + 21 * e * f^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 65 * a + + 60 * c + + 5 * f + + 48 * b * c + + 15 * c^2 + + 46 * a * d + + 40 * e^2 + + 78 * a * f + + 89 * d * f + + 13 * e * f + + 41 * a * b^2 + + 79 * a^2 * c + + 47 * b^2 * c + + 17 * c^3 + + 9 * b^2 * d + + 85 * a * c * d + + 28 * b * c * d + + 40 * c^2 * d + + 30 * a * c * e + + 43 * a * d * e + + 52 * d^2 * e + + 62 * a * e^2 + + 61 * d * e^2 + + 15 * e^3 + + a^2 * f + + 30 * b^2 * f + + 76 * c * d * f + + 49 * e^2 * f + + 57 * a * f^2 + + 31 * a^4 + + 31 * b^4 + + 25 * a * b * c^2 + + 58 * c^4 + + 85 * a^2 * c * d + + 75 * a * c^2 * d + + 86 * b * c^2 * d + + 63 * b * c * d^2 + + 72 * a * d^3 + + 33 * b * d^3 + + 6 * b^2 * c * e + + 86 * a^2 * d * e + + 40 * a * b * d * e + + 80 * b * c * d * e + + 79 * c * d^2 * e + + 62 * b^2 * e^2 + + 56 * b * d * e^2 + + 72 * d^2 * e^2 + + 85 * b * e^3 + + 62 * c * e^3 + + 18 * e^4 + + 13 * a * b * c * f + + 3 * b * c^2 * f + + 33 * b^2 * d * f + + 83 * a * c * d * f + + 85 * b * c * d * f + + 61 * a * d^2 * f + + 52 * d^3 * f + + 75 * b^2 * e * f + + 53 * a * c * e * f + + 17 * b * e^2 * f + + 3 * b^2 * f^2 + + 61 * d^2 * f^2 + + 52 * a * e * f^2 + + 68 * e * f^3 + + 75 * a^5 + + 79 * a^4 * b + + 15 * a^3 * b * c + + 88 * a * b^3 * c + + 55 * a^3 * c * d + + 63 * a * b^2 * c * d + + 85 * b^3 * c * d + + 54 * a^2 * c^2 * d + + 39 * a * b * c^2 * d + + 75 * b^2 * c^2 * d + + 54 * a * c^3 * d + + 75 * a^2 * b * d^2 + + 19 * a^2 * d^3 + + 42 * c^2 * d^3 + + 89 * c * d^4 + + 50 * a^4 * e + + 6 * a * b^2 * c * e + + 62 * b * c^3 * e + + 40 * c^4 * e + + 14 * a^3 * d * e + + 77 * a^2 * b * d * e + + 76 * b^2 * d^2 * e + + 18 * a * c * d^2 * e + + 55 * a^2 * c * e^2 + + 13 * b^2 * c * e^2 + + 24 * b * c * d * e^2 + + 33 * a * d^2 * e^2 + + 12 * b * d^2 * e^2 + + 76 * a * c * e^3 + + 13 * c * e^4 + + 89 * e^5 + + 22 * a^3 * c * f + + 54 * a^2 * b * c * f + + 90 * a^2 * c^2 * f + + 60 * a * c^3 * f + + 39 * b * c^3 * f + + 23 * b^3 * d * f + + 62 * a^2 * c * d * f + + 11 * c^3 * d * f + + 85 * a^3 * e * f + + 46 * a^2 * b * e * f + + 76 * b^3 * e * f + + 75 * a * c^2 * e * f + + 76 * b * c^2 * e * f + + 43 * c^3 * e * f + + 4 * a * b * d * e * f + + 65 * b^2 * d * e * f + + 22 * c^2 * d * e * f + + 77 * b * d^2 * e * f + + 22 * d^3 * e * f + + 79 * a * c * e^2 * f + + 74 * a * d * e^2 * f + + 33 * e^4 * f + + 76 * a^3 * f^2 + + 68 * a^2 * d * f^2 + + 73 * a * b * e * f^2 + + 72 * c^2 * e * f^2 + + 9 * d^2 * e * f^2 + + 31 * a * e^2 * f^2 + + 90 * d * e^2 * f^2 + + 67 * a * d * f^3 + + 32 * a * e * f^3 + + 19 * e^2 * f^3 + + 45 * b * f^4, + 22 * d + + 72 * f + + 59 * a^2 + + 25 * a * b + + 40 * b^2 + + 25 * b * c + + 13 * c^2 + + 37 * d^2 + + 73 * b * e + + 11 * c * e + + 37 * a^2 * b + + 83 * a * b * d + + 44 * b^2 * d + + 24 * c * d^2 + + 59 * a * c * e + + 87 * b * c * e + + 31 * c^2 * e + + 25 * a * e^2 + + 13 * b * e^2 + + 71 * c * e^2 + + 74 * d * e^2 + + 79 * b * c * f + + 12 * c * d * f + + 23 * c * e * f + + 16 * e^2 * f + + 6 * c * f^2 + + 4 * a^4 + + 88 * a^3 * b + + a^2 * b^2 + + 57 * a * b * c^2 + + 83 * b^3 * d + + 33 * a^2 * c * d + + 56 * b * c^2 * d + + 18 * a^2 * d^2 + + 77 * c^2 * d^2 + + 83 * b * d^3 + + 24 * c * d^3 + + 57 * a * b^2 * e + + 28 * a * b * c * e + + 4 * b^2 * c * e + + 47 * c^3 * e + + 84 * b^2 * d * e + + 21 * a * c * d * e + + 33 * d^3 * e + + 59 * a^2 * e^2 + + 47 * a * c * e^2 + + 90 * b * c * e^2 + + 74 * a * e^3 + + 68 * d * e^3 + + 22 * a^3 * f + + 42 * a^2 * b * f + + 53 * a * b^2 * f + + 47 * a * c^2 * f + + 77 * b^2 * d * f + + 77 * c^2 * d * f + + 22 * a^2 * e * f + + 15 * a * b * e * f + + 15 * b^2 * e * f + + 44 * c^2 * e * f + + 75 * a * e^2 * f + + 4 * a * c * f^2 + + 56 * b * c * f^2 + + 60 * a * d * f^2 + + 37 * b * d * f^2 + + 5 * b * e * f^2 + + 58 * c * e * f^2 + + 56 * d * e * f^2 + + 19 * a^4 * b + + 7 * a^2 * b^3 + + 50 * a^4 * c + + 18 * a^3 * b * c + + 51 * a^2 * c^3 + + 23 * a * c^4 + + 10 * a^4 * d + + 86 * a * b^2 * c * d + + 33 * a^2 * c^2 * d + + 34 * a^3 * d^2 + + 21 * b^3 * d^2 + + 82 * b^2 * c * d^2 + + 38 * b * c^2 * d^2 + + 6 * a * c * d^3 + + 88 * b * d^4 + + 14 * c * d^4 + + 20 * a^4 * e + + 63 * b^4 * e + + 3 * a^2 * b * c * e + + 47 * b * c^3 * e + + 56 * c^4 * e + + 60 * a * b^2 * d * e + + 15 * b^2 * c * d * e + + 38 * a^2 * d^2 * e + + 22 * b^2 * d^2 * e + + 31 * a * c * d^2 * e + + 50 * c^2 * d^2 * e + + 90 * a * d^3 * e + + 50 * a * b^2 * e^2 + + 87 * a^2 * d * e^2 + + 18 * b^2 * d * e^2 + + 73 * b * c * d * e^2 + + 27 * c * d^2 * e^2 + + 53 * a * b * e^3 + + 45 * a * c * e^3 + + 28 * c^2 * e^3 + + 4 * b * d * e^3 + + 85 * d^2 * e^3 + + 75 * c * e^4 + + 30 * a * b^3 * f + + 70 * a^3 * c * f + + 57 * a^2 * b * c * f + + 89 * a * b^2 * c * f + + 79 * a^2 * c^2 * f + + 3 * c^4 * f + + 40 * a^3 * d * f + + 30 * a^2 * c * d * f + + 77 * b * c^2 * d * f + + 76 * a * c * d^2 * f + + 61 * b * c * d^2 * f + + 65 * a^3 * e * f + + 64 * b^3 * e * f + + 11 * a^2 * c * e * f + + 16 * a * b * c * e * f + + 79 * b^2 * c * e * f + + 89 * b * c^2 * e * f + + 61 * c^3 * e * f + + 47 * b^2 * d * e * f + + 39 * a * d^2 * e * f + + 21 * b * d^2 * e * f + + 71 * b^2 * e^2 * f + + 76 * a * c * e^2 * f + + 20 * a * d * e^2 * f + + 13 * c * d * e^2 * f + + 50 * e^4 * f + + 46 * a * b^2 * f^2 + + 22 * b^2 * c * f^2 + + 54 * b * c^2 * f^2 + + 68 * a * b * d * f^2 + + 66 * b * c * d * f^2 + + 6 * b * d^2 * f^2 + + 55 * a * c * e * f^2 + + 23 * b * c * f^3 + + 9 * c^2 * f^3 + + 40 * d * f^4 + + 65 * e * f^4, + 41 + + 61 * d + + 44 * c^2 + + 41 * a * e + + 45 * b * e + + 45 * c * f + + 59 * a * b * c + + 21 * c^3 + + 31 * a * d^2 + + 13 * a * c * e + + 14 * b * d * e + + 27 * d^2 * e + + 10 * a * e^2 + + 57 * d * e^2 + + 5 * e^3 + + 67 * a^2 * f + + 78 * a * b * f + + 78 * a * c * f + + 60 * c^2 * f + + b * d * f + + 55 * c * e * f + + d * f^2 + + 79 * a^2 * b^2 + + 63 * a^3 * c + + 39 * a * b^2 * c + + 41 * a^2 * c^2 + + 65 * a^3 * d + + 55 * a^2 * b * d + + 87 * a^2 * c * d + + 62 * a * b * c * d + + 21 * c^2 * d^2 + + 53 * a * d^3 + + 27 * b * d^3 + + 43 * d^4 + + 28 * a^3 * e + + 44 * a^2 * c * e + + 81 * b * c^2 * e + + 26 * b * c * d * e + + 52 * b * d^2 * e + + 30 * a * d * e^2 + + 53 * c * d * e^2 + + 5 * d^2 * e^2 + + 56 * a^2 * c * f + + 10 * b * c^2 * f + + 5 * c^3 * f + + 13 * a^2 * d * f + + 82 * b^2 * d * f + + 70 * b * c * d * f + + 56 * b * d^2 * f + + 23 * a * d * e * f + + 3 * c * d * e * f + + 22 * a * e^2 * f + + 32 * d * e^2 * f + + 55 * a^2 * f^2 + + 63 * b^2 * f^2 + + 39 * c^2 * f^2 + + 43 * a * d * f^2 + + 34 * b * e * f^2 + + 28 * d * e * f^2 + + b * f^3 + + 25 * a^4 * b + + 51 * a * b^4 + + 10 * b^5 + + 48 * a^4 * c + + 13 * b^3 * c^2 + + 57 * a^2 * c^3 + + 85 * a * b * c^3 + + 14 * c^5 + + 68 * a^2 * b^2 * d + + 41 * a^3 * c * d + + 32 * a * b * c^2 * d + + 51 * b^2 * c^2 * d + + 71 * a * c^3 * d + + 62 * b * c^3 * d + + 45 * c^4 * d + + 55 * b^3 * d^2 + + 58 * b * c^2 * d^2 + + 69 * c^3 * d^2 + + 45 * a * d^4 + + 40 * a^2 * b^2 * e + + 76 * a * b^3 * e + + 61 * b^3 * c * e + + 73 * a^2 * b * d * e + + 47 * a * b^2 * d * e + + 9 * a^2 * c * d * e + + 7 * a * b * c * d * e + + 52 * a * c^2 * d * e + + 80 * a^2 * d^2 * e + + 34 * a * c * d^2 * e + + 53 * c^2 * d^2 * e + + 18 * c * d^3 * e + + 84 * a^3 * e^2 + + 42 * a^2 * b * e^2 + + 22 * a * b * c * e^2 + + 78 * b^2 * c * e^2 + + 86 * a * c^2 * e^2 + + 28 * b * c^2 * e^2 + + 65 * a * c * d * e^2 + + 2 * a * d^2 * e^2 + + 47 * d^3 * e^2 + + 41 * a * b * e^3 + + 61 * b^2 * e^3 + + 72 * a * d * e^3 + + 56 * c * d * e^3 + + 69 * d^2 * e^3 + + 49 * a * e^4 + + 41 * c * e^4 + + 75 * e^5 + + 8 * a^3 * b * f + + 62 * a * b^3 * f + + 83 * b^4 * f + + 45 * a^3 * c * f + + 46 * a * b * c^2 * f + + 7 * b^2 * c^2 * f + + 28 * a^3 * d * f + + 59 * b^3 * d * f + + 56 * b * c^2 * d * f + + 57 * c^3 * d * f + + 23 * a^2 * d^2 * f + + 52 * a * b * d^2 * f + + 33 * b^2 * d^2 * f + + 65 * a^2 * c * e * f + + 6 * a * c^2 * e * f + + 51 * c^3 * e * f + + 17 * a * c * d * e * f + + 40 * b * c * d * e * f + + 61 * c * d^2 * e * f + + 66 * d^3 * e * f + + 72 * b^2 * e^2 * f + + 64 * b * c * e^2 * f + + 26 * b * d * e^2 * f + + 48 * c * d * e^2 * f + + 68 * b * e^3 * f + + 6 * a^3 * f^2 + + 16 * b * c^2 * f^2 + + 63 * c^2 * d * f^2 + + 67 * b * d^2 * f^2 + + 11 * a^2 * e * f^2 + + 66 * c * d * e * f^2 + + 50 * a * b * f^3 + + 80 * b * c * f^3 + + 44 * a * d * f^3 + + 40 * c * d * f^3 + + 4 * d^2 * f^3 + + 63 * a * f^4 + + 22 * b * f^4 + + 81 * e * f^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 21 * d + + 19 * e + + 19 * f + + 30 * a * c + + 22 * b * c + + 28 * c^2 + + 54 * a * d + + 6 * d^2 + + 18 * b * e + + 28 * e^2 + + 59 * d * f + + 76 * a * b * d + + 73 * a * d^2 + + 65 * a^2 * e + + 41 * a * b * e + + 28 * a * c * e + + 73 * b * c * e + + 32 * a * e^2 + + 53 * b * e^2 + + 86 * d * e^2 + + 73 * a^2 * f + + 12 * b * c * f + + 3 * a * d * f + + 64 * c * e * f + + 89 * e^2 * f + + 37 * b * f^2 + + 85 * c * f^2 + + 20 * d * f^2 + + 75 * a * b^3 + + 84 * a^2 * b * d + + 89 * b * c^2 * d + + 21 * a^2 * d^2 + + 23 * c^2 * d^2 + + 64 * c * d^3 + + 18 * d^4 + + 47 * a^3 * e + + 70 * a * b * c * e + + 27 * c^3 * e + + 75 * b^2 * d * e + + 37 * a * d^2 * e + + 20 * b * d^2 * e + + 16 * b * d * e^2 + + 86 * c * d * e^2 + + 83 * a * e^3 + + 85 * b * e^3 + + 3 * d * e^3 + + 44 * b^3 * f + + 47 * b * c^2 * f + + 33 * a * b * d * f + + 9 * b^2 * d * f + + 64 * b * c * d * f + + 5 * c * d^2 * f + + 19 * a * c * e * f + + 6 * b * c * e * f + + 83 * b * d * e * f + + 28 * a * e^2 * f + + 29 * a^2 * f^2 + + 53 * a * c * f^2 + + 90 * a * d * f^2 + + 60 * d * e * f^2 + + 90 * e^2 * f^2 + + 55 * a^2 * b^3 + + 66 * a * b^4 + + 21 * b^5 + + 60 * a^4 * c + + 3 * a^2 * b^2 * c + + 77 * a * b^2 * c^2 + + 26 * a^2 * c^3 + + 19 * b^2 * c^3 + + 2 * a * c^4 + + 25 * a^4 * d + + 72 * a^2 * b^2 * d + + 67 * a^2 * b * c * d + + 14 * a * b * d^3 + + 16 * b^2 * d^3 + + 32 * c * d^4 + + 16 * d^5 + + 90 * a^4 * e + + 55 * a^2 * b^2 * e + + 52 * a * b^3 * e + + 4 * a * b^2 * c * e + + 18 * a * b * c^2 * e + + 29 * b^2 * c^2 * e + + 19 * b * c^3 * e + + 75 * a^3 * d * e + + 49 * a^2 * b * d * e + + 62 * a^2 * c * d * e + + 30 * b^2 * c * d * e + + 77 * a * c^2 * d * e + + 50 * b * c^2 * d * e + + 5 * c^3 * d * e + + 21 * a * c * d^2 * e + + 59 * b * c * d^2 * e + + b * d^3 * e + + 69 * d^4 * e + + 44 * a * b * c * e^2 + + 56 * c^3 * e^2 + + 61 * a^2 * d * e^2 + + 4 * a * b * d * e^2 + + 39 * b * c * d * e^2 + + 75 * b * d^2 * e^2 + + 57 * b^2 * e^3 + + 10 * c * d * e^3 + + 65 * e^5 + + 19 * a * b^3 * f + + 72 * b^2 * c^2 * f + + 76 * a^2 * b * d * f + + 52 * a * b * c * d * f + + 80 * a^2 * d^2 * f + + 47 * b^2 * d^2 * f + + 80 * b * d^3 * f + + 67 * a^2 * b * e * f + + b^2 * c * e * f + + 5 * b * c^2 * e * f + + 20 * a * c * d * e * f + + 59 * c^2 * d * e * f + + 60 * c^2 * e^2 * f + + 79 * b * e^3 * f + + 22 * c * e^3 * f + + 48 * a^2 * c * f^2 + + 23 * a * c^2 * f^2 + + 78 * b^2 * d * f^2 + + 85 * a * c * d * f^2 + + 55 * c^2 * d * f^2 + + 77 * d^3 * f^2 + + 40 * a * c * e * f^2 + + 83 * b * c * e * f^2 + + 55 * b * d * e * f^2 + + 26 * c * d * e * f^2 + + 35 * a^2 * f^3 + + 10 * b * c * f^3 + + 61 * c^2 * f^3 + + 86 * d^2 * f^3 + + 4 * a * e * f^3 + + 58 * b * f^4 + + 84 * f^5, + 51 * b + + 3 * e + + 14 * b^2 + + 66 * c^2 + + 80 * b * d + + 77 * c * d + + 83 * b * e + + 34 * a * b^2 + + 82 * a^2 * c + + 7 * a * c^2 + + 61 * a * c * d + + 81 * b * c * d + + 5 * c^2 * d + + 33 * d^3 + + 87 * a * d * e + + 23 * b * d * e + + 84 * b * e^2 + + 78 * c * e^2 + + 41 * e^3 + + 9 * a * d * f + + 13 * c * d * f + + 60 * b * e * f + + 78 * d * e * f + + 65 * a * f^2 + + 52 * b * f^2 + + 10 * a^3 * b + + 9 * a^2 * b^2 + + 63 * a * b^3 + + 54 * b^4 + + 75 * a^2 * b * c + + 40 * a^2 * c^2 + + 35 * b * c^3 + + 14 * c^4 + + 80 * a^3 * d + + 69 * b^3 * d + + 4 * a * b * c * d + + 75 * a * c^2 * d + + 64 * a * b * d^2 + + 31 * a^3 * e + + 17 * a^2 * b * e + + 56 * c^2 * d * e + + 55 * b * d^2 * e + + 72 * c * d^2 * e + + 89 * a^2 * e^2 + + 2 * b * c * e^2 + + 60 * b * d * e^2 + + 90 * b * e^3 + + 70 * c * e^3 + + 71 * a^2 * c * f + + 48 * b * c^2 * f + + 7 * a^2 * d * f + + 60 * a * c * d * f + + 61 * c^2 * d * f + + 23 * c * d^2 * f + + 40 * b^2 * e * f + + 8 * a * c * e * f + + 18 * a * d * e * f + + 18 * b * d * e * f + + 48 * c * d * e * f + + 26 * c * e^2 * f + + 34 * a * c * f^2 + + 26 * c^2 * f^2 + + 87 * b * d * f^2 + + 64 * c * d * f^2 + + 67 * a * e * f^2 + + 71 * a * f^3 + + 32 * e * f^3 + + 53 * a^5 + + 80 * b^5 + + 53 * a^3 * b * c + + 39 * a^2 * b^2 * c + + 27 * a * b^3 * c + + 44 * a * b^2 * c^2 + + 51 * b * c^4 + + 8 * c^5 + + 6 * b^4 * d + + 5 * a^2 * c^2 * d + + 22 * b * c^3 * d + + 39 * a^3 * d^2 + + 75 * b^2 * c * d^2 + + 28 * c^3 * d^2 + + 64 * b^2 * d^3 + + 60 * d^5 + + 63 * a^2 * b * c * e + + 30 * b * c^3 * e + + 53 * c^4 * e + + 20 * b^3 * d * e + + 60 * a * b * c * d * e + + 18 * a * c^2 * d * e + + 17 * a * c * d^2 * e + + 58 * a * d^3 * e + + 19 * a^2 * b * e^2 + + 86 * b^3 * e^2 + + 56 * a * b * c * e^2 + + 23 * a * d^2 * e^2 + + 50 * d^3 * e^2 + + 18 * a * c * e^3 + + 70 * b * c * e^3 + + 52 * b * e^4 + + 72 * c * e^4 + + 56 * d * e^4 + + 77 * a^4 * f + + 17 * a * b * c^2 * f + + 63 * a^2 * b * d * f + + 12 * a^2 * c * d * f + + 53 * a * b * d^2 * f + + 25 * b^2 * d^2 * f + + 26 * b * d^3 * f + + 70 * c * d^3 * f + + 33 * d^4 * f + + 42 * a * b * c * e * f + + 74 * b * c^2 * e * f + + 60 * a^2 * d * e * f + + 40 * b * d^2 * e * f + + 3 * c * d^2 * e * f + + 79 * a * c * e^2 * f + + 50 * b * c * e^2 * f + + 30 * a * d * e^2 * f + + 88 * d^2 * e^2 * f + + 88 * b * e^3 * f + + 28 * c * e^3 * f + + 17 * e^4 * f + + 20 * a^3 * f^2 + + 18 * a^2 * b * f^2 + + 35 * b^2 * c * f^2 + + 2 * c^2 * d * f^2 + + 68 * b * d^2 * f^2 + + 50 * c * d^2 * f^2 + + 13 * d^3 * f^2 + + 74 * a^2 * e * f^2 + + 69 * b^2 * e * f^2 + + 81 * b * c * e * f^2 + + 82 * c^2 * e * f^2 + + 27 * d^2 * e * f^2 + + 6 * e^3 * f^2 + + 47 * a * b * f^3 + + 25 * c * d * f^3 + + 89 * b * e * f^3 + + 56 * c * e * f^3 + + 23 * e^2 * f^3 + + 90 * b * f^4 + + 80 * e * f^4 + + 15 * f^5, + 51 + + 52 * e + + 11 * a^2 + + 36 * b * c + + b * d + + 73 * c * d + + 38 * a * e + + 9 * b * e + + 46 * a * b^2 + + 30 * b^3 + + 85 * a^2 * c + + 77 * a * b * c + + 4 * b^2 * c + + 33 * b^2 * d + + 82 * a * d^2 + + 32 * c * d^2 + + 35 * b^2 * e + + 44 * a * c * e + + 50 * b * c * e + + 28 * c * d * e + + 72 * a * b * f + + 61 * b^2 * f + + 24 * c^2 * f + + 19 * b * e * f + + 52 * a * b^2 * c + + 88 * b^3 * c + + 79 * a^2 * c^2 + + 70 * a * c^3 + + 70 * b * c^3 + + 10 * a * b^2 * d + + b^3 * d + + 18 * b^2 * c * d + + 36 * b * c^2 * d + + a^2 * d^2 + + 5 * b^2 * d^2 + + 71 * c^2 * d^2 + + 49 * c * d^3 + + 82 * d^4 + + 40 * c^3 * e + + 6 * b^2 * d * e + + 66 * a * c * d * e + + 42 * b * d^2 * e + + 90 * d^3 * e + + 21 * a^2 * e^2 + + 25 * b * d * e^2 + + 84 * d^2 * e^2 + + 69 * b * e^3 + + 36 * e^4 + + 86 * a^3 * f + + 63 * b^3 * f + + 56 * b^2 * c * f + + 79 * a * c * d * f + + 49 * a * b * e * f + + 56 * b^2 * e * f + + c^2 * e * f + + 15 * d^2 * e * f + + 82 * e^3 * f + + 17 * a * c * f^2 + + 24 * b * c * f^2 + + 87 * c^2 * f^2 + + 31 * a * d * f^2 + + 77 * b * e * f^2 + + 11 * d * e * f^2 + + 67 * a^4 * b + + 52 * a^3 * b^2 + + 90 * b^4 * c + + 32 * a^2 * b * c^2 + + 86 * a * b^2 * c^2 + + 70 * a^2 * c^3 + + 26 * a * c^4 + + 64 * b * c^4 + + 43 * c^5 + + 25 * a^2 * c^2 * d + + 53 * a * c^3 * d + + 50 * a^3 * d^2 + + 54 * a * b^2 * d^2 + + 71 * a^2 * c * d^2 + + 78 * a * b * c * d^2 + + 47 * a * c^2 * d^2 + + 15 * c^3 * d^2 + + 45 * b * d^4 + + 43 * c * d^4 + + 76 * a^3 * b * e + + 82 * a^3 * c * e + + 18 * a^2 * c^2 * e + + 9 * b^2 * c^2 * e + + 78 * a^3 * d * e + + 71 * a^2 * b * d * e + + 11 * a * b * c * d * e + + 13 * b * c^2 * d * e + + 16 * c^3 * d * e + + 52 * a^2 * d^2 * e + + 6 * b * d^3 * e + + 90 * b^3 * e^2 + + 65 * c^3 * e^2 + + 10 * a^2 * d * e^2 + + 77 * b^2 * d * e^2 + + c * d^2 * e^2 + + 90 * c^2 * e^3 + + 61 * b * e^4 + + 35 * e^5 + + 70 * a^4 * f + + 49 * a^3 * b * f + + 53 * a^2 * b^2 * f + + 67 * a^3 * c * f + + 58 * a^2 * b * c * f + + 29 * a^2 * c^2 * f + + 65 * b * c^3 * f + + 88 * a * c^2 * d * f + + 39 * a^2 * d^2 * f + + 64 * a * c * d^2 * f + + 82 * b * c * d^2 * f + + 52 * a^2 * c * e * f + + 22 * a * c^2 * e * f + + 41 * a * b * d * e * f + + 64 * b * c * d * e * f + + 87 * c^2 * d * e * f + + 74 * b * d^2 * e * f + + 53 * c * d^2 * e * f + + 83 * a * b * e^2 * f + + 49 * c^2 * e^2 * f + + 44 * b * d * e^2 * f + + 89 * c * d * e^2 * f + + 20 * a * e^3 * f + + 72 * c * e^3 * f + + 64 * a * b * c * f^2 + + 34 * a * b * d * f^2 + + 79 * b^2 * d * f^2 + + 36 * c * d^2 * f^2 + + 15 * b * c * e * f^2 + + 64 * a * d * e * f^2 + + 58 * d^2 * e * f^2 + + 89 * d * e^2 * f^2 + + 22 * a * d * f^3 + + a * e * f^3 + + 57 * d * e * f^3 + + 3 * c * f^4 + + 84 * d * f^4 + + 40 * e * f^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(3*10),90)", i, S) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 60 + + 62 * b + + 28 * c + + 70 * d + + 17 * a * d + + 21 * b * d + + 53 * c * d + + d * e + + 23 * e^2 + + 51 * a * f + + 40 * b * f + + 87 * e * f + + 56 * a^3 + + 80 * a * b^2 + + 11 * b^3 + + 5 * a * b * c + + 7 * b^2 * c + + 17 * c^3 + + 89 * a^2 * d + + 18 * a * b * d + + 39 * b^2 * d + + 6 * b * d^2 + + 40 * c * d^2 + + 53 * d^3 + + 24 * a^2 * e + + 14 * a * c * e + + 68 * d^2 * e + + 26 * a * e^2 + + 69 * a * b * f + + 39 * b^2 * f + + 69 * c^2 * f + + 23 * a * d * f + + 58 * d^2 * f + + 3 * a * e * f + + 12 * b * e * f + + 73 * d * e * f + + 51 * e^2 * f + + 90 * a * f^2 + + 61 * b * f^2 + + 74 * c * f^2 + + 44 * f^3 + + 56 * a^3 * b + + 74 * a^2 * b * c + + 25 * a^2 * c^2 + + 39 * b^2 * c^2 + + 86 * a^3 * d + + 84 * a^2 * b * d + + 55 * b^3 * d + + 24 * a^2 * c * d + + 5 * a * b * c * d + + 33 * b * c^2 * d + + 63 * c^3 * d + + 67 * b * d^3 + + 32 * d^4 + + 79 * a * b * c * e + + 42 * b^2 * c * e + + 47 * a * b * d * e + + 78 * b^2 * d * e + + 48 * c^2 * d * e + + 84 * d^3 * e + + 30 * a^2 * e^2 + + 90 * a * b * e^2 + + 55 * b^2 * e^2 + + 33 * b * c * e^2 + + 53 * b * d * e^2 + + 32 * c * d * e^2 + + 75 * a * e^3 + + 71 * b * e^3 + + 46 * c * e^3 + + 16 * d * e^3 + + 28 * e^4 + + 39 * a * c^2 * f + + 24 * c^3 * f + + 54 * a^2 * d * f + + 80 * a * d^2 * f + + 60 * c * d^2 * f + + 72 * a * c * e * f + + 2 * a * d * e * f + + 4 * b * d * e * f + + 52 * c * d * e * f + + 29 * d^2 * e * f + + 84 * b * e^2 * f + + 88 * d * e^2 * f + + 48 * a * b * f^2 + + 39 * b * c * f^2 + + 20 * c^2 * f^2 + + 72 * a * d * f^2 + + 28 * b * d * f^2 + + 56 * c * d * f^2 + + 53 * c * e * f^2 + + 62 * e^2 * f^2 + + 76 * a * f^3 + + 33 * b * f^3 + + 4 * d * f^3 + + 88 * a^3 * b^2 + + 36 * b^5 + + 48 * a^3 * b * c + + 11 * b^4 * c + + 82 * a^3 * c^2 + + 24 * a^2 * b * c^2 + + 54 * a * b * c^3 + + 4 * b^2 * c^3 + + 23 * b * c^4 + + 48 * a^3 * b * d + + 36 * a * b^3 * d + + 48 * a^3 * c * d + + 60 * a^2 * b * c * d + + 47 * a * b^2 * c * d + + 85 * a^2 * c^2 * d + + 64 * a^3 * d^2 + + 88 * a * b * c * d^2 + + 70 * a * c^2 * d^2 + + 36 * b * c^2 * d^2 + + 21 * a^2 * d^3 + + 65 * a * b * d^3 + + 54 * b^2 * d^3 + + 53 * a * c * d^3 + + 49 * a^3 * b * e + + 35 * b^4 * e + + 62 * a * b^2 * c * e + + 17 * a * b * c^2 * e + + 76 * c^4 * e + + 58 * a^3 * d * e + + 83 * a * b^2 * d * e + + 83 * b^3 * d * e + + 55 * a^2 * c * d * e + + 14 * a * c^2 * d * e + + 45 * c^3 * d * e + + 57 * a * b * d^2 * e + + 6 * a * c * d^2 * e + + 42 * c^2 * d^2 * e + + 61 * b * d^3 * e + + 32 * c * d^3 * e + + 15 * a^3 * e^2 + + 34 * a^2 * b * e^2 + + 74 * a * b^2 * e^2 + + 22 * b^3 * e^2 + + 90 * a^2 * c * e^2 + + 4 * c^3 * e^2 + + 36 * a * b * d * e^2 + + 36 * a * c * d * e^2 + + 20 * c^2 * d * e^2 + + 15 * a * d^2 * e^2 + + 24 * c * d^2 * e^2 + + 72 * d^3 * e^2 + + 41 * a * c * e^3 + + 61 * a * e^4 + + 6 * c * e^4 + + 51 * e^5 + + 50 * a^4 * f + + 54 * a^2 * b^2 * f + + 83 * a * b^3 * f + + 87 * a^3 * c * f + + 39 * a^2 * b * c * f + + 53 * b^3 * c * f + + 53 * b^2 * c^2 * f + + 13 * a * c^3 * f + + 46 * a * b^2 * d * f + + 77 * b * c^2 * d * f + + 36 * a^2 * d^2 * f + + 12 * a * c * d^2 * f + + 2 * b * c * d^2 * f + + 19 * c^2 * d^2 * f + + 15 * a^3 * e * f + + 69 * a^2 * c * e * f + + 90 * a * b * c * e * f + + 4 * a * c^2 * e * f + + 28 * a * b * d * e * f + + 15 * b^2 * d * e * f + + 14 * a * c * d * e * f + + 38 * b * c * d * e * f + + 13 * a * d^2 * e * f + + 32 * c * d^2 * e * f + + 89 * b * c * e^2 * f + + 7 * c^2 * e^2 * f + + 8 * b * d * e^2 * f + + 78 * c * d * e^2 * f + + 56 * c * e^3 * f + + 63 * d * e^3 * f + + 59 * e^4 * f + + 89 * a^2 * b * f^2 + + 20 * a * b^2 * f^2 + + 74 * b^3 * f^2 + + 26 * a * b * c * f^2 + + 87 * a * c^2 * f^2 + + 65 * b * c^2 * f^2 + + 50 * a^2 * d * f^2 + + 75 * a * c * d * f^2 + + 30 * a * d^2 * f^2 + + 5 * a^2 * e * f^2 + + 63 * b^2 * e * f^2 + + 22 * c^2 * e * f^2 + + 39 * a * d * e * f^2 + + 51 * c * d * e * f^2 + + 77 * b * e^2 * f^2 + + 24 * e^3 * f^2 + + 55 * a^2 * f^3 + + 31 * b * c * f^3 + + 38 * c * d * f^3 + + 63 * d^2 * f^3 + + 53 * a * e * f^3 + + 70 * d * e * f^3 + + 2 * e^2 * f^3 + + 87 * b * f^4 + + 59 * c * f^4 + + 61 * e * f^4 + + 53 * f^5, + 12 * b + + 88 * f + + 7 * a^2 + + 26 * b^2 + + 81 * b * c + + 18 * a * d + + 29 * b * e + + 36 * c * e + + 21 * e^2 + + 21 * a * f + + 29 * d * f + + 8 * e * f + + 4 * f^2 + + 24 * b^3 + + 86 * a * c^2 + + 68 * b * c^2 + + 57 * a^2 * d + + 8 * a * c * d + + 24 * b * c * d + + 63 * a * b * e + + 68 * c^2 * e + + 81 * b^2 * f + + 16 * b * c * f + + 66 * c * d * f + + 89 * b * e * f + + 86 * c * e * f + + 49 * d * e * f + + 55 * d * f^2 + + 4 * e * f^2 + + 27 * f^3 + + 72 * a^2 * b * c + + 51 * a * b^2 * c + + 52 * b^3 * c + + 23 * a^2 * c * d + + 16 * b^2 * c * d + + 81 * b * c^2 * d + + 41 * a^2 * d^2 + + 59 * b * c * d^2 + + a * d^3 + + 52 * c * d^3 + + 70 * d^4 + + 30 * a^2 * b * e + + 51 * b^3 * e + + 26 * a * b * c * e + + 82 * a * c^2 * e + + 20 * b * c^2 * e + + 42 * c^3 * e + + 10 * b^2 * d * e + + 26 * a * c * d * e + + 74 * b * c * d * e + + 65 * b * d^2 * e + + 47 * d^3 * e + + 65 * a^2 * e^2 + + 4 * b^2 * e^2 + + 61 * a * c * e^2 + + 48 * c^2 * e^2 + + 48 * a * d * e^2 + + 24 * b * d * e^2 + + 79 * b * e^3 + + 3 * c * e^3 + + 45 * a^2 * b * f + + 73 * a * b * c * f + + 33 * a * c^2 * f + + 39 * a^2 * d * f + + 26 * a * b * d * f + + 23 * c^2 * d * f + + 13 * b * d^2 * f + + 53 * a^2 * e * f + + 85 * b^2 * e * f + + 31 * a * c * e * f + + 49 * b * c * e * f + + 7 * a * e^2 * f + + 86 * c * e^2 * f + + 15 * e^3 * f + + 38 * a^2 * f^2 + + 70 * a * c * f^2 + + 37 * c^2 * f^2 + + 16 * a * d * f^2 + + 51 * b * d * f^2 + + 88 * c * e * f^2 + + 68 * e^2 * f^2 + + 75 * b * f^3 + + 37 * c * f^3 + + 38 * a^4 * b + + 84 * a * b^4 + + 88 * b^5 + + 49 * a^3 * b * c + + 8 * a^2 * b^2 * c + + 39 * b^4 * c + + 11 * a^2 * c^3 + + 29 * a * b * c^3 + + 72 * b^2 * c^3 + + 39 * a * c^4 + + 54 * b * c^4 + + 77 * a^4 * d + + 89 * a^3 * b * d + + 65 * a^3 * c * d + + 66 * a * b^2 * c * d + + 20 * a^2 * c^2 * d + + 79 * a * b * c^2 * d + + 68 * b^2 * c^2 * d + + 76 * c^4 * d + + 90 * b^3 * d^2 + + 46 * a * b * c * d^2 + + 82 * a * c^2 * d^2 + + 68 * b * c^2 * d^2 + + 60 * a^2 * d^3 + + 20 * a * b * d^3 + + 52 * a^3 * b * e + + 12 * a * b^3 * e + + 15 * b^4 * e + + 63 * a * b * c^2 * e + + 26 * b^2 * c^2 * e + + 63 * a * c^3 * e + + 31 * b^3 * d * e + + 65 * a * c^2 * d * e + + 45 * b * c * d^2 * e + + 31 * a * d^3 * e + + 33 * c * d^3 * e + + 38 * d^4 * e + + 53 * a^3 * e^2 + + 30 * a^2 * b * e^2 + + 31 * a * b^2 * e^2 + + 26 * a^2 * c * e^2 + + 33 * b^2 * c * e^2 + + 25 * a * c^2 * e^2 + + 61 * b * c^2 * e^2 + + 82 * c^3 * e^2 + + 71 * b^2 * d * e^2 + + 79 * a * d^2 * e^2 + + 47 * b * d^2 * e^2 + + 82 * c * d^2 * e^2 + + 84 * a * b * e^3 + + 25 * b * c * e^3 + + 52 * d^2 * e^3 + + 17 * b * e^4 + + 48 * c * e^4 + + 25 * a^4 * f + + 82 * a^3 * b * f + + 7 * a^3 * c * f + + 20 * a * b^2 * c * f + + 16 * a * b * c^2 * f + + 3 * a * c^3 * f + + 60 * c^4 * f + + 65 * a^3 * d * f + + 54 * a * b^2 * d * f + + 44 * a * b * c * d * f + + 32 * b * c^2 * d * f + + 15 * b^2 * d^2 * f + + 72 * c^2 * d^2 * f + + 79 * d^4 * f + + 81 * a^2 * b * e * f + + 49 * a * b^2 * e * f + + 64 * a * b * c * e * f + + 87 * b^2 * d * e * f + + 47 * c^2 * d * e * f + + 30 * a * d^2 * e * f + + 64 * b * d^2 * e * f + + 86 * a^2 * e^2 * f + + 14 * b * c * e^2 * f + + 81 * c^2 * e^2 * f + + 61 * d^2 * e^2 * f + + 54 * d * e^3 * f + + 75 * a^3 * f^2 + + 32 * a^2 * b * f^2 + + 62 * a * c^2 * f^2 + + 23 * c^2 * d * f^2 + + 11 * a * d^2 * f^2 + + 12 * b * d^2 * f^2 + + 74 * c * d^2 * f^2 + + 75 * b * c * e * f^2 + + 52 * c^2 * e * f^2 + + 7 * d^2 * e * f^2 + + 6 * a * e^2 * f^2 + + 73 * d * e^2 * f^2 + + 56 * e^3 * f^2 + + 51 * a^2 * f^3 + + 24 * c^2 * f^3 + + 90 * b * d * f^3 + + 76 * b * e * f^3 + + 59 * c * e * f^3 + + 24 * e * f^4 + + 57 * f^5, + 6 + + 36 * c + + 85 * e + + 12 * f + + 2 * c^2 + + 40 * c * d + + 84 * a * e + + 63 * b * e + + 72 * e^2 + + 76 * b * f + + 8 * e * f + + 81 * a^3 + + 86 * b^3 + + 30 * b * c^2 + + 68 * a * c * d + + 43 * c^2 * d + + 32 * a * d^2 + + 67 * c * d^2 + + 13 * a^2 * e + + 2 * a * b * e + + 60 * b^2 * e + + 80 * b * c * e + + 67 * a * d * e + + 38 * b * d * e + + 71 * a * e^2 + + 23 * c * e^2 + + 89 * b * c * f + + 74 * c^2 * f + + 76 * b * d * f + + 46 * a * e * f + + 12 * c * e * f + + 70 * d * e * f + + 22 * f^3 + + 60 * a^4 + + 18 * a^2 * b^2 + + 71 * b^4 + + 41 * a^2 * c^2 + + 62 * a * b * c^2 + + 84 * a * c^3 + + 72 * c^4 + + 76 * b^3 * d + + 41 * a * c * d^2 + + 47 * b * c * d^2 + + 44 * a^3 * e + + 74 * a^2 * b * e + + 21 * a^2 * c * e + + 37 * a * b * c * e + + 74 * a * c^2 * e + + 9 * b * c^2 * e + + 61 * a^2 * d * e + + 54 * b^2 * d * e + + 57 * b * c * d * e + + 52 * b^2 * e^2 + + 80 * c^2 * e^2 + + 80 * c * d * e^2 + + 15 * a^3 * f + + 11 * b^3 * f + + 45 * a^2 * c * f + + 14 * a * c^2 * f + + 77 * a^2 * d * f + + 89 * b * c * d * f + + 37 * b * d^2 * f + + 55 * d^3 * f + + 31 * a * b * e * f + + b * c * e * f + + 43 * a * d * e * f + + 84 * c * d * e * f + + 78 * d^2 * e * f + + 40 * d * e^2 * f + + 88 * b * c * f^2 + + 50 * b * d * f^2 + + 86 * c * d * f^2 + + 15 * d^2 * f^2 + + 78 * b * e * f^2 + + 46 * a * f^3 + + 56 * b * f^3 + + 76 * c * f^3 + + 89 * d * f^3 + + 83 * f^4 + + 86 * a^2 * b^3 + + 74 * a * b^4 + + 63 * b^5 + + 89 * a * b^3 * c + + 54 * a^2 * b * c^2 + + 50 * b^3 * c^2 + + 27 * a^2 * c^3 + + 54 * a * b * c^3 + + 46 * a^4 * d + + 2 * b^4 * d + + 80 * a * b * c^2 * d + + 16 * a * c^3 * d + + 68 * b * c^3 * d + + 4 * a * b^2 * d^2 + + 15 * b * c^2 * d^2 + + 66 * b * d^4 + + 8 * a^2 * b^2 * e + + 72 * b^4 * e + + 67 * a^2 * b * c * e + + 59 * b^3 * c * e + + 57 * b^2 * c^2 * e + + 60 * a^2 * b * d * e + + 82 * a * b^2 * d * e + + a * b * c * d * e + + 65 * b^2 * c * d * e + + 35 * b * c^2 * d * e + + 37 * a^2 * d^2 * e + + 80 * b^2 * d^2 * e + + 47 * c^2 * d^2 * e + + 9 * c * d^3 * e + + 33 * a * b^2 * e^2 + + 27 * a^2 * c * e^2 + + 46 * b^2 * c * e^2 + + 64 * b * c^2 * e^2 + + 58 * c^3 * e^2 + + 20 * a * b * d * e^2 + + 87 * b * c * d * e^2 + + 39 * c * d^2 * e^2 + + 4 * a^2 * e^3 + + 68 * b^2 * e^3 + + a * d * e^3 + + 41 * c * d * e^3 + + 72 * d^2 * e^3 + + 14 * a * e^4 + + 74 * b^4 * f + + 16 * a^3 * c * f + + 39 * a^2 * b * c * f + + 17 * b^2 * c^2 * f + + 58 * a * c^3 * f + + 82 * a^2 * b * d * f + + 87 * b^3 * d * f + + 12 * a * d^3 * f + + 86 * b * d^3 * f + + 2 * c * d^3 * f + + 67 * a * b^2 * e * f + + 50 * b^3 * e * f + + 67 * b * c^2 * e * f + + 51 * c^3 * e * f + + 15 * a * b * d * e * f + + 61 * b^2 * d * e * f + + 11 * b * d^2 * e * f + + 13 * a * b * e^2 * f + + 41 * b^2 * e^2 * f + + 17 * c^2 * e^2 * f + + 3 * b * d * e^2 * f + + 28 * a * e^3 * f + + 13 * b * e^3 * f + + 26 * c * e^3 * f + + 45 * e^4 * f + + 5 * a^3 * f^2 + + 49 * b^3 * f^2 + + 74 * a^2 * c * f^2 + + 61 * a * b * c * f^2 + + 49 * c^3 * f^2 + + 66 * a * c * d * f^2 + + 81 * b * c * d * f^2 + + 90 * c^2 * d * f^2 + + 28 * a * d^2 * f^2 + + 15 * c * d^2 * f^2 + + 17 * d^3 * f^2 + + 30 * a * b * e * f^2 + + 75 * a * e^2 * f^2 + + 48 * b * e^2 * f^2 + + 66 * c * e^2 * f^2 + + 46 * b^2 * f^3 + + 56 * b * c * f^3 + + 82 * c * d * f^3 + + 25 * a * e * f^3 + + 41 * d * e * f^3 + + 86 * c * f^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 69 * a + + 66 * b + + 40 * a * b + + 20 * b^2 + + 57 * c^2 + + 76 * c * d + + 46 * d^2 + + 7 * a * e + + 5 * b * e + + 59 * d * e + + 41 * a^3 + + 33 * a^2 * b + + 86 * a^2 * c + + 80 * a * b * c + + 80 * b^2 * c + + 55 * b * c^2 + + 2 * c^3 + + 82 * a^2 * d + + 59 * a * c * d + + 28 * a * d^2 + + 76 * d^3 + + 45 * a^2 * e + + 65 * b^2 * e + + 58 * a * c * e + + 23 * c^2 * e + + 9 * d^2 * e + + 17 * b * e^2 + + 5 * c * e^2 + + 19 * a * b * f + + 21 * b^2 * f + + 35 * b * c * f + + 63 * b * d * f + + 49 * e * f^2 + + 76 * f^3 + + 19 * a^3 * c + + 35 * a^2 * b * c + + 17 * b^3 * c + + 66 * a * c^3 + + 6 * c^4 + + 52 * a^2 * b * d + + 36 * a * b^2 * d + + 9 * b^2 * c * d + + 27 * b * c^2 * d + + 48 * a^2 * d^2 + + 38 * a * c * d^2 + + 11 * a * d^3 + + 8 * c * d^3 + + d^4 + + 39 * a^3 * e + + 59 * a * b^2 * e + + 68 * b^3 * e + + 62 * b^2 * c * e + + 4 * b * c^2 * e + + 8 * a * b * d * e + + 78 * b^2 * d * e + + 34 * a * c * d * e + + 10 * b * c * d * e + + 77 * b * d^2 * e + + 57 * c * d^2 * e + + 88 * a * b * e^2 + + 29 * a * c * e^2 + + 72 * a * d * e^2 + + 80 * b * d * e^2 + + 32 * d^2 * e^2 + + 67 * b * e^3 + + 15 * c * e^3 + + 26 * e^4 + + 78 * a * b^2 * f + + 20 * b^3 * f + + 29 * a^2 * c * f + + 12 * b * c^2 * f + + 22 * c^3 * f + + 10 * a * c * d * f + + 24 * b * c * d * f + + 77 * a * d^2 * f + + 86 * c * d^2 * f + + 74 * a^2 * e * f + + 6 * a * b * e * f + + 54 * b^2 * e * f + + 8 * a * d * e * f + + 30 * d^2 * e * f + + 89 * b * e^2 * f + + 88 * c * e^2 * f + + 40 * e^3 * f + + 63 * a^2 * f^2 + + 76 * a * b * f^2 + + 21 * c * d * f^2 + + 43 * d^2 * f^2 + + 60 * d * e * f^2 + + 50 * e^2 * f^2 + + 70 * b * f^3 + + 82 * c * f^3 + + 24 * d * f^3 + + 37 * f^4 + + 50 * a^5 + + 64 * a^4 * b + + 52 * a^3 * b^2 + + 19 * b^5 + + 60 * a * b^3 * c + + 43 * a^2 * b * c^2 + + 49 * a * b^2 * c^2 + + 64 * b^3 * c^2 + + 36 * a * b * c^3 + + 54 * b * c^4 + + 36 * c^5 + + 31 * a^4 * d + + 46 * a^3 * b * d + + 35 * b^4 * d + + 87 * a^2 * b * c * d + + 41 * b^3 * c * d + + 24 * a^2 * c^2 * d + + 79 * b^2 * c^2 * d + + 66 * b * c^3 * d + + 33 * a * b^2 * d^2 + + 24 * b^3 * d^2 + + 21 * a * b * c * d^2 + + 80 * b^2 * c * d^2 + + 73 * a * c^2 * d^2 + + 7 * b^2 * d^3 + + 21 * c * d^4 + + 31 * a^4 * e + + 22 * a^3 * b * e + + 49 * b^3 * c * e + + 17 * a * c^3 * e + + 65 * b^3 * d * e + + 67 * a * b * c * d * e + + 36 * c^3 * d * e + + 13 * a * b * d^2 * e + + 3 * b^2 * d^2 * e + + 87 * c * d^3 * e + + 25 * d^4 * e + + 47 * a^3 * e^2 + + 54 * a^2 * b * e^2 + + 66 * b^3 * e^2 + + 38 * a^2 * d * e^2 + + 18 * b * c * d * e^2 + + 10 * a * d^2 * e^2 + + 22 * b * d^2 * e^2 + + 74 * a * b * e^3 + + 68 * b^2 * e^3 + + 23 * a * c * e^3 + + 84 * b * c * e^3 + + 55 * a * d * e^3 + + 27 * d^2 * e^3 + + 54 * c * e^4 + + 4 * e^5 + + 4 * a * b^3 * f + + 57 * a^3 * c * f + + 8 * a^2 * b * c * f + + 3 * a * b * c^2 * f + + 71 * b * c^3 * f + + 46 * a^3 * d * f + + 62 * b^3 * d * f + + 63 * a^2 * c * d * f + + 85 * b^2 * c * d * f + + 74 * c^3 * d * f + + 25 * a * b * d^2 * f + + 62 * c^2 * d^2 * f + + 70 * b^2 * c * e * f + + 2 * c^3 * e * f + + 45 * b * c * d * e * f + + 88 * c^2 * d * e * f + + 8 * a * d^2 * e * f + + 37 * c * d^2 * e * f + + 28 * d^3 * e * f + + 39 * a^2 * e^2 * f + + 27 * b^2 * e^2 * f + + 25 * b * c * e^2 * f + + 62 * c^2 * e^2 * f + + 53 * c * d * e^2 * f + + 73 * e^4 * f + + 89 * a^3 * f^2 + + 3 * b^3 * f^2 + + 70 * b^2 * c * f^2 + + 16 * c^3 * f^2 + + 11 * a^2 * d * f^2 + + 20 * b * c * d * f^2 + + 68 * b^2 * e * f^2 + + 5 * a * e^2 * f^2 + + 88 * b^2 * f^3 + + 47 * b * c * f^3 + + 3 * c^2 * f^3 + + 74 * a * d * f^3 + + 24 * c * d * f^3 + + 86 * d * e * f^3 + + 3 * b * f^4 + + 72 * c * f^4, + 43 + + 89 * b + + 74 * c + + 72 * d + + 9 * a^2 + + 12 * b^2 + + 12 * a * c + + c^2 + + 28 * c * e + + 49 * c * f + + 77 * a * b^2 + + 16 * a * b * c + + 12 * a * c^2 + + 65 * a^2 * d + + 51 * b * c * d + + 45 * c^2 * d + + 21 * c * d^2 + + 15 * a^2 * e + + 51 * b * d * e + + 40 * c * d * e + + 9 * a * e^2 + + 25 * b * e^2 + + 9 * c * e^2 + + 62 * e^3 + + 76 * b^2 * f + + 77 * c^2 * f + + 61 * b * d * f + + 56 * c * d * f + + 51 * d^2 * f + + 86 * e^2 * f + + 41 * c * f^2 + + 43 * d * f^2 + + 19 * f^3 + + 66 * a * b^3 + + 60 * a^2 * c^2 + + 49 * b * c^3 + + 41 * b * c^2 * d + + 31 * c^3 * d + + 32 * a^2 * d^2 + + 63 * b^2 * d^2 + + 59 * c^2 * d^2 + + 37 * a * d^3 + + 33 * c * d^3 + + 35 * d^4 + + 9 * a^3 * e + + 15 * a^2 * b * e + + 33 * a^2 * c * e + + 19 * a * b * c * e + + 33 * b^2 * c * e + + 13 * a^2 * d * e + + 50 * a * b * d * e + + 90 * b * c * d * e + + 85 * c^2 * d * e + + 79 * d^3 * e + + 55 * a * c * e^2 + + 75 * b * c * e^2 + + 11 * c^2 * e^2 + + 40 * d^2 * e^2 + + 74 * c * e^3 + + 79 * a * b^2 * f + + 16 * a * b * c * f + + 84 * b * c^2 * f + + 10 * b * c * d * f + + 47 * a * d^2 * f + + 39 * d^3 * f + + 56 * a^2 * e * f + + 60 * a * b * e * f + + 70 * b^2 * e * f + + 63 * c^2 * e * f + + 53 * b * e^2 * f + + 31 * c * e^2 * f + + 43 * e^3 * f + + 16 * a * b * f^2 + + 79 * b * c * f^2 + + 74 * b * d * f^2 + + 15 * b * e * f^2 + + 18 * c * e * f^2 + + 33 * b * f^3 + + 44 * c * f^3 + + 89 * a^4 * b + + 42 * a^3 * b^2 + + 39 * a * b^4 + + 43 * a * b^3 * c + + 36 * a^3 * c^2 + + 57 * a * b^2 * c^2 + + 10 * b^3 * c^2 + + 69 * a * c^4 + + 32 * b * c^4 + + 90 * c^5 + + 85 * a^4 * d + + 12 * a^3 * b * d + + 42 * a * b^3 * d + + 74 * a^3 * c * d + + 23 * a * b^2 * c * d + + 29 * a^2 * c * d^2 + + 57 * a * b * c * d^2 + + 62 * b^2 * c * d^2 + + 20 * b^2 * d^3 + + 14 * b * c * d^3 + + 62 * c^2 * d^3 + + 76 * a * d^4 + + b * d^4 + + 89 * a^2 * b^2 * e + + 79 * a * b^3 * e + + 2 * b^4 * e + + 27 * a^2 * b * c * e + + 4 * a * b * c^2 * e + + 17 * a * c^3 * e + + 55 * b * c^3 * e + + 35 * c^4 * e + + 21 * a * b^2 * d * e + + 43 * b^3 * d * e + + 60 * a * b * c * d * e + + 5 * b * c^2 * d * e + + 62 * a * b * d^2 * e + + 72 * b^2 * d^2 * e + + 60 * a * c * d^2 * e + + 90 * c^2 * d^2 * e + + 14 * a * d^3 * e + + 19 * d^4 * e + + 69 * a^3 * e^2 + + 42 * a^2 * b * e^2 + + 10 * a * b^2 * e^2 + + 69 * a * c^2 * e^2 + + 72 * b^2 * d * e^2 + + 58 * a * c * d * e^2 + + 29 * a^2 * e^3 + + 41 * a * b * e^3 + + 83 * a * c * e^3 + + 32 * b * c * e^3 + + 34 * a * d * e^3 + + 74 * d * e^4 + + 35 * e^5 + + 87 * a^2 * b^2 * f + + 86 * a^2 * b * c * f + + 14 * a * c^3 * f + + 8 * c^4 * f + + 87 * a^2 * b * d * f + + 81 * b^3 * d * f + + 69 * a * b * c * d * f + + 34 * c^3 * d * f + + 48 * a * b * d^2 * f + + 15 * b^2 * d^2 * f + + 47 * c^2 * d^2 * f + + 77 * b * d^3 * f + + 87 * a^3 * e * f + + 8 * a^2 * b * e * f + + 5 * a^2 * c * e * f + + 14 * a * b * c * e * f + + 42 * a * c * d * e * f + + 82 * b * c * d * e * f + + 11 * c^2 * d * e * f + + 55 * a * b * e^2 * f + + 74 * b * c * e^2 * f + + 28 * c^2 * e^2 * f + + 74 * b * d * e^2 * f + + 10 * a * e^3 * f + + 58 * d * e^3 * f + + 50 * a^2 * b * f^2 + + 61 * a * b * c * f^2 + + 25 * b * c^2 * f^2 + + 87 * c^3 * f^2 + + 70 * a^2 * d * f^2 + + 59 * a * b * d * f^2 + + 75 * a * c * d * f^2 + + 20 * c * d^2 * f^2 + + 51 * a * b * e * f^2 + + 4 * a * c * e * f^2 + + 51 * a * d * e * f^2 + + 14 * b * d * e * f^2 + + 83 * a * e^2 * f^2 + + 79 * b * e^2 * f^2 + + 80 * a^2 * f^3 + + 72 * a * c * f^3 + + 30 * b * c * f^3 + + 25 * c^2 * f^3 + + 33 * d^2 * f^3 + + 71 * a * e * f^3 + + 54 * c * e * f^3 + + 35 * e^2 * f^3, + 34 + + 72 * b + + 33 * e + + 45 * f + + 26 * a * c + + 58 * b * c + + 90 * c^2 + + 25 * a * d + + 29 * c * d + + 7 * b * e + + 78 * c * e + + 22 * e^2 + + 76 * a * f + + 12 * c * f + + 79 * d * f + + 70 * e * f + + 46 * b^2 * c + + 48 * b * c * d + + 51 * c^2 * d + + 54 * a * d^2 + + 55 * b * d^2 + + 28 * a^2 * e + + 21 * a * b * e + + 60 * a * c * e + + 40 * b * c * e + + 31 * c * d * e + + 25 * d^2 * e + + 10 * a * e^2 + + 30 * a^2 * f + + 76 * b * c * f + + 29 * c * d * f + + 35 * d^2 * f + + 8 * a * e * f + + 17 * b * e * f + + 2 * d * e * f + + 30 * e * f^2 + + 68 * f^3 + + 34 * a^3 * c + + 28 * a^2 * b * c + + 53 * b^3 * c + + 81 * b^2 * c^2 + + 4 * a * c^3 + + 58 * b * c^3 + + 82 * a * b^2 * d + + 87 * a^2 * c * d + + 26 * b^2 * c * d + + 17 * b * c^2 * d + + 56 * a * b * d^2 + + 79 * a * c * d^2 + + 84 * a^2 * c * e + + 77 * b^2 * c * e + + 66 * b * c^2 * e + + 89 * c^3 * e + + 73 * a * d^2 * e + + 73 * b * d^2 * e + + 23 * a * c * e^2 + + 47 * b * c * e^2 + + 27 * c^2 * e^2 + + 2 * a * d * e^2 + + 80 * d^2 * e^2 + + 9 * b * e^3 + + 78 * c * e^3 + + 86 * a * b^2 * f + + 38 * b * c^2 * f + + 53 * c^3 * f + + 30 * a * c * d * f + + 81 * d^3 * f + + 6 * a * b * e * f + + 59 * b^2 * e * f + + 75 * a * c * e * f + + 4 * c^2 * e * f + + 71 * d^2 * e * f + + 52 * b * e^2 * f + + 42 * a^2 * f^2 + + 33 * b^2 * f^2 + + 74 * a * d * f^2 + + 87 * b * d * f^2 + + 72 * d^2 * f^2 + + 56 * a * e * f^2 + + 75 * c * e * f^2 + + 59 * e^2 * f^2 + + 22 * a * f^3 + + 54 * c * f^3 + + 52 * a^2 * b^3 + + 40 * a^2 * b^2 * c + + 27 * a * b^3 * c + + 27 * b^4 * c + + 23 * a^3 * c^2 + + 5 * a^2 * b * c^2 + + 77 * a^2 * c^3 + + 54 * c^5 + + 3 * a^3 * b * d + + 2 * a * b^3 * d + + 55 * a^3 * c * d + + 25 * a^2 * c^2 * d + + 9 * b^2 * c^2 * d + + 52 * a * c^3 * d + + 32 * a^2 * b * d^2 + + 75 * a * b^2 * d^2 + + 64 * a^2 * c * d^2 + + 27 * b^2 * c * d^2 + + 12 * a^2 * d^3 + + 72 * b^2 * d^3 + + 89 * a * d^4 + + 42 * b * d^4 + + 63 * c * d^4 + + 32 * a^3 * c * e + + 12 * b^2 * c^2 * e + + 38 * b * c^3 * e + + 41 * b * c^2 * d * e + + 79 * a^2 * d^2 * e + + 24 * a * b * d^2 * e + + 88 * a * d^3 * e + + 13 * a * b * c * e^2 + + 3 * b^2 * c * e^2 + + 55 * a * c^2 * e^2 + + 68 * a * b * d * e^2 + + 88 * b^2 * d * e^2 + + 51 * a * c * d * e^2 + + 42 * b * c * d * e^2 + + 37 * c^2 * d * e^2 + + 78 * a * d^2 * e^2 + + 4 * c * d^2 * e^2 + + 68 * b * c * e^3 + + 34 * d^2 * e^3 + + 72 * a * e^4 + + 21 * c * e^4 + + 76 * d * e^4 + + 79 * e^5 + + 16 * a^4 * f + + 57 * a^3 * c * f + + 23 * b^3 * c * f + + 68 * a^2 * c^2 * f + + 78 * b^2 * c^2 * f + + 56 * a^2 * b * d * f + + 28 * a * b^2 * d * f + + 36 * b^3 * d * f + + 71 * a^2 * c * d * f + + 9 * a * b * c * d * f + + 49 * b^2 * c * d * f + + 20 * a * c^2 * d * f + + 71 * b * c^2 * d * f + + 74 * a^2 * d^2 * f + + 32 * a * b * d^2 * f + + 37 * b^2 * d^2 * f + + 2 * a * d^3 * f + + 39 * d^4 * f + + 20 * b^3 * e * f + + 9 * a * b * c * e * f + + 53 * b^2 * c * e * f + + 68 * a * c^2 * e * f + + 52 * c^3 * e * f + + 24 * a * b * d * e * f + + 9 * c^2 * d * e * f + + 49 * a * d^2 * e * f + + 81 * b * d^2 * e * f + + 72 * a^2 * e^2 * f + + 31 * a * b * e^2 * f + + 76 * b^2 * e^2 * f + + 36 * a * c * e^2 * f + + 32 * c^2 * e^2 * f + + 50 * c * d * e^2 * f + + 76 * c * e^3 * f + + 82 * e^4 * f + + 71 * a * b * c * f^2 + + 63 * a^2 * d * f^2 + + 3 * a * b * d * f^2 + + 17 * b^2 * d * f^2 + + 5 * b * c * d * f^2 + + 37 * b * d^2 * f^2 + + 79 * a * c * e * f^2 + + 27 * c^2 * e * f^2 + + 43 * a * d * e * f^2 + + 49 * b * d * e * f^2 + + 54 * c * d * e * f^2 + + 29 * a * e^2 * f^2 + + 4 * c * e^2 * f^2 + + e^3 * f^2 + + 82 * a^2 * f^3 + + a * b * f^3 + + 61 * b^2 * f^3 + + 67 * a * c * f^3 + + 9 * c^2 * f^3 + + 84 * a * d * f^3 + + 9 * a * e * f^3 + + 47 * b * e * f^3 + + 44 * d * e * f^3 + + 30 * e^2 * f^3 + + 50 * c * f^4 + + 76 * d * f^4 + + 8 * e * f^4 + + 24 * f^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 40 * b + + 36 * c + + 81 * b^2 + + 25 * b * c + + 19 * a * d + + 42 * b * d + + 24 * c * d + + 10 * c * e + + 43 * d * e + + 61 * e^2 + + 12 * c * f + + 3 * a^3 + + 16 * a^2 * c + + 60 * a * b * c + + 40 * c^3 + + 30 * a^2 * d + + 86 * a * c * d + + 23 * c^2 * d + + 71 * a * d^2 + + 19 * a * b * e + + 21 * a * c * e + + 43 * b * c * e + + 64 * a * d * e + + 8 * c * d * e + + 23 * c * e^2 + + 39 * d * e^2 + + 70 * b^2 * f + + 3 * a * c * f + + 40 * c * d * f + + 88 * a * e * f + + 63 * e^2 * f + + 80 * a * f^2 + + a * b^3 + + 37 * a * b^2 * c + + 6 * b^3 * c + + 71 * a^2 * c^2 + + 3 * a * b * c^2 + + 76 * b^2 * c^2 + + 90 * a * c^3 + + 79 * b * c^3 + + 3 * c^4 + + 86 * a * b^2 * d + + 76 * b^3 * d + + 34 * a^2 * c * d + + 64 * a * b * c * d + + 72 * a * c^2 * d + + 47 * a^2 * d^2 + + 27 * b^2 * d^2 + + 84 * a^3 * e + + 52 * b^2 * c * e + + 8 * a * c^2 * e + + 44 * b * c^2 * e + + 62 * c^3 * e + + 88 * c^2 * d * e + + 75 * a * d^2 * e + + 14 * c * d^2 * e + + 78 * a^2 * e^2 + + 70 * a * b * e^2 + + 71 * a * c * e^2 + + 80 * c^2 * e^2 + + 32 * d^2 * e^2 + + 83 * a * e^3 + + 45 * c * e^3 + + 77 * d * e^3 + + 76 * a^2 * b * f + + 82 * b^3 * f + + 22 * a * b * c * f + + 10 * a * c^2 * f + + 26 * b * c^2 * f + + 45 * a^2 * d * f + + 10 * a * b * d * f + + 59 * b^2 * d * f + + 34 * c^2 * d * f + + 42 * a^2 * e * f + + 59 * b^2 * e * f + + 50 * a * c * e * f + + 30 * a * b * f^2 + + 36 * b * d * f^2 + + 38 * b * f^3 + + 6 * e * f^3 + + 82 * a^4 * c + + 71 * a * b^3 * c + + a^3 * c^2 + + 36 * a^2 * b * c^2 + + 87 * a * b^2 * c^2 + + 6 * a^2 * c^3 + + 89 * a * b * c^3 + + 8 * a * c^4 + + 59 * b * c^4 + + 81 * a^4 * d + + 6 * a^3 * b * d + + 45 * a^3 * c * d + + 73 * a^2 * b * c * d + + 41 * b^3 * c * d + + 3 * a * b * c^2 * d + + 26 * b^2 * c^2 * d + + 42 * a * c^3 * d + + 37 * b * c^3 * d + + 44 * a^2 * b * d^2 + + 6 * a * b^2 * d^2 + + 87 * a^2 * c * d^2 + + 35 * a * c^2 * d^2 + + 71 * b * c^2 * d^2 + + 27 * c^3 * d^2 + + 67 * a * b * d^3 + + 76 * a * c * d^3 + + 57 * c^2 * d^3 + + 15 * a * d^4 + + 82 * b * d^4 + + 23 * a^3 * b * e + + 36 * a * b^3 * e + + 72 * a^2 * c^2 * e + + 53 * a * b * c^2 * e + + 20 * b * c^3 * e + + 9 * a^3 * d * e + + 86 * a * b^2 * d * e + + 81 * b^3 * d * e + + 29 * b^2 * c * d * e + + 56 * b * c^2 * d * e + + 74 * c^3 * d * e + + 79 * b^2 * d^2 * e + + 86 * b * c * d^2 * e + + 49 * c^2 * d^2 * e + + 2 * a * d^3 * e + + 13 * b * d^3 * e + + 73 * c * d^3 * e + + 17 * a^3 * e^2 + + 47 * a^2 * b * e^2 + + 33 * a * b^2 * e^2 + + 15 * a^2 * c * e^2 + + 17 * a * b * c * e^2 + + 25 * b^2 * c * e^2 + + 46 * a^2 * d * e^2 + + 31 * b^2 * d * e^2 + + 36 * a * c * d * e^2 + + 39 * c^2 * d * e^2 + + 23 * b * d^2 * e^2 + + 86 * c * d^2 * e^2 + + 68 * a^2 * e^3 + + 31 * a * c * e^3 + + 20 * c^2 * e^3 + + 5 * a * d * e^3 + + 28 * c * d * e^3 + + 59 * b^2 * c^2 * f + + 68 * a * c^3 * f + + 75 * b * c^3 * f + + 5 * c^4 * f + + 56 * a^2 * c * d * f + + 28 * b^2 * c * d * f + + 44 * a * c^2 * d * f + + 44 * b^2 * d^2 * f + + 15 * a * d^3 * f + + 83 * b * d^3 * f + + 58 * a^3 * e * f + + 77 * a * b^2 * e * f + + 37 * a * c^2 * e * f + + 6 * b * c^2 * e * f + + 25 * c^3 * e * f + + 54 * a^2 * d * e * f + + 33 * a * b * e^2 * f + + 40 * b^2 * e^2 * f + + 87 * a * c * e^2 * f + + 10 * c^2 * e^2 * f + + 90 * a * d * e^2 * f + + 87 * b * d * e^2 * f + + 57 * d^2 * e^2 * f + + 82 * d * e^3 * f + + 65 * e^4 * f + + 60 * b^2 * c * f^2 + + 48 * a^2 * d * f^2 + + 39 * a * c * d * f^2 + + 48 * a^2 * e * f^2 + + 30 * a * b * e * f^2 + + 7 * a * c * e * f^2 + + 27 * c * d * e * f^2 + + 25 * a * e^2 * f^2 + + 41 * d * e^2 * f^2 + + 80 * e^3 * f^2 + + 71 * b^2 * f^3 + + 9 * c^2 * f^3 + + 64 * a * d * f^3 + + 47 * c * d * f^3 + + 40 * a * e * f^3 + + 20 * c * e * f^3 + + 14 * d * e * f^3 + + 20 * a * f^4 + + 47 * e * f^4, + 65 + + 43 * a + + 13 * c + + 66 * e + + 26 * a * b + + 8 * c * d + + 83 * d * e + + 85 * d * f + + 79 * e * f + + 19 * a^2 * b + + 39 * c^3 + + 14 * a * c * d + + 43 * c^2 * d + + 79 * a * d^2 + + 41 * c * d^2 + + 80 * d^3 + + 4 * a * b * e + + 72 * b^2 * e + + 5 * b * c * e + + 84 * c * d * e + + 21 * b * e^2 + + 5 * e^3 + + 61 * b^2 * f + + 30 * a * c * f + + 80 * c^2 * f + + 22 * b * d * f + + 15 * d * e * f + + 8 * a * f^2 + + 19 * b * f^2 + + 39 * d * f^2 + + 43 * a^4 + + 16 * a * b^3 + + 15 * a^3 * c + + 34 * a^2 * b * c + + 81 * a^2 * c^2 + + 10 * a * b * c^2 + + 30 * b^2 * c^2 + + 83 * a * c^3 + + 82 * a^3 * d + + 14 * a^2 * b * d + + 10 * a * b^2 * d + + 2 * b^3 * d + + 88 * a^2 * c * d + + 60 * c^3 * d + + 9 * a * b * d^2 + + 60 * b^2 * d^2 + + 34 * a * c * d^2 + + 36 * b * c * d^2 + + 59 * b * d^3 + + 38 * b^3 * e + + 59 * a^2 * c * e + + 81 * a * c^2 * e + + 56 * b * c^2 * e + + 87 * c^3 * e + + 6 * a^2 * d * e + + 40 * b * d^2 * e + + 35 * a^2 * e^2 + + 56 * a * b * e^2 + + 17 * b^2 * e^2 + + 75 * a * d * e^2 + + 3 * b * e^3 + + 17 * e^4 + + 33 * a^3 * f + + 68 * b^3 * f + + 65 * a^2 * c * f + + 53 * b^2 * c * f + + 45 * a * c^2 * f + + 36 * b * c^2 * f + + 5 * b^2 * d * f + + 7 * b * c * d * f + + 55 * c^2 * d * f + + 41 * a * d^2 * f + + 79 * d^3 * f + + 11 * a * b * e * f + + 84 * b^2 * e * f + + 78 * b * c * e * f + + 46 * b * d * e * f + + 10 * a * e^2 * f + + 39 * c * e^2 * f + + 74 * b^2 * f^2 + + 27 * b * d * f^2 + + 77 * c * d * f^2 + + c * e * f^2 + + 9 * e^2 * f^2 + + 59 * b * f^3 + + 18 * c * f^3 + + 20 * e * f^3 + + 62 * f^4 + + 22 * a^5 + + 24 * a^4 * b + + 73 * a^2 * b^2 * c + + 62 * b^4 * c + + 34 * a^3 * c^2 + + 71 * a^2 * b * c^2 + + 10 * a^2 * c^3 + + 53 * a * b * c^3 + + 2 * b * c^4 + + 29 * a^4 * d + + 54 * a^3 * c * d + + 40 * b^3 * c * d + + 65 * a^2 * c^2 * d + + 72 * a * b * c^2 * d + + 80 * b^2 * c^2 * d + + 64 * a * c^3 * d + + 59 * b * c^3 * d + + 13 * a^2 * b * d^2 + + 26 * a * b^2 * d^2 + + 20 * b * c^2 * d^2 + + 9 * a * c * d^3 + + 18 * c^2 * d^3 + + 59 * a * d^4 + + 50 * a^4 * e + + 67 * a^2 * b^2 * e + + 68 * a * b^3 * e + + 38 * b^4 * e + + 19 * a^2 * b * c * e + + 7 * a * b^2 * c * e + + 15 * b^3 * c * e + + 23 * a * b * c^2 * e + + 49 * b^2 * c^2 * e + + 63 * c^4 * e + + 25 * b^3 * d * e + + 10 * a^2 * c * d * e + + 8 * c^3 * d * e + + 14 * a * b * d^2 * e + + 27 * b * c * d^2 * e + + 80 * d^4 * e + + 60 * b^3 * e^2 + + 11 * a * b * d * e^2 + + 37 * b^2 * d * e^2 + + 71 * b * c * d * e^2 + + 86 * c^2 * d * e^2 + + 86 * b * d^2 * e^2 + + 12 * c * d^2 * e^2 + + 83 * b^2 * e^3 + + 19 * a * c * e^3 + + 32 * b * c * e^3 + + 63 * b * d * e^3 + + 59 * c * d * e^3 + + 82 * c * e^4 + + 74 * e^5 + + 68 * a^3 * b * f + + 30 * b^4 * f + + 85 * a^3 * c * f + + 45 * a^2 * c^2 * f + + 39 * b^2 * c^2 * f + + 71 * b * c^3 * f + + 73 * c^4 * f + + 4 * b^3 * d * f + + 78 * a^2 * c * d * f + + 83 * b^2 * c * d * f + + 7 * a * c^2 * d * f + + 6 * c^3 * d * f + + 3 * a^2 * d^2 * f + + 88 * b^2 * d^2 * f + + 35 * a * c * d^2 * f + + 40 * b * c * d^2 * f + + 52 * c^2 * d^2 * f + + 58 * d^4 * f + + 35 * a^3 * e * f + + 54 * a^2 * c * e * f + + 90 * b * c^2 * e * f + + 66 * a * b * d * e * f + + 40 * a * c * d * e * f + + 2 * b * c * d * e * f + + 81 * c * d^2 * e * f + + 53 * d^3 * e * f + + 9 * a^2 * e^2 * f + + 23 * b * d * e^2 * f + + 42 * a * e^3 * f + + 21 * c * e^3 * f + + 18 * b^3 * f^2 + + 49 * a^2 * c * f^2 + + 68 * a * c^2 * f^2 + + 90 * b * c^2 * f^2 + + 36 * c^3 * f^2 + + 59 * a * b * d * f^2 + + 34 * b^2 * d * f^2 + + 56 * b * c * d * f^2 + + 4 * b * d^2 * f^2 + + 28 * a^2 * e * f^2 + + 54 * b^2 * e * f^2 + + 80 * a * c * e * f^2 + + 56 * d^2 * e * f^2 + + 68 * b * e^2 * f^2 + + 21 * c * e^2 * f^2 + + 78 * b^2 * f^3 + + 5 * b * c * f^3, + 35 + + 32 * a + + 8 * b + + 27 * f + + 35 * a^2 + + 11 * a * b + + 67 * b^2 + + 51 * a * c + + 78 * b * c + + 65 * c^2 + + 7 * a * d + + 22 * a * e + + 15 * b * e + + 19 * c * f + + 43 * e * f + + 67 * f^2 + + 23 * a^3 + + 36 * a * b * c + + 62 * b^2 * c + + 74 * a * b * d + + 90 * b^2 * d + + 62 * a * c * d + + 14 * b * c * d + + 12 * a * d^2 + + 76 * c * d^2 + + 79 * d^3 + + 34 * a * b * e + + 23 * b^2 * e + + 3 * a * c * e + + 89 * b * c * e + + 85 * a * d * e + + 78 * b * d * e + + 78 * c * d * e + + 28 * d^2 * e + + 75 * a * e^2 + + 7 * d * e^2 + + 39 * b * c * f + + 50 * d^2 * f + + 79 * c * e * f + + 80 * e^2 * f + + 60 * b * f^2 + + 27 * f^3 + + 2 * a^3 * b + + 59 * a^3 * c + + 31 * a^2 * b * c + + 53 * a * b^2 * c + + 19 * b^3 * c + + 58 * a^2 * c^2 + + 16 * b * c^3 + + 38 * c^4 + + 31 * a^3 * d + + 39 * a^2 * b * d + + 38 * a^2 * c * d + + 32 * b * c * d^2 + + 5 * a * d^3 + + 58 * a * b^2 * e + + 4 * a^2 * c * e + + 3 * b^2 * c * e + + 3 * b * c * d * e + + 11 * c^2 * d * e + + 88 * c * d^2 * e + + 46 * a * b * e^2 + + 75 * a * d * e^2 + + 15 * b * e^3 + + 58 * c * e^3 + + 57 * d * e^3 + + 28 * a * b^2 * f + + 14 * b^3 * f + + 26 * a^2 * c * f + + 53 * a * b * d * f + + 6 * b * c * d * f + + 78 * c * d^2 * f + + 37 * d^3 * f + + 34 * a^2 * e * f + + 63 * a * b * e * f + + 5 * c * d * e * f + + 42 * d^2 * e * f + + 37 * a * e^2 * f + + 23 * c * e^2 * f + + 33 * a * b * f^2 + + 77 * b^2 * f^2 + + 70 * b * c * f^2 + + 9 * a * d * f^2 + + 66 * d^2 * f^2 + + 14 * a * e * f^2 + + 63 * e^2 * f^2 + + 2 * b * f^3 + + 82 * c * f^3 + + 9 * a^5 + + 4 * a * b^4 + + 30 * b^5 + + 31 * a^3 * b * c + + 30 * a^2 * b^2 * c + + 39 * a * b * c^3 + + 82 * b * c^4 + + 8 * a^4 * d + + 44 * b^4 * d + + 8 * a^2 * b * c * d + + 28 * b^2 * c^2 * d + + 9 * a * c^3 * d + + 32 * a^2 * b * d^2 + + 16 * a * b^2 * d^2 + + 21 * b^3 * d^2 + + 25 * a * b * c * d^2 + + 42 * a * d^4 + + 41 * b * d^4 + + 79 * d^5 + + 4 * b^3 * c * e + + 2 * a * c^3 * e + + 26 * a^2 * b * d * e + + 82 * b^2 * c * d * e + + 88 * a * c^2 * d * e + + 73 * a * b * d^2 * e + + 56 * b * c * d^2 * e + + 19 * c^2 * d^2 * e + + 70 * b * d^3 * e + + 88 * d^4 * e + + 78 * a * b^2 * e^2 + + 62 * b * c^2 * e^2 + + 79 * c^3 * e^2 + + 65 * a * b * d * e^2 + + 53 * b^2 * d * e^2 + + 60 * a * c * d * e^2 + + 60 * c^2 * d * e^2 + + 18 * b * d^2 * e^2 + + 12 * a^2 * e^3 + + 12 * b^2 * e^3 + + 37 * b * c * e^3 + + 54 * d^2 * e^3 + + 69 * b * e^4 + + 89 * c * e^4 + + 6 * d * e^4 + + 79 * e^5 + + 40 * a^4 * f + + 25 * a^3 * b * f + + 71 * a * b^3 * f + + 74 * b^4 * f + + 76 * a^3 * c * f + + 64 * a * b^2 * c * f + + 21 * a^2 * c^2 * f + + 26 * b^2 * c^2 * f + + 12 * a * c^3 * f + + 28 * a^2 * b * d * f + + 65 * a * b^2 * d * f + + 44 * b^3 * d * f + + 4 * a * c^2 * d * f + + 68 * b * c * d^2 * f + + 12 * b * d^3 * f + + 76 * d^4 * f + + 34 * a^2 * b * e * f + + 50 * a * b^2 * e * f + + 55 * b^3 * e * f + + 34 * a * b * c * e * f + + 38 * c^3 * e * f + + 50 * a^2 * d * e * f + + 62 * a * b * d * e * f + + 68 * a * c * d * e * f + + 47 * a^2 * e^2 * f + + 11 * c^2 * e^2 * f + + 10 * b * d * e^2 * f + + 68 * c * d * e^2 * f + + 65 * d * e^3 * f + + 83 * a^2 * b * f^2 + + 39 * b * c^2 * f^2 + + 21 * c^3 * f^2 + + 9 * a * b * d * f^2 + + 64 * b * c * d * f^2 + + 85 * a^2 * e * f^2 + + 51 * a * b * e * f^2 + + 51 * b^2 * e * f^2 + + 28 * c^2 * e * f^2 + + 43 * b * d * e * f^2 + + 29 * c * d * e * f^2 + + 84 * d * e^2 * f^2 + + 59 * e^3 * f^2 + + 2 * a * c * f^3 + + b * d * f^3 + + 90 * d * e * f^3 + + 16 * e^2 * f^3 + + 8 * a * f^4 + + 7 * b * f^4 + + 46 * c * f^4 + + 49 * d * f^4 + + 31 * e * f^4, + ], + ), + ) + for i in ideals + runb("sparseid(3,0,5,100-(4*10),90)", i, S) + end + ideals = [] + + prinln("Completed examples.") +end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl new file mode 100644 index 000000000..99cd5ac7d --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl @@ -0,0 +1,225 @@ +include("GroebnerWalkUtilitysFinal.jl") + +#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) +#Maybe not needed +mutable struct MonomialOrder{ + T<:Matrix{Int64}, + v<:Vector{Int64}, + tv<:Vector{Int64}, +} + m::T + w::v + t::tv +end +#= +@doc Markdown.doc""" + convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} +Given a Vector{Number} $v$ this function computes a Vector{Int64} w with w = v*gcd(v). +"""=# +function convert_bounding_vector(v::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(v) + push!(w, float(divexact(v[i], gcd(v)))) + end + return w +end + +#= +@doc Markdown.doc""" +function inCone( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + t::Vector{Int64}, +) +Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. +"""=# +function inCone( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + t::Vector{Int64}, +) + R = change_order(G.base_ring, T.t, T.m) + I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end + +#= +@doc Markdown.doc""" +function lift_fractal_walk( + G::Singular.sideal, + Gw::Singular.sideal, + R::Singular.PolyRing, + S::Singular.PolyRing, +) +Performs a lifting step in the Groebner Walk. See Fukuda et. al. +"""=# +function lift_fractal_walk( + G::Singular.sideal, + Gw::Singular.sideal, + R::Singular.PolyRing, + Rn::Singular.PolyRing, +) + G.isGB = true + rest = [ + change_ring(gen, Rn) - + change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for + gen in Singular.gens(Gw) + ] + G = Singular.Ideal(Rn, [Rn(x) for x in rest]) + G.isGB = true + return G +end + +#returns ´true´ if all polynomials of the array are monomials. +function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 1 + return false + end + end + return true +end + +#returns ´true´ if all polynomials of the array are binomial or less. +function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return false + end + end + return true +end + + +function nextT( + G::Singular.sideal, + w::Array{T,1}, + tw::Array{K,1}, +) where {T<:Number,K<:Number} + if (w == tw) + return [0] + end + tmin = 2 + t = 0 + for g in gens(G) + a = Singular.leading_exponent_vector(g) + d = Singular.exponent_vectors(tail(g)) + for v in d + frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) + if frac != 0 + t = (dot(w, a) - dot(w, v)) // frac + end + if t > 0 && t < tmin + tmin = t + end + end + end + if tmin <= 1 + return tmin + else + return [0] + end +end + +function change_order( + R::Singular.PolyRing, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) where {L<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(T.w) * Singular.ordering_M(T.m), + ) + return S +end + +function pertubed_vector( + G::Singular.sideal, + Mo::MonomialOrder{Matrix{Int64}}, + t::Vector{Int64}, + p::Integer, +) + if t == Mo.m[1, :] + M = Mo.m + else + M = insert_weight_vector(t, Mo.m) + end + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + return w +end + +function pertubed_vector( + G::Singular.sideal, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + p::Integer, +) + m = [] + if T.t == T.m[1, :] + M = T.m + else + M = insert_weight_vector(T.t, T.m) + end + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + return w +end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl new file mode 100644 index 000000000..67cbcc5e9 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl @@ -0,0 +1,286 @@ +include("GroebnerWalkUtilitysFinal.jl") + +############################################################### +#Utilitys for generic_walk +############################################################### + +#Return the facet_facet_facet_initials of polynomials w.r.t. a weight vector. +function facet_initials( + G::Singular.sideal, + lm::Vector{spoly{L}}, + v::Vector{Int64}, +) where {L<:Nemo.RingElem} + Rn = base_ring(G) + initials = Array{Singular.elem_type(Rn),1}(undef, 0) + count = 1 + for g in Singular.gens(G) + inw = Singular.MPolyBuildCtx(Rn) + el = first(Singular.exponent_vectors(lm[count])) + for (e, c) in + zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + if el == e || isParallel(el - e, v) + Singular.push_term!(inw, c, e) + end + end + h = finish(inw) + push!(initials, h) + count += 1 + end + return initials +end + +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. +function difference_lead_tail( + I::Singular.sideal, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + v = Vector{Int}[] + for i = 1:ngens(I) + ltu = Singular.leading_exponent_vector(Lm[i]) + for e in Singular.exponent_vectors(gens(I)[i]) + if ltu != e + push!(v, ltu .- e) + end + end + end + return unique!(v) +end + +# +function isParallel(u::Vector{Int64}, v::Vector{Int64}) + count = 1 + x = 0 + for i = 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + if v[i] != x * u[i] + return false + end + end + return true +end + +#lifting step of the generic_walk +function lift_generic( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + H::Singular.sideal, +) where {L<:Nemo.RingElem} + Rn = base_ring(G) + Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) + liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) + for g in Singular.gens(H) + r, b = modulo(g, gens(G), Lm) + diff = g - r + if diff != 0 + push!(Newlm, Singular.leading_term(g)) + push!(liftPolys, diff) + end + end + return liftPolys, Newlm +end + +function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) + btz = Set{Vector{Int64}}() + for v in V + if bigger_than_zero(S, v) + push!(btz, v) + end + end + return btz +end + +function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) + btz = Set{Vector{Int64}}() + for v in V + if less_than_zero(S, v) + push!(btz, v) + end + end + return btz +end +function filter_lf( + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, + V::Set{Vector{Int64}}, +) + btz = Set{Vector{Int64}}() + for v in V + if less_facet(w, v, S, T) + push!(btz, v) + end + end + return btz +end + +#return the next facet_normal. +function next_gamma( + G::Singular.sideal, + Lm::Vector{spoly{L}}, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) where {L<:Nemo.RingElem} + V = filter_btz(S, difference_lead_tail(G, Lm)) + V = filter_ltz(T, V) + if (w != [0]) + V = filter_lf(w, S, T, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v + end + end + return minV +end + +#return the next facet_normal. +function next_gamma( + G::Singular.sideal, + w::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + V = filter_btz(S, difference_lead_tail(G)) + V = filter_ltz(T, V) + if (w != [0]) + V = filter_lf(w, S, T, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if less_facet(v, minV, S, T) + minV = v + end + end + return minV +end + +function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + for i = 1:size(M)[1] + d = dot(M[i, :], v) + if d != 0 + return d > 0 + end + end + return false +end + +function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) + nrows, ncols = size(M) + for i = 1:nrows + d = 0 + for j = 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d < 0 + end + end + return false +end + +function less_facet( + u::Vector{Int64}, + v::Vector{Int64}, + S::Matrix{Int64}, + T::Matrix{Int64}, +) + for i = 1:size(T)[1] + for j = 1:size(S)[1] + Tuv = dot(T[i, :], u) * dot(S[j, :], v) + Tvu = dot(T[i, :], v) * dot(S[j, :], u) + if Tuv != Tvu + return Tuv < Tvu + end + end + end + return false +end + +#returns divrem() +function divremGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) + div = false + newpoly = Singular.MPolyBuildCtx(S) + for term in Singular.terms(p) + (b, c) = Singular.divides(term, lm) + if b + push_term!( + newpoly, + first(Singular.coefficients(c)), + first(Singular.exponent_vectors(c)), + ) + div = true + end + end + return (finish(newpoly), div) +end + +function modulo( + p::Singular.spoly, + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, + c::Bool = false, +) where {L<:Nemo.RingElem} + I = 0 + R = parent(p) + Q = zero(R) + for i = 1:length(G) + (q, b) = divremGW(p, Lm[i], R) + if b + I = i + Q = q + break + end + end + if I != 0 + r, b = modulo(p - (Q * G[I]), G, Lm) + return r, true + else + return p, false + end +end + +function interreduce( + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + Rn = parent(first(G)) + for i = 1:Singular.length(G) + gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) + Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) + for j = 1:length(G) + if i != j + push!(gensrest, G[j]) + push!(Lmrest, Lm[j]) + end + end + r, b = modulo(G[i], gensrest, Lmrest) + if b + G[i] = r + end + end + return G +end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl new file mode 100644 index 000000000..0e9f62936 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -0,0 +1,942 @@ +include("GroebnerWalkUtilitysFinal.jl") +include("FractalWalkUtilitysFinal.jl") +include("GenericWalkUtilitysFinal.jl") +include("StandardWalkUtilitysFinal.jl") +include("TranWalkUtilitysFinal.jl") +using BenchmarkTools +BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 +export groebnerwalk +a="-" +b="-" +z ="-" +c="-" +d="-" +e="-" +f="-" +g="-" +h="-" +i="-" +j="-" +k="-" +l="-" +function cleardf() + global a="-" + global b="-" + global c="-" + global d="-" + global e="-" + global f="-" + global g="-" + global h="-" + global i="-" + global j="-" + global k="-" + global l="-" + global z ="-" +end + +############################################################### +#Implementation of the gröbner walk. +############################################################### + +#for counting the steps of the groebnerwalk. +counter = 0 +function getCounter() + global counter + temp = counter + counter = 0 + return temp +end +#= +@doc Markdown.doc""" +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) +Given an Ideal G generated by a reduced Groebner Basis w.r.t. the monomial ordering S this function +returns a reduced Groebner Basis w.r.t. the monomial ordering T by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart et al. (1993) +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). +Pertubed Walk (:pertubed, with p = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. +Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that T represents the lex ordering. Pertubes only the target vector. +Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. +"""=# +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) + if grwalktype == :standard + walk = (x, y, z) -> standard_walk(x, y, z) + elseif grwalktype == :generic + walk = (x, y, z) -> generic_walk(x, y, z) + elseif grwalktype == :pertubed + walk = (x, y, z) -> pertubed_walk(x, y, z, p) + elseif grwalktype == :fractal + walk = + (x, y, z) -> fractal_walk( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_start_order + walk = + (x, y, z) -> fractal_walk_start_order( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_lex + walk = + (x, y, z) -> fractal_walk_lex( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_look_ahead + walk = + (x, y, z) -> fractal_walk_look_ahead( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :tran + walk = (x, y, z) -> tran_walk(x, y, z) + elseif grwalktype == :fractal_combined + walk = + (x, y, z) -> fractal_walk_combined( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + end + + ######TODO:Check the parameter##### + R = base_ring(G) + I = Singular.Ideal(R, [R(x) for x in gens(G)]) + + Gb = walk(I, S, T) + println("Cones crossed: ", getCounter()) + + S = change_order(Gb.base_ring, T) + return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) +end + + +function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + println("standard_walk results") + println("Crossed Cones in: ") + standard_walk(G, S, T, S[1, :], T[1, :]) +end + +function standard_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, +) + R = base_ring(G) + Rn = change_order(R, cweight, T) + terminate = false + while !terminate + global counter = getCounter() + 1 + println(cweight) + global b = cweight + G = standard_step(G, R, cweight, Rn) + if cweight == tweight + terminate = true + else + global a = @belapsed next_weight($G, $cweight, $tweight) + cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) + end + end + return G +end + +function standard_step( + G::Singular.sideal, + R::Singular.PolyRing, + cw::Vector{Int64}, + Rn::Singular.PolyRing +) +global z = length(Singular.gens(G)) + + +global c = @belapsed initials($Rn, gens($G), $cw) + + Gw = initials(Rn, gens(G), cw) + global d= @belapsed Singular.std( + Singular.Ideal($Rn, $Gw), + complete_reduction = true, + ) + + H = Singular.std( + Singular.Ideal(Rn, Gw), + complete_reduction = true, + ) + + + global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) + global f= @belapsed lift($G, $R, $H, $Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + global g = @belapsed Singular.std($H, complete_reduction = true) + + df = DataFrame(a=[a], b = [b],z=[z] c = [c], d = [d], e = [e], f = [f],g=[g], h=[counter]) + cleardf() + savea(df,"standardWalk.txt") + return Singular.std(H, complete_reduction = true) +end +############################## +#just for benchmark###### +############################# +function standard_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + println("standard_walk results") + println("Crossed Cones in: ") + standard_walk2(G, S, T, S[1, :], T[1, :]) +end + +function standard_walk2( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, + k::Int64, +) +R = base_ring(G) +Rn = change_order(R, cweight, T) +terminate = false +while !terminate + global counter = getCounter() + 1 + println(cweight) + global b = cweight + G = standard_step2(G, R, cweight, Rn) + df = DataFrame(a=[a], b = [b], z=[z], c = [c], d = [d], e = [e], f=[f],g=[g],h=[h], i=[i], j =[j], k=[k],l=[l]) + cleardf() + savea(df,"pertubedWalk.txt",k) + if cweight == tweight + terminate = true + else + global a = @belapsed next_weight($G, $cweight, $tweight) + cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) + end +end +return G +end + +function standard_step2( + G::Singular.sideal, + R::Singular.PolyRing, + cw::Vector{Int64}, + Rn::Singular.PolyRing +) +global z = length(Singular.gens(G)) + + +global c = @belapsed initials($Rn, gens($G), $cw) + Gw = initials(Rn, gens(G), cw) + + global d= @belapsed Singular.std( + Singular.Ideal($Rn, $Gw), + complete_reduction = true, + ) + + H = Singular.std( + Singular.Ideal(Rn, Gw), + complete_reduction = true, + ) + + + global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) + global f= @belapsed lift($G, $R, $H, $Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + global g = @belapsed Singular.std($H, complete_reduction = true) + + return Singular.std(H, complete_reduction = true) +end +############################################################### +#Generic-version of the groebner walk by Fukuda et al. (2007) +############################################################### + +function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + R = base_ring(G) + Rn = change_order(G.base_ring, T) + global a =@belapsed next_gamma($G, $[0], $S, $T) + v = next_gamma(G, [0], S, T) + Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) + + println("generic_walk results") + println("Crossed Cones with facetNormal: ") + while !isempty(v) + global counter = getCounter() + 1 + global b = v + println(v) + G, Lm = generic_step(G, Lm, v, T,R) + df = DataFrame(a = [a], b = [b],z=[z], c = [c], d=[d], e=[e],f=[f],g=[g]) + savea(df, "genericWalk.txt") + cleardf() + global a = @belapsed next_gamma($G, $Lm, $v, $S, $T) + v =next_gamma(G, Lm, v, S, T) + end + return Singular.interreduce(G) +end + +function generic_step( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + v::Vector{Int64}, + T::Matrix{Int64}, + R::Singular.PolyRing +) where {L<:Nemo.RingElem} +global z = length(Singular.gens(G)) + + + Rn = Singular.base_ring(G) + global c =@belapsed facet_initials($G,$Lm, $v) + facet_Generators = facet_initials(G,Lm, v) + global d= @belapsed Singular.std( + Singular.Ideal($Rn, facet_Generators), + complete_reduction = true, + ) + H = Singular.std( + Singular.Ideal(Rn, facet_Generators), + complete_reduction = true, + ) + global e = @belapsed lift_generic($G, $Lm, $H) + H, Lm = lift_generic(G, Lm, H) + global f= @belapsed interreduce($H, $Lm) + G = interreduce(H, Lm) + G = Singular.Ideal(Rn, G) + G.isGB = true + return G, Lm +end + + +############################################################### +#Pertubed-version of the groebner walk Amrhein et al. +############################################################### +function pertubed_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + p::Int64, +) +k=p +df = DataFrame(a=["-"], b = ["-"],z=["-"] c = ["-"], d = ["-"], e = ["-"], f = ["-"], g=["-"], h=["-"], i=[(p,p)], j=["-"]) +savea(df, "pertubedWalk.txt",k) + #cweight = pertubed_vector(G, S, p) + cweight = S[1, :] + terminate = false + println("pertubed_walk results") + println("Crossed Cones in: ") + + while !terminate + global h = @belapsed pertubed_vector($G, $T, $p) + tweight = pertubed_vector(G, T, p) + G = standard_walk2(G, S, T, cweight, tweight,k) + + if inCone(G, T, tweight) + global i = @belapsed inCone($G, $T, $tweight) + terminate = true + else + if p == 1 + R = change_order(G.base_ring, T) + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + global j= @belapsed Singular.std($G, complete_reduction = true) + G = Singular.std(G, complete_reduction = true) + terminate = true + end + p = p - 1 + cweight = tweight + end + df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k],l=[l]) + savea(df, "pertubedWalk.txt",k) + cleardf() + end + return G +end + +############################################################### +#fractal-walk by Amrhein et al. +#Inlcuding: +#fractal_walk -> standard-version +#fractal_walk2 -> checks if the starting weight is in the inner of a cone. +#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. +# checks if the starting weight is in the inner of a cone. +############################################################### + +######################################## +#Counter for the steps in the fractal_walk +######################################## +counterFr = 0 +function deleteCounterFr() + global counterFr + temp = counterFr + counterFr = 0 + return temp +end +function getCounterFr() + global counterFr + return counterFr +end +function raiseCounterFr() + global counterFr = getCounterFr() + 1 +end +PertVecs = [] +sigma = [] + +function fractal_walk( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println(PertVecs) + println("FacrtalWalk_standard results") + println("Crossed Cones in: ") + Gb = fractal_recursiv(G, S,T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_recursiv( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + terminate = false + G.isGB = true + w = S.w + h= "-" + i="-" + while !terminate + a = @belapsed nextT($G, $w, $PertVecs[p]) + t = nextT(G, w, PertVecs[p]) + if (t == [0]) + if inCone(G, T,PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) + return G + else + i = @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + b = w + T.w = w + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @belapsed initials($R, Singular.gens($G), $w) + Gw = initials(R, Singular.gens(G), w) + if p == nvars(R) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + H = fractal_recursiv( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + end + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) + f = @belapsed lift($G, $R, $H, $Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + g = @belapsed Singular.std($H, complete_reduction = true) + G = Singular.std(H, complete_reduction = true) + R = Rn + j = p + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"fractalWalk.txt") + end + return G +end + +cwPert = [] +firstStepMode = false +function cwpert(p::Int64) + cwPert[p] +end + +function fractal_walk_start_order( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + global sigma = S.w + println("fractal_walk_withStartorder results") + println("Crossed Cones in: ") + Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_recursiv_startorder( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + h= "-" + i="-" + while !terminate + a = @belapsed nextT($G, $w, $PertVecs[p]) + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) + println(PertVecs[p], " in depth", p) + return G + else + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @belapsed initials($R, Singular.gens($G), $w) + Gw = initials(R, gens(G), w) + if p == Singular.nvars(R) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + complete_reduction = true, + ) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk_recursiv_startorder( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) + f = @belapsed lift($G, $R, $H, $Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + g = @belapsed Singular.std($H, complete_reduction = true) + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"fractalWalkstartorder.txt") + R = Rn + end + return G +end +function fractal_walk_lex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println("fractal_walk_lex results") + println("Crossed Cones in: ") + Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_recursive_lex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = S.w + h= "-" + i="-" + while !terminate + a = @belapsed nextT($G, $w, $PertVecs[p]) + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) + return G + else + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] + println(PertVecs) + continue + end + end + if t == 1 && p==1 + return fractal_walk_recursive_lex( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @belapsed initials($R, Singular.gens($G), $w) + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + complete_reduction = true, + ) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk_recursive_lex( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) + f = @belapsed lift($G, $R, $H, $Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + g = @belapsed Singular.std($H, complete_reduction = true) + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b],z=[z] c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"fractalWalklex.txt") + R = Rn + end + return G +end +function fractal_walk_look_ahead( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + println("fractal_walk_look_ahead results") + println("Crossed Cones in: ") + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_look_ahead_recursiv( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = S.w + h= "-" + i="-" + while !terminate + a = @belapsed nextT($G, $w, $PertVecs[p]) + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) + return G + else + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @belapsed initials($R, Singular.gens($G), $w) + Gw = initials(R, Singular.gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + complete_reduction = true, + ) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk_look_ahead_recursiv( + Singular.Ideal(R, Gw), + S, + T, + PertVecs, + p + 1, + ) + end + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) + f = @belapsed lift($G, $R, $H, $Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R H, Rn) + g = @belapsed Singular.std($H, complete_reduction = true) + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"fractalWalklookahead.txt") + R = Rn + end + return G +end + + + + +function fractal_walk_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + println("fractal_walk_withStartorder results") + println("Crossed Cones in: ") + Gb = fractal_walk_combined(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + h= "-" + i="-" + while !terminate + a = @belapsed nextT($G, $w, $PertVecs[p]) + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) + println(PertVecs[p], " in depth", p) + return G + else + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + if t == 1 && p==1 + return fractal_walk_combined( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @belapsed initials($R, Singular.gens($G), $w) + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + complete_reduction = true, + ) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) + f = @belapsed lift($G, $R, $H, $Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + g = @belapsed Singular.std($H, complete_reduction = true) + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b],z=[z] c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"fractalWalkcombined.txt") + R = Rn + end + return G +end + +############################################################### +#Tran-version of the groebner walk by Tran (2002) +############################################################### + +function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + cweight = S[1, :] + tweight = T[1, :] + println("tran_walk results") + println("Crossed Cones in: ") + R = base_ring(G) + if !isMonomial(initials(R, Singular.gens(G), cweight)) + cweight = pertubed_vector(G, S, nvars(R)) + end + + terminate = false + while !terminate + global a = @belapsed next_weight($G, $cweight, $tweight) + w = next_weight(G, cweight, tweight) + if tryparse(Int32, string(w)) == nothing + println("w bigger than int32") + return G + end + Rn= change_order(R, w, T) + if w == tweight + if inCone(G, T, cweight) + global i = @belapsed inCone($G, $T, $cweight) + return G + else + if inSeveralCones(initials(base_ring(G), gens(G), w)) + global j = @belapsed inSeveralCones(initials(base_ring($G), gens($G), $w)) + global h = @belapsed representation_vector($G, $T) + tweight = representation_vector(G, T) + continue + end + end + end + G = standard_step2(G, R, w, Rn) + global counter = getCounter() + 1 + println(w) + global b=w + R = Rn + cweight = w + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"tranWalk.txt") + cleardf() + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl new file mode 100644 index 000000000..1af94310f --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl @@ -0,0 +1,376 @@ +############################################################### +#Utilitys for Groebnerwalks +############################################################### + +#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. +#This Version is used by the standard_walk, pertubed_walk and tran_walk. +function next_weight( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + tv = [] + for v in difference_lead_tail(G) + cw = dot(cweight, v) + tw = dot(tweight, v) + if tw < 0 + push!(tv, cw // (cw - tw)) + end + end + push!(tv, 1) + t = minimum(tv) + w = (1 - t) * cweight + t * tweight + return convert_bounding_vector(w) +end + +#Return the initials of polynomials w.r.t. a weight vector. +function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) + inits = spoly{elem_type(base_ring(R))}[] + indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] + for g in G + empty!(indexw) + maxw = 0 + eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + for (e, c) in eczip + tmpw = dot(w, e) + if maxw == tmpw + push!(indexw, (e, c)) + elseif maxw < tmpw + empty!(indexw) + push!(indexw, (e, c)) + maxw = tmpw + end + end + inw = MPolyBuildCtx(R) + for (e, c) in indexw + Singular.push_term!(inw, c, e) + end + h = finish(inw) + push!(inits, h) + end + return inits +end + +#Return the difference of the exponents of the leading terms (Lm) and the +#exponent vectors of the tail of all polynomials of the ideal. +function difference_lead_tail(I::Singular.sideal) + v = Vector{Int}[] + for g in gens(I) + ltu = Singular.leading_exponent_vector(g) + for e in Singular.exponent_vectors(tail(g)) + push!(v, ltu .- e) + end + end + return unique!(v) +end + +function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + return w +end + +function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) + R = change_order(G.base_ring, T) + I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + return false + end + end + return true +end +#Fukuda et al +function lift( + G::Singular.sideal, + R::Singular.PolyRing, + H::Singular.sideal, + Rn::Singular.PolyRing +) + G.isGB = true + rest = [ + change_ring(gen, Rn) - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for + gen in Singular.gens(H) + ] + Gnew = Singular.Ideal(Rn, [Rn(x) for x in rest]) + Gnew.isGB = true + return Gnew +end +#Amrhein & Gloor +function liftGW2( + G::Singular.sideal, + R::Singular.PolyRing, + inG::Vector{spoly{L}}, + H::Singular.sideal, + Rn::Singular.PolyRing +) where {L<:Nemo.RingElem} + + gH = collect(gens(H)) + gG = collect(gens(G)) + s = length(inG) + for i = 1:length(gH) + q = divalg(change_ring(gH[i], R), [change_ring(x, R) for x in inG], R) + gH[i] = R(0) + for j = 1:s + gH[i] = change_ring(gH[i], R) + q[j] * gG[j] + end + end + Gnew = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gH]) + Gnew.isGB = true + return Gnew +end + +function divalg( + p::spoly{L}, + f::Vector{spoly{L}}, + R::Singular.PolyRing, +) where {L<:Nemo.RingElem} + s = length(f) + q = Array{Singular.elem_type(R),1}(undef, s) + for i = 1:s + q[i] = R(0) + end + while !isequal(p, R(0)) + i = 1 + div = false + while (div == false && i <= s) + b, m = divides(leading_term(p), leading_term(f[i])) + if b + q[i] = q[i] + m + p = p - (m * f[i]) + div = true + else + i = i + 1 + end + end + if div == false + p = p - leading_term(p) + end + end + return q +end + +#Solves problems with weight vectors of floats. +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} + w = Vector{Int64}() + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + end + return w +end + +#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) +function change_order( + R::Singular.PolyRing, + cweight::Array{L,1}, + T::Matrix{Int64}, +) where {L<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), + cached = false, + ) + return S +end + +#return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) +function change_order( + R::Singular.PolyRing, + M::Matrix{Int64}, +) where {T<:Number,K<:Number} + G = Singular.gens(R) + Gstrich = string.(G) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_M(M), + cached = false, + ) + #@error("Not implemented yet") + return S +end + +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + Singular.push_term!(M, c, v) + end + return finish(M) +end +function change_ring(p::Singular.spoly, R::Singular.PolyRing) + cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) + M = MPolyBuildCtx(R) + for (c, v) in cvzip + Singular.push_term!(M, c, v) + end + return finish(M) +end + + +############################################# +# unspecific help functions +############################################# + +function ident_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int64) + M = zeros(Int64, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end + +# Singular.isequal depends on order of generators +function equalitytest(G::Singular.sideal, K::Singular.sideal) + generators = Singular.gens(G) + count = 0 + for gen in generators + for r in Singular.gens(K) + if gen - r == 0 + count += 1 + end + end + end + if count == Singular.ngens(G) + return true + end + return false +end + +function dot(v::Vector{Int64}, w::Vector{Int64}) + n = length(v) + sum = 0 + for i = 1:n + sum += v[i] * w[i] + end + return sum +end + +function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) + if length(w) > 2 + if ord == :lex + return [ + w' + ident_matrix(length(w))[1:length(w)-1, :] + ] + end + if ord == :deglex + return [ + w' + ones(Int64, length(w))' + ident_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :degrevlex + return [ + w' + ones(Int64, length(w))' + anti_diagonal_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end + else + error("not implemented") + end +end + +function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) + return [ + w' + M[2:length(w), :] + ] +end +function insert_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) + return [ + w' + M[1:length(w)-1, :] + ] +end + + +function ordering_as_matrix(ord::Symbol, nvars::Int64) + if ord == :lex + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int64, nvars)' + ident_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :degrevlex + return [ + ones(Int64, nvars)' + anti_diagonal_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + else + error("not implemented") + end +end + + +function deg(p::Singular.spoly, n::Int64) + max = 0 + for mon in Singular.monomials(p) + ev = Singular.exponent_vectors(mon) + sum = 0 + for e in ev + for i = 1:n + sum += e[i] + end + end + if (max < sum) + max = sum + end + end + return max +end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl new file mode 100644 index 000000000..97e90e9d4 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl @@ -0,0 +1,5 @@ +include("GroebnerWalkUtilitysFinal.jl") + +############################################################### +#Utilitys for standard_walk +############################################################### diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl new file mode 100644 index 000000000..d85d13e0a --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl @@ -0,0 +1,44 @@ +include("GroebnerWalkUtilitysFinal.jl") + + +function representation_vector(G::Singular.sideal, T::Matrix{Int64}) + n = size(T)[1] + M = 0 + for i = 1:n + for j = 1:n + temp = T[i, j] + if M < temp + M = temp + end + end + end + d0 = 0 + for g in Singular.gens(G) + temp = deg(g, n) + if d0 < temp + d0 = temp + end + end + d = M * (2 * d0^2 + (n + 1) * d0) + w = d^(n - 1) * T[1, :] + for i = 2:n + w = w + d^(n - i) * T[i, :] + end + return w +end + +function inSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} + counter = 0 + for g in Gw + if size(collect(Singular.coefficients(g)))[1] > 2 + return true + end + if size(collect(Singular.coefficients(g)))[1] == 2 + counter = counter + 1 + end + end + if counter > 1 + return true + end + return false +end diff --git a/src/GroebnerWalkFinal/Benchmarking/parser.jl b/src/GroebnerWalkFinal/Benchmarking/parser.jl new file mode 100644 index 000000000..b939bcb83 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/parser.jl @@ -0,0 +1,49 @@ +cd("/Users/JordiWelp/Results/1ideals") +include("readWriteHelper.jl") +using CSV +using DataFrames + +function parseideal() + csv_reader = CSV.File("Beispiele4Variablen.txt") + for row in csv_reader + poly = collect(split("$(row.generator)", "")) + result = "" + println("from", poly) + d = length(poly) + for i = 1:d + a = poly[i] + if i == d + result = result * a + println("to", result) + break + end + b = poly[i+1] + + if (a == "+" || a == "-") + result = result * a + else + if tryparse(Int32, string(a)) != nothing + if tryparse(Int32, string(b)) != nothing + result = result * a + elseif (b == "+" || b == "-") + result = result * a + else + result = result * a * "*" + end + else + if (tryparse(Int32, string(b)) != nothing) + result = result * a * "^" + elseif (b == "+" || b == "-") + result = result * a + else + result = result * a * "*" + end + end + end + end + df = DataFrame(generator = result) + savea(df, "cBeispiele4Variablen.txt") + cd("/Users/JordiWelp/Results/1ideals") + + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl new file mode 100644 index 000000000..0972290de --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl @@ -0,0 +1,55 @@ +using DataFrames +using CSV +function savew(df::DataFrame, file::String) + + open(file, "w") do io # create a file and write with header as the file does not exist + foreach(row -> print(io, row), CSV.RowWriter(df)) + end +end + +function savea(df::DataFrame, file::String) + + open(file, "a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end +end + +function savea(df::DataFrame, file::String, p::Int64) + if p == 2 + open("pertubedWalk2.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 3 + open("pertubedWalk3.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 4 + open("pertubedWalk4.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 5 + open("pertubedWalk5.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 6 + open("pertubedWalk6.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 7 + open("pertubedWalk7.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 8 + open("pertubedWalk8.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 9 + open("pertubedWalk9.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + elseif p == 10 + open("pertubedWalk10.txt","a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl new file mode 100644 index 000000000..62cc30593 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl @@ -0,0 +1,286 @@ +function runb( + v::String, + ideal::Singular.sideal, + S::Singular.PolyRing, + StartOrd::Matrix{Int64}, + TarOrd::Matrix{Int64}, +) + println("starting Benchmark") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + example = [v], + ) + savea(df, "standardWalk.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk2.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk3.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk4.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk5.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk6.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk7.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk8.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk9.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + savea(df, "pertubedWalk10.txt") + df = DataFrame( + weights = ["-"], + facetnormal = ["-"], + initials = ["-"], + stdh = ["-"], + liftgeneric = ["-"], + interred = ["-"], + example = [v], + ) + savea(df, "genericWalk.txt") + + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalk.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalklex.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalklookahead.txt") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalkcombined.txt") + df = DataFrame( + weights = "-", + weight = "-", + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + rep = ["-"], + inCone = ["-"], + inseveral = ["-"], + example = [v], + ) + savea(df, "tranWalk.txt") + + + + @time I = Singular.std(ideal, complete_reduction = true) + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + println("Computing GB") + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + df = DataFrame(test1 = ["-"], test2 = ["-"], example = [v]) + savea(df, "correct.txt") + + println("Benchmark ideals") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b]) + savea(df, "correct.txt") + end +end From 621f4c0bb6437729055159bf6fd1eca0f0bcbc18 Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 27 Dec 2021 13:40:25 +0100 Subject: [PATCH 40/85] new examples --- .../Benchmarking/BspEinzeln.jl | 84 ++++++++++- src/GroebnerWalkFinal/Benchmarking/BspVar4.jl | 4 +- src/GroebnerWalkFinal/Benchmarking/BspVar5.jl | 3 +- src/GroebnerWalkFinal/Benchmarking/BspVar6.jl | 3 +- .../GroebnerWalkFinalBenchmarkProcedures.jl | 141 +++++++++--------- 5 files changed, 154 insertions(+), 81 deletions(-) diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 9f7520db4..4e95e9959 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -1,5 +1,5 @@ -include("src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("benchi.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") @@ -19,7 +19,6 @@ function runAllSingleExample() ordering = Singular.ordering_M(StartOrd), ) S = change_order(R, TarOrd) - ideals= [] f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v f2 = 2*z*y + 2 * z * t + 2 * t * u + 2 * u * v - u @@ -57,7 +56,6 @@ function runAllSingleExample() ordering = Singular.ordering_M(StartOrd), ) S = change_order(R, TarOrd) - ideals= [] f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v f2 = 2*x * y +2* y * z + 2 * z * t + 2 * t * u + 2 * u * v - u f3 = 2 * x * z + 2 * y * t + 2 * z * u +2* u^2 + 2 * t * v - t @@ -83,4 +81,82 @@ function runAllSingleExample() df = DataFrame(a = [a], b = [b], c=["Katsura6"]) savea(df, "correct.txt") end + + + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example ="Cyclic7" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1,x2,x3,x4,x5,x6,x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1","x2","x3","x4","x5","x6","x7"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + f1=x1+x2+x3+x4+x5+x6+x7 + f2=x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x1*x7+x6*x7 + f3=x1*x2*x3+x2*x3*x4+x3*x4*x5+x4*x5*x6+x1*x2*x7+x1*x6*x7+x5*x6*x7 + f4=x1*x2*x3*x4+x2*x3*x4*x5+x3*x4*x5*x6+x1*x2*x3*x7+x1*x2*x6*x7+x1*x5*x6*x7+x4*x5*x6*x7 + f5=x1*x2*x3*x4*x5+x2*x3*x4*x5*x6+x1*x2*x3*x4*x7+x1*x2*x3*x6*x7+x1*x2*x5*x6*x7+x1*x4*x5*x6*x7+x3*x4*x5*x6*x7 + f6=x1*x2*x3*x4*x5*x6+x1*x2*x3*x4*x5*x7+x1*x2*x3*x4*x6*x7+x1*x2*x3*x5*x6*x7+x1*x2*x4*x5*x6*x7+x1*x3*x4*x5*x6*x7+x2*x3*x4*x5*x6*x7 + f7=x1*x2*x3*x4*x5*x6*x7-1 + + I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7]), complete_reduction= true) + runb(example, I, S) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, + ) + df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) + savew(df, "correct.txt") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b], c=[example]) + savea(df, "correct.txt") +end + +dim = 6 +ve = [1, 1, 1, 1, 1, 1] +example ="Cyclic6" +StartOrd = ordering_as_matrix(ve, :lex) +TarOrd = ordering_as_matrix(:lex, dim) +R, (x1,x2,x3,x4,x5,x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1","x2","x3","x4","x5","x6"], + ordering = Singular.ordering_M(StartOrd), +) +S = change_order(R, TarOrd) + + + f1 =x1+x2+x3+x4+x5+x6 + f2 =x1*x2+x2*x3+x3*x4+x4*x5+x1*x6+x5*x6 + f3 =x1*x2*x3+x2*x3*x4+x3*x4*x5+x1*x2*x6+x1*x5*x6+x4*x5*x6 + f4 =x1*x2*x3*x4+x2*x3*x4*x5+x1*x2*x3*x6+x1*x2*x5*x6+x1*x4*x5*x6+x3*x4*x5*x6 + f5 =x1*x2*x3*x4*x5+x1*x2*x3*x4*x6+x1*x2*x3*x5*x6+x1*x2*x4*x5*x6+x1*x3*x4*x5*x6+x2*x3*x4*x5*x6 + f6 =x1*x2*x3*x4*x5*x6-1 + + I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5,f6]), complete_reduction= true) + runb(example, I, S) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, + ) + df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) + savew(df, "correct.txt") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b], c=[example]) + savea(df, "correct.txt") +end end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl index ebad1cfe4..628215679 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl @@ -1,6 +1,4 @@ -include(" -src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl -") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl index 2eb5e42ef..e78bedf7d 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl @@ -1,5 +1,4 @@ -include( -"src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl index d3b0af6bf..665ea1a81 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl @@ -1,5 +1,4 @@ -include( -"src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl index 0e9f62936..3b9e2259c 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -5,6 +5,7 @@ include("StandardWalkUtilitysFinal.jl") include("TranWalkUtilitysFinal.jl") using BenchmarkTools BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 +BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 export groebnerwalk a="-" b="-" @@ -157,7 +158,7 @@ function standard_walk( if cweight == tweight terminate = true else - global a = @belapsed next_weight($G, $cweight, $tweight) + global a = @belapsed next_weight($G, $cweight, $tweight) evals =1 samples=1 cweight = next_weight(G, cweight, tweight) R = Rn Rn = change_order(Rn, cweight, T) @@ -175,13 +176,13 @@ function standard_step( global z = length(Singular.gens(G)) -global c = @belapsed initials($Rn, gens($G), $cw) +global c = @belapsed initials($Rn, gens($G), $cw) evals =1 samples=1 Gw = initials(Rn, gens(G), cw) global d= @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, Gw), @@ -189,13 +190,13 @@ global c = @belapsed initials($Rn, gens($G), $cw) ) - global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) - global f= @belapsed lift($G, $R, $H, $Rn) + global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + global f= @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - global g = @belapsed Singular.std($H, complete_reduction = true) + global g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 - df = DataFrame(a=[a], b = [b],z=[z] c = [c], d = [d], e = [e], f = [f],g=[g], h=[counter]) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f],g=[g], h=[counter]) cleardf() savea(df,"standardWalk.txt") return Singular.std(H, complete_reduction = true) @@ -231,7 +232,7 @@ while !terminate if cweight == tweight terminate = true else - global a = @belapsed next_weight($G, $cweight, $tweight) + global a = @belapsed next_weight($G, $cweight, $tweight) evals =1 samples=1 cweight = next_weight(G, cweight, tweight) R = Rn Rn = change_order(Rn, cweight, T) @@ -249,13 +250,13 @@ function standard_step2( global z = length(Singular.gens(G)) -global c = @belapsed initials($Rn, gens($G), $cw) +global c = @belapsed initials($Rn, gens($G), $cw) evals =1 samples=1 Gw = initials(Rn, gens(G), cw) global d= @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, Gw), @@ -263,11 +264,11 @@ global c = @belapsed initials($Rn, gens($G), $cw) ) - global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) - global f= @belapsed lift($G, $R, $H, $Rn) + global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + global f= @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - global g = @belapsed Singular.std($H, complete_reduction = true) + global g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 return Singular.std(H, complete_reduction = true) end @@ -278,7 +279,7 @@ end function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R = base_ring(G) Rn = change_order(G.base_ring, T) - global a =@belapsed next_gamma($G, $[0], $S, $T) + global a =@belapsed next_gamma($G, $[0], $S, $T) evals =1 samples=1 v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) @@ -293,7 +294,7 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) df = DataFrame(a = [a], b = [b],z=[z], c = [c], d=[d], e=[e],f=[f],g=[g]) savea(df, "genericWalk.txt") cleardf() - global a = @belapsed next_gamma($G, $Lm, $v, $S, $T) + global a = @belapsed next_gamma($G, $Lm, $v, $S, $T) evals =1 samples=1 v =next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) @@ -310,19 +311,19 @@ global z = length(Singular.gens(G)) Rn = Singular.base_ring(G) - global c =@belapsed facet_initials($G,$Lm, $v) + global c =@belapsed facet_initials($G,$Lm, $v) evals =1 samples=1 facet_Generators = facet_initials(G,Lm, v) global d= @belapsed Singular.std( - Singular.Ideal($Rn, facet_Generators), + Singular.Ideal($Rn, $facet_Generators), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, facet_Generators), complete_reduction = true, ) - global e = @belapsed lift_generic($G, $Lm, $H) + global e = @belapsed lift_generic($G, $Lm, $H) evals =1 samples=1 H, Lm = lift_generic(G, Lm, H) - global f= @belapsed interreduce($H, $Lm) + global f= @belapsed interreduce($H, $Lm) evals =1 samples=1 G = interreduce(H, Lm) G = Singular.Ideal(Rn, G) G.isGB = true @@ -340,7 +341,7 @@ function pertubed_walk( p::Int64, ) k=p -df = DataFrame(a=["-"], b = ["-"],z=["-"] c = ["-"], d = ["-"], e = ["-"], f = ["-"], g=["-"], h=["-"], i=[(p,p)], j=["-"]) +df = DataFrame(a=["-"], b = ["-"],z=["-"], c = ["-"], d = ["-"], e = ["-"], f = ["-"], g=["-"], h=["-"], i=[(p,p)], j=["-"]) savea(df, "pertubedWalk.txt",k) #cweight = pertubed_vector(G, S, p) cweight = S[1, :] @@ -349,18 +350,18 @@ savea(df, "pertubedWalk.txt",k) println("Crossed Cones in: ") while !terminate - global h = @belapsed pertubed_vector($G, $T, $p) + global h = @belapsed pertubed_vector($G, $T, $p) evals =1 samples=1 tweight = pertubed_vector(G, T, p) G = standard_walk2(G, S, T, cweight, tweight,k) if inCone(G, T, tweight) - global i = @belapsed inCone($G, $T, $tweight) + global i = @belapsed inCone($G, $T, $tweight) evals =1 samples=1 terminate = true else if p == 1 R = change_order(G.base_ring, T) G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - global j= @belapsed Singular.std($G, complete_reduction = true) + global j= @belapsed Singular.std($G, complete_reduction = true) evals =1 samples=1 G = Singular.std(G, complete_reduction = true) terminate = true end @@ -431,14 +432,14 @@ function fractal_recursiv( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) + a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if (t == [0]) if inCone(G, T,PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 return G else - i = @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] + i = @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals =1 samples=1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -450,13 +451,13 @@ function fractal_recursiv( Rn = change_order(R, T) global z = length(Singular.gens(G)) - c = @belapsed initials($R, Singular.gens($G), $w) + c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 Gw = initials(R, Singular.gens(G), w) if p == nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -474,11 +475,11 @@ function fractal_recursiv( p + 1, ) end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) - f = @belapsed lift($G, $R, $H, $Rn) + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) + g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 G = Singular.std(H, complete_reduction = true) R = Rn j = p @@ -533,15 +534,15 @@ function fractal_walk_recursiv_startorder( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) + a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 println(PertVecs[p], " in depth", p) return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -554,13 +555,13 @@ function fractal_walk_recursiv_startorder( Rn = change_order(R, T) global z = length(Singular.gens(G)) - c = @belapsed initials($R, Singular.gens($G), $w) + c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 Gw = initials(R, gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -580,11 +581,11 @@ function fractal_walk_recursiv_startorder( ) global firstStepMode = false end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) - f = @belapsed lift($G, $R, $H, $Rn) + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) + g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 j = p G = Singular.std(H, complete_reduction = true) @@ -621,14 +622,14 @@ function fractal_walk_recursive_lex( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) + a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] println(PertVecs) @@ -652,13 +653,13 @@ function fractal_walk_recursive_lex( Rn = change_order(R, T) global z = length(Singular.gens(G)) - c = @belapsed initials($R, Singular.gens($G), $w) + c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -679,15 +680,15 @@ function fractal_walk_recursive_lex( global firstStepMode = false end end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) - f = @belapsed lift($G, $R, $H, $Rn) + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) + g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 j = p G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z] c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) savea(df,"fractalWalklex.txt") R = Rn end @@ -720,14 +721,14 @@ function fractal_walk_look_ahead_recursiv( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) + a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -740,13 +741,13 @@ function fractal_walk_look_ahead_recursiv( Rn = change_order(R, T) global z = length(Singular.gens(G)) - c = @belapsed initials($R, Singular.gens($G), $w) + c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -765,11 +766,11 @@ function fractal_walk_look_ahead_recursiv( p + 1, ) end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) - f = @belapsed lift($G, $R, $H, $Rn) + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) + g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 j = p G = Singular.std(H, complete_reduction = true) @@ -821,15 +822,15 @@ function fractal_walk_combined( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) + a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) + h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 println(PertVecs[p], " in depth", p) return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] + i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -851,13 +852,13 @@ function fractal_walk_combined( Rn = change_order(R, T) global z = length(Singular.gens(G)) - c = @belapsed initials($R, Singular.gens($G), $w) + c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 Gw = initials(R, gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), complete_reduction = true, - ) + ) evals =1 samples=1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -878,15 +879,15 @@ function fractal_walk_combined( global firstStepMode = false end end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) - f = @belapsed lift($G, $R, $H, $Rn) + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) + g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 j = p G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z] c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) savea(df,"fractalWalkcombined.txt") R = Rn end @@ -909,7 +910,7 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate - global a = @belapsed next_weight($G, $cweight, $tweight) + global a = @belapsed next_weight($G, $cweight, $tweight) evals =1 samples=1 w = next_weight(G, cweight, tweight) if tryparse(Int32, string(w)) == nothing println("w bigger than int32") @@ -918,12 +919,12 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) Rn= change_order(R, w, T) if w == tweight if inCone(G, T, cweight) - global i = @belapsed inCone($G, $T, $cweight) + global i = @belapsed inCone($G, $T, $cweight) evals =1 samples=1 return G else if inSeveralCones(initials(base_ring(G), gens(G), w)) - global j = @belapsed inSeveralCones(initials(base_ring($G), gens($G), $w)) - global h = @belapsed representation_vector($G, $T) + global j = @belapsed inSeveralCones(initials(base_ring($G), gens($G), $w)) evals =1 samples=1 + global h = @belapsed representation_vector($G, $T) evals =1 samples=1 tweight = representation_vector(G, T) continue end From 0cc2846e88bcfd87edea8fbe3b16dd9adc913740 Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 27 Dec 2021 17:59:08 +0100 Subject: [PATCH 41/85] new examples, new tools --- .../GroebnerWalkFinalBenchmark.jl | 682 ++++++++++++++++++ .../BenchmarkingAlg/runbenchmark2.jl | 145 ++++ .../Benchmarking/BspEinzeln.jl | 651 ++++++++++++++--- src/GroebnerWalkFinal/Benchmarking/BspVar3 | 0 .../GroebnerWalkFinalBenchmarkProcedures.jl | 28 +- src/GroebnerWalkFinal/Benchmarking/parser.jl | 4 +- .../Benchmarking/runbenchmark.jl | 262 ++++++- 7 files changed, 1657 insertions(+), 115 deletions(-) create mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar3 diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl new file mode 100644 index 000000000..25e448a55 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl @@ -0,0 +1,682 @@ +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl") +using BenchmarkTools + +############################################################### +#Implementation of the gröbner walk. +############################################################### + +#for counting the steps of the groebnerwalk. +counter = 0 +function getCounter() + global counter + temp = counter + counter = 0 + return temp +end +#= +@doc Markdown.doc""" +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) +Given an Ideal $G$ generated by a reduced Groebner Basis w.r.t. the monomial ordering $S$ this function +returns a reduced Groebner Basis w.r.t. the monomial ordering $T$ by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart et al. (1993) +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). +Pertubed Walk (:pertubed, with $p$ = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. +Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that $T$ represents the lex ordering. Pertubes only the target vector. +Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. +"""=# +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) + if grwalktype == :standard + walk = (x, y, z) -> standard_walk(x, y, z) + elseif grwalktype == :generic + walk = (x, y, z) -> generic_walk(x, y, z) + elseif grwalktype == :pertubed + walk = (x, y, z) -> pertubed_walk(x, y, z, p) + elseif grwalktype == :fractal + walk = + (x, y, z) -> fractal_walk( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_start_order + walk = + (x, y, z) -> fractal_walk_start_order( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_lex + walk = + (x, y, z) -> fractal_walk_lex( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_look_ahead + walk = + (x, y, z) -> fractal_walk_look_ahead( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :tran + walk = (x, y, z) -> tran_walk(x, y, z) + elseif grwalktype == :fractal_combined + walk = + (x, y, z) -> fractal_combined( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + end + + ######TODO:Check the parameter##### + R = base_ring(G) + I = Singular.Ideal(R, [R(x) for x in gens(G)]) + + Gb = walk(I, S, T) + #println("Cones crossed: ", getCounter()) + + S = change_order(Gb.base_ring, T) + return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) +end + + +function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + #println("standard_walk results") + #println("Crossed Cones in: ") + standard_walk(G, S, T, S[1, :], T[1, :]) +end + +function standard_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, +) + R = base_ring(G) + Rn = change_order(R, cweight, T) + terminate = false + while !terminate + G = standard_step(G, R, cweight, Rn) + #println(cweight) + #global counter = getCounter() + 1 + if cweight == tweight + terminate = true + else + cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) + end + end + return G +end + +function standard_step( + G::Singular.sideal, + R::Singular.PolyRing, + cw::Vector{Int64}, + Rn::Singular.PolyRing +) + Gw = initials(Rn, gens(G), cw) + H = Singular.std( + Singular.Ideal(Rn, Gw), + complete_reduction = true, + ) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + return Singular.std(H, complete_reduction = true) +end + +############################################################### +#Generic-version of the groebner walk by Fukuda et al. (2007) +############################################################### + +function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + R = base_ring(G) + Rn = change_order(G.base_ring, T) + v = next_gamma(G, [0], S, T) + Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) + + #println("generic_walk results") + #println("Crossed Cones with facetNormal: ") + while !isempty(v) + #global counter = getCounter() + 1 + #println(v) + G, Lm = generic_step(G, Lm, v, T,R) + v = next_gamma(G, Lm, v, S, T) + end + return Singular.interreduce(G) +end + +function generic_step( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + v::Vector{Int64}, + T::Matrix{Int64}, + R::Singular.PolyRing +) where {L<:Nemo.RingElem} + + Rn = Singular.base_ring(G) + + facet_Generators = facet_initials(G,Lm, v) + H = Singular.std( + Singular.Ideal(Rn, facet_Generators), + complete_reduction = true, + ) + H, Lm = lift_generic(G, Lm, H) + G = interreduce(H, Lm) + G = Singular.Ideal(Rn, G) + G.isGB = true + return G, Lm +end + + +############################################################### +#Pertubed-version of the groebner walk Amrhein et al. +############################################################### +function pertubed_walk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + p::Int64, +) + #cweight = pertubed_vector(G, S, p) + cweight = S[1, :] + terminate = false + #println("pertubed_walk results") + #println("Crossed Cones in: ") + + while !terminate + tweight = pertubed_vector(G, T, p) + G = standard_walk(G, S, T, cweight, tweight) + if inCone(G, T, tweight) + terminate = true + else + if p == 1 + R = change_order(G.base_ring, T) + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + G = Singular.std(G, complete_reduction = true) + terminate = true + end + p = p - 1 + cweight = tweight + end + end + return G +end + +############################################################### +#fractal-walk by Amrhein et al. +#Inlcuding: +#fractal_walk -> standard-version +#fractal_walk2 -> checks if the starting weight is in the inner of a cone. +#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. +# checks if the starting weight is in the inner of a cone. +############################################################### + +######################################## +#Counter for the steps in the fractal_walk +######################################## +counterFr = 0 +function deleteCounterFr() + global counterFr + temp = counterFr + counterFr = 0 + return temp +end +function getCounterFr() + global counterFr + return counterFr +end +function raiseCounterFr() + global counterFr = getCounterFr() + 1 +end +PertVecs = [] +sigma = [] + +function fractal_walk( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + #println(PertVecs) + #println("FacrtalWalk_standard results") + #println("Crossed Cones in: ") + Gb = fractal_recursiv(G, S,T, PertVecs, 1) + #println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_recursiv( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + terminate = false + G.isGB = true + w = S.w + + while !terminate + t = nextT(G, w, PertVecs[p]) + if (t == [0]) + if inCone(G, T,PertVecs[p]) + return G + else + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + Rn = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) + if p == nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + H = fractal_recursiv( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + end + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + end + return G +end + +cwPert = [] +firstStepMode = false +function cwpert(p::Int64) + cwPert[p] +end + +function fractal_walk_start_order( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + global sigma = S.w + #println("fractal_walk_withStartorder results") + #println("Crossed Cones in: ") + Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) + #println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_recursiv_startorder( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + + while !terminate + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + #println(PertVecs[p], " in depth", p) + return G + else + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + Rn = change_order(R, T) + Gw = initials(R, gens(G), w) + if p == Singular.nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + + H = fractal_walk_recursiv_startorder( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + end + return G +end +function fractal_walk_lex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + #println("fractal_walk_lex results") + #println("Crossed Cones in: ") + Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) + #println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_recursive_lex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = S.w + while !terminate + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + return G + else + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] + #println(PertVecs) + continue + end + end + if t == 1 && p==1 + return fractal_walk_recursive_lex( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + Rn = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + H = fractal_walk_recursive_lex( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + end + return G +end +function fractal_walk_look_ahead( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + #println("fractal_walk_look_ahead results") + #println("Crossed Cones in: ") + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) + #println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_look_ahead_recursiv( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = S.w + + while !terminate + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + return G + else + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + Rn = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + H = fractal_walk_look_ahead_recursiv( + Singular.Ideal(R, Gw), + S, + T, + PertVecs, + p + 1, + ) + end + + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R H, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + end + return G +end + + + + +function fractal_walk_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + #println("fractal_walk_withStartorder results") + #println("Crossed Cones in: ") + Gb = fractal_walk_combined(G, S, T, PertVecs, 1) + #println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + while !terminate + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + #println(PertVecs[p], " in depth", p) + return G + else + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + if t == 1 && p==1 + return fractal_walk_combined( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + Rn = change_order(R, T) + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + H = fractal_walk_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + G = Singular.std(H, complete_reduction = true) + R = Rn + end + return G +end +############################################################### +#Tran-version of the groebner walk by Tran (2002) +############################################################### + +function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + cweight = S[1, :] + tweight = T[1, :] + #println("tran_walk results") + #println("Crossed Cones in: ") + R = base_ring(G) + if !isMonomial(initials(R, Singular.gens(G), cweight)) + cweight = pertubed_vector(G, S, nvars(R)) + end + + terminate = false + while !terminate + w = next_weight(G, cweight, tweight) + if tryparse(string(w), Int32) == nothing + #println("w bigger than int32") + return G + end + Rn= change_order(R, w, T) + if w == tweight + if inCone(G, T, cweight) + return G + else + if inSeveralCones(initials(base_ring(G), gens(G), w)) + tweight = representation_vector(G, T) + continue + end + end + end + G = standard_step(G, R, w, Rn) + #global counter = getCounter() + 1 + #println(w) + R = Rn + cweight = w + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl new file mode 100644 index 000000000..f83ba674f --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl @@ -0,0 +1,145 @@ +using BenchmarkTools +function prepare2() + + df = DataFrame( + example=[], + standard=[], + pertubed2=[], + pertubed3=[], + pertubed4=[], + pertubed5=[], + pertubed6=[], + pertubed7=[], + pertubed8=[], + pertubed9=[], + pertubed10=[], + fractal=[], + fractallex=[], + fractallookahead[], + fractalcombined=[], + generic=[], + tran=[], + stime=[], + ttime=[] + ) + savew(df, "CompareAlg.txt") +end + +function runb2( + v::String, + ideal::Singular.sideal, + S::Singular.PolyRing, + StartOrd::Matrix{Int64}, + TarOrd::Matrix{Int64}, +) + println("starting Benchmark") + + + example=[] + standard=[] + pertubed2=[] + pertubed3=[] + pertubed4=[] + pertubed5=[] + pertubed6=[] + pertubed7=[] + pertubed8=[] + pertubed9=[] + pertubed10=[] + fractal=[] + fractallex=[] + fractallookahead[] + fractalcombined=[] + generic=[] + tran=[] + + @belapsed stime = Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 + I = Singular.std(ideal, complete_reduction = true) + ideals = [] + + for i = 2:nvars(S) + if i ==2 + pertubed2 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==3 + pertubed3 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==4 + pertubed4 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==5 + pertubed5 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==6 + pertubed6 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==7 + pertubed7 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==8 + pertubed8 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==9 + pertubed9 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + elseif i==10 + pertubed10 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + end + gb = groebnerwalk(I, StartOrd, TarOrd, :pertubed, i) + push!(ideals, gb) + end + standard = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:standard, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + generic = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:generic, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + fractal = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractal, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + fractallex = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractallex, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + fractallookahead = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractallookahead, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + fractalcombined = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractalcombined, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + tran = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:tran, $i) evals =1 samples =1 + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + println("Computing GB") + ttime = @belapsed Singular.std( + Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), + complete_reduction = true, + ) evals=1 samples =1 + + df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) + savea(df, "SingularComputationTimings") + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) + savea(df, "correct.txt") + df = DataFrame( + example=[v], + standard=[standard], + pertubed2=[pertubed2], + pertubed3=[pertubed3], + pertubed4=[pertubed4], + pertubed5=[pertubed5], + pertubed6=[pertubed6], + pertubed7=[pertubed7], + pertubed8=[pertubed8], + pertubed9=[pertubed9], + pertubed10=[pertubed10], + fractal=[fractal], + fractallex=[fractallex], + fractallookahead[fractallookahead], + fractalcombined=[fractalcombined], + generic=[generic], + tran=[tran], + stime=[stime], + ttime=[ttime] + ) + savea(df, "CompareAlg.txt") + + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b],c=[v]) + savea(df, "correct.txt") + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 4e95e9959..15dcfc0e4 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -1,4 +1,7 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl", +) +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") @@ -8,12 +11,15 @@ using DataFrames using CSV function runAllSingleExample() cd("/Users/JordiWelp/Results") -#Katsura 5 + prepare() + prepare2() + + #Katsura 5 dim = 5 ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (v,u,t,z,y) = Singular.PolynomialRing( + R, (v, u, t, z, y) = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y"], ordering = Singular.ordering_M(StartOrd), @@ -21,28 +27,13 @@ function runAllSingleExample() S = change_order(R, TarOrd) f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2*z*y + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * y * t + 2 * z * u + 2*u^2 + 2 * t * v - t - f4 = 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 - I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5]), complete_reduction=true) + f2 = 2 * z * y + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t + f4 = 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) runb("Katsura5", I, S, StartOrd, TarOrd) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, - ) - df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) - savew(df, "correct.txt") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b], c=["Katsura5"]) - savea(df, "correct.txt") - end + runb2("Katsura5", I, S, StartOrd, TarOrd) #Katsura6 @@ -50,27 +41,125 @@ function runAllSingleExample() ve = [1, 1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (v,u,t,z,y,x) = Singular.PolynomialRing( + R, (v, u, t, z, y, x) = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y", "x"], ordering = Singular.ordering_M(StartOrd), ) S = change_order(R, TarOrd) f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2*x * y +2* y * z + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * x * z + 2 * y * t + 2 * z * u +2* u^2 + 2 * t * v - t + f2 = 2 * x * y + 2 * y * z + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * x * z + 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 - I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5,f6]), complete_reduction= true) - runb("Katsura6", I, S) + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + runb("Katsura6", I, S, StartOrd, TarOrd) + runb2("Katsura6", I, S, StartOrd, TarOrd) + + + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example = "Cyclic7" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + f1 = x1 + x2 + x3 + x4 + x5 + x6 + x7 + f2 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 * x7 + x6 * x7 + f3 = + x1 * x2 * x3 + + x2 * x3 * x4 + + x3 * x4 * x5 + + x4 * x5 * x6 + + x1 * x2 * x7 + + x1 * x6 * x7 + + x5 * x6 * x7 + f4 = + x1 * x2 * x3 * x4 + + x2 * x3 * x4 * x5 + + x3 * x4 * x5 * x6 + + x1 * x2 * x3 * x7 + + x1 * x2 * x6 * x7 + + x1 * x5 * x6 * x7 + + x4 * x5 * x6 * x7 + f5 = + x1 * x2 * x3 * x4 * x5 + + x2 * x3 * x4 * x5 * x6 + + x1 * x2 * x3 * x4 * x7 + + x1 * x2 * x3 * x6 * x7 + + x1 * x2 * x5 * x6 * x7 + + x1 * x4 * x5 * x6 * x7 + + x3 * x4 * x5 * x6 * x7 + f6 = + x1 * x2 * x3 * x4 * x5 * x6 + + x1 * x2 * x3 * x4 * x5 * x7 + + x1 * x2 * x3 * x4 * x6 * x7 + + x1 * x2 * x3 * x5 * x6 * x7 + + x1 * x2 * x4 * x5 * x6 * x7 + + x1 * x3 * x4 * x5 * x6 * x7 + + x2 * x3 * x4 * x5 * x6 * x7 + f7 = x1 * x2 * x3 * x4 * x5 * x6 * x7 - 1 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + + + + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "Cyclic6" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + + f1 = x1 + x2 + x3 + x4 + x5 + x6 + f2 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x1 * x6 + x5 * x6 + f3 = + x1 * x2 * x3 + + x2 * x3 * x4 + + x3 * x4 * x5 + + x1 * x2 * x6 + + x1 * x5 * x6 + + x4 * x5 * x6 + f4 = + x1 * x2 * x3 * x4 + + x2 * x3 * x4 * x5 + + x1 * x2 * x3 * x6 + + x1 * x2 * x5 * x6 + + x1 * x4 * x5 * x6 + + x3 * x4 * x5 * x6 + f5 = + x1 * x2 * x3 * x4 * x5 + + x1 * x2 * x3 * x4 * x6 + + x1 * x2 * x3 * x5 * x6 + + x1 * x2 * x4 * x5 * x6 + + x1 * x3 * x4 * x5 * x6 + + x2 * x3 * x4 * x5 * x6 + f6 = x1 * x2 * x3 * x4 * x5 * x6 - 1 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), complete_reduction = true, ) - df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) + df = DataFrame(a = ["test1"], b = ["test2"], c = ["example"]) savew(df, "correct.txt") for id in ideals a = isequal( @@ -78,85 +167,457 @@ function runAllSingleExample() s, ) b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b], c=["Katsura6"]) + df = DataFrame(a = [a], b = [b], c = [example]) savea(df, "correct.txt") end + dim = 5 + ve = [1, 1, 1, 1, 1] + example = "Cyclic5" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (v, w, x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["v", "w", "x", "y", "z"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) - dim = 7 - ve = [1, 1, 1, 1, 1, 1, 1] - example ="Cyclic7" - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (x1,x2,x3,x4,x5,x6,x7) = Singular.PolynomialRing( - Singular.QQ, - ["x1","x2","x3","x4","x5","x6","x7"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - f1=x1+x2+x3+x4+x5+x6+x7 - f2=x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x1*x7+x6*x7 - f3=x1*x2*x3+x2*x3*x4+x3*x4*x5+x4*x5*x6+x1*x2*x7+x1*x6*x7+x5*x6*x7 - f4=x1*x2*x3*x4+x2*x3*x4*x5+x3*x4*x5*x6+x1*x2*x3*x7+x1*x2*x6*x7+x1*x5*x6*x7+x4*x5*x6*x7 - f5=x1*x2*x3*x4*x5+x2*x3*x4*x5*x6+x1*x2*x3*x4*x7+x1*x2*x3*x6*x7+x1*x2*x5*x6*x7+x1*x4*x5*x6*x7+x3*x4*x5*x6*x7 - f6=x1*x2*x3*x4*x5*x6+x1*x2*x3*x4*x5*x7+x1*x2*x3*x4*x6*x7+x1*x2*x3*x5*x6*x7+x1*x2*x4*x5*x6*x7+x1*x3*x4*x5*x6*x7+x2*x3*x4*x5*x6*x7 - f7=x1*x2*x3*x4*x5*x6*x7-1 - - I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7]), complete_reduction= true) - runb(example, I, S) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, + f1 = v + w + x + y + z + f2 = v * w + w * x + x * y + v * z + y * z + f3 = v * w * x + w * x * y + v * w * z + v * y * z + x * y * z + f4 = + v * w * x * y + + v * w * x * z + + v * w * y * z + + v * x * y * z + + w * x * y * z + f5 = v * w * x * y * z - 1 + + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "eco6" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + + f1 = x1 + x2 + x3 + x4 + x5 + 1 + f2 = x5 * x6 - 5 + f3 = x1 * x5 * x6 + x4 * x6 - 4 + f4 = x1 * x4 * x6 + x2 * x5 * x6 + x3 * x6 - 3 + f5 = x1 * x3 * x6 + x2 * x4 * x6 + x3 * x5 * x6 + x2 * x6 - 2 + f6 = x1 * x2 * x6 + x2 * x3 * x6 + x3 * x4 * x6 + x4 * x5 * x6 + x1 * x6 - 1 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "eco7" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 = x1 + x2 + x3 + x4 + x5 + x6 + 1 + f2 = x6 * x7 - 6 + f3 = x1 * x6 * x7 + x5 * x7 - 5 + f4 = x1 * x5 * x7 + x2 * x6 * x7 + x4 * x7 - 4 + f5 = x1 * x4 * x7 + x2 * x5 * x7 + x3 * x6 * x7 + x3 * x7 - 3 + f6 = x1 * x3 * x7 + x2 * x4 * x7 + x3 * x5 * x7 + x4 * x6 * x7 + x2 * x7 - 2 + f7 = + x1 * x2 * x7 + + x2 * x3 * x7 + + x3 * x4 * x7 + + x4 * x5 * x7 + + x5 * x6 * x7 + + x1 * x7 - 1 + + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + + dim = 5 + ve = [1, 1, 1, 1, 1] + example = "noon5" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 = + 10 * x1^2 * x5 + 10 * x2^2 * x5 + 10 * x3^2 * x5 + 10 * x4^2 * x5 - + 11 * x5 + 10 + f2 = + 10 * x1^2 * x4 + 10 * x2^2 * x4 + 10 * x3^2 * x4 + 10 * x4 * x5^2 - + 11 * x4 + 10 + f3 = + 10 * x1^2 * x3 + 10 * x2^2 * x3 + 10 * x3 * x4^2 + 10 * x3 * x5^2 - + 11 * x3 + 10 + f4 = + 10 * x1 * x2^2 + 10 * x1 * x3^2 + 10 * x1 * x4^2 + 10 * x1 * x5^2 - + 11 * x1 + 10 + f5 = + 10 * x1^2 * x2 + 10 * x2 * x3^2 + 10 * x2 * x4^2 + 10 * x2 * x5^2 - + 11 * x2 + 10 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) + runb(example, I, S, StartOrd, TarOrd) + + + + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "noon6" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 = + 10 * x1^2 * x6 + + 10 * x2^2 * x6 + + 10 * x3^2 * x6 + + 10 * x4^2 * x6 + + 10 * x5^2 * x6 - 11 * x6 + 10 + f2 = + 10 * x1^2 * x5 + + 10 * x2^2 * x5 + + 10 * x3^2 * x5 + + 10 * x4^2 * x5 + + 10 * x5 * x6^2 - 11 * x5 + 10 + f3 = + 10 * x1^2 * x4 + + 10 * x2^2 * x4 + + 10 * x3^2 * x4 + + 10 * x4 * x5^2 + + 10 * x4 * x6^2 - 11 * x4 + 10 + f4 = + 10 * x1^2 * x3 + + 10 * x2^2 * x3 + + 10 * x3 * x4^2 + + 10 * x3 * x5^2 + + 10 * x3 * x6^2 - 11 * x3 + 10 + f5 = + 10 * x1 * x2^2 + + 10 * x1 * x3^2 + + 10 * x1 * x4^2 + + 10 * x1 * x5^2 + + 10 * x1 * x6^2 - 11 * x1 + 10 + f6 = + 10 * x1^2 * x2 + + 10 * x2 * x3^2 + + 10 * x2 * x4^2 + + 10 * x2 * x5^2 + + 10 * x2 * x6^2 - 11 * x2 + 10 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example = "noon7" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 = + 10 * x1^2 * x7 + + 10 * x2^2 * x7 + + 10 * x3^2 * x7 + + 10 * x4^2 * x7 + + 10 * x5^2 * x7 + + 10 * x6^2 * x7 - 11 * x7 + 10 + f2 = + 10 * x1^2 * x6 + + 10 * x2^2 * x6 + + 10 * x3^2 * x6 + + 10 * x4^2 * x6 + + 10 * x5^2 * x6 + + 10 * x6 * x7^2 - 11 * x6 + 10 + f3 = + 10 * x1^2 * x5 + + 10 * x2^2 * x5 + + 10 * x3^2 * x5 + + 10 * x4^2 * x5 + + 10 * x5 * x6^2 + + 10 * x5 * x7^2 - 11 * x5 + 10 + f4 = + 10 * x1^2 * x4 + + 10 * x2^2 * x4 + + 10 * x3^2 * x4 + + 10 * x4 * x5^2 + + 10 * x4 * x6^2 + + 10 * x4 * x7^2 - 11 * x4 + 10 + f5 = + 10 * x1^2 * x3 + + 10 * x2^2 * x3 + + 10 * x3 * x4^2 + + 10 * x3 * x5^2 + + 10 * x3 * x6^2 + + 10 * x3 * x7^2 - 11 * x3 + 10 + f6 = + 10 * x1 * x2^2 + + 10 * x1 * x3^2 + + 10 * x1 * x4^2 + + 10 * x1 * x5^2 + + 10 * x1 * x6^2 + + 10 * x1 * x7^2 - 11 * x1 + 10 + f7 = + 10 * x1^2 * x2 + + 10 * x2 * x3^2 + + 10 * x2 * x4^2 + + 10 * x2 * x5^2 + + 10 * x2 * x6^2 + + 10 * x2 * x7^2 - 11 * x2 + 10 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + + dim = 8 + ve = [1, 1, 1, 1, 1, 1, 1, 1] + example = "noon8" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 = + 10 * x1^2 * x8 + + 10 * x2^2 * x8 + + 10 * x3^2 * x8 + + 10 * x4^2 * x8 + + 10 * x5^2 * x8 + + 10 * x6^2 * x8 + + 10 * x7^2 * x8 - 11 * x8 + 10 + f2 = + 10 * x1^2 * x7 + + 10 * x2^2 * x7 + + 10 * x3^2 * x7 + + 10 * x4^2 * x7 + + 10 * x5^2 * x7 + + 10 * x6^2 * x7 + + 10 * x7 * x8^2 - 11 * x7 + 10 + f3 = + 10 * x1^2 * x6 + + 10 * x2^2 * x6 + + 10 * x3^2 * x6 + + 10 * x4^2 * x6 + + 10 * x5^2 * x6 + + 10 * x6 * x7^2 + + 10 * x6 * x8^2 - 11 * x6 + 10 + f4 = + 10 * x1^2 * x5 + + 10 * x2^2 * x5 + + 10 * x3^2 * x5 + + 10 * x4^2 * x5 + + 10 * x5 * x6^2 + + 10 * x5 * x7^2 + + 10 * x5 * x8^2 - 11 * x5 + 10 + f5 = + 10 * x1^2 * x4 + + 10 * x2^2 * x4 + + 10 * x3^2 * x4 + + 10 * x4 * x5^2 + + 10 * x4 * x6^2 + + 10 * x4 * x7^2 + + 10 * x4 * x8^2 - 11 * x4 + 10 + f6 = + 10 * x1^2 * x3 + + 10 * x2^2 * x3 + + 10 * x3 * x4^2 + + 10 * x3 * x5^2 + + 10 * x3 * x6^2 + + 10 * x3 * x7^2 + + 10 * x3 * x8^2 - 11 * x3 + 10 + f7 = + 10 * x1 * x2^2 + + 10 * x1 * x3^2 + + 10 * x1 * x4^2 + + 10 * x1 * x5^2 + + 10 * x1 * x6^2 + + 10 * x1 * x7^2 + + 10 * x1 * x8^2 - 11 * x1 + 10 + f8 = + 10 * x1^2 * x2 + + 10 * x2 * x3^2 + + 10 * x2 * x4^2 + + 10 * x2 * x5^2 + + 10 * x2 * x6^2 + + 10 * x2 * x7^2 + + 10 * x2 * x8^2 - 11 * x2 + 10 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) + runb(example, I, S, StartOrd, TarOrd) + + + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example = "redeco7" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1, x2, x3, x4, u7, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "u7", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 = -6 * u7 + x6 + f2 = x1 + x2 + x3 + x4 + x5 + x6 + 1 + f3 = x1 * x6 - 5 * u7 + x5 + f4 = x1 * x5 + x2 * x6 + x4 - 4 * u7 + f5 = x1 * x4 + x2 * x5 + x3 * x6 + x3 - 3 * u7 + f6 = x1 * x3 + x2 * x4 + x3 * x5 + x4 * x6 + x2 - 2 * u7 + f7 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 - u7 + + I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + + dim = 8 + ve = [1, 1, 1, 1, 1,1,1,1] + example ="redeco8" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1,x2,x3,x4,u8,x5,x6,x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1","x2","x3","x4","u8","x5","x6","x7"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 =-7*u8+x7 + f2 =x1+x2+x3+x4+x5+x6+x7+1 + f3 =x1*x7-6*u8+x6 + f4 =x1*x6+x2*x7+x5-5*u8 + f5 =x1*x5+x2*x6+x3*x7+x4-4*u8 + f6 =x1*x4+x2*x5+x3*x6+x4*x7+x3-3*u8 + f7 =x1*x3+x2*x4+x3*x5+x4*x6+x5*x7+x2-2*u8 + f8 =x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x6*x7+x1-u8 + + I = Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7, f8]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + dim = 6 + ve = [1, 1, 1, 1, 1,1] + example ="Wang-91" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x3,x2,x1,x0,b,a) = Singular.PolynomialRing( + Singular.QQ, + ["x3","x2","x1","x0","b","a"], + ordering = Singular.ordering_M(StartOrd), ) - df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) - savew(df, "correct.txt") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b], c=[example]) - savea(df, "correct.txt") + S = change_order(R, TarOrd) + + f1 =3*x2*x1*a+3*x0^2 + f2 =3*x2*x1*b+3*x3^2 + f3 =3*x3*x1*b+3*x1*x0*a+3*x2^2 + f4 =3*x3*x2*b+3*x2*x0*a+3*x1^2 + + I = Singular.Ideal(R, [f1, f2,f3,f4]) + runb(example, I, S, StartOrd, TarOrd) + runb2(example, I, S, StartOrd, TarOrd) + + + dim = 4 + ve = [1, 1, 1, 1] + example ="cohn4" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x,y,z,t) = Singular.PolynomialRing( + Singular.QQ, + ["x","y","z","t"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + f1 =-x^3*y^2+2*x^2*y^2*z-x^2*y*z^2-144*x^2*y^2-207*x^2*y*z+288*x*y^2*z+78*x*y*z^2+x*z^3-3456*x^2*y-5184*x*y^2-9504*x*y*z-432*x*z^2-248832*x*y+62208*x*z-2985984*x + f2 =y^3*t^3-y^2*z*t^3+4*y^3*t^2-2*y^2*z*t^2+72*y^2*t^3+71*y*z*t^3+288*y^2*t^2+360*y*z*t^2+6*z^2*t^2+1728*y*t^3-464*z*t^3+432*y*z*t+8*z^2*t+6912*y*t^2-4320*z*t^2+13824*t^3+z^2-13824*z*t+55296*t^2-13824*z + f3 =x^2*y*t^3-2*x*y^2*t^3+y^3*t^3+8*x^2*y*t^2-12*x*y^2*t^2+4*y^3*t^2-24*x*y*t^3+24*y^2*t^3+20*x^2*y*t-20*x*y^2*t-160*x*y*t^2+96*y^2*t^2+128*x*t^3+16*x^2*y+96*x*y*t+2304*x*t^2+1152*x*y+13824*x*t+27648*x + f4 =-x^3*z*t^2+x^2*z^2*t^2-6*x^3*z*t+4*x^2*z^2*t+32*x^3*t^2-72*x^2*z*t^2-87*x*z^2*t^2-z^3*t^2-8*x^3*z-432*x^2*z*t-414*x*z^2*t+2592*x*z*t^2+864*z^2*t^2-1728*x^2*z-20736*x*z*t+3456*z^2*t-186624*z*t^2-124416*x*z-1492992*z*t-2985984*z + I = Singular.Ideal(R, [f1, f2,f3,f4]) + runb(example, I, S, StartOrd, TarOrd) end +#= -dim = 6 -ve = [1, 1, 1, 1, 1, 1] -example ="Cyclic6" +dim = 7 +ve = [1, 1, 1, 1, 1,1,1] +example ="redeco7" StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) -R, (x1,x2,x3,x4,x5,x6) = Singular.PolynomialRing( +R, (x1,x2,x3,x4,u7,x5,x6) = Singular.PolynomialRing( Singular.QQ, - ["x1","x2","x3","x4","x5","x6"], + ["x1","x2","x3","x4","u7","x5","x6"], ordering = Singular.ordering_M(StartOrd), ) S = change_order(R, TarOrd) + f1 =-6*u7+x6 + f2 =x1+x2+x3+x4+x5+x6+1 + f3 =x1*x6-5*u7+x5 + f4 =x1*x5+x2*x6+x4-4*u7 + f5 =x1*x4+x2*x5+x3*x6+x3-3*u7 + f6 =x1*x3+x2*x4+x3*x5+x4*x6+x2-2*u7 + f7 =x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x1-u7 - f1 =x1+x2+x3+x4+x5+x6 - f2 =x1*x2+x2*x3+x3*x4+x4*x5+x1*x6+x5*x6 - f3 =x1*x2*x3+x2*x3*x4+x3*x4*x5+x1*x2*x6+x1*x5*x6+x4*x5*x6 - f4 =x1*x2*x3*x4+x2*x3*x4*x5+x1*x2*x3*x6+x1*x2*x5*x6+x1*x4*x5*x6+x3*x4*x5*x6 - f5 =x1*x2*x3*x4*x5+x1*x2*x3*x4*x6+x1*x2*x3*x5*x6+x1*x2*x4*x5*x6+x1*x3*x4*x5*x6+x2*x3*x4*x5*x6 - f6 =x1*x2*x3*x4*x5*x6-1 +I = Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7]) +runb(example, I, S, StartOrd, TarOrd) - I = Singular.std(Singular.Ideal(R, [f1, f2,f3,f4,f5,f6]), complete_reduction= true) - runb(example, I, S) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, - ) - df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) - savew(df, "correct.txt") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b], c=[example]) - savea(df, "correct.txt") -end +s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), + complete_reduction = true, +) +df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) +savew(df, "correct.txt") +for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b], c=[example]) + savea(df, "correct.txt") end +=# diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3 b/src/GroebnerWalkFinal/Benchmarking/BspVar3 new file mode 100644 index 000000000..e69de29bb diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl index 3b9e2259c..8aeda1489 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -432,11 +432,11 @@ function fractal_recursiv( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if (t == [0]) if inCone(G, T,PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 + h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 return G else i = @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals =1 samples=1 @@ -534,11 +534,11 @@ function fractal_walk_recursiv_startorder( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 + h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 println(PertVecs[p], " in depth", p) return G else @@ -559,7 +559,7 @@ function fractal_walk_recursiv_startorder( Gw = initials(R, gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, ) evals =1 samples=1 H = Singular.std( @@ -622,11 +622,11 @@ function fractal_walk_recursive_lex( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 + h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 return G else i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 @@ -657,7 +657,7 @@ function fractal_walk_recursive_lex( Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, ) evals =1 samples=1 H = Singular.std( @@ -721,11 +721,11 @@ function fractal_walk_look_ahead_recursiv( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 + h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 return G else i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 @@ -745,7 +745,7 @@ function fractal_walk_look_ahead_recursiv( Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, ) evals =1 samples=1 H = Singular.std( @@ -822,11 +822,11 @@ function fractal_walk_combined( h= "-" i="-" while !terminate - a = @belapsed nextT($G, $w, $PertVecs[p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,$PertVecs[p]) evals =1 samples=1 + h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 println(PertVecs[p], " in depth", p) return G else @@ -856,7 +856,7 @@ function fractal_walk_combined( Gw = initials(R, gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, Rn) for x in $Gw]), + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, ) evals =1 samples=1 H = Singular.std( diff --git a/src/GroebnerWalkFinal/Benchmarking/parser.jl b/src/GroebnerWalkFinal/Benchmarking/parser.jl index b939bcb83..96062daef 100644 --- a/src/GroebnerWalkFinal/Benchmarking/parser.jl +++ b/src/GroebnerWalkFinal/Benchmarking/parser.jl @@ -4,7 +4,7 @@ using CSV using DataFrames function parseideal() - csv_reader = CSV.File("Beispiele4Variablen.txt") + csv_reader = CSV.File("Beispiele3Variablen.txt") for row in csv_reader poly = collect(split("$(row.generator)", "")) result = "" @@ -42,7 +42,7 @@ function parseideal() end end df = DataFrame(generator = result) - savea(df, "cBeispiele4Variablen.txt") + savea(df, "cBeispiele3Variablen.txt") cd("/Users/JordiWelp/Results/1ideals") end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl index 62cc30593..499cfc11c 100644 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl @@ -1,3 +1,249 @@ +using BenchmarkTools + +function prepare() +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + example = ["example"], +) +savew(df, "standardWalk.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk2.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk3.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk4.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk5.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk6.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk7.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk8.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk9.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +savew(df, "pertubedWalk10.txt") +df = DataFrame( + weights = ["weights"], + facetnormal = ["-"], + initials = ["initials"], + stdh = ["stdh"], + liftgeneric = ["liftgeneric"], + interred = ["interred"], + example = ["example"], +) +savew(df, "genericWalk.txt") + +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalk.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalklex.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalklookahead.txt") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalkcombined.txt") +df = DataFrame( + weights = "weights", + weight = "weight", + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + rep = ["rep"], + inCone = ["inCone"], + inseveral = ["inseveral"], + example = ["example"], +) +savew(df, "tranWalk.txt") +end function runb( v::String, ideal::Singular.sideal, @@ -236,6 +482,7 @@ function runb( df = DataFrame( weights = "-", weight = "-", + nGens = ["-"], initials = ["-"], stdh = ["-"], liftGW2 = ["-"], @@ -249,8 +496,8 @@ function runb( savea(df, "tranWalk.txt") - - @time I = Singular.std(ideal, complete_reduction = true) + stime =@belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 + I = Singular.std(ideal, complete_reduction = true) ideals = [] for i = 2:nvars(S) push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) @@ -265,12 +512,19 @@ function runb( push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) println("Computing GB") + ttime = @belapsed Singular.std( + Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), + complete_reduction = true, + ) evals=1 samples =1 + + df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) + savea(df, "SingularComputationTimings") s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), complete_reduction = true, ) - df = DataFrame(test1 = ["-"], test2 = ["-"], example = [v]) + df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) savea(df, "correct.txt") println("Benchmark ideals") @@ -280,7 +534,7 @@ function runb( s, ) b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b]) + df = DataFrame(a = [a], b = [b],c=[v]) savea(df, "correct.txt") end end From 758c232495f85c6de69ac027db3b3797a5500250 Mon Sep 17 00:00:00 2001 From: welpj Date: Tue, 28 Dec 2021 12:41:03 +0100 Subject: [PATCH 42/85] Benchmark2 --- src/GroebnerWalkFinal/Benchmarking/BspVar3 | 0 src/GroebnerWalkFinal/Benchmarking/BspVar3.jl | 1 + src/GroebnerWalkFinal/Benchmarking/BspVar4.jl | 16 +++++++++++++++- src/GroebnerWalkFinal/Benchmarking/BspVar5.jl | 11 ++++++++++- src/GroebnerWalkFinal/Benchmarking/BspVar6.jl | 9 ++++++++- 5 files changed, 34 insertions(+), 3 deletions(-) delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar3 create mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar3.jl diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3 b/src/GroebnerWalkFinal/Benchmarking/BspVar3 deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl new file mode 100644 index 000000000..db19648db --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl @@ -0,0 +1 @@ +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl index 628215679..9c762582f 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl @@ -2,6 +2,8 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/ include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") + using DataFrames @@ -9,7 +11,8 @@ using CSV function benchmarkVar4() cd("/Users/JordiWelp/Results") - + prepare() + prepare2() dim = 4 ve = [1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) @@ -168,6 +171,8 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + end push!( @@ -427,6 +432,7 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -799,6 +805,9 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + + end push!( ideals, @@ -1285,6 +1294,7 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -1882,6 +1892,7 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -2593,6 +2604,8 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + end push!( ideals, @@ -3418,6 +3431,7 @@ function benchmarkVar4() ) for i in ideals runb("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) end s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl index e78bedf7d..099851511 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl @@ -2,6 +2,7 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/ include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") using DataFrames @@ -9,7 +10,8 @@ using CSV function benchmarkVar5() cd("/Users/JordiWelp/Results") - + prepare() + prepare() dim = 5 ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) @@ -284,6 +286,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -767,6 +770,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -1481,6 +1485,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -2420,6 +2425,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -3587,6 +3593,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -4976,6 +4983,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) end push!( ideals, @@ -6593,6 +6601,7 @@ function benchmarkVar5() ) for i in ideals runb("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) + runb2("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) end s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl index 665ea1a81..0eb55daf0 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl @@ -2,6 +2,7 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/ include("readWriteHelper.jl") include("parser.jl") include("runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") using DataFrames @@ -9,7 +10,8 @@ using CSV function var6() cd("/Users/JordiWelp/Results") - + prepare() + prepare2() dim = 6 ve = [1, 1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) @@ -471,6 +473,8 @@ function var6() for i in ideals runb("sparseid(3,0,5,100-(1*10),90)", i, S) + runb2("sparseid(3,0,5,100-(1*10),90)", i, S) + end ideals = [] push!( @@ -1339,6 +1343,7 @@ function var6() ) for i in ideals runb("sparseid(3,0,5,100-(2*10),90)", i, S) + runb2("sparseid(3,0,5,100-(2*10),90)", i, S) end ideals = [] push!( @@ -2621,6 +2626,7 @@ function var6() ) for i in ideals runb("sparseid(3,0,5,100-(3*10),90)", i, S) + runb2("sparseid(3,0,5,100-(3*10),90)", i, S) end ideals = [] push!( @@ -4326,6 +4332,7 @@ function var6() ) for i in ideals runb("sparseid(3,0,5,100-(4*10),90)", i, S) + runb2("sparseid(3,0,5,100-(4*10),90)", i, S) end ideals = [] From cb79286478a7f3aea5da50d9809a8e14c7035db1 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 29 Dec 2021 17:44:47 +0100 Subject: [PATCH 43/85] Testing --- .../Benchmarking/BenchmarkHelper | 372 ++++++ .../GroebnerWalkFinalBenchmark.jl | 114 +- .../BenchmarkingAlg/runbenchmark2.jl | 117 +- .../GroebnerWalkFinalBenchmarkProcedures.jl | 949 ++++++++++++++ .../bechmarkingEveryProcedure/runbenchmark.jl | 292 +++++ .../Benchmarking/BspEinzeln.jl | 97 +- src/GroebnerWalkFinal/Benchmarking/BspVar3.jl | 260 ++++ .../FractalWalkUtilitysFinal.jl | 225 ---- .../GenericWalkUtilitysFinal.jl | 286 ----- .../GroebnerWalkFinalBenchmarkProcedures.jl | 1124 +++++++++++++---- .../GroebnerWalkUtilitysFinal.jl | 376 ------ .../StandardWalkUtilitysFinal.jl | 5 - .../TranWalkUtilitysFinal.jl | 44 - .../bechmarkingEveryProcedure/runbenchmark.jl | 176 +++ .../Benchmarking/readWriteHelper.jl | 46 +- .../Benchmarking/runbenchmark.jl | 540 -------- .../FractalWalkUtilitysFinal.jl | 8 +- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 2 +- .../GroebnerWalkUtilitysFinal.jl | 6 +- 19 files changed, 3076 insertions(+), 1963 deletions(-) create mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper create mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl create mode 100644 src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper new file mode 100644 index 000000000..e8a1410ad --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper @@ -0,0 +1,372 @@ +function runAll( + v::String, + ideal::Singular.sideal, + S::Singular.PolyRing, + StartOrd::Matrix{Int64}, + TarOrd::Matrix{Int64}, +) +runb(v,ideal,S,StartOrd,TarOrd) +runb2(v,ideal,S,StartOrd,TarOrd) +runb3(v,ideal,S,StartOrd,TarOrd) +end + +function prepareAlloc() +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + example = ["example"], +) +savew(df, "allocsStandardWalk") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +for i in 2:10 +savew(df, "allocsPertubedWalk",i) +end + +df = DataFrame( + weights = ["weights"], + facetnormal = ["-"], + initials = ["initials"], + stdh = ["stdh"], + liftgeneric = ["liftgeneric"], + interred = ["interred"], + example = ["example"], +) +savew(df, "allocsGenericWalk") + +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalk") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalklex") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalklookahead") + +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalkcombined") +df = DataFrame( + weights = "weights", + weight = "weight", + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + rep = ["rep"], + inCone = ["inCone"], + inseveral = ["inseveral"], + example = ["example"], +) +savew(df, "allocsTranWalk") +end + +function prepareExampleAlloc(v::String) +df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + example = [v], +) +savea(df, "allocsStandardWalk") +df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], +) +for i in 2:10 +savea(df, "allocsPertubedWalk",i) +end + +df = DataFrame( + weights = ["-"], + facetnormal = ["-"], + initials = ["-"], + stdh = ["-"], + liftgeneric = ["-"], + interred = ["-"], + example = [v], +) +savea(df, "allocsGenericWalk") + +df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], +) +savea(df, "allocsFractalWalk") +df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], +) +savea(df, "allocsFractalWalklex") +df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], +) +savea(df, "allocsFractalWalklookahead") +df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], +) +savea(df, "allocsFractalWalkcombined") +df = DataFrame( + weights = "-", + weight = "-", + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + rep = ["-"], + inCone = ["-"], + inseveral = ["-"], + example = [v], +) +savea(df, "allocsTranWalk") +end + +function prepareExampleElapsed(v::String) + df = DataFrame( + NextWeight = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift = ["-"], + interred = ["-"], + example = [v], + ) + savea(df, "standardWalk") + df = DataFrame( + NextWeight = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + for i in 2:10 + savew(df, "pertubedWalk",i) + end + + df = DataFrame( + NextWeight = ["-"], + facetnormal = ["-"], + initials = ["-"], + stdh = ["-"], + liftgeneric = ["-"], + interred = ["-"], + example = [v], + ) + savea(df, "genericWalk") + + df = DataFrame( + NextWeight = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["liftGW2"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalk") + df = DataFrame( + NextWeight = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["liftGW2"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalklex") + df = DataFrame( + NextWeight = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["liftGW2"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalklookahead") + df = DataFrame( + NextWeight = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["liftGW2"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalkcombined") + df = DataFrame( + NextWeight = "-", + weight = "-", + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift = ["-"], + interred = ["-"], + rep = ["-"], + inCone = ["-"], + inseveral = ["-"], + example = [v], + ) + savea(df, "tranWalk") +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl index 25e448a55..20f255f76 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl @@ -1,8 +1,8 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl") using BenchmarkTools ############################################################### @@ -39,7 +39,7 @@ Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Am Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that $T$ represents the lex ordering. Pertubes only the target vector. Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. """=# -function groebnerwalk( +function groebnerwalk2( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -47,44 +47,44 @@ function groebnerwalk( p::Int64 = 0, ) if grwalktype == :standard - walk = (x, y, z) -> standard_walk(x, y, z) + walk = (x, y, z) -> standard_walk2(x, y, z) elseif grwalktype == :generic - walk = (x, y, z) -> generic_walk(x, y, z) + walk = (x, y, z) -> generic_walk2(x, y, z) elseif grwalktype == :pertubed - walk = (x, y, z) -> pertubed_walk(x, y, z, p) + walk = (x, y, z) -> pertubed_walk2(x, y, z, p) elseif grwalktype == :fractal walk = - (x, y, z) -> fractal_walk( + (x, y, z) -> fractal_walk2( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) elseif grwalktype == :fractal_start_order walk = - (x, y, z) -> fractal_walk_start_order( + (x, y, z) -> fractal_walk2_start_order( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) elseif grwalktype == :fractal_lex walk = - (x, y, z) -> fractal_walk_lex( + (x, y, z) -> fractal_walk2_lex( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) elseif grwalktype == :fractal_look_ahead walk = - (x, y, z) -> fractal_walk_look_ahead( + (x, y, z) -> fractal_walk2_look_ahead( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), ) elseif grwalktype == :tran - walk = (x, y, z) -> tran_walk(x, y, z) - elseif grwalktype == :fractal_combined + walk = (x, y, z) -> tran_walk2(x, y, z) + elseif grwalktype == :fractal_combined2 walk = - (x, y, z) -> fractal_combined( + (x, y, z) -> fractal_combined2( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), @@ -103,13 +103,13 @@ function groebnerwalk( end -function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - #println("standard_walk results") +function standard_walk22(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + #println("standard_walk22 results") #println("Crossed Cones in: ") - standard_walk(G, S, T, S[1, :], T[1, :]) + standard_walk22(G, S, T, S[1, :], T[1, :]) end -function standard_walk( +function standard_walk22( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -154,14 +154,14 @@ end #Generic-version of the groebner walk by Fukuda et al. (2007) ############################################################### -function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function generic_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R = base_ring(G) Rn = change_order(G.base_ring, T) v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) - #println("generic_walk results") + #println("generic_walk2 results") #println("Crossed Cones with facetNormal: ") while !isempty(v) #global counter = getCounter() + 1 @@ -198,7 +198,7 @@ end ############################################################### #Pertubed-version of the groebner walk Amrhein et al. ############################################################### -function pertubed_walk( +function pertubed_walk2( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -207,12 +207,12 @@ function pertubed_walk( #cweight = pertubed_vector(G, S, p) cweight = S[1, :] terminate = false - #println("pertubed_walk results") + #println("pertubed_walk2 results") #println("Crossed Cones in: ") while !terminate tweight = pertubed_vector(G, T, p) - G = standard_walk(G, S, T, cweight, tweight) + G = standard_walk22(G, S, T, cweight, tweight) if inCone(G, T, tweight) terminate = true else @@ -232,14 +232,14 @@ end ############################################################### #fractal-walk by Amrhein et al. #Inlcuding: -#fractal_walk -> standard-version -#fractal_walk2 -> checks if the starting weight is in the inner of a cone. -#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. +#fractal_walk2 -> standard-version +#fractal_walk22 -> checks if the starting weight is in the inner of a cone. +#fractal_walk23 -> fractal walk expecially for conversion to the lexikographic orderig. # checks if the starting weight is in the inner of a cone. ############################################################### ######################################## -#Counter for the steps in the fractal_walk +#Counter for the steps in the fractal_walk2 ######################################## counterFr = 0 function deleteCounterFr() @@ -258,7 +258,7 @@ end PertVecs = [] sigma = [] -function fractal_walk( +function fractal_walk2( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -267,12 +267,12 @@ function fractal_walk( #println(PertVecs) #println("FacrtalWalk_standard results") #println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S,T, PertVecs, 1) + Gb = fractal_recursiv2(G, S,T, PertVecs, 1) #println("Cones crossed: ", deleteCounterFr()) return Gb end -function fractal_recursiv( +function fractal_recursiv2( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -308,7 +308,7 @@ function fractal_recursiv( #raiseCounterFr() else #println("up in: ", p, " with: ", w) - H = fractal_recursiv( + H = fractal_recursiv2( Singular.Ideal(R, [x for x in Gw]), S, T, @@ -330,7 +330,7 @@ function cwpert(p::Int64) cwPert[p] end -function fractal_walk_start_order( +function fractal_walk2_start_order( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -338,14 +338,14 @@ function fractal_walk_start_order( global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] global sigma = S.w - #println("fractal_walk_withStartorder results") + #println("fractal_walk2_withStartorder results") #println("Crossed Cones in: ") - Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) + Gb = fractal_walk2_recursiv_startorder2(G, S, T, PertVecs, 1) #println("Cones crossed: ", deleteCounterFr()) return Gb end -function fractal_walk_recursiv_startorder( +function fractal_walk2_recursiv_startorder2( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -393,7 +393,7 @@ function fractal_walk_recursiv_startorder( else #println("up in: ", p, " with: ", w) - H = fractal_walk_recursiv_startorder( + H = fractal_walk2_recursiv_startorder2( Singular.Ideal(R, [x for x in Gw]), S, T, @@ -409,20 +409,20 @@ function fractal_walk_recursiv_startorder( end return G end -function fractal_walk_lex( +function fractal_walk2_lex( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - #println("fractal_walk_lex results") + #println("fractal_walk2_lex results") #println("Crossed Cones in: ") - Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) + Gb = fractal_walk2_recursive_lex2(G, S, T, PertVecs, 1) #println("Cones crossed: ", deleteCounterFr()) return Gb end -function fractal_walk_recursive_lex( +function fractal_walk2_recursive_lex2( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -446,7 +446,7 @@ function fractal_walk_recursive_lex( end end if t == 1 && p==1 - return fractal_walk_recursive_lex( + return fractal_walk2_recursive_lex2( G, S, T, @@ -468,7 +468,7 @@ function fractal_walk_recursive_lex( #raiseCounterFr() else #println("up in: ", p, " with: ", w) - H = fractal_walk_recursive_lex( + H = fractal_walk2_recursive_lex2( Singular.Ideal(R, [x for x in Gw]), S, T, @@ -485,20 +485,20 @@ function fractal_walk_recursive_lex( end return G end -function fractal_walk_look_ahead( +function fractal_walk2_look_ahead( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) - #println("fractal_walk_look_ahead results") + #println("fractal_walk2_look_ahead results") #println("Crossed Cones in: ") global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) + Gb = fractal_walk2_look_ahead_recursiv2(G, S, T, PertVecs, 1) #println("Cones crossed: ", deleteCounterFr()) return Gb end -function fractal_walk_look_ahead_recursiv( +function fractal_walk2_look_ahead_recursiv2( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -534,7 +534,7 @@ function fractal_walk_look_ahead_recursiv( #raiseCounterFr() else #println("up in: ", p, " with: ", w) - H = fractal_walk_look_ahead_recursiv( + H = fractal_walk2_look_ahead_recursiv2( Singular.Ideal(R, Gw), S, T, @@ -554,21 +554,21 @@ end -function fractal_walk_combined( +function fractal_walk2_combined( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - #println("fractal_walk_withStartorder results") + #println("fractal_walk2_withStartorder results") #println("Crossed Cones in: ") - Gb = fractal_walk_combined(G, S, T, PertVecs, 1) + Gb = fractal_walk2_combined(G, S, T, PertVecs, 1) #println("Cones crossed: ", deleteCounterFr()) return Gb end -function fractal_walk_combined( +function fractal_walk2_combined( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -601,7 +601,7 @@ function fractal_walk_combined( end end if t == 1 && p==1 - return fractal_walk_combined( + return fractal_walk2_combined( G, S, T, @@ -624,7 +624,7 @@ function fractal_walk_combined( #raiseCounterFr() else #println("up in: ", p, " with: ", w) - H = fractal_walk_combined( + H = fractal_walk2_combined( Singular.Ideal(R, [x for x in Gw]), S, T, @@ -645,10 +645,10 @@ end #Tran-version of the groebner walk by Tran (2002) ############################################################### -function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function tran_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) cweight = S[1, :] tweight = T[1, :] - #println("tran_walk results") + #println("tran_walk2 results") #println("Crossed Cones in: ") R = base_ring(G) if !isMonomial(initials(R, Singular.gens(G), cweight)) diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl index f83ba674f..37927c0e6 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl @@ -2,27 +2,27 @@ using BenchmarkTools function prepare2() df = DataFrame( - example=[], - standard=[], - pertubed2=[], - pertubed3=[], - pertubed4=[], - pertubed5=[], - pertubed6=[], - pertubed7=[], - pertubed8=[], - pertubed9=[], - pertubed10=[], - fractal=[], - fractallex=[], - fractallookahead[], - fractalcombined=[], - generic=[], - tran=[], - stime=[], - ttime=[] + example=["-"], + standard=["-"], + pertubed2=["-"], + pertubed3=["-"], + pertubed4=["-"], + pertubed5=["-"], + pertubed6=["-"], + pertubed7=["-"], + pertubed8=["-"], + pertubed9=["-"], + pertubed10=["-"], + fractal=["-"], + fractallex=["-"], + fractallookahead=["-"], + fractalcombined=["-"], + generic=["-"], + tran=["-"], + stime=["-"], + ttime=["-"] ) - savew(df, "CompareAlg.txt") + savew(df, "CompareAlg") end function runb2( @@ -32,7 +32,7 @@ function runb2( StartOrd::Matrix{Int64}, TarOrd::Matrix{Int64}, ) - println("starting Benchmark") + println("starting Benchmark2") example=[] @@ -53,63 +53,51 @@ function runb2( generic=[] tran=[] + println("Computing deglex-Basis") @belapsed stime = Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 I = Singular.std(ideal, complete_reduction = true) ideals = [] + println("Benchmarking groebnerwalk2") for i = 2:nvars(S) if i ==2 - pertubed2 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed2 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==3 - pertubed3 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed3 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==4 - pertubed4 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed4 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==5 - pertubed5 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed5 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==6 - pertubed6 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed6 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==7 - pertubed7 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed7 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==8 - pertubed8 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed8 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==9 - pertubed9 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed9 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 elseif i==10 - pertubed10 = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + pertubed10 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 end - gb = groebnerwalk(I, StartOrd, TarOrd, :pertubed, i) + gb = groebnerwalk2(I, StartOrd, TarOrd, :pertubed, i) push!(ideals, gb) end - standard = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:standard, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - generic = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:generic, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - fractal = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractal, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - fractallex = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractallex, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - fractallookahead = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractallookahead, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - fractalcombined = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:fractalcombined, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - tran = @belapsed groebnerwalk($I, $StartOrd, $TarOrd, $:tran, $i) evals =1 samples =1 - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + standard = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:standard, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :standard)) + generic = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:generic, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :generic)) + fractal = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal)) + fractallex = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractallex, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal_look_ahead)) + fractallookahead = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractallookahead, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal_lex)) + fractalcombined = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractalcombined, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal_combined)) + tran = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:tran, $i) evals =1 samples =1 + push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :tran)) - println("Computing GB") - ttime = @belapsed Singular.std( - Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), - complete_reduction = true, - ) evals=1 samples =1 - df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) - savea(df, "SingularComputationTimings") - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), - complete_reduction = true, - ) - - df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) - savea(df, "correct.txt") df = DataFrame( example=[v], standard=[standard], @@ -131,15 +119,6 @@ function runb2( stime=[stime], ttime=[ttime] ) - savea(df, "CompareAlg.txt") + savea(df, "CompareAlg") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b],c=[v]) - savea(df, "correct.txt") - end end diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl new file mode 100644 index 000000000..b5da84a11 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -0,0 +1,949 @@ +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl") +using BenchmarkTools +BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 +BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 +a="-" +b="-" +z ="-" +c="-" +d="-" +e="-" +f="-" +g="-" +h="-" +i="-" +j="-" +k="-" +l="-" +function cleardf() + global a="-" + global b="-" + global c="-" + global d="-" + global e="-" + global f="-" + global g="-" + global h="-" + global i="-" + global j="-" + global k="-" + global l="-" + global z ="-" +end + +############################################################### +#Implementation of the gröbner walk. +############################################################### + +#for counting the steps of the groebnerwalk. +counter = 0 +function getCounter() + global counter + temp = counter + counter = 0 + return temp +end +#= +@doc Markdown.doc""" +function groebnerwalk( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) +Given an Ideal G generated by a reduced Groebner Basis w.r.t. the monomial ordering S this function +returns a reduced Groebner Basis w.r.t. the monomial ordering T by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart et al. (1993) +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). +Pertubed Walk (:pertubed, with p = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. +Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that T represents the lex ordering. Pertubes only the target vector. +Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. +"""=# +function groebnerwalk3( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + grwalktype::Symbol = :standard, + p::Int64 = 0, +) + if grwalktype == :standard + walk = (x, y, z) -> standard_walk3(x, y, z) + elseif grwalktype == :generic + walk = (x, y, z) -> generic_walk3(x, y, z) + elseif grwalktype == :pertubed + walk = (x, y, z) -> pertubed_walk3(x, y, z, p) + elseif grwalktype == :fractal + walk = + (x, y, z) -> fractal_walk3( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_start_order + walk = + (x, y, z) -> fractal_walk3_start_order( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_lex + walk = + (x, y, z) -> fractal_walk3_lex( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :fractal_look_ahead + walk = + (x, y, z) -> fractal_walk3_look_ahead( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + elseif grwalktype == :tran + walk = (x, y, z) -> tran_walk3(x, y, z) + elseif grwalktype == :fractal_combined + walk = + (x, y, z) -> fractal_walk3_combined( + x, + MonomialOrder(S, S[1, :], [0]), + MonomialOrder(T, T[1, :], T[1, :]), + ) + end + + ######TODO:Check the parameter##### + R = base_ring(G) + I = Singular.Ideal(R, [R(x) for x in gens(G)]) + + Gb = walk(I, S, T) + println("Cones crossed: ", getCounter()) + + S = change_order(Gb.base_ring, T) + return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) +end + + +function standard_walk3(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + println("standard_walk3 results") + println("Crossed Cones in: ") + standard_walk3(G, S, T, S[1, :], T[1, :]) +end + +function standard_walk3( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, +) + R = base_ring(G) + Rn = change_order(R, cweight, T) + terminate = false + while !terminate + global counter = getCounter() + 1 + println(cweight) + global b = cweight + G = standard_step3(G, R, cweight, Rn) + if cweight == tweight + terminate = true + else + global a = @ballocated next_weight($G, $cweight, $tweight) evals =1 samples=1 + cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) + end + end + return G +end + +function standard_step3( + G::Singular.sideal, + R::Singular.PolyRing, + cw::Vector{Int64}, + Rn::Singular.PolyRing +) +global z = length(Singular.gens(G)) + + +global c = @ballocated initials($Rn, gens($G), $cw) evals =1 samples=1 + + Gw = initials(Rn, gens(G), cw) + global d= @ballocated Singular.std( + Singular.Ideal($Rn, $Gw), + complete_reduction = true, + ) evals =1 samples=1 + + H = Singular.std( + Singular.Ideal(Rn, Gw), + complete_reduction = true, + ) + + + global e=@ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + global f= @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + global g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f],g=[g], h=[counter]) + cleardf() + savea(df,"allocsStandardWalk") + return Singular.std(H, complete_reduction = true) +end +############################## +#just for benchmark###### +############################# +function standard_walk32(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + println("standard_walk3 results") + println("Crossed Cones in: ") + standard_walk32(G, S, T, S[1, :], T[1, :]) +end + +function standard_walk32( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + cweight::Vector{Int64}, + tweight::Vector{Int64}, + k::Int64, +) +R = base_ring(G) +Rn = change_order(R, cweight, T) +terminate = false +while !terminate + global counter = getCounter() + 1 + println(cweight) + global b = cweight + G = standard_step32(G, R, cweight, Rn) + df = DataFrame(a=[a], b = [b], z=[z], c = [c], d = [d], e = [e], f=[f],g=[g],h=[h], i=[i], j =[j], k=[k],l=[l]) + cleardf() + savea(df,"allocsPertubedWalk",k) + if cweight == tweight + terminate = true + else + global a = @ballocated next_weight($G, $cweight, $tweight) evals =1 samples=1 + cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) + end +end +return G +end + +function standard_step32( + G::Singular.sideal, + R::Singular.PolyRing, + cw::Vector{Int64}, + Rn::Singular.PolyRing +) +global z = length(Singular.gens(G)) + + +global c = @ballocated initials($Rn, gens($G), $cw) evals =1 samples=1 + Gw = initials(Rn, gens(G), cw) + + global d= @ballocated Singular.std( + Singular.Ideal($Rn, $Gw), + complete_reduction = true, + ) evals =1 samples=1 + + H = Singular.std( + Singular.Ideal(Rn, Gw), + complete_reduction = true, + ) + + + global e=@ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + global f= @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + global g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + + return Singular.std(H, complete_reduction = true) +end +############################################################### +#Generic-version of the groebner walk by Fukuda et al. (2007) +############################################################### + +function generic_walk3(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + R = base_ring(G) + Rn = change_order(G.base_ring, T) + global a =@ballocated next_gamma($G, $[0], $S, $T) evals =1 samples=1 + v = next_gamma(G, [0], S, T) + Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) + + println("generic_walk3 results") + println("Crossed Cones with facetNormal: ") + while !isempty(v) + global counter = getCounter() + 1 + global b = v + println(v) + G, Lm = generic_step3(G, Lm, v, T,R) + df = DataFrame(a = [a], b = [b],z=[z], c = [c], d=[d], e=[e],f=[f],g=[g]) + savea(df, "allocsGenericWalk") + cleardf() + global a = @ballocated next_gamma($G, $Lm, $v, $S, $T) evals =1 samples=1 + v =next_gamma(G, Lm, v, S, T) + end + return Singular.interreduce(G) +end + +function generic_step3( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + v::Vector{Int64}, + T::Matrix{Int64}, + R::Singular.PolyRing +) where {L<:Nemo.RingElem} +global z = length(Singular.gens(G)) + + + Rn = Singular.base_ring(G) + global c =@ballocated facet_initials($G,$Lm, $v) evals =1 samples=1 + facet_Generators = facet_initials(G,Lm, v) + global d= @ballocated Singular.std( + Singular.Ideal($Rn, $facet_Generators), + complete_reduction = true, + ) evals =1 samples=1 + H = Singular.std( + Singular.Ideal(Rn, facet_Generators), + complete_reduction = true, + ) + global e = @ballocated lift_generic($G, $Lm, $H) evals =1 samples=1 + H, Lm = lift_generic(G, Lm, H) + global f= @ballocated interreduce($H, $Lm) evals =1 samples=1 + G = interreduce(H, Lm) + G = Singular.Ideal(Rn, G) + G.isGB = true + return G, Lm +end + + +############################################################### +#Pertubed-version of the groebner walk Amrhein et al. +############################################################### +function pertubed_walk3( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, + p::Int64, +) +k=p +df = DataFrame(a=["-"], b = ["-"],z=["-"], c = ["-"], d = ["-"], e = ["-"], f = ["-"], g=["-"], h=["-"], i=[(p,p)], j=["-"]) +savea(df, "allocsPertubedWalk",k) + #cweight = pertubed_vector(G, S, p) + cweight = S[1, :] + terminate = false + println("pertubed_walk3 results") + println("Crossed Cones in: ") + + while !terminate + global h = @ballocated pertubed_vector($G, $T, $p) evals =1 samples=1 + tweight = pertubed_vector(G, T, p) + G = standard_walk32(G, S, T, cweight, tweight,k) + + if inCone(G, T, tweight) + global i = @ballocated inCone($G, $T, $tweight) evals =1 samples=1 + terminate = true + else + if p == 1 + R = change_order(G.base_ring, T) + G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + global j= @ballocated Singular.std($G, complete_reduction = true) evals =1 samples=1 + G = Singular.std(G, complete_reduction = true) + terminate = true + end + p = p - 1 + cweight = tweight + end + df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k],l=[l]) + savea(df, "allocsPertubedWalk",k) + cleardf() + end + return G +end + +############################################################### +#fractal-walk by Amrhein et al. +#Inlcuding: +#fractal_walk3 -> standard-version +#fractal_walk32 -> checks if the starting weight is in the inner of a cone. +#fractal_walk33 -> fractal walk expecially for conversion to the lexikographic orderig. +# checks if the starting weight is in the inner of a cone. +############################################################### + +######################################## +#Counter for the steps in the fractal_walk3 +######################################## +counterFr = 0 +function deleteCounterFr() + global counterFr + temp = counterFr + counterFr = 0 + return temp +end +function getCounterFr() + global counterFr + return counterFr +end +function raiseCounterFr() + global counterFr = getCounterFr() + 1 +end +PertVecs = [] +sigma = [] + +function fractal_walk3( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println(PertVecs) + println("FacrtalWalk_standard results") + println("Crossed Cones in: ") + Gb = fractal_recursiv3(G, S,T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_recursiv3( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = base_ring(G) + terminate = false + G.isGB = true + w = S.w + h= "-" + i="-" + while !terminate + a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + t = nextT(G, w, PertVecs[p]) + if (t == [0]) + if inCone(G, T,PertVecs[p]) + h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + return G + else + i = @ballocated [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals =1 samples=1 + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + b = w + T.w = w + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 + Gw = initials(R, Singular.gens(G), w) + if p == nvars(R) + d = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals =1 samples=1 + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + H = fractal_recursiv3( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + end + e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + G = Singular.std(H, complete_reduction = true) + R = Rn + j = p + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"allocsFractalWalk") + cleardf() + + end + return G +end + +cwPert = [] +firstStepMode = false +function cwpert(p::Int64) + cwPert[p] +end + +function fractal_walk3_start_order( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + global sigma = S.w + println("fractal_walk3_withStartorder results") + println("Crossed Cones in: ") + Gb = fractal_walk3_recursiv_startorder(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk3_recursiv_startorder( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + h= "-" + i="-" + while !terminate + a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + println(PertVecs[p], " in depth", p) + return G + else + i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 + Gw = initials(R, gens(G), w) + if p == Singular.nvars(R) + d = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals =1 samples=1 + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk3_recursiv_startorder( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"allocsFractalWalkstartorder") + cleardf() + + R = Rn + end + return G +end +function fractal_walk3_lex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println("fractal_walk3_lex results") + println("Crossed Cones in: ") + Gb = fractal_walk3_recursive_lex(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk3_recursive_lex( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = S.w + h= "-" + i="-" + while !terminate + a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + return G + else + i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] + println(PertVecs) + continue + end + end + if t == 1 && p==1 + return fractal_walk3_recursive_lex( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + d = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals =1 samples=1 + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk3_recursive_lex( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"allocsFractalWalklex") + cleardf() + + R = Rn + end + return G +end +function fractal_walk3_look_ahead( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + println("fractal_walk3_look_ahead results") + println("Crossed Cones in: ") + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = fractal_walk3_look_ahead_recursiv(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk3_look_ahead_recursiv( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + w = S.w + h= "-" + i="-" + while !terminate + a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + return G + else + i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 + Gw = initials(R, Singular.gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + d = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals =1 samples=1 + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk3_look_ahead_recursiv( + Singular.Ideal(R, Gw), + S, + T, + PertVecs, + p + 1, + ) + end + e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R H, Rn) + g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"allocsFractalWalklookahead") + cleardf() + + R = Rn + end + return G +end + +function fractal_walk3_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + println("fractal_walk3_withStartorder results") + println("Crossed Cones in: ") + Gb = fractal_walk3_combined(G, S, T, PertVecs, 1) + println("Cones crossed: ", deleteCounterFr()) + return Gb +end + +function fractal_walk3_combined( + G::Singular.sideal, + S::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + PertVecs::Vector{Vector{Int64}}, + p::Int64, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + if (p == 1) + if !isMonomial(initials(R, Singular.gens(G), S.w)) + global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = cwPert[p] + else + w = S.w + end + h= "-" + i="-" + while !terminate + a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + t = nextT(G, w, PertVecs[p]) + if t == [0] + if inCone(G, T, PertVecs[p]) + h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + println(PertVecs[p], " in depth", p) + return G + else + i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + continue + end + end + if t == 1 && p==1 + return fractal_walk3_combined( + G, + S, + T, + PertVecs, + p + 1, + ) + else + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + + Rn = change_order(R, T) + global z = length(Singular.gens(G)) + + c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + d = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals =1 samples=1 + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + + H = fractal_walk3_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end + end + e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 + f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) + g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 + j = p + + G = Singular.std(H, complete_reduction = true) + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"allocsFractalWalkcombined") + cleardf() + + R = Rn + end + return G +end + +############################################################### +#Tran-version of the groebner walk by Tran (2002) +############################################################### + +function tran_walk3(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + cweight = S[1, :] + tweight = T[1, :] + println("tran_walk3 results") + println("Crossed Cones in: ") + R = base_ring(G) + if !isMonomial(initials(R, Singular.gens(G), cweight)) + cweight = pertubed_vector(G, S, nvars(R)) + end + + terminate = false + while !terminate + global a = @ballocated next_weight($G, $cweight, $tweight) evals =1 samples=1 + w = next_weight(G, cweight, tweight) + if tryparse(Int32, string(w)) == nothing + println("w bigger than int32") + return G + end + Rn= change_order(R, w, T) + if w == tweight + if inCone(G, T, cweight) + global i = @ballocated inCone($G, $T, $cweight) evals =1 samples=1 + return G + else + if inSeveralCones(initials(base_ring(G), gens(G), w)) + global j = @ballocated inSeveralCones(initials(base_ring($G), gens($G), $w)) evals =1 samples=1 + global h = @ballocated representation_vector($G, $T) evals =1 samples=1 + tweight = representation_vector(G, T) + continue + end + end + end + G = standard_step32(G, R, w, Rn) + global counter = getCounter() + 1 + println(w) + global b=w + R = Rn + cweight = w + df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) + savea(df,"allocsTranWalk") + cleardf() + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl new file mode 100644 index 000000000..e0a24dc47 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl @@ -0,0 +1,292 @@ +using BenchmarkTools + +function prepare3() +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + example = ["example"], +) +savew(df, "allocsStandardWalk") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +for i in 2:10 +savew(df, "allocsPertubedWalk",i) +end + +df = DataFrame( + weights = ["weights"], + facetnormal = ["-"], + initials = ["initials"], + stdh = ["stdh"], + liftgeneric = ["liftgeneric"], + interred = ["interred"], + example = ["example"], +) +savew(df, "allocsGenericWalk") + +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalk") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalklex") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalklookahead") +df = DataFrame( + weights = ["weights"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + lift2 = ["lift2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "allocsFractalWalkcombined") +df = DataFrame( + weights = "weights", + weight = "weight", + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift2 = ["lift2"], + interred = ["interred"], + rep = ["rep"], + inCone = ["inCone"], + inseveral = ["inseveral"], + example = ["example"], +) +savew(df, "allocsTranWalk") +end +function runb3( + v::String, + ideal::Singular.sideal, + S::Singular.PolyRing, + StartOrd::Matrix{Int64}, + TarOrd::Matrix{Int64}, +) + println("starting Benchmark") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + example = [v], + ) + savea(df, "allocsStandardWalk") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + for i in 2:10 + savea(df, "allocsPertubedWalk",i) +end + + df = DataFrame( + weights = ["-"], + facetnormal = ["-"], + initials = ["-"], + stdh = ["-"], + liftgeneric = ["-"], + interred = ["-"], + example = [v], + ) + savea(df, "allocsGenericWalk") + + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalk") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalklex") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalklookahead") + df = DataFrame( + weights = ["-"], + weight = ["-"], + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + lift2 = ["-"], + lift = ["-"], + interred = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalkcombined") + df = DataFrame( + weights = "-", + weight = "-", + nGens = ["-"], + initials = ["-"], + stdh = ["-"], + liftGW2 = ["-"], + lift2 = ["-"], + interred = ["-"], + rep = ["-"], + inCone = ["-"], + inseveral = ["-"], + example = [v], + ) + savea(df, "allocsTranWalk") + + println("Computing deglex-Basis") + stime =@belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 + I = Singular.std(ideal, complete_reduction = true) + + println("Benchmarking GroebnerWalk") + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + println("Computing lex-Basis") + ttime = @belapsed Singular.std( + Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), + complete_reduction = true, + ) evals=1 samples =1 + + df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) + savea(df, "SingularComputationTimings") + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) + savea(df, "correct") + + println("Benchmarking ideals") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b],c=[v]) + savea(df, "correct") + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 15dcfc0e4..6a0a96dbd 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -1,10 +1,10 @@ -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl", -) +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") include("readWriteHelper.jl") -include("parser.jl") -include("runbenchmark.jl") + using DataFrames @@ -13,6 +13,7 @@ function runAllSingleExample() cd("/Users/JordiWelp/Results") prepare() prepare2() + prepareAlloc() #Katsura 5 dim = 5 @@ -34,6 +35,7 @@ function runAllSingleExample() I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) runb("Katsura5", I, S, StartOrd, TarOrd) runb2("Katsura5", I, S, StartOrd, TarOrd) + runb3("Katsura5", I, S, StartOrd, TarOrd) #Katsura6 @@ -55,8 +57,7 @@ function runAllSingleExample() f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - runb("Katsura6", I, S, StartOrd, TarOrd) - runb2("Katsura6", I, S, StartOrd, TarOrd) + runAll("Katsura6", I, S, StartOrd, TarOrd) dim = 7 @@ -107,8 +108,7 @@ function runAllSingleExample() f7 = x1 * x2 * x3 * x4 * x5 * x6 * x7 - 1 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) @@ -152,24 +152,7 @@ function runAllSingleExample() f6 = x1 * x2 * x3 * x4 * x5 * x6 - 1 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, - ) - df = DataFrame(a = ["test1"], b = ["test2"], c = ["example"]) - savew(df, "correct.txt") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b], c = [example]) - savea(df, "correct.txt") - end + runAll(example, I, S, StartOrd, TarOrd) dim = 5 ve = [1, 1, 1, 1, 1] @@ -196,8 +179,8 @@ function runAllSingleExample() I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 6 ve = [1, 1, 1, 1, 1, 1] @@ -220,8 +203,8 @@ function runAllSingleExample() f6 = x1 * x2 * x6 + x2 * x3 * x6 + x3 * x4 * x6 + x4 * x5 * x6 + x1 * x6 - 1 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 6 ve = [1, 1, 1, 1, 1, 1] @@ -251,8 +234,8 @@ function runAllSingleExample() I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 5 @@ -284,8 +267,7 @@ function runAllSingleExample() 11 * x2 + 10 I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) - runb(example, I, S, StartOrd, TarOrd) - + runAll(example, I, S, StartOrd, TarOrd) dim = 6 @@ -338,8 +320,8 @@ function runAllSingleExample() 10 * x2 * x6^2 - 11 * x2 + 10 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 7 ve = [1, 1, 1, 1, 1, 1, 1] @@ -404,8 +386,8 @@ function runAllSingleExample() 10 * x2 * x7^2 - 11 * x2 + 10 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 8 @@ -486,7 +468,7 @@ function runAllSingleExample() 10 * x2 * x8^2 - 11 * x2 + 10 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) - runb(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) dim = 7 @@ -510,9 +492,7 @@ function runAllSingleExample() f7 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 - u7 I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) - + runAll(example, I, S, StartOrd, TarOrd) dim = 8 ve = [1, 1, 1, 1, 1,1,1,1] @@ -536,8 +516,8 @@ function runAllSingleExample() f8 =x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x6*x7+x1-u8 I = Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7, f8]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 6 ve = [1, 1, 1, 1, 1,1] @@ -557,8 +537,8 @@ function runAllSingleExample() f4 =3*x3*x2*b+3*x2*x0*a+3*x1^2 I = Singular.Ideal(R, [f1, f2,f3,f4]) - runb(example, I, S, StartOrd, TarOrd) - runb2(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + dim = 4 @@ -578,7 +558,28 @@ function runAllSingleExample() f3 =x^2*y*t^3-2*x*y^2*t^3+y^3*t^3+8*x^2*y*t^2-12*x*y^2*t^2+4*y^3*t^2-24*x*y*t^3+24*y^2*t^3+20*x^2*y*t-20*x*y^2*t-160*x*y*t^2+96*y^2*t^2+128*x*t^3+16*x^2*y+96*x*y*t+2304*x*t^2+1152*x*y+13824*x*t+27648*x f4 =-x^3*z*t^2+x^2*z^2*t^2-6*x^3*z*t+4*x^2*z^2*t+32*x^3*t^2-72*x^2*z*t^2-87*x*z^2*t^2-z^3*t^2-8*x^3*z-432*x^2*z*t-414*x*z^2*t+2592*x*z*t^2+864*z^2*t^2-1728*x^2*z-20736*x*z*t+3456*z^2*t-186624*z*t^2-124416*x*z-1492992*z*t-2985984*z I = Singular.Ideal(R, [f1, f2,f3,f4]) - runb(example, I, S, StartOrd, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) + + + + dim = 3 + ve = [9, 9, 8] + example ="Oberfranz" + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (x1,x2,x3) = Singular.PolynomialRing( + Singular.QQ, + ["x1","x2","x3"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + f1=x2^3+x1*x2*x3+x2^2*x3+x1*x3^3 + f2=3+x1*x2+x1^2*x2+x2^2*x3 + + I = Singular.Ideal(R, [f1, f2]) + runAll(example, I, S, StartOrd, TarOrd) + + end #= diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl index db19648db..ab0f27133 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl @@ -1 +1,261 @@ +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") +include("readWriteHelper.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") + + +using DataFrames +using CSV + + +function benchmarkVar3() + cd("/Users/JordiWelp/Results") + prepare() + prepare2() + prepare3() + dim = 3 + ve = [1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + ideals = [] + + push!( + ideals, + Singular.Ideal( + R, + [b*c^2+78*a^2*b*c+27*a*b^2*c+31*a*b^4+a^2*b*c^2+89*a*b^2*c^2+70*a*b*c^3, +56*c+2*b*c+72*a^2*b*c+64*a^2*c^2+78*a*c^3, +55+12*a*c+28*b^2*c+12*c^3+82*b^5+67*a^4*c+5*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [25+47*a*b+74*b^3+16*a*b*c^2+28*b*c^3+11*b^5+38*a*b^3*c+33*a^2*c^3, +73*a*c+34*a^2*c+41*a*b^3+67*a^5+39*b^4*c+85*a^2*c^3+78*c^5, +48*c+70*a*c^2+6*a*b*c^2+90*c^4])) +push!( + ideals, + Singular.Ideal( + R, + [57*b*c^2+63*c^3+58*a^3*c+59*b^3*c^2+a*b*c^3+57*b^2*c^3+11*b*c^4+50*c^5, +83*b+69*b*c+33*a*b*c^3, +47+69*c^2+82*b^3+33*a^3*b+22*a*b^3+5*a*b^2*c+12*c^4+44*b*c^4])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] +push!( + ideals, + Singular.Ideal( + R, + [8*a*b+88*a^3+70*a^2*b+62*c^3+47*b^4+46*b^3*c+17*a^2*c^2+23*b^2*c^2+50*a*c^3+72*a*b^4+78*b^5+27*a*b^2*c^2, +79*c+79*a^2+42*a*b+69*c^2+70*b^2*c+3*a*c^2+41*b*c^2+29*a*c^3+31*b*c^3+15*a^2*b^2*c+45*a^2*b*c^2+2*a*c^4, +23+5*c+58*a^3*b+88*b*c^3+79*a^3*b^2+13*a*b^4+86*a^3*b*c+89*b^4*c+61*a*b^2*c^2+89*b^3*c^2+85*b^2*c^3])) +push!( + ideals, + Singular.Ideal( + R, + [9*b+88*b*c+47*b^2*c+41*a^4+82*a*b^3+44*a^3*c+43*a^4*b+57*b^4*c+43*a^2*b*c^2+39*a^2*c^3+50*c^5, +74*b+81*a^2+59*b^2+47*a^2*b+44*a*b^2+64*b*c^2+74*a*b*c^2+82*a*c^3+26*a^5+89*a^2*b^2*c+57*a^3*c^2, +71+49*b^2+83*b^3+10*a^2*c+49*a^3*b+79*a*b^3+12*b^3*c+9*a^2*c^2+65*a*b^4+23*a^2*b*c^2+71*b^3*c^2+2*b^2*c^3+46*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [45+5*c+18*b^2+5*a*c+39*c^2+17*a^3+39*a^2*b+78*a^2*c+86*a*c^2+44*a^4+64*a^2*b*c+29*b^5, +21*a^3+61*b*c^2+45*a*b^2*c+85*b^3*c+11*a^2*c^2+51*a*b*c^2+38*c^4+82*a*b^4+55*a*b^3*c+57*b^4*c+42*a^3*c^2+74*a^2*c^3+55*b^2*c^3, +5*b+40*b^2+90*b^4+12*b^3*c+45*a^3*b^2+73*b^3*c^2+49*a*b*c^3+2*b^2*c^3+73*b*c^4+c^5])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] + +push!( + ideals, + Singular.Ideal( + R, + [52+30*a+58*c+62*a*b^2+b^3+59*a*b*c+49*a*c^2+29*a^2*b^2+5*a^3*c+43*a^2*b*c+76*a^2*c^2+20*b*c^3+66*c^4+11*a^3*b^2+57*a*b^4+31*a^4*c+68*a^2*b^2*c+56*a*b^2*c^2+12*a*c^4, +23*c+29*a^2+6*b^2+71*b*c+47*c^2+55*a*b^2+88*b^3+66*a*b*c+29*b*c^2+62*a^3*b+41*a^2*b*c+59*a*b^2*c+82*a*b^4+47*b^5+83*b^4*c+60*a*b*c^3+51*b^2*c^3, +57*a^2+86*a*b+78*a*b*c+88*a*b^3+20*a^2*b*c+16*a*b*c^2+69*a*c^3+89*c^4+87*a*b^4+25*b^5+84*a*b^3*c+87*b^4*c+11*a^2*b*c^2+28*b^3*c^2+28*a^2*c^3+8*a*c^4])) +push!( + ideals, + Singular.Ideal( + R, + [87*a*b+89*b^2+b*c+31*b^2*c+89*a^4+3*a*b^3+74*b^4+81*a^3*c+31*a^2*b*c+78*a^2*c^2+47*c^4+45*a^3*b^2+29*a^2*b^3+27*a*b^3*c+19*b^4*c+32*a^3*c^2+71*a^2*b*c^2, +21+5*a+89*a*c+24*a^2*b+22*b^3+47*b*c^2+2*c^3+43*a^3*c+16*a*b*c^2+a^4*b+45*b^5+56*b^4*c+36*a^2*c^3+33*a*b*c^3, +71*a+66*b+15*a*b+41*a*c+35*a^3+26*a*b^2+59*a*c^2+77*c^3+65*a*b^3+a*b^2*c+26*b^3*c+27*a*c^3+76*c^4+43*a^5+16*a^3*b^2+33*a*b^4+44*b^5+41*b^4*c+80*a*b^2*c^2+9*a^2*c^3+b^2*c^3])) +push!( + ideals, + Singular.Ideal( + R, + [79*b+38*c+63*a*b+69*a*c^2+45*b*c^2+18*b^4+89*a*b^2*c+24*a*c^3+51*c^4+66*a^2*b^3+50*a^4*c+51*a^3*b*c+51*a^2*b*c^2+29*a*b^2*c^2+80*a*c^4, +31*a^2+61*a*b+61*a*c+10*b*c+61*a*b^2+3*b^3+66*a^2*c+57*a^2*b^2+62*a*b^3+28*a^2*b*c+12*a*b^2*c+7*a*c^3+26*b*c^3+73*a^3*b^2+65*a^3*b*c+21*a^3*c^2+58*a^2*b*c^2+23*b^2*c^3+2*c^5, +67+29*b+12*a*c+10*a^3+21*a^2*c+35*a*b*c+5*c^3+12*a^3*c+38*a^2*c^2+44*a*b*c^2+61*b^2*c^2+13*a*b^4+63*b^5+59*b^4*c+83*a^2*c^3+47*a*b*c^3+62*b^2*c^3+57*b*c^4])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] + +push!( + ideals, + Singular.Ideal( + R, + [86+29*c+64*a^2+47*a*b+79*b^2+59*c^2+77*a^3+53*a^2*b+34*a*b^2+54*b^3+65*a*b*c+69*c^3+30*b^4+25*a^3*c+31*b^3*c+42*a^2*c^2+29*b^2*c^2+71*b*c^3+10*c^4+a^5+54*a^2*b^3+48*a^3*b*c+13*a^2*b*c^2+33*b^3*c^2+71*a^2*c^3+51*c^5, +24*b+c+8*a*b+85*b^2+68*a*b*c+90*b^4+29*a^3*c+88*a*b^2*c+39*b^3*c+28*a^5+47*a^4*b+40*a^2*b^3+86*a*b^4+86*a^4*c+48*a^3*b*c+22*a^2*b^2*c+59*a*b^3*c+84*a^2*b*c^2+43*a*b^2*c^2+8*a*b*c^3+88*a*c^4+36*b*c^4+56*c^5, +71+32*c+25*a*b+67*c^2+10*a^3+4*b^3+22*a*b*c+5*b^2*c+26*b*c^2+57*a^4+40*a^2*b^2+11*b^4+65*a^3*c+18*a*b^2*c+31*b^3*c+23*a^2*c^2+2*a^5+51*a^4*b+77*b^4*c+50*a*b^2*c^2+45*b^2*c^3])) +push!( + ideals, + Singular.Ideal( + R, + [73*b+3*a^2+65*a*c+30*a*b*c+4*b*c^2+9*c^3+55*a^2*b^2+34*a*b^3+86*b^4+55*a^2*c^2+75*a*c^3+13*b*c^3+19*c^4+82*a^5+44*a^4*b+64*a^2*b^3+74*a*b^4+82*b^5+54*a^2*b^2*c+56*a*b*c^3+85*b*c^4+34*c^5, +31+8*b^2+31*a^3+33*a^2*c+13*a*b*c+29*c^3+25*a^4+17*b^4+50*a^3*c+66*a^2*b*c+66*b^3*c+77*a*b^4+64*b^5+27*a^2*b^2*c+76*a*b^3*c+88*b^4*c+81*a^3*c^2+40*a^2*b*c^2+37*a*b*c^3, +49+5*a+80*b+86*c+28*a^2+8*a*b+31*b^2+47*a*c+65*b*c+73*a^3+54*a^2*b+31*b^3+41*a^2*c+30*c^3+27*a^2*b^2+85*a*b^3+31*b^4+56*a^3*c+a^2*c^2+16*b*c^3+46*a^5+8*a^4*b+65*a^2*b^3+51*a*b^4+30*a^4*c+77*a^3*c^2+20*b^3*c^2+14*a*b*c^3+48*b*c^4])) +push!( + ideals, + Singular.Ideal( + R, + [76+83*b+36*c+67*a^2+4*a*b+81*a*c+26*b^3+63*a^2*c+12*a*b*c+32*b^2*c+9*c^3+82*a^4+4*b^4+49*a*b^2*c+77*b^3*c+73*a*b*c^2+14*b^2*c^2+26*b*c^3+5*a^3*b^2+73*a^4*c+44*b^4*c+86*a^3*c^2+67*a*b^2*c^2+2*b^3*c^2+84*a^2*c^3+35*a*c^4+67*b*c^4, +81+27*a^2+69*b^2+60*a^3+53*a*b*c+12*a*b^3+66*b^4+5*a^2*b*c+9*a*b^2*c+88*b^3*c+72*a^2*c^2+6*a^4*b+55*a^2*b^3+72*a*b^4+43*b^5+62*a^2*b^2*c+53*a^2*b*c^2+46*a*b^2*c^2+75*b^2*c^3, +50*a+9*b+36*a*b+52*a*c+81*c^2+29*a^3+33*a*b^2+36*b^3+23*a^2*c+71*b*c^2+33*a*b^3+46*b^4+11*a^3*c+86*b^3*c+3*a*c^3+56*a^5+74*a^3*b^2+38*a*b^4+16*a^4*c+40*a^2*b*c^2+27*a*b*c^3+6*b^2*c^3+72*a*c^4+50*c^5])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] + +push!( + ideals, + Singular.Ideal( + R, + [37+33*b+64*a^2+40*b*c+86*c^2+19*a*c^2+30*b*c^2+61*c^3+54*a^4+25*a^3*b+81*a*b^3+87*a^3*c+67*a^2*b*c+25*a*c^3+88*b*c^3+15*a^3*b^2+73*a^2*b^3+54*a^2*b^2*c+48*a*b^3*c+56*b^4*c+7*a^3*c^2+49*a^2*b*c^2+82*a^2*c^3+8*a*b*c^3+42*b*c^4, +77+13*a+7*b+72*a*b+b^2+72*b*c+85*c^2+90*a^2*b+6*b^3+51*a^2*c+41*a*b*c+8*a*c^2+56*b*c^2+81*a^3*c+39*a^2*b*c+34*b^2*c^2+55*a*c^3+75*a^3*b*c+61*a^2*b^2*c+48*b^4*c+76*a^2*b*c^2+18*a*b^2*c^2+7*b^3*c^2+53*b^2*c^3+35*b*c^4+12*c^5, +30*a+16*b+37*a*c+11*c^2+77*a^3+87*a^2*b+17*a*b^2+38*b^3+37*b^2*c+31*a*c^2+29*a^4+57*a^3*b+14*a*b^3+78*b^4+56*a^3*c+73*a^2*b*c+80*b^3*c+75*a^2*c^2+68*a*b*c^2+58*a*c^3+66*b*c^3+40*c^4+40*a^5+23*a^3*b^2+25*a^2*b^3+36*a*b^4+70*a^2*b^2*c+48*b^4*c+87*a^3*c^2+29*a*b^2*c^2+81*b^3*c^2+27*a^2*c^3+19*a*b*c^3+8*a*c^4+16*b*c^4])) +push!( + ideals, + Singular.Ideal( + R, + [23+23*b+51*c+19*a*b+49*b^2+84*b*c+32*c^2+20*a^3+a^2*b+89*a*b^2+74*b^3+44*b^2*c+19*c^3+45*a^4+38*a^3*b+47*a^2*b^2+5*a*b^3+54*b^4+35*a^3*c+13*b^3*c+72*b^2*c^2+37*a*c^3+75*b*c^3+67*a^4*b+65*a*b^4+63*a^4*c+16*a^3*b*c+32*b^4*c+58*a*b*c^3+90*a*c^4+22*b*c^4, +9*c+11*a*c+29*c^2+69*a^3+75*a^2*b+56*a*b^2+44*c^3+86*a^3*b+60*b^4+16*a^2*b*c+3*a^2*c^2+43*a*b*c^2+21*b^2*c^2+31*a^4*b+44*b^5+44*a^4*c+68*a^3*b*c+86*a*b^3*c+24*b^4*c+40*a*b^2*c^2+36*b^3*c^2+37*a^2*c^3+28*a*b*c^3+54*b^2*c^3+20*a*c^4+23*b*c^4+15*c^5, +45+44*a+69*b+40*a^2+9*b*c+52*c^2+62*a^2*b+15*a*b^2+13*b^3+19*b^2*c+88*b*c^2+30*a^4+13*a^3*b+74*a^3*c+10*a^2*b*c+42*a*b^2*c+53*a^2*c^2+88*a*c^3+59*a^5+66*a^4*b+49*a^2*b^3+44*a^4*c+65*a^3*b*c+50*b^4*c+46*a^2*b*c^2+45*a*b*c^3+69*b^2*c^3+86*a*c^4])) +push!( + ideals, + Singular.Ideal( + R, + [22*a+c+69*b^2+41*a*c+60*c^2+35*a^2*b+89*a*b*c+26*b^2*c+27*a*c^2+38*a^2*b^2+32*b^4+36*a^3*c+78*a^2*b*c+56*a*b^2*c+20*b^3*c+77*b^2*c^2+17*a*c^3+51*b*c^3+8*a^5+56*a^2*b^3+88*a*b^4+77*b^5+47*a^3*b*c+22*a*b^3*c+54*b^4*c+37*a^2*b*c^2+34*a*b^2*c^2+10*a^2*c^3+13*b*c^4, +87+52*a+56*b+16*a^2+14*b^2+21*a*c+47*c^2+54*a^3+30*a^2*c+87*a*b*c+34*a*c^2+2*c^3+81*a^2*b^2+46*b^4+34*a^2*b*c+24*b^3*c+89*a^2*c^2+54*a*c^3+64*b*c^3+40*a^5+65*a^3*b^2+68*a^4*c+42*a^3*b*c+49*a^2*b*c^2+29*a*b*c^3+2*b^2*c^3+26*a*c^4+12*c^5, +48+23*b+50*b^2+73*a*c+47*a^3+60*a^2*b+50*a*b^2+57*b^3+57*a*b*c+55*b^2*c+11*a^3*b+3*a^2*b^2+60*b^4+23*b^3*c+81*a*c^3+5*b*c^3+41*c^4+78*a^4*b+66*a*b^4+15*b^5+10*a^4*c+49*a^3*b*c+40*a^2*b^2*c+41*a^3*c^2+8*a^2*b*c^2+12*a*b^2*c^2+81*a^2*c^3+66*a*c^4+66*b*c^4])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] + +push!( + ideals, + Singular.Ideal( + R, + [1+62*a+86*c+31*a*b+47*b^2+41*a*c+3*c^2+48*a^3+38*a^2*b+27*b^3+79*a*b*c+78*a*c^2+62*a^4+12*a^2*b^2+28*a*b^3+32*b^4+81*a^3*c+19*a^2*b*c+32*b^3*c+16*b*c^3+85*c^4+51*a^5+85*a^3*b^2+60*a^2*b^3+a^2*b^2*c+80*a*b^3*c+6*a^3*c^2+58*a^2*b*c^2+29*b^3*c^2+27*a^2*c^3+67*a*b*c^3+43*a*c^4+41*b*c^4+48*c^5, +64*a+4*b+26*c+77*a^2+27*b^2+2*b*c+30*a^3+54*a*b^2+42*a^2*c+47*a*b*c+49*b^2*c+41*b*c^2+90*c^3+64*a^4+78*a^3*b+a*b^3+51*a^3*c+27*a^2*b*c+55*a*b^2*c+26*a^2*c^2+47*a*b*c^2+44*b^2*c^2+56*c^4+20*a^4*b+53*a^2*b^3+3*a*b^4+29*a^4*c+36*a^3*b*c+60*a*b^2*c^2+87*b^3*c^2+35*b^2*c^3+11*a*c^4+36*b*c^4+11*c^5, +50+43*c+25*a^2+80*a*b+29*b^2+3*a*c+7*a^3+24*a*b^2+56*b^3+78*a^2*c+4*a*b*c+78*c^3+29*a^3*b+52*a*b^3+74*b^4+27*a^3*c+60*a*b^2*c+28*a^2*c^2+37*b^2*c^2+52*a*c^3+65*a^5+18*a^4*b+71*a^3*b^2+68*a^2*b^3+13*b^5+36*a^4*c+5*a^3*b*c+72*a^2*b^2*c+26*a*b^3*c+59*a^2*b*c^2+43*a*b*c^3+68*b^2*c^3+79*a*c^4+71*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [47+81*a+41*c+47*a^2+62*b^2+28*a*c+59*a^3+78*b^3+41*a*b*c+20*b^2*c+18*b*c^2+10*a^4+52*a^2*b^2+19*b^4+66*a^3*c+64*a^2*b*c+14*b^3*c+71*a^2*c^2+39*a*c^3+b*c^3+26*a^4*b+38*a^3*b^2+89*a^2*b^3+39*b^5+59*a^4*c+49*b^4*c+8*a^2*b*c^2+26*a*b^2*c^2+7*a^2*c^3+25*a*c^4, +50+82*a+69*b+46*a*b+26*b^2+61*c^2+71*a^3+5*a^2*b+43*a*b^2+11*b^3+81*a^2*c+83*a*b*c+26*b^2*c+36*b*c^2+82*a^4+11*a^3*b+16*a*b^3+55*a^2*b*c+24*a*b^2*c+30*b^3*c+60*a^2*c^2+67*a*b*c^2+85*b^2*c^2+90*a*c^3+63*a^5+37*a^3*b^2+51*a*b^4+58*b^5+90*a^4*c+29*a^2*b^2*c+36*a*b^3*c+59*a*b^2*c^2+81*a*b*c^3+70*b^2*c^3+55*a*c^4+8*c^5, +30*b+62*c+6*a^2+36*a*b+22*b^2+42*b*c+23*c^2+20*a^3+88*a^2*b+55*a*b^2+56*b^2*c+75*c^3+18*a^3*b+21*a^2*b^2+65*a^2*b*c+70*a*b^2*c+47*a*b*c^2+11*b^2*c^2+69*a*c^3+82*c^4+42*a^5+25*a^4*b+19*a^3*b^2+79*a^2*b^3+19*a*b^4+44*b^5+53*a^2*b^2*c+83*b^4*c+28*a^2*b*c^2+67*a*b^2*c^2+54*b^3*c^2+6*a^2*c^3+13*b^2*c^3+64*a*c^4+52*b*c^4+76*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [28+76*b+41*c+34*a^2+77*a*b+12*b^2+50*a*c+75*c^2+52*a^3+26*b^2*c+17*a*c^2+12*c^3+16*a^4+51*a^3*b+41*a^2*b^2+12*a*b^3+62*b^4+63*a^3*c+48*a^2*b*c+45*a*b^2*c+62*b^3*c+34*a^2*c^2+33*a*c^3+84*c^4+81*a^5+53*a^3*b^2+62*b^5+57*a^4*c+65*a^3*b*c+14*b^4*c+52*a^3*c^2+19*a^2*b*c^2+37*a*b^2*c^2+32*a^2*c^3+36*a*b*c^3+32*b^2*c^3+51*b*c^4+51*c^5, +54*a+42*b+14*c+41*a*b+10*b*c+10*c^2+87*a^2*b+43*a*b^2+14*a*b*c+39*b^2*c+59*a*c^2+58*b*c^2+5*c^3+10*a^4+51*a*b^3+64*b^4+73*a*b*c^2+59*b^2*c^2+a*c^3+77*b*c^3+5*a^5+31*a^4*b+88*a^2*b^3+37*a*b^4+29*a^2*b^2*c+53*a^3*c^2+2*b^3*c^2+15*a^2*c^3+38*a*c^4+20*c^5, +16+b+85*a^2+90*a*c+37*c^2+44*a^3+55*a*b^2+31*b^3+17*a*b*c+76*a*c^2+33*b*c^2+9*c^3+84*a^3*b+11*a^2*b^2+13*a*b^3+62*a^2*c^2+45*a*b*c^2+60*b^2*c^2+15*b*c^3+85*c^4+15*a^5+78*a^2*b^3+25*a*b^4+87*b^5+74*a^4*c+31*a^2*b^2*c+6*a*b^3*c+22*b^4*c+35*a^2*b*c^2+76*b^3*c^2+34*a^2*c^3+80*a*b*c^3+77*b^2*c^3+c^5])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] + +push!( + ideals, + Singular.Ideal( + R, + [59+38*a+16*b+11*c+57*a^2+30*a*b+17*b^2+4*a*c+59*b*c+28*a^3+4*a^2*b+57*a*b^2+71*b^3+62*a^2*c+35*b^2*c+84*c^3+79*a^4+3*a*b^3+38*b^4+56*a^3*c+21*b^3*c+48*a^2*c^2+70*a*c^3+7*b*c^3+40*c^4+4*a^5+28*a^2*b^3+16*b^5+20*a^4*c+27*a^3*b*c+35*a*b^3*c+36*b^4*c+17*a^3*c^2+29*a^2*b*c^2+59*a*b^2*c^2+28*b^3*c^2+30*a^2*c^3+76*b*c^4+85*c^5, +49+4*a+6*c+8*a^2+55*a*b+63*b^2+57*a*c+5*c^2+8*a^3+82*a*b^2+14*b^3+6*a*b*c+53*b^2*c+90*a*c^2+74*b*c^2+8*c^3+82*a^3*b+54*a^2*b^2+39*a*b^3+37*b^4+3*a^2*b*c+49*a*b^2*c+12*a^2*c^2+25*a*b*c^2+88*b^2*c^2+30*a*c^3+41*c^4+86*a^5+13*a^4*b+58*a^2*b^3+74*b^5+64*a^4*c+25*a^2*b^2*c+52*a*b^3*c+40*a^3*c^2+73*a^2*b*c^2+55*a*b*c^3+4*b^2*c^3+10*a*c^4+16*c^5, +35*a+30*b+42*a^2+47*b*c+13*c^2+71*a^3+9*a^2*b+33*a*b^2+84*a^2*c+b*c^2+57*c^3+46*a^4+43*a^3*b+18*a*b^3+44*b^4+6*a^3*c+5*a^2*b*c+85*a*b^2*c+75*b^3*c+33*b^2*c^2+14*a*c^3+33*c^4+22*a^5+2*a^4*b+21*a^3*b^2+62*a^2*b^3+13*a*b^4+54*b^5+44*a^4*c+62*a^3*b*c+16*a^2*b^2*c+32*a*b^3*c+53*b^4*c+20*a*b^2*c^2+83*a^2*c^3+18*b^2*c^3+40*a*c^4+12*b*c^4+26*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [61+81*a+73*b+17*c+9*a^2+50*a*b+84*a*c+66*c^2+20*a^3+2*a^2*b+9*a*b^2+72*a^2*c+70*a*b*c+60*b^2*c+73*a*c^2+44*b*c^2+32*a^4+50*a^3*b+53*b^4+12*a*b^2*c+33*a^2*c^2+75*b*c^3+30*a^5+42*a^2*b^3+18*a*b^4+71*b^5+26*a^3*b*c+39*a^2*b^2*c+74*a*b^3*c+81*b^4*c+38*b^3*c^2+23*a^2*c^3+7*a*b*c^3+66*b^2*c^3+30*a*c^4+7*b*c^4, +63+86*a+46*c+29*a*c+74*b*c+90*c^2+13*a^3+39*a*b^2+44*b^3+77*a^2*c+58*a*c^2+68*c^3+77*a^4+a^3*b+15*a^2*b^2+42*a*b^3+59*a^3*c+50*a^2*b*c+89*a*b^2*c+47*b^3*c+5*a^2*c^2+17*a*b*c^2+11*b^2*c^2+77*a*c^3+78*b*c^3+38*a^5+55*a^4*b+53*a^3*b^2+43*a^2*b^3+24*a*b^4+30*b^5+55*a^4*c+76*a^3*b*c+39*a^2*b^2*c+47*a*b^3*c+66*a^2*b*c^2+79*b^3*c^2+7*a^2*c^3+46*a*b*c^3+19*b^2*c^3+70*a*c^4+16*b*c^4, +31+40*b+5*a^2+a*b+49*b^2+80*a*c+54*c^2+42*a^3+20*a^2*b+86*a*b^2+9*a^2*c+61*b^2*c+53*b*c^2+66*c^3+19*a^4+6*a^3*b+79*a^2*b^2+83*a*b^3+29*b^4+2*a^3*c+24*a^2*b*c+71*a*b^2*c+47*b^3*c+31*a^2*c^2+42*b^2*c^2+58*a*c^3+77*b*c^3+74*a^4*b+33*a^3*b^2+52*a^4*c+37*a^3*b*c+74*a*b^3*c+42*b^4*c+55*a^3*c^2+84*a^2*b*c^2+14*b^3*c^2+69*a^2*c^3+43*b^2*c^3+61*a*c^4+55*b*c^4+16*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [56+30*a+90*b+19*c+15*a^2+12*a*c+90*b*c+81*c^2+87*a^3+37*b^3+44*a*b*c+65*a*c^2+66*b*c^2+20*c^3+65*a^4+63*a^3*b+76*b^4+37*a^2*b*c+11*a*b^2*c+67*b^3*c+23*a^2*c^2+78*a*b*c^2+45*b^2*c^2+19*b*c^3+6*a^5+85*a^2*b^3+54*a*b^4+15*b^5+66*a^4*c+5*a^2*b^2*c+20*a*b^3*c+31*b^4*c+65*a^3*c^2+84*b^3*c^2+58*a^2*c^3+59*a*b*c^3+66*b^2*c^3+55*b*c^4, +69*c+62*a^2+51*a*b+29*b^2+86*b*c+51*a^3+16*a^2*b+37*a*b^2+23*b^3+77*a^2*c+10*a*b*c+31*a*c^2+77*b*c^2+19*a^3*b+39*a*b^3+19*b^4+76*a^2*b*c+54*b^3*c+31*a*b*c^2+8*b^2*c^2+74*a*c^3+28*b*c^3+59*c^4+23*a^5+59*a^4*b+35*a^3*b^2+8*a^2*b^3+35*b^5+72*a^4*c+24*a^3*b*c+63*a^2*b^2*c+26*b^4*c+24*a^3*c^2+68*a^2*b*c^2+14*a*b^2*c^2+33*b^3*c^2+10*a^2*c^3+63*b^2*c^3+87*c^5, +12+37*a+37*b+49*c+59*a^2+74*b^2+61*a*c+66*b*c+17*c^2+57*a^3+56*a^2*b+76*a*b^2+72*b^3+58*a^2*c+2*b*c^2+36*c^3+73*a^3*b+29*a^2*b^2+58*a*b^3+27*b^4+8*a^3*c+88*a*b^2*c+45*a^2*c^2+83*b^2*c^2+28*a*c^3+18*b*c^3+18*c^4+75*a^5+50*a^4*b+6*a^2*b^3+54*a*b^4+11*a^4*c+71*a^3*b*c+78*a^2*b^2*c+32*b^4*c+78*a^3*c^2+7*a^2*b*c^2+32*a*b^2*c^2+13*a^2*c^3+25*a*b*c^3+11*c^5])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] +push!( + ideals, + Singular.Ideal( + R, + [82*a+26*b+37*a*b+53*b^2+22*b*c+77*c^2+88*a^3+64*a^2*b+78*a*b^2+22*b^3+56*a^2*c+9*a*b*c+66*b^2*c+21*a*c^2+51*b*c^2+11*c^3+52*a^4+44*a^3*b+10*a^2*b^2+78*a*b^3+23*a^3*c+83*a^2*b*c+30*a*b^2*c+88*a^2*c^2+27*a*b*c^2+49*b^2*c^2+77*a*c^3+8*b*c^3+89*c^4+49*a^5+15*a^4*b+38*a^3*b^2+20*a*b^4+53*b^5+64*a^4*c+42*a*b^3*c+68*b^4*c+56*a^3*c^2+43*a^2*b*c^2+85*a*b^2*c^2+9*b^3*c^2+39*a^2*c^3+20*a*b*c^3+73*b^2*c^3+82*b*c^4, +26+9*a+45*b+16*c+14*a^2+3*a*b+70*b^2+52*a*c+68*b*c+39*a^3+90*a^2*b+58*a*b^2+68*b^3+87*a^2*c+38*b^2*c+30*a*c^2+8*b*c^2+86*a^4+86*a^3*b+21*a^2*b^2+57*a*b^3+25*b^4+17*b^3*c+73*a^2*c^2+30*a*b*c^2+58*a*c^3+89*b*c^3+55*c^4+33*a^5+14*a^4*b+34*a^3*b^2+18*a^2*b^3+71*a*b^4+33*b^5+62*a^4*c+21*a^3*b*c+85*a^2*b^2*c+20*a*b^3*c+68*b^4*c+2*a^2*b*c^2+73*a^2*c^3+a*b*c^3+10*a*c^4+66*c^5, +26+37*a+73*b+c+62*a^2+11*a*b+34*a*c+20*b*c+34*c^2+35*a^3+41*b^3+15*a^2*c+17*b^2*c+89*a*c^2+75*b*c^2+21*a^4+43*a^3*b+41*a*b^3+15*b^4+38*a^3*c+87*a^2*b*c+19*a*b^2*c+43*b^3*c+54*b^2*c^2+86*a*c^3+18*b*c^3+8*c^4+58*a^5+69*a^4*b+52*a^2*b^3+78*a*b^4+55*a^4*c+5*a^3*b*c+71*a^2*b^2*c+58*a*b^3*c+80*b^4*c+82*a^3*c^2+85*a*b^2*c^2+50*b^3*c^2+27*a^2*c^3+76*a*b*c^3+12*b^2*c^3+63*a*c^4+43*b*c^4+51*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [82+44*a+31*b+21*c+68*a^2+80*a*c+64*b*c+43*c^2+48*a^2*b+38*a*b^2+87*b^3+77*a^2*c+34*a*c^2+26*c^3+83*a^4+16*a^3*b+77*a^2*b^2+87*a*b^3+47*b^4+63*a^3*c+9*a*b^2*c+85*b^3*c+54*b^2*c^2+27*a*c^3+44*b*c^3+31*a^4*b+40*a^3*b^2+a^2*b^3+58*a*b^4+60*b^5+76*a^4*c+77*a^3*b*c+73*a^2*b^2*c+51*a*b^3*c+43*a^3*c^2+26*a^2*b*c^2+34*a*b^2*c^2+3*b^3*c^2+50*a^2*c^3+9*a*b*c^3+42*c^5, +10+64*a+76*c+43*b^2+67*a*c+33*b*c+26*c^2+53*a^3+65*a^2*b+4*a*b^2+6*b^3+35*a^2*c+34*a*b*c+37*b^2*c+18*a*c^2+32*b*c^2+68*c^3+51*a^4+29*a^3*b+48*a^2*b^2+3*b^4+54*a^3*c+68*a^2*b*c+87*a*b^2*c+b^3*c+88*a*b*c^2+42*b^2*c^2+32*a*c^3+52*b*c^3+59*c^4+19*a^5+81*a^3*b^2+4*a^2*b^3+87*a*b^4+34*b^5+73*a^4*c+82*a^3*b*c+69*a^2*b^2*c+7*a*b^3*c+65*a^3*c^2+34*a^2*b*c^2+90*a*b^2*c^2+24*a*b*c^3+82*b^2*c^3+58*a*c^4+55*b*c^4+31*c^5, +44*a+64*b+47*c+5*a^2+67*a*b+2*b^2+62*a*c+b*c+69*c^2+3*a^3+51*a^2*b+80*a*b^2+86*b^3+76*a^2*c+33*a*b*c+79*a*c^2+35*b*c^2+29*a^4+23*a^3*b+75*a^2*b^2+16*a*b^3+50*b^4+48*a^3*c+8*a^2*b*c+75*a*b^2*c+74*b^3*c+50*a^2*c^2+69*b*c^3+38*c^4+10*a^5+46*a^3*b^2+36*a^2*b^3+83*a*b^4+74*b^5+32*a^4*c+85*a^3*b*c+14*a^2*b^2*c+81*a*b^3*c+47*b^4*c+66*a^3*c^2+86*a*b^2*c^2+36*b^3*c^2+63*a*b*c^3+18*b^2*c^3+39*a*c^4+27*b*c^4+32*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [79+47*b+67*c+61*a^2+20*a*b+64*b^2+11*a*c+74*b*c+68*c^2+78*a^3+20*a^2*b+17*a*b^2+15*b^3+21*a^2*c+15*a*b*c+35*b^2*c+90*a*c^2+3*b*c^2+35*a^3*b+69*a^2*b^2+3*a*b^3+51*b^4+46*a^3*c+59*a^2*b*c+61*a*b^2*c+38*b^3*c+56*a^2*c^2+33*a*b*c^2+49*b^2*c^2+42*a*c^3+48*b*c^3+57*c^4+78*a^5+77*a^4*b+75*a^3*b^2+72*a*b^4+81*a^4*c+18*a*b^3*c+78*b^4*c+81*a^3*c^2+47*a^2*b*c^2+39*a*b^2*c^2+76*b^3*c^2+57*a^2*c^3+26*a*b*c^3+2*b^2*c^3+11*a*c^4+3*b*c^4, +40*a+64*b+70*c+82*b^2+63*a*c+78*c^2+12*a^3+61*a*b^2+66*a^2*c+75*a*b*c+39*b^2*c+27*a*c^2+50*b*c^2+29*c^3+73*a^4+51*a^3*b+32*a*b^3+87*b^4+41*a^3*c+45*a^2*b*c+65*a*b^2*c+83*b^3*c+6*a^2*c^2+83*b^2*c^2+45*a*c^3+36*b*c^3+90*c^4+78*a^5+56*a^4*b+59*a^3*b^2+64*a^2*b^3+48*b^5+41*a^4*c+23*a^3*b*c+27*a^2*b^2*c+29*a*b^3*c+68*b^4*c+65*a^3*c^2+78*a^2*b*c^2+a*b^2*c^2+28*b^3*c^2+31*a^2*c^3+48*a*b*c^3+52*b^2*c^3+40*b*c^4+10*c^5, +37+33*a+66*b+68*c+49*a^2+3*a*b+48*b^2+54*a*c+85*c^2+a^2*b+20*b^3+52*a^2*c+56*a*b*c+71*b^2*c+47*b*c^2+12*c^3+25*a^4+33*a^3*b+65*a^2*b^2+53*a*b^3+14*a^3*c+7*a*b^2*c+29*b^3*c+41*b^2*c^2+83*c^4+42*a^3*b^2+3*a^2*b^3+87*a*b^4+57*b^5+31*a^3*b*c+53*a^2*b^2*c+51*a*b^3*c+34*b^4*c+22*a^3*c^2+80*a^2*b*c^2+20*a^2*c^3+85*a*b*c^3+28*b^2*c^3+15*a*c^4+62*c^5])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(8*10),90)", i, S, StartOrd, TarOrd) +end +ideals=[] +push!( + ideals, + Singular.Ideal( + R, + [73+71*a+48*b+18*c+46*a^2+75*a*b+75*b^2+51*a*c+85*b*c+67*c^2+3*a^3+90*a^2*b+41*a*b^2+40*b^3+44*a^2*c+18*a*b*c+17*b^2*c+90*a*c^2+41*b*c^2+39*c^3+3*a^4+32*a^3*b+46*a*b^3+78*b^4+26*a^3*c+66*a^2*b*c+53*a*b^2*c+38*b^3*c+69*a^2*c^2+64*b^2*c^2+51*a*c^3+38*b*c^3+32*c^4+72*a^5+19*a^4*b+24*a^3*b^2+41*a^2*b^3+30*a*b^4+b^5+4*a^4*c+40*a^3*b*c+73*a^2*b^2*c+63*a*b^3*c+78*b^4*c+27*a^3*c^2+55*a^2*b*c^2+29*b^3*c^2+75*a^2*c^3+21*a*b*c^3+50*b^2*c^3+88*b*c^4+60*c^5, +49+13*a+24*b+88*c+39*a^2+27*a*b+81*b^2+54*a*c+43*b*c+31*c^2+18*a^3+2*a^2*b+72*a*b^2+44*b^3+48*a^2*c+33*b^2*c+23*a*c^2+49*b*c^2+30*c^3+21*a^4+70*a^3*b+68*a*b^3+41*b^4+87*a^3*c+27*a^2*b*c+8*a*b^2*c+6*b^3*c+61*a^2*c^2+83*a*b*c^2+5*b^2*c^2+72*a*c^3+89*b*c^3+14*c^4+16*a^5+25*a^4*b+29*a^2*b^3+71*a*b^4+19*b^5+10*a^4*c+4*a^3*b*c+17*a^2*b^2*c+25*a*b^3*c+60*b^4*c+60*a^3*c^2+74*a*b^2*c^2+5*b^3*c^2+46*a^2*c^3+34*a*b*c^3+53*b^2*c^3+14*a*c^4+44*b*c^4+53*c^5, +32*a+58*b+21*c+46*a^2+9*a*b+78*a*c+36*b*c+11*c^2+21*a^3+7*a*b^2+84*b^3+89*a^2*c+29*a*b*c+17*a*c^2+14*b*c^2+79*c^3+63*a^4+23*a^3*b+57*a^2*b^2+17*a*b^3+79*a^3*c+69*a^2*b*c+24*a*b^2*c+5*b^3*c+79*a^2*c^2+83*a*b*c^2+22*b^2*c^2+88*a*c^3+2*b*c^3+11*c^4+5*a^5+14*a^2*b^3+51*a*b^4+57*b^5+55*a^4*c+57*a^3*b*c+61*a^2*b^2*c+47*a*b^3*c+79*b^4*c+86*a^3*c^2+11*a^2*b*c^2+77*a*b^2*c^2+42*b^3*c^2+59*a^2*c^3+4*a*b*c^3+54*b^2*c^3+72*a*c^4+62*b*c^4+48*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [57*a+35*b+40*c+15*a^2+44*a*b+29*b^2+21*a*c+65*b*c+26*c^2+40*a^3+41*a^2*b+15*a*b^2+9*b^3+60*a^2*c+62*a*b*c+24*b^2*c+60*a*c^2+83*b*c^2+52*c^3+33*a^4+54*a^3*b+13*a^2*b^2+7*a*b^3+57*a^3*c+72*a^2*b*c+33*a*b^2*c+88*b^3*c+36*a^2*c^2+45*b^2*c^2+47*a*c^3+42*b*c^3+17*c^4+14*a^5+44*a^4*b+33*a^3*b^2+53*a^2*b^3+86*a*b^4+22*b^5+23*a^4*c+32*a^3*b*c+52*a^2*b^2*c+86*a*b^3*c+81*b^4*c+52*a^3*c^2+9*a^2*b*c^2+11*a*b^2*c^2+65*a^2*c^3+22*a*b*c^3+56*b^2*c^3+14*a*c^4+69*b*c^4+64*c^5, +26+6*a+27*b+23*c+25*a^2+8*a*b+86*b^2+28*a*c+85*c^2+54*a^3+47*a^2*b+16*b^3+57*a^2*c+2*a*b*c+30*b^2*c+28*a*c^2+90*b*c^2+5*a^3*b+11*a^2*b^2+40*a*b^3+4*b^4+35*a^3*c+66*a^2*b*c+73*a*b^2*c+21*a^2*c^2+88*a*b*c^2+54*b^2*c^2+87*a*c^3+89*b*c^3+68*c^4+58*a^5+11*a^4*b+60*a^3*b^2+48*a^2*b^3+63*a*b^4+22*b^5+63*a^4*c+42*a^2*b^2*c+65*a*b^3*c+83*b^4*c+87*a^3*c^2+4*a*b^2*c^2+33*b^3*c^2+83*a^2*c^3+67*a*b*c^3+66*b^2*c^3+81*a*c^4+84*b*c^4, +31+17*a+37*b+29*c+84*a^2+56*a*b+38*b^2+64*b*c+74*c^2+57*a^3+36*a^2*b+23*a*b^2+87*b^3+63*a^2*c+70*a*b*c+b^2*c+65*a*c^2+52*c^3+69*a^4+72*a^3*b+58*a^2*b^2+50*a*b^3+83*b^4+79*a^3*c+3*a^2*b*c+27*a*b^2*c+54*b^3*c+28*a^2*c^2+21*a*b*c^2+28*b^2*c^2+32*b*c^3+66*c^4+82*a^5+81*a^4*b+85*a^3*b^2+64*a^2*b^3+9*a*b^4+71*b^5+69*a^4*c+72*a^3*b*c+14*a^2*b^2*c+37*a*b^3*c+90*b^4*c+50*a^3*c^2+16*a^2*b*c^2+18*a*b^2*c^2+62*b^3*c^2+5*a^2*c^3+90*a*c^4+9*c^5])) +push!( + ideals, + Singular.Ideal( + R, + [69+46*a+19*b+58*c+4*a^2+46*a*b+22*b^2+52*a*c+85*b*c+62*c^2+78*a^3+29*a^2*b+79*a*b^2+35*b^3+41*a^2*c+4*a*b*c+53*b^2*c+4*a*c^2+33*c^3+23*a^4+27*a^2*b^2+18*b^4+32*a^3*c+52*a^2*b*c+25*a*b^2*c+34*b^3*c+12*a^2*c^2+15*a*b*c^2+90*b^2*c^2+85*a*c^3+89*b*c^3+28*c^4+62*a^5+77*a^4*b+73*a^3*b^2+a^2*b^3+40*a*b^4+27*b^5+73*a^3*b*c+10*a^2*b^2*c+73*a*b^3*c+66*b^4*c+25*a^3*c^2+83*a^2*b*c^2+2*a*b^2*c^2+61*a^2*c^3+88*a*b*c^3+23*b^2*c^3+39*a*c^4+90*b*c^4+57*c^5, +60+80*a+49*b+23*c+28*a^2+3*a*b+14*b^2+31*a*c+42*b*c+9*c^2+61*a^3+26*a^2*b+8*a*b^2+80*a^2*c+36*a*b*c+18*b^2*c+82*a*c^2+32*b*c^2+29*c^3+13*a^4+35*a^3*b+48*a^2*b^2+67*a*b^3+53*b^4+46*a^3*c+5*a*b^2*c+88*b^3*c+80*a^2*c^2+32*a*b*c^2+52*b^2*c^2+44*a*c^3+76*b*c^3+42*c^4+37*a^5+15*a^4*b+35*a^3*b^2+80*a^2*b^3+31*a*b^4+51*a^4*c+21*a^3*b*c+4*a^2*b^2*c+72*a*b^3*c+62*b^4*c+15*a^3*c^2+33*a^2*b*c^2+5*b^3*c^2+77*a^2*c^3+7*a*b*c^3+65*a*c^4+17*b*c^4+11*c^5, +75+55*a+25*c+41*a^2+39*a*b+3*b^2+53*a*c+51*c^2+35*a^2*b+79*a*b^2+21*b^3+39*a^2*c+73*a*b*c+82*b^2*c+41*a*c^2+26*b*c^2+80*c^3+88*a^4+19*a^3*b+4*a*b^3+86*b^4+76*a^3*c+70*a^2*b*c+64*a*b^2*c+66*b^3*c+2*a^2*c^2+31*a*b*c^2+5*b^2*c^2+76*a*c^3+42*b*c^3+22*c^4+64*a^5+87*a^4*b+34*a^3*b^2+18*a^2*b^3+56*a*b^4+82*a^4*c+2*a^3*b*c+86*a^2*b^2*c+81*a*b^3*c+18*b^4*c+9*a^3*c^2+9*a^2*b*c^2+60*a*b^2*c^2+42*b^3*c^2+89*a^2*c^3+50*a*b*c^3+49*b^2*c^3+13*a*c^4+12*b*c^4])) +for i in ideals + runAll("Var3 - sparseid(3,0,5,100-(9*10),90)", i, S, StartOrd, TarOrd) +end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl deleted file mode 100644 index 99cd5ac7d..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/FractalWalkUtilitysFinal.jl +++ /dev/null @@ -1,225 +0,0 @@ -include("GroebnerWalkUtilitysFinal.jl") - -#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) -#Maybe not needed -mutable struct MonomialOrder{ - T<:Matrix{Int64}, - v<:Vector{Int64}, - tv<:Vector{Int64}, -} - m::T - w::v - t::tv -end -#= -@doc Markdown.doc""" - convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} -Given a Vector{Number} $v$ this function computes a Vector{Int64} w with w = v*gcd(v). -"""=# -function convert_bounding_vector(v::Vector{T}) where {T<:Number} - w = Vector{Int64}() - for i = 1:length(v) - push!(w, float(divexact(v[i], gcd(v)))) - end - return w -end - -#= -@doc Markdown.doc""" -function inCone( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - t::Vector{Int64}, -) -Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. -"""=# -function inCone( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - t::Vector{Int64}, -) - R = change_order(G.base_ring, T.t, T.m) - I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end - -#= -@doc Markdown.doc""" -function lift_fractal_walk( - G::Singular.sideal, - Gw::Singular.sideal, - R::Singular.PolyRing, - S::Singular.PolyRing, -) -Performs a lifting step in the Groebner Walk. See Fukuda et. al. -"""=# -function lift_fractal_walk( - G::Singular.sideal, - Gw::Singular.sideal, - R::Singular.PolyRing, - Rn::Singular.PolyRing, -) - G.isGB = true - rest = [ - change_ring(gen, Rn) - - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in Singular.gens(Gw) - ] - G = Singular.Ideal(Rn, [Rn(x) for x in rest]) - G.isGB = true - return G -end - -#returns ´true´ if all polynomials of the array are monomials. -function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 1 - return false - end - end - return true -end - -#returns ´true´ if all polynomials of the array are binomial or less. -function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 - return false - end - end - return true -end - - -function nextT( - G::Singular.sideal, - w::Array{T,1}, - tw::Array{K,1}, -) where {T<:Number,K<:Number} - if (w == tw) - return [0] - end - tmin = 2 - t = 0 - for g in gens(G) - a = Singular.leading_exponent_vector(g) - d = Singular.exponent_vectors(tail(g)) - for v in d - frac = (dot(w, a) - dot(w, v) + dot(tw, v) - dot(tw, a)) - if frac != 0 - t = (dot(w, a) - dot(w, v)) // frac - end - if t > 0 && t < tmin - tmin = t - end - end - end - if tmin <= 1 - return tmin - else - return [0] - end -end - -function change_order( - R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) where {L<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(T.w) * Singular.ordering_M(T.m), - ) - return S -end - -function pertubed_vector( - G::Singular.sideal, - Mo::MonomialOrder{Matrix{Int64}}, - t::Vector{Int64}, - p::Integer, -) - if t == Mo.m[1, :] - M = Mo.m - else - M = insert_weight_vector(t, Mo.m) - end - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - return w -end - -function pertubed_vector( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - p::Integer, -) - m = [] - if T.t == T.m[1, :] - M = T.m - else - M = insert_weight_vector(T.t, T.m) - end - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - return w -end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl deleted file mode 100644 index 67cbcc5e9..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GenericWalkUtilitysFinal.jl +++ /dev/null @@ -1,286 +0,0 @@ -include("GroebnerWalkUtilitysFinal.jl") - -############################################################### -#Utilitys for generic_walk -############################################################### - -#Return the facet_facet_facet_initials of polynomials w.r.t. a weight vector. -function facet_initials( - G::Singular.sideal, - lm::Vector{spoly{L}}, - v::Vector{Int64}, -) where {L<:Nemo.RingElem} - Rn = base_ring(G) - initials = Array{Singular.elem_type(Rn),1}(undef, 0) - count = 1 - for g in Singular.gens(G) - inw = Singular.MPolyBuildCtx(Rn) - el = first(Singular.exponent_vectors(lm[count])) - for (e, c) in - zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - if el == e || isParallel(el - e, v) - Singular.push_term!(inw, c, e) - end - end - h = finish(inw) - push!(initials, h) - count += 1 - end - return initials -end - -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. -function difference_lead_tail( - I::Singular.sideal, - Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} - v = Vector{Int}[] - for i = 1:ngens(I) - ltu = Singular.leading_exponent_vector(Lm[i]) - for e in Singular.exponent_vectors(gens(I)[i]) - if ltu != e - push!(v, ltu .- e) - end - end - end - return unique!(v) -end - -# -function isParallel(u::Vector{Int64}, v::Vector{Int64}) - count = 1 - x = 0 - for i = 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - if v[i] != x * u[i] - return false - end - end - return true -end - -#lifting step of the generic_walk -function lift_generic( - G::Singular.sideal, - Lm::Vector{Singular.spoly{L}}, - H::Singular.sideal, -) where {L<:Nemo.RingElem} - Rn = base_ring(G) - Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) - liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) - for g in Singular.gens(H) - r, b = modulo(g, gens(G), Lm) - diff = g - r - if diff != 0 - push!(Newlm, Singular.leading_term(g)) - push!(liftPolys, diff) - end - end - return liftPolys, Newlm -end - -function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) - btz = Set{Vector{Int64}}() - for v in V - if bigger_than_zero(S, v) - push!(btz, v) - end - end - return btz -end - -function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) - btz = Set{Vector{Int64}}() - for v in V - if less_than_zero(S, v) - push!(btz, v) - end - end - return btz -end -function filter_lf( - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, - V::Set{Vector{Int64}}, -) - btz = Set{Vector{Int64}}() - for v in V - if less_facet(w, v, S, T) - push!(btz, v) - end - end - return btz -end - -#return the next facet_normal. -function next_gamma( - G::Singular.sideal, - Lm::Vector{spoly{L}}, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) where {L<:Nemo.RingElem} - V = filter_btz(S, difference_lead_tail(G, Lm)) - V = filter_ltz(T, V) - if (w != [0]) - V = filter_lf(w, S, T, V) - end - if isempty(V) - return V - end - minV = first(V) - for v in V - if less_facet(v, minV, S, T) - minV = v - end - end - return minV -end - -#return the next facet_normal. -function next_gamma( - G::Singular.sideal, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - V = filter_btz(S, difference_lead_tail(G)) - V = filter_ltz(T, V) - if (w != [0]) - V = filter_lf(w, S, T, V) - end - if isempty(V) - return V - end - minV = first(V) - for v in V - if less_facet(v, minV, S, T) - minV = v - end - end - return minV -end - -function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - for i = 1:size(M)[1] - d = dot(M[i, :], v) - if d != 0 - return d > 0 - end - end - return false -end - -function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - nrows, ncols = size(M) - for i = 1:nrows - d = 0 - for j = 1:ncols - @inbounds d += M[i, j] * v[j] - end - if d != 0 - return d < 0 - end - end - return false -end - -function less_facet( - u::Vector{Int64}, - v::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - for i = 1:size(T)[1] - for j = 1:size(S)[1] - Tuv = dot(T[i, :], u) * dot(S[j, :], v) - Tvu = dot(T[i, :], v) * dot(S[j, :], u) - if Tuv != Tvu - return Tuv < Tvu - end - end - end - return false -end - -#returns divrem() -function divremGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) - div = false - newpoly = Singular.MPolyBuildCtx(S) - for term in Singular.terms(p) - (b, c) = Singular.divides(term, lm) - if b - push_term!( - newpoly, - first(Singular.coefficients(c)), - first(Singular.exponent_vectors(c)), - ) - div = true - end - end - return (finish(newpoly), div) -end - -function modulo( - p::Singular.spoly, - G::Vector{spoly{L}}, - Lm::Vector{spoly{L}}, - c::Bool = false, -) where {L<:Nemo.RingElem} - I = 0 - R = parent(p) - Q = zero(R) - for i = 1:length(G) - (q, b) = divremGW(p, Lm[i], R) - if b - I = i - Q = q - break - end - end - if I != 0 - r, b = modulo(p - (Q * G[I]), G, Lm) - return r, true - else - return p, false - end -end - -function interreduce( - G::Vector{spoly{L}}, - Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} - Rn = parent(first(G)) - for i = 1:Singular.length(G) - gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) - Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) - for j = 1:length(G) - if i != j - push!(gensrest, G[j]) - push!(Lmrest, Lm[j]) - end - end - r, b = modulo(G[i], gensrest, Lmrest) - if b - G[i] = r - end - end - return G -end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl index 8aeda1489..40a31c745 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -1,41 +1,81 @@ -include("GroebnerWalkUtilitysFinal.jl") -include("FractalWalkUtilitysFinal.jl") -include("GenericWalkUtilitysFinal.jl") -include("StandardWalkUtilitysFinal.jl") -include("TranWalkUtilitysFinal.jl") +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl", +) using BenchmarkTools BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 -export groebnerwalk -a="-" -b="-" -z ="-" -c="-" -d="-" -e="-" -f="-" -g="-" -h="-" -i="-" -j="-" -k="-" -l="-" +a = "-" +b = "-" +z = "-" +c = "-" +d = "-" +e = "-" +f = "-" +g = "-" +h = "-" +i = "-" +j = "-" +k = "-" +l = "-" + +a2 = "-" +b2 = "-" +z2 = "-" +c2 = "-" +d2 = "-" +e2 = "-" +f2 = "-" +g2 = "-" +h2 = "-" +i2 = "-" +j2 = "-" +k2 = "-" +l2 = "-" + function cleardf() - global a="-" - global b="-" - global c="-" - global d="-" - global e="-" - global f="-" - global g="-" - global h="-" - global i="-" - global j="-" - global k="-" - global l="-" - global z ="-" + global a = "-" + global b = "-" + global c = "-" + global d = "-" + global e = "-" + global f = "-" + global g = "-" + global h = "-" + global i = "-" + global j = "-" + global k = "-" + global l = "-" + global z = "-" + global a2 = "-" + global b2 = "-" + global c2 = "-" + global d2 = "-" + global e2 = "-" + global f2 = "-" + global g2 = "-" + global h2 = "-" + global i2 = "-" + global j2 = "-" + global k2 = "-" + global l2 = "-" + global z2 = "-" end + + + ############################################################### #Implementation of the gröbner walk. ############################################################### @@ -154,11 +194,18 @@ function standard_walk( global counter = getCounter() + 1 println(cweight) global b = cweight + global b2 = cweight G = standard_step(G, R, cweight, Rn) if cweight == tweight terminate = true else - global a = @belapsed next_weight($G, $cweight, $tweight) evals =1 samples=1 + global a = + @belapsed next_weight($G, $cweight, $tweight) evals = 1 samples = + 1 + global a2 = + @ballocated next_weight($G, $cweight, $tweight) evals = 1 samples = + 1 + cweight = next_weight(G, cweight, tweight) R = Rn Rn = change_order(Rn, cweight, T) @@ -171,34 +218,70 @@ function standard_step( G::Singular.sideal, R::Singular.PolyRing, cw::Vector{Int64}, - Rn::Singular.PolyRing + Rn::Singular.PolyRing, ) -global z = length(Singular.gens(G)) + global z = length(Singular.gens(G)) + global z2 = length(Singular.gens(G)) -global c = @belapsed initials($Rn, gens($G), $cw) evals =1 samples=1 + global c = @belapsed initials($Rn, gens($G), $cw) evals = 1 samples = 1 + global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 1 samples = 1 Gw = initials(Rn, gens(G), cw) - global d= @belapsed Singular.std( + global d = @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals =1 samples=1 + ) evals = 1 samples = 1 - H = Singular.std( - Singular.Ideal(Rn, Gw), + global d2 = @ballocated Singular.std( + Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) + ) evals = 1 samples = 1 + + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) + + global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + + global f = @belapsed lift($G, $R, $H, $Rn) evals = 1 samples = 1 + global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 1 samples = 1 - global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - global f= @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - global g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + global g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + global g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [counter], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [counter], + ) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f],g=[g], h=[counter]) + savea(df, "standardWalk") + savea(df2, "allocsStandardWalk") cleardf() - savea(df,"standardWalk.txt") return Singular.std(H, complete_reduction = true) end ############################## @@ -218,57 +301,108 @@ function standard_walk2( tweight::Vector{Int64}, k::Int64, ) -R = base_ring(G) -Rn = change_order(R, cweight, T) -terminate = false -while !terminate - global counter = getCounter() + 1 - println(cweight) - global b = cweight - G = standard_step2(G, R, cweight, Rn) - df = DataFrame(a=[a], b = [b], z=[z], c = [c], d = [d], e = [e], f=[f],g=[g],h=[h], i=[i], j =[j], k=[k],l=[l]) - cleardf() - savea(df,"pertubedWalk.txt",k) - if cweight == tweight - terminate = true - else - global a = @belapsed next_weight($G, $cweight, $tweight) evals =1 samples=1 - cweight = next_weight(G, cweight, tweight) - R = Rn - Rn = change_order(Rn, cweight, T) + R = base_ring(G) + Rn = change_order(R, cweight, T) + terminate = false + while !terminate + global counter = getCounter() + 1 + println(cweight) + global b = cweight + global b2 = cweight + + G = standard_step2(G, R, cweight, Rn) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + l = [l], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + l2 = [l2], + ) + cleardf() + savea(df, "pertubedWalk", k) + savea(df2, "allocsPertubedWalk", k) + + if cweight == tweight + terminate = true + else + global a2 = + @ballocated next_weight($G, $cweight, $tweight) evals = 1 samples = + 1 + global a = + @belapsed next_weight($G, $cweight, $tweight) evals = 1 samples = + 1 + cweight = next_weight(G, cweight, tweight) + R = Rn + Rn = change_order(Rn, cweight, T) + end end -end -return G + return G end function standard_step2( G::Singular.sideal, R::Singular.PolyRing, cw::Vector{Int64}, - Rn::Singular.PolyRing + Rn::Singular.PolyRing, ) -global z = length(Singular.gens(G)) + global z = length(Singular.gens(G)) + global z2 = length(Singular.gens(G)) -global c = @belapsed initials($Rn, gens($G), $cw) evals =1 samples=1 + global c = @belapsed initials($Rn, gens($G), $cw) evals = 1 samples = 1 + global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 1 samples = 1 + Gw = initials(Rn, gens(G), cw) - global d= @belapsed Singular.std( + global d = @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals =1 samples=1 + ) evals = 1 samples = 1 - H = Singular.std( - Singular.Ideal(Rn, Gw), + global d2 = @ballocated Singular.std( + Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) + ) evals = 1 samples = 1 + + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) + + global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - global e=@belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - global f= @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 + global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 1 samples = 1 + global f = @belapsed lift($G, $R, $H, $Rn) evals = 1 samples = 1 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - global g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + global g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + global g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 return Singular.std(H, complete_reduction = true) end @@ -279,7 +413,9 @@ end function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R = base_ring(G) Rn = change_order(G.base_ring, T) - global a =@belapsed next_gamma($G, $[0], $S, $T) evals =1 samples=1 + global a = @belapsed next_gamma($G, $[0], $S, $T) evals = 1 samples = 1 + global a2 = @ballocated next_gamma($G, $[0], $S, $T) evals = 1 samples = 1 + v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) @@ -289,13 +425,39 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while !isempty(v) global counter = getCounter() + 1 global b = v + global b2 = v + println(v) - G, Lm = generic_step(G, Lm, v, T,R) - df = DataFrame(a = [a], b = [b],z=[z], c = [c], d=[d], e=[e],f=[f],g=[g]) - savea(df, "genericWalk.txt") + G, Lm = generic_step(G, Lm, v, T, R) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + ) + savea(df2, "allocsGenericWalk") + savea(df, "genericWalk") cleardf() - global a = @belapsed next_gamma($G, $Lm, $v, $S, $T) evals =1 samples=1 - v =next_gamma(G, Lm, v, S, T) + global a2 = + @ballocated next_gamma($G, $Lm, $v, $S, $T) evals = 1 samples = 1 + + global a = + @belapsed next_gamma($G, $Lm, $v, $S, $T) evals = 1 samples = 1 + v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) end @@ -305,25 +467,36 @@ function generic_step( Lm::Vector{Singular.spoly{L}}, v::Vector{Int64}, T::Matrix{Int64}, - R::Singular.PolyRing + R::Singular.PolyRing, ) where {L<:Nemo.RingElem} -global z = length(Singular.gens(G)) + global z = length(Singular.gens(G)) Rn = Singular.base_ring(G) - global c =@belapsed facet_initials($G,$Lm, $v) evals =1 samples=1 - facet_Generators = facet_initials(G,Lm, v) - global d= @belapsed Singular.std( + global c = @belapsed facet_initials($G, $Lm, $v) evals = 1 samples = 1 + global c2 = @ballocated facet_initials($G, $Lm, $v) evals = 1 samples = 1 + + facet_Generators = facet_initials(G, Lm, v) + global d = @belapsed Singular.std( + Singular.Ideal($Rn, $facet_Generators), + complete_reduction = true, + ) evals = 1 samples = 1 + + global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $facet_Generators), complete_reduction = true, - ) evals =1 samples=1 + ) evals = 1 samples = 1 H = Singular.std( Singular.Ideal(Rn, facet_Generators), complete_reduction = true, ) - global e = @belapsed lift_generic($G, $Lm, $H) evals =1 samples=1 + global e2 = @ballocated lift_generic($G, $Lm, $H) evals = 1 samples = 1 + + global e = @belapsed lift_generic($G, $Lm, $H) evals = 1 samples = 1 H, Lm = lift_generic(G, Lm, H) - global f= @belapsed interreduce($H, $Lm) evals =1 samples=1 + global f = @belapsed interreduce($H, $Lm) evals = 1 samples = 1 + global f2 = @ballocated interreduce($H, $Lm) evals = 1 samples = 1 + G = interreduce(H, Lm) G = Singular.Ideal(Rn, G) G.isGB = true @@ -340,9 +513,40 @@ function pertubed_walk( T::Matrix{Int64}, p::Int64, ) -k=p -df = DataFrame(a=["-"], b = ["-"],z=["-"], c = ["-"], d = ["-"], e = ["-"], f = ["-"], g=["-"], h=["-"], i=[(p,p)], j=["-"]) -savea(df, "pertubedWalk.txt",k) + k = p + k2 = p + df = DataFrame( + a = ["-"], + b = ["-"], + z = ["-"], + c = ["-"], + d = ["-"], + e = ["-"], + f = ["-"], + g = ["-"], + h = ["-"], + i = ["-"], + j = ["-"], + k = [(p, p)], + l = ["-"], + ) + df2 = DataFrame( + a2 = ["-"], + b2 = ["-"], + z2 = ["-"], + c2 = ["-"], + d2 = ["-"], + e2 = ["-"], + f2 = ["-"], + g2 = ["-"], + h2 = ["-"], + i2 = ["-"], + j2 = ["-"], + k2 = [(p, p)], + l2 = ["-"], + ) + savea(df2, "allocsPertubedWalk", k) + savea(df, "pertubedWalk", k) #cweight = pertubed_vector(G, S, p) cweight = S[1, :] terminate = false @@ -350,27 +554,70 @@ savea(df, "pertubedWalk.txt",k) println("Crossed Cones in: ") while !terminate - global h = @belapsed pertubed_vector($G, $T, $p) evals =1 samples=1 + global h = @belapsed pertubed_vector($G, $T, $p) evals = 1 samples = 1 + global h2 = + @ballocated pertubed_vector($G, $T, $p) evals = 1 samples = 1 + tweight = pertubed_vector(G, T, p) - G = standard_walk2(G, S, T, cweight, tweight,k) + G = standard_walk2(G, S, T, cweight, tweight, k) if inCone(G, T, tweight) - global i = @belapsed inCone($G, $T, $tweight) evals =1 samples=1 + global i = @belapsed inCone($G, $T, $tweight) evals = 1 samples = 1 + global i2 = + @ballocated inCone($G, $T, $tweight) evals = 1 samples = 1 + terminate = true else if p == 1 R = change_order(G.base_ring, T) G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - global j= @belapsed Singular.std($G, complete_reduction = true) evals =1 samples=1 + global j = + @belapsed Singular.std($G, complete_reduction = true) evals = + 1 samples = 1 + global j2 = + @ballocated Singular.std($G, complete_reduction = true) evals = + 1 samples = 1 + G = Singular.std(G, complete_reduction = true) terminate = true end p = p - 1 cweight = tweight end - df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k],l=[l]) - savea(df, "pertubedWalk.txt",k) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + l = [l], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + l2 = [l2], + ) + savea(df, "pertubedWalk", k) + savea(df2, "allocsPertubedWalk", k) cleardf() + end return G end @@ -413,7 +660,7 @@ function fractal_walk( println(PertVecs) println("FacrtalWalk_standard results") println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S,T, PertVecs, 1) + Gb = fractal_recursiv(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -429,35 +676,56 @@ function fractal_recursiv( terminate = false G.isGB = true w = S.w - h= "-" - i="-" + h = "-" + i = "-" + h2 = "-" + i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + t = nextT(G, w, PertVecs[p]) if (t == [0]) - if inCone(G, T,PertVecs[p]) - h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + if inCone(G, T, PertVecs[p]) + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h2 = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = + 1 + return G else - i = @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals =1 samples=1 + i2 = + @ballocated [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals = 1 samples = 1 + + i = + @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) - b = w + b = w + b2 = w T.w = w Rn = change_order(R, T) - global z = length(Singular.gens(G)) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) + + c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 - c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 + c = @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = 1 Gw = initials(R, Singular.gens(G), w) if p == nvars(R) - d = @belapsed Singular.std( + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals =1 samples=1 + ) evals = 1 samples = 1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -466,7 +734,9 @@ function fractal_recursiv( raiseCounterFr() else println("up in: ", p, " with: ", w) - d = "rec" + d = "rec" + d2 = "rec" + H = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), S, @@ -475,16 +745,56 @@ function fractal_recursiv( p + 1, ) end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + H = lift_fractal_walk(G, R, H, Rn) + g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + + g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 G = Singular.std(H, complete_reduction = true) R = Rn - j = p - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"fractalWalk.txt") + j = p + j2 = p + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + ) + + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + ) + savea(df, "fractalWalk") + savea(df2, "allocsFractalWalk") + cleardf() end return G end @@ -531,18 +841,30 @@ function fractal_walk_recursiv_startorder( else w = S.w end - h= "-" - i="-" + h = "-" + i = "-" + h2 = "-" + i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h2 = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = + 1 + println(PertVecs[p], " in depth", p) return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + i2 = + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + + i = + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -551,17 +873,26 @@ function fractal_walk_recursiv_startorder( w = convert_bounding_vector(w) T.w = w b = w + b2 = w Rn = change_order(R, T) - global z = length(Singular.gens(G)) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) - c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 + c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 + + c = @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = 1 Gw = initials(R, gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + d2 = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -571,6 +902,8 @@ function fractal_walk_recursiv_startorder( else println("up in: ", p, " with: ", w) d = "rec" + d2 = "rec" + H = fractal_walk_recursiv_startorder( Singular.Ideal(R, [x for x in Gw]), @@ -581,16 +914,57 @@ function fractal_walk_recursiv_startorder( ) global firstStepMode = false end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + #H = lift_fractal_walk(G, R, H, Rn) + g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + + g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 j = p + j2 = p G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"fractalWalkstartorder.txt") + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + ) + savea(df2, "allocsFractalWalkstartorder") + savea(df, "fractalWalkstartorder") + cleardf() + R = Rn end return G @@ -619,77 +993,136 @@ function fractal_walk_recursive_lex( terminate = false G.isGB = true w = S.w - h= "-" - i="-" + h = "-" + i = "-" + h2 = "-" + i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h2 = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = + 1 + return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + i = + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + i2 = + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - println(PertVecs) + println(PertVecs) continue end end - if t == 1 && p==1 - return fractal_walk_recursive_lex( - G, - S, - T, - PertVecs, - p + 1, - ) + if t == 1 && p == 1 + return fractal_walk_recursive_lex(G, S, T, PertVecs, p + 1) else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - - H = fractal_walk_recursive_lex( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + b2 = w + + Rn = change_order(R, T) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) + + c2 = + @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 + + c = + @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + d2 = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + d2 = "rec" + + + H = fractal_walk_recursive_lex( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end end - end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + #H = lift_fractal_walk(G, R, H, Rn) + g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + j = p + j2 = p G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"fractalWalklex.txt") + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + ) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + ) + savea(df, "fractalWalklex") + savea(df2, "allocsFractalWalklex") + cleardf() R = Rn end return G @@ -718,17 +1151,29 @@ function fractal_walk_look_ahead_recursiv( terminate = false G.isGB = true w = S.w - h= "-" - i="-" + h = "-" + i = "-" + h2 = "-" + i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h2 = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = + 1 + return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + i = + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + i2 = + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -736,18 +1181,26 @@ function fractal_walk_look_ahead_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w - b = w + b = w + b2 = w Rn = change_order(R, T) - global z = length(Singular.gens(G)) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) + c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 - c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 + c = @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = 1 Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + d2 = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -757,6 +1210,7 @@ function fractal_walk_look_ahead_recursiv( else println("up in: ", p, " with: ", w) d = "rec" + d2 = "rec" H = fractal_walk_look_ahead_recursiv( Singular.Ideal(R, Gw), @@ -766,16 +1220,44 @@ function fractal_walk_look_ahead_recursiv( p + 1, ) end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + #H = lift_fractal_walk(G, R H, Rn) + g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + j = p + j2 = p G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"fractalWalklookahead.txt") + df = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + ) + savea(df, "fractalWalklookahead") + savea(df2, "allocsFractalWalklookahead") + cleardf2() + cleardf() + R = Rn end return G @@ -819,76 +1301,133 @@ function fractal_walk_combined( else w = S.w end - h= "-" - i="-" + h = "-" + i = "-" + h2 = "-" + i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals =1 samples=1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T,PertVecs[$p]) evals =1 samples=1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h2 = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = + 1 println(PertVecs[p], " in depth", p) return G else - i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 + i2 = + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + + i = + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end end - if t == 1 && p==1 - return fractal_walk_combined( - G, - S, - T, - PertVecs, - p + 1, - ) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @belapsed initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() + if t == 1 && p == 1 + return fractal_walk_combined(G, S, T, PertVecs, p + 1) else - println("up in: ", p, " with: ", w) - d = "rec" - - H = fractal_walk_combined( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + b2 = w + + Rn = change_order(R, T) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) + + c2 = + @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 + + c = + @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = + 1 + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + d = @belapsed Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + d2 = @ballocated Singular.std( + Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), + complete_reduction = true, + ) evals = 1 samples = 1 + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + d = "rec" + d2 = "rec" + + + H = fractal_walk_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end end - end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @belapsed lift($G, $R, $H, $Rn) evals =1 samples=1 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - g = @belapsed Singular.std($H, complete_reduction = true) evals =1 samples=1 + #H = lift_fractal_walk(G, R, H, Rn) + g2 = + @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 + g = + @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = + 1 j = p + j2 = p G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"fractalWalkcombined.txt") + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + ) + savea(df, "fractalWalkcombined") + savea(df2, "allocsFractalWalkcombined") + cleardf() + R = Rn end return G @@ -910,21 +1449,40 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate - global a = @belapsed next_weight($G, $cweight, $tweight) evals =1 samples=1 + global a2 = + @ballocated next_weight($G, $cweight, $tweight) evals = 1 samples = + 1 + + global a = + @belapsed next_weight($G, $cweight, $tweight) evals = 1 samples = 1 w = next_weight(G, cweight, tweight) if tryparse(Int32, string(w)) == nothing println("w bigger than int32") return G end - Rn= change_order(R, w, T) + Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) - global i = @belapsed inCone($G, $T, $cweight) evals =1 samples=1 + global i2 = + @ballocated inCone($G, $T, $cweight) evals = 1 samples = 1 + + global i = + @belapsed inCone($G, $T, $cweight) evals = 1 samples = 1 return G else if inSeveralCones(initials(base_ring(G), gens(G), w)) - global j = @belapsed inSeveralCones(initials(base_ring($G), gens($G), $w)) evals =1 samples=1 - global h = @belapsed representation_vector($G, $T) evals =1 samples=1 + global j = @belapsed inSeveralCones( + initials(base_ring($G), gens($G), $w), + ) evals = 1 samples = 1 + global j2 = @ballocated inSeveralCones( + initials(base_ring($G), gens($G), $w), + ) evals = 1 samples = 1 + global h2 = + @ballocated representation_vector($G, $T) evals = 1 samples = + 1 + global h = + @belapsed representation_vector($G, $T) evals = 1 samples = + 1 tweight = representation_vector(G, T) continue end @@ -933,11 +1491,41 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) G = standard_step2(G, R, w, Rn) global counter = getCounter() + 1 println(w) - global b=w + global b = w + global b2 = w + R = Rn cweight = w - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"tranWalk.txt") + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + ) + df2 = DataFrame( + a2 = [a2], + b2 = [b2], + z2 = [z2], + c2 = [c2], + d2 = [d2], + e2 = [e2], + f2 = [f2], + g2 = [g2], + h2 = [h2], + i2 = [i2], + j2 = [j2], + k2 = [k2], + ) + savea(df, "tranWalk") + savea(df2, "allocsTranWalk") cleardf() end end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl deleted file mode 100644 index 1af94310f..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkUtilitysFinal.jl +++ /dev/null @@ -1,376 +0,0 @@ -############################################################### -#Utilitys for Groebnerwalks -############################################################### - -#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. -#This Version is used by the standard_walk, pertubed_walk and tran_walk. -function next_weight( - G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} - tv = [] - for v in difference_lead_tail(G) - cw = dot(cweight, v) - tw = dot(tweight, v) - if tw < 0 - push!(tv, cw // (cw - tw)) - end - end - push!(tv, 1) - t = minimum(tv) - w = (1 - t) * cweight + t * tweight - return convert_bounding_vector(w) -end - -#Return the initials of polynomials w.r.t. a weight vector. -function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) - inits = spoly{elem_type(base_ring(R))}[] - indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] - for g in G - empty!(indexw) - maxw = 0 - eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - for (e, c) in eczip - tmpw = dot(w, e) - if maxw == tmpw - push!(indexw, (e, c)) - elseif maxw < tmpw - empty!(indexw) - push!(indexw, (e, c)) - maxw = tmpw - end - end - inw = MPolyBuildCtx(R) - for (e, c) in indexw - Singular.push_term!(inw, c, e) - end - h = finish(inw) - push!(inits, h) - end - return inits -end - -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. -function difference_lead_tail(I::Singular.sideal) - v = Vector{Int}[] - for g in gens(I) - ltu = Singular.leading_exponent_vector(g) - for e in Singular.exponent_vectors(tail(g)) - push!(v, ltu .- e) - end - end - return unique!(v) -end - -function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - return w -end - -function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) - R = change_order(G.base_ring, T) - I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end -#Fukuda et al -function lift( - G::Singular.sideal, - R::Singular.PolyRing, - H::Singular.sideal, - Rn::Singular.PolyRing -) - G.isGB = true - rest = [ - change_ring(gen, Rn) - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in Singular.gens(H) - ] - Gnew = Singular.Ideal(Rn, [Rn(x) for x in rest]) - Gnew.isGB = true - return Gnew -end -#Amrhein & Gloor -function liftGW2( - G::Singular.sideal, - R::Singular.PolyRing, - inG::Vector{spoly{L}}, - H::Singular.sideal, - Rn::Singular.PolyRing -) where {L<:Nemo.RingElem} - - gH = collect(gens(H)) - gG = collect(gens(G)) - s = length(inG) - for i = 1:length(gH) - q = divalg(change_ring(gH[i], R), [change_ring(x, R) for x in inG], R) - gH[i] = R(0) - for j = 1:s - gH[i] = change_ring(gH[i], R) + q[j] * gG[j] - end - end - Gnew = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gH]) - Gnew.isGB = true - return Gnew -end - -function divalg( - p::spoly{L}, - f::Vector{spoly{L}}, - R::Singular.PolyRing, -) where {L<:Nemo.RingElem} - s = length(f) - q = Array{Singular.elem_type(R),1}(undef, s) - for i = 1:s - q[i] = R(0) - end - while !isequal(p, R(0)) - i = 1 - div = false - while (div == false && i <= s) - b, m = divides(leading_term(p), leading_term(f[i])) - if b - q[i] = q[i] + m - p = p - (m * f[i]) - div = true - else - i = i + 1 - end - end - if div == false - p = p - leading_term(p) - end - end - return q -end - -#Solves problems with weight vectors of floats. -function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int64}() - for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) - end - return w -end - -#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) -function change_order( - R::Singular.PolyRing, - cweight::Array{L,1}, - T::Matrix{Int64}, -) where {L<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), - cached = false, - ) - return S -end - -#return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) -function change_order( - R::Singular.PolyRing, - M::Matrix{Int64}, -) where {T<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_M(M), - cached = false, - ) - #@error("Not implemented yet") - return S -end - -function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - Singular.push_term!(M, c, v) - end - return finish(M) -end -function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - Singular.push_term!(M, c, v) - end - return finish(M) -end - - -############################################# -# unspecific help functions -############################################# - -function ident_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, n+1-i] = -1 - end - return M -end - -# Singular.isequal depends on order of generators -function equalitytest(G::Singular.sideal, K::Singular.sideal) - generators = Singular.gens(G) - count = 0 - for gen in generators - for r in Singular.gens(K) - if gen - r == 0 - count += 1 - end - end - end - if count == Singular.ngens(G) - return true - end - return false -end - -function dot(v::Vector{Int64}, w::Vector{Int64}) - n = length(v) - sum = 0 - for i = 1:n - sum += v[i] * w[i] - end - return sum -end - -function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) - if length(w) > 2 - if ord == :lex - return [ - w' - ident_matrix(length(w))[1:length(w)-1, :] - ] - end - if ord == :deglex - return [ - w' - ones(Int64, length(w))' - ident_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :degrevlex - return [ - w' - ones(Int64, length(w))' - anti_diagonal_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - end - else - error("not implemented") - end -end - -function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) - return [ - w' - M[2:length(w), :] - ] -end -function insert_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) - return [ - w' - M[1:length(w)-1, :] - ] -end - - -function ordering_as_matrix(ord::Symbol, nvars::Int64) - if ord == :lex - return ident_matrix(nvars) - end - if ord == :deglex - return [ - ones(Int64, nvars)' - ident_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :degrevlex - return [ - ones(Int64, nvars)' - anti_diagonal_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - else - error("not implemented") - end -end - - -function deg(p::Singular.spoly, n::Int64) - max = 0 - for mon in Singular.monomials(p) - ev = Singular.exponent_vectors(mon) - sum = 0 - for e in ev - for i = 1:n - sum += e[i] - end - end - if (max < sum) - max = sum - end - end - return max -end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl deleted file mode 100644 index 97e90e9d4..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/StandardWalkUtilitysFinal.jl +++ /dev/null @@ -1,5 +0,0 @@ -include("GroebnerWalkUtilitysFinal.jl") - -############################################################### -#Utilitys for standard_walk -############################################################### diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl deleted file mode 100644 index d85d13e0a..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/TranWalkUtilitysFinal.jl +++ /dev/null @@ -1,44 +0,0 @@ -include("GroebnerWalkUtilitysFinal.jl") - - -function representation_vector(G::Singular.sideal, T::Matrix{Int64}) - n = size(T)[1] - M = 0 - for i = 1:n - for j = 1:n - temp = T[i, j] - if M < temp - M = temp - end - end - end - d0 = 0 - for g in Singular.gens(G) - temp = deg(g, n) - if d0 < temp - d0 = temp - end - end - d = M * (2 * d0^2 + (n + 1) * d0) - w = d^(n - 1) * T[1, :] - for i = 2:n - w = w + d^(n - i) * T[i, :] - end - return w -end - -function inSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} - counter = 0 - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 - return true - end - if size(collect(Singular.coefficients(g)))[1] == 2 - counter = counter + 1 - end - end - if counter > 1 - return true - end - return false -end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl new file mode 100644 index 000000000..f6b537ee5 --- /dev/null +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl @@ -0,0 +1,176 @@ +using BenchmarkTools + +function prepare() +df = DataFrame( + NextWeight = ["NextWeight"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdH = ["stdH"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + example = ["example"], +) +savew(df, "standardWalk") +df = DataFrame( + NextWeight = ["NextWeight"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + pert = ["pert"], + inCone = ["inCone"], + laststd = ["laststd"], + degree = ["degree"], + example = ["example"], +) +for i in 2:10 +savew(df, "pertubedWalk",i) +end +df = DataFrame( + NextWeight = ["NextWeight"], + facetnormal = ["-"], + initials = ["initials"], + stdh = ["stdh"], + liftgeneric = ["liftgeneric"], + interred = ["interred"], + example = ["example"], +) +savew(df, "genericWalk") + +df = DataFrame( + NextWeight = ["NextWeight"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalk") +df = DataFrame( + NextWeight = ["NextWeight"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalklex") +df = DataFrame( + NextWeight = ["NextWeight"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalklookahead") +df = DataFrame( + NextWeight = ["NextWeight"], + weight = ["weight"], + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + inCone = ["inCone"], + pertvec = ["pertvec"], + depth = ["depth"], + example = ["example"], +) +savew(df, "fractalWalkcombined") +df = DataFrame( + NextWeight = "NextWeight", + weight = "weight", + nGens = ["nGens"], + initials = ["initials"], + stdh = ["stdh"], + liftGW2 = ["liftGW2"], + lift = ["lift"], + interred = ["interred"], + rep = ["rep"], + inCone = ["inCone"], + inseveral = ["inseveral"], + example = ["example"], +) +savew(df, "tranWalk") +end +function runb( + v::String, + ideal::Singular.sideal, + S::Singular.PolyRing, + StartOrd::Matrix{Int64}, + TarOrd::Matrix{Int64}, +) + println("starting Benchmark") + prepareExampleAlloc(v) + prepareExampleElapsed(v) + + println("Computing deglex-Basis") + stime =@belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 + I = Singular.std(ideal, complete_reduction = true) + + println("Benchmarking GroebnerWalk") + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + println("Computing lex-Basis") + ttime = @belapsed Singular.std( + Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), + complete_reduction = true, + ) evals=1 samples =1 + + df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) + savea(df, "SingularComputationTimings") + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) + savea(df, "correct") + + println("Benchmarking ideals") + for id in ideals + a = isequal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + b = equalitytest(s, id) + df = DataFrame(a = [a], b = [b],c=[v]) + savea(df, "correct") + end +end diff --git a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl index 0972290de..3206c9bba 100644 --- a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl +++ b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl @@ -2,54 +2,26 @@ using DataFrames using CSV function savew(df::DataFrame, file::String) - open(file, "w") do io # create a file and write with header as the file does not exist + open(file*".txt", "w") do io # create a file and write with header as the file does not exist foreach(row -> print(io, row), CSV.RowWriter(df)) end end function savea(df::DataFrame, file::String) - open(file, "a") do io # append to file and write without header + open(file*".txt", "a") do io # append to file and write without header foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) end end function savea(df::DataFrame, file::String, p::Int64) - if p == 2 - open("pertubedWalk2.txt","a") do io # append to file and write without header + open(file * "$p.txt","a") do io # append to file and write without header foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 3 - open("pertubedWalk3.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 4 - open("pertubedWalk4.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 5 - open("pertubedWalk5.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 6 - open("pertubedWalk6.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 7 - open("pertubedWalk7.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 8 - open("pertubedWalk8.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 9 - open("pertubedWalk9.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - elseif p == 10 - open("pertubedWalk10.txt","a") do io # append to file and write without header +end +end + +function savew(df::DataFrame, file::String, p::Int64) + open(file * "$p.txt","w") do io # append to file and write without header foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end - end +end end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl deleted file mode 100644 index 499cfc11c..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl +++ /dev/null @@ -1,540 +0,0 @@ -using BenchmarkTools - -function prepare() -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - example = ["example"], -) -savew(df, "standardWalk.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk2.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk3.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk4.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk5.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk6.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk7.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk8.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk9.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -savew(df, "pertubedWalk10.txt") -df = DataFrame( - weights = ["weights"], - facetnormal = ["-"], - initials = ["initials"], - stdh = ["stdh"], - liftgeneric = ["liftgeneric"], - interred = ["interred"], - example = ["example"], -) -savew(df, "genericWalk.txt") - -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalk.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalklex.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalklookahead.txt") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalkcombined.txt") -df = DataFrame( - weights = "weights", - weight = "weight", - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - rep = ["rep"], - inCone = ["inCone"], - inseveral = ["inseveral"], - example = ["example"], -) -savew(df, "tranWalk.txt") -end -function runb( - v::String, - ideal::Singular.sideal, - S::Singular.PolyRing, - StartOrd::Matrix{Int64}, - TarOrd::Matrix{Int64}, -) - println("starting Benchmark") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - example = [v], - ) - savea(df, "standardWalk.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk2.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk3.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk4.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk5.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk6.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk7.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk8.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk9.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - savea(df, "pertubedWalk10.txt") - df = DataFrame( - weights = ["-"], - facetnormal = ["-"], - initials = ["-"], - stdh = ["-"], - liftgeneric = ["-"], - interred = ["-"], - example = [v], - ) - savea(df, "genericWalk.txt") - - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalk.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalklex.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalklookahead.txt") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalkcombined.txt") - df = DataFrame( - weights = "-", - weight = "-", - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - rep = ["-"], - inCone = ["-"], - inseveral = ["-"], - example = [v], - ) - savea(df, "tranWalk.txt") - - - stime =@belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 - I = Singular.std(ideal, complete_reduction = true) - ideals = [] - for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) - end - - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) - - println("Computing GB") - ttime = @belapsed Singular.std( - Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), - complete_reduction = true, - ) evals=1 samples =1 - - df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) - savea(df, "SingularComputationTimings") - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), - complete_reduction = true, - ) - - df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) - savea(df, "correct.txt") - - println("Benchmark ideals") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b],c=[v]) - savea(df, "correct.txt") - end -end diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 99cd5ac7d..1b052aa60 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -176,9 +176,9 @@ function pertubed_vector( end end e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) + w = view(M,1, :) * e^(p - 1) for i = 2:p - w += e^(p - i) * M[i, :] + w += e^(p - i) * view(M,i, :) end return w end @@ -217,9 +217,9 @@ function pertubed_vector( end end e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) + w = view(M, 1, :) * e^(p - 1) for i = 2:p - w += e^(p - i) * M[i, :] + w += e^(p - i) * view(M, i, :) end return w end diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index dc98e7b17..cd0b24b23 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -266,7 +266,7 @@ function fractal_walk( ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println(PertVecs) - println("FacrtalWalk_standard results") + println("FractalWalk_standard results") println("Crossed Cones in: ") Gb = fractal_recursiv(G, S,T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index e307f7cb6..88e78b12a 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -137,12 +137,12 @@ function liftGW2( s = length(inG) for i = 1:length(gH) q = divalg(change_ring(gH[i], R), [change_ring(x, R) for x in inG], R) - gH[i] = R(0) + gH[i] = Rn(0) for j = 1:s - gH[i] = change_ring(gH[i], R) + q[j] * gG[j] + gH[i] = change_ring(gH[i], Rn) + change_ring(q[j],Rn) * change_ring(gG[j],Rn) end end - G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gH]) + G = Singular.Ideal(Rn, [x for x in gH]) G.isGB = true return G end From 89ca2af2a8162fd7615b2a2d6453509a4dd4cc46 Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 30 Dec 2021 21:59:35 +0100 Subject: [PATCH 44/85] Anpassung der Beispiele --- .../Benchmarking/BenchmarkHelper | 1 - .../GroebnerWalkFinalBenchmark.jl | 28 +- .../BenchmarkingAlg/runbenchmark2.jl | 60 +- .../Benchmarking/BspEinzeln.jl | 5 +- src/GroebnerWalkFinal/Benchmarking/BspVar3.jl | 267 +- src/GroebnerWalkFinal/Benchmarking/BspVar4.jl | 3653 +-------- src/GroebnerWalkFinal/Benchmarking/BspVar5.jl | 6668 +---------------- src/GroebnerWalkFinal/Benchmarking/BspVar6.jl | 4340 ----------- .../GroebnerWalkFinalBenchmarkProcedures.jl | 39 +- .../bechmarkingEveryProcedure/runbenchmark.jl | 8 - src/GroebnerWalkFinal/Benchmarking/parser.jl | 10 +- .../FractalWalkUtilitysFinal.jl | 4 +- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 2 +- 13 files changed, 573 insertions(+), 14512 deletions(-) delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar6.jl diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper index e8a1410ad..03808e91b 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper @@ -7,7 +7,6 @@ function runAll( ) runb(v,ideal,S,StartOrd,TarOrd) runb2(v,ideal,S,StartOrd,TarOrd) -runb3(v,ideal,S,StartOrd,TarOrd) end function prepareAlloc() diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl index 20f255f76..e8cc3b96f 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl @@ -47,7 +47,7 @@ function groebnerwalk2( p::Int64 = 0, ) if grwalktype == :standard - walk = (x, y, z) -> standard_walk2(x, y, z) + walk = (x, y, z) -> standard_walkAlloc(x, y, z) elseif grwalktype == :generic walk = (x, y, z) -> generic_walk2(x, y, z) elseif grwalktype == :pertubed @@ -82,7 +82,7 @@ function groebnerwalk2( ) elseif grwalktype == :tran walk = (x, y, z) -> tran_walk2(x, y, z) - elseif grwalktype == :fractal_combined2 + elseif grwalktype == :fractal_combined walk = (x, y, z) -> fractal_combined2( x, @@ -103,13 +103,13 @@ function groebnerwalk2( end -function standard_walk22(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - #println("standard_walk22 results") +function standard_walkAlloc(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) + #println("standard_walkAlloc results") #println("Crossed Cones in: ") - standard_walk22(G, S, T, S[1, :], T[1, :]) + standard_walkAlloc(G, S, T, S[1, :], T[1, :]) end -function standard_walk22( +function standard_walkAlloc( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, @@ -120,7 +120,7 @@ function standard_walk22( Rn = change_order(R, cweight, T) terminate = false while !terminate - G = standard_step(G, R, cweight, Rn) + G = standard_stepAlloc(G, R, cweight, Rn) #println(cweight) #global counter = getCounter() + 1 if cweight == tweight @@ -134,7 +134,7 @@ function standard_walk22( return G end -function standard_step( +function standard_stepAlloc( G::Singular.sideal, R::Singular.PolyRing, cw::Vector{Int64}, @@ -166,13 +166,13 @@ function generic_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while !isempty(v) #global counter = getCounter() + 1 #println(v) - G, Lm = generic_step(G, Lm, v, T,R) + G, Lm = generic_stepAlloc(G, Lm, v, T,R) v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) end -function generic_step( +function generic_stepAlloc( G::Singular.sideal, Lm::Vector{Singular.spoly{L}}, v::Vector{Int64}, @@ -212,7 +212,7 @@ function pertubed_walk2( while !terminate tweight = pertubed_vector(G, T, p) - G = standard_walk22(G, S, T, cweight, tweight) + G = standard_walkAlloc(G, S, T, cweight, tweight) if inCone(G, T, tweight) terminate = true else @@ -554,7 +554,7 @@ end -function fractal_walk2_combined( +function fractal_combined2( G::Singular.sideal, S::MonomialOrder{Matrix{Int64},Vector{Int64}}, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -658,7 +658,7 @@ function tran_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) - if tryparse(string(w), Int32) == nothing + if tryparse(Int32,string(w)) == nothing #println("w bigger than int32") return G end @@ -673,7 +673,7 @@ function tran_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) end end end - G = standard_step(G, R, w, Rn) + G = standard_stepAlloc(G, R, w, Rn) #global counter = getCounter() + 1 #println(w) R = Rn diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl index 37927c0e6..727eaa4b3 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl @@ -35,30 +35,20 @@ function runb2( println("starting Benchmark2") - example=[] - standard=[] - pertubed2=[] - pertubed3=[] - pertubed4=[] - pertubed5=[] - pertubed6=[] - pertubed7=[] - pertubed8=[] - pertubed9=[] - pertubed10=[] - fractal=[] - fractallex=[] - fractallookahead[] - fractalcombined=[] - generic=[] - tran=[] - println("Computing deglex-Basis") - @belapsed stime = Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 + stime = @belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 I = Singular.std(ideal, complete_reduction = true) ideals = [] println("Benchmarking groebnerwalk2") - + pertubed2= "-" + pertubed3= "-" + pertubed4= "-" + pertubed5= "-" + pertubed6= "-" + pertubed7= "-" + pertubed8= "-" + pertubed9= "-" + pertubed10= "-" for i = 2:nvars(S) if i ==2 pertubed2 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 @@ -79,24 +69,20 @@ function runb2( elseif i==10 pertubed10 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 end - gb = groebnerwalk2(I, StartOrd, TarOrd, :pertubed, i) - push!(ideals, gb) end - standard = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:standard, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :standard)) - generic = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:generic, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :generic)) - fractal = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal)) - fractallex = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractallex, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal_look_ahead)) - fractallookahead = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractallookahead, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal_lex)) - fractalcombined = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractalcombined, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :fractal_combined)) - tran = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:tran, $i) evals =1 samples =1 - push!(ideals, groebnerwalk2(I, StartOrd, TarOrd, :tran)) + standard = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:standard) evals =1 samples =1 + generic = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:generic) evals =1 samples =1 + fractal = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal) evals =1 samples =1 + fractallex = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_lex) evals =1 samples =1 + fractallookahead = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_look_ahead) evals =1 samples =1 + fractalcombined = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_combined) evals =1 samples =1 + tran = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:tran) evals =1 samples =1 + println("Computing lex-Basis") + ttime = @belapsed Singular.std( + Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), + complete_reduction = true, + ) evals=1 samples =1 df = DataFrame( example=[v], @@ -112,7 +98,7 @@ function runb2( pertubed10=[pertubed10], fractal=[fractal], fractallex=[fractallex], - fractallookahead[fractallookahead], + fractallookahead=[fractallookahead], fractalcombined=[fractalcombined], generic=[generic], tran=[tran], diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 6a0a96dbd..04d23dbc4 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -33,9 +33,8 @@ function runAllSingleExample() f4 = 2 * y * u + 2 * t * u + 2 * z * v - z f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) - runb("Katsura5", I, S, StartOrd, TarOrd) - runb2("Katsura5", I, S, StartOrd, TarOrd) - runb3("Katsura5", I, S, StartOrd, TarOrd) + runAll("Katsura5", I, S, StartOrd, TarOrd) + #Katsura6 diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl index ab0f27133..381f9539d 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl @@ -2,21 +2,16 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("readWriteHelper.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") - - +include("readWriteHelper.jl") using DataFrames using CSV - function benchmarkVar3() - cd("/Users/JordiWelp/Results") + cd("/Users/JordiWelp/Results2") prepare() prepare2() - prepare3() + prepareAlloc() dim = 3 ve = [1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) @@ -30,232 +25,224 @@ function benchmarkVar3() ideals = [] push!( - ideals, - Singular.Ideal( - R, - [b*c^2+78*a^2*b*c+27*a*b^2*c+31*a*b^4+a^2*b*c^2+89*a*b^2*c^2+70*a*b*c^3, -56*c+2*b*c+72*a^2*b*c+64*a^2*c^2+78*a*c^3, -55+12*a*c+28*b^2*c+12*c^3+82*b^5+67*a^4*c+5*c^5])) + ideals, + Singular.Ideal( + R,[48*b+23*a*c+47*a^5+69*a*b^4, +53*b*c^2, +65+21*a*b*c^2])) push!( ideals, Singular.Ideal( - R, - [25+47*a*b+74*b^3+16*a*b*c^2+28*b*c^3+11*b^5+38*a*b^3*c+33*a^2*c^3, -73*a*c+34*a^2*c+41*a*b^3+67*a^5+39*b^4*c+85*a^2*c^3+78*c^5, -48*c+70*a*c^2+6*a*b*c^2+90*c^4])) + R,[R(47), +4*a*b^3+64*a^3*b^2, +40*a+90*b^2+59*a*b^2+74*b^4*c])) push!( ideals, Singular.Ideal( - R, - [57*b*c^2+63*c^3+58*a^3*c+59*b^3*c^2+a*b*c^3+57*b^2*c^3+11*b*c^4+50*c^5, -83*b+69*b*c+33*a*b*c^3, -47+69*c^2+82*b^3+33*a^3*b+22*a*b^3+5*a*b^2*c+12*c^4+44*b*c^4])) + R,[89*c+78*a*c^3, +26*a*c^2, +26+4*c^2+89*a^4*b+73*a^2*b^2*c])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(1*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] +ideals =[] push!( ideals, Singular.Ideal( - R, - [8*a*b+88*a^3+70*a^2*b+62*c^3+47*b^4+46*b^3*c+17*a^2*c^2+23*b^2*c^2+50*a*c^3+72*a*b^4+78*b^5+27*a*b^2*c^2, -79*c+79*a^2+42*a*b+69*c^2+70*b^2*c+3*a*c^2+41*b*c^2+29*a*c^3+31*b*c^3+15*a^2*b^2*c+45*a^2*b*c^2+2*a*c^4, -23+5*c+58*a^3*b+88*b*c^3+79*a^3*b^2+13*a*b^4+86*a^3*b*c+89*b^4*c+61*a*b^2*c^2+89*b^3*c^2+85*b^2*c^3])) + R,[65+a^3+37*a^4+60*a^3*c^2, +47*a*b+4*a^2*b+35*b*c^4, +a+23*a^3*b+84*a*b^2*c^2])) push!( ideals, Singular.Ideal( - R, - [9*b+88*b*c+47*b^2*c+41*a^4+82*a*b^3+44*a^3*c+43*a^4*b+57*b^4*c+43*a^2*b*c^2+39*a^2*c^3+50*c^5, -74*b+81*a^2+59*b^2+47*a^2*b+44*a*b^2+64*b*c^2+74*a*b*c^2+82*a*c^3+26*a^5+89*a^2*b^2*c+57*a^3*c^2, -71+49*b^2+83*b^3+10*a^2*c+49*a^3*b+79*a*b^3+12*b^3*c+9*a^2*c^2+65*a*b^4+23*a^2*b*c^2+71*b^3*c^2+2*b^2*c^3+46*c^5])) + R,[86+77*a+13*a^3+23*a^2*b+21*c^4+4*a*b^4+7*c^5, +82*c^2, +23*c^4+4*a^3*b*c])) push!( ideals, Singular.Ideal( - R, - [45+5*c+18*b^2+5*a*c+39*c^2+17*a^3+39*a^2*b+78*a^2*c+86*a*c^2+44*a^4+64*a^2*b*c+29*b^5, -21*a^3+61*b*c^2+45*a*b^2*c+85*b^3*c+11*a^2*c^2+51*a*b*c^2+38*c^4+82*a*b^4+55*a*b^3*c+57*b^4*c+42*a^3*c^2+74*a^2*c^3+55*b^2*c^3, -5*b+40*b^2+90*b^4+12*b^3*c+45*a^3*b^2+73*b^3*c^2+49*a*b*c^3+2*b^2*c^3+73*b*c^4+c^5])) + R,[71*c^3+67*a^4+14*b*c^4, +64+87*b^2+40*a^2*b+21*b^2*c^2+73*a^4*b, +50*b+21*a^2*b^3])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(2*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] - +ideals =[] push!( ideals, Singular.Ideal( - R, - [52+30*a+58*c+62*a*b^2+b^3+59*a*b*c+49*a*c^2+29*a^2*b^2+5*a^3*c+43*a^2*b*c+76*a^2*c^2+20*b*c^3+66*c^4+11*a^3*b^2+57*a*b^4+31*a^4*c+68*a^2*b^2*c+56*a*b^2*c^2+12*a*c^4, -23*c+29*a^2+6*b^2+71*b*c+47*c^2+55*a*b^2+88*b^3+66*a*b*c+29*b*c^2+62*a^3*b+41*a^2*b*c+59*a*b^2*c+82*a*b^4+47*b^5+83*b^4*c+60*a*b*c^3+51*b^2*c^3, -57*a^2+86*a*b+78*a*b*c+88*a*b^3+20*a^2*b*c+16*a*b*c^2+69*a*c^3+89*c^4+87*a*b^4+25*b^5+84*a*b^3*c+87*b^4*c+11*a^2*b*c^2+28*b^3*c^2+28*a^2*c^3+8*a*c^4])) + R,[22+38*b*c^2+60*a*c^4, +14*a+67*a^2+58*b^2*c^2+87*b^5+88*a^2*b*c^2, +67*a*c+83*a^2*c+87*b^4+18*a*c^3+74*b^3*c^2])) push!( ideals, Singular.Ideal( - R, - [87*a*b+89*b^2+b*c+31*b^2*c+89*a^4+3*a*b^3+74*b^4+81*a^3*c+31*a^2*b*c+78*a^2*c^2+47*c^4+45*a^3*b^2+29*a^2*b^3+27*a*b^3*c+19*b^4*c+32*a^3*c^2+71*a^2*b*c^2, -21+5*a+89*a*c+24*a^2*b+22*b^3+47*b*c^2+2*c^3+43*a^3*c+16*a*b*c^2+a^4*b+45*b^5+56*b^4*c+36*a^2*c^3+33*a*b*c^3, -71*a+66*b+15*a*b+41*a*c+35*a^3+26*a*b^2+59*a*c^2+77*c^3+65*a*b^3+a*b^2*c+26*b^3*c+27*a*c^3+76*c^4+43*a^5+16*a^3*b^2+33*a*b^4+44*b^5+41*b^4*c+80*a*b^2*c^2+9*a^2*c^3+b^2*c^3])) + R,[49*a+88*a*b*c^2+55*a*b*c^3, +5*c^2+83*a^3*b+10*a^4*c+28*a*c^4, +54+19*b^2+8*b*c^2+54*c^3+10*a*b^2*c+40*c^5])) push!( ideals, Singular.Ideal( - R, - [79*b+38*c+63*a*b+69*a*c^2+45*b*c^2+18*b^4+89*a*b^2*c+24*a*c^3+51*c^4+66*a^2*b^3+50*a^4*c+51*a^3*b*c+51*a^2*b*c^2+29*a*b^2*c^2+80*a*c^4, -31*a^2+61*a*b+61*a*c+10*b*c+61*a*b^2+3*b^3+66*a^2*c+57*a^2*b^2+62*a*b^3+28*a^2*b*c+12*a*b^2*c+7*a*c^3+26*b*c^3+73*a^3*b^2+65*a^3*b*c+21*a^3*c^2+58*a^2*b*c^2+23*b^2*c^3+2*c^5, -67+29*b+12*a*c+10*a^3+21*a^2*c+35*a*b*c+5*c^3+12*a^3*c+38*a^2*c^2+44*a*b*c^2+61*b^2*c^2+13*a*b^4+63*b^5+59*b^4*c+83*a^2*c^3+47*a*b*c^3+62*b^2*c^3+57*b*c^4])) + R,[44*c+60*b*c+3*a^2*c+43*c^4, +85*a^2+36*b^3*c^2+19*c^5, +5+64*a*b^2+55*a^2*b^2+18*b^4+26*b*c^4+5*c^5])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(3*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] - +ideals =[] push!( ideals, Singular.Ideal( - R, - [86+29*c+64*a^2+47*a*b+79*b^2+59*c^2+77*a^3+53*a^2*b+34*a*b^2+54*b^3+65*a*b*c+69*c^3+30*b^4+25*a^3*c+31*b^3*c+42*a^2*c^2+29*b^2*c^2+71*b*c^3+10*c^4+a^5+54*a^2*b^3+48*a^3*b*c+13*a^2*b*c^2+33*b^3*c^2+71*a^2*c^3+51*c^5, -24*b+c+8*a*b+85*b^2+68*a*b*c+90*b^4+29*a^3*c+88*a*b^2*c+39*b^3*c+28*a^5+47*a^4*b+40*a^2*b^3+86*a*b^4+86*a^4*c+48*a^3*b*c+22*a^2*b^2*c+59*a*b^3*c+84*a^2*b*c^2+43*a*b^2*c^2+8*a*b*c^3+88*a*c^4+36*b*c^4+56*c^5, -71+32*c+25*a*b+67*c^2+10*a^3+4*b^3+22*a*b*c+5*b^2*c+26*b*c^2+57*a^4+40*a^2*b^2+11*b^4+65*a^3*c+18*a*b^2*c+31*b^3*c+23*a^2*c^2+2*a^5+51*a^4*b+77*b^4*c+50*a*b^2*c^2+45*b^2*c^3])) + R,[74*a*c+48*b*c+26*a*b^2*c+9*c^4+83*a*b^4+45*b^5+49*a^3*c^2, +85+42*a*b^2*c+68*a*c^3+50*b^2*c^3+45*c^5, +26*a+59*a^2*b+49*a^2*c+75*c^3+40*a^2*c^3])) push!( ideals, Singular.Ideal( - R, - [73*b+3*a^2+65*a*c+30*a*b*c+4*b*c^2+9*c^3+55*a^2*b^2+34*a*b^3+86*b^4+55*a^2*c^2+75*a*c^3+13*b*c^3+19*c^4+82*a^5+44*a^4*b+64*a^2*b^3+74*a*b^4+82*b^5+54*a^2*b^2*c+56*a*b*c^3+85*b*c^4+34*c^5, -31+8*b^2+31*a^3+33*a^2*c+13*a*b*c+29*c^3+25*a^4+17*b^4+50*a^3*c+66*a^2*b*c+66*b^3*c+77*a*b^4+64*b^5+27*a^2*b^2*c+76*a*b^3*c+88*b^4*c+81*a^3*c^2+40*a^2*b*c^2+37*a*b*c^3, -49+5*a+80*b+86*c+28*a^2+8*a*b+31*b^2+47*a*c+65*b*c+73*a^3+54*a^2*b+31*b^3+41*a^2*c+30*c^3+27*a^2*b^2+85*a*b^3+31*b^4+56*a^3*c+a^2*c^2+16*b*c^3+46*a^5+8*a^4*b+65*a^2*b^3+51*a*b^4+30*a^4*c+77*a^3*c^2+20*b^3*c^2+14*a*b*c^3+48*b*c^4])) + R,[48*a*c+19*a*c^2+23*a^3*b^2+42*a*b^2*c^2, +18*b^2+32*a^2*b+64*b*c^2+44*a*b^3+2*b^4+23*a^3*b^2+2*a^2*b^3+13*b^3*c^2, +41+19*c+51*a*b^3+9*b*c^3+50*a*b*c^3])) push!( ideals, Singular.Ideal( - R, - [76+83*b+36*c+67*a^2+4*a*b+81*a*c+26*b^3+63*a^2*c+12*a*b*c+32*b^2*c+9*c^3+82*a^4+4*b^4+49*a*b^2*c+77*b^3*c+73*a*b*c^2+14*b^2*c^2+26*b*c^3+5*a^3*b^2+73*a^4*c+44*b^4*c+86*a^3*c^2+67*a*b^2*c^2+2*b^3*c^2+84*a^2*c^3+35*a*c^4+67*b*c^4, -81+27*a^2+69*b^2+60*a^3+53*a*b*c+12*a*b^3+66*b^4+5*a^2*b*c+9*a*b^2*c+88*b^3*c+72*a^2*c^2+6*a^4*b+55*a^2*b^3+72*a*b^4+43*b^5+62*a^2*b^2*c+53*a^2*b*c^2+46*a*b^2*c^2+75*b^2*c^3, -50*a+9*b+36*a*b+52*a*c+81*c^2+29*a^3+33*a*b^2+36*b^3+23*a^2*c+71*b*c^2+33*a*b^3+46*b^4+11*a^3*c+86*b^3*c+3*a*c^3+56*a^5+74*a^3*b^2+38*a*b^4+16*a^4*c+40*a^2*b*c^2+27*a*b*c^3+6*b^2*c^3+72*a*c^4+50*c^5])) + R,[49*c^3+78*c^5, +12*a+22*b^4+40*a^3*b*c+44*a*b*c^3, +75+87*a*b+86*c^2+16*a^2*b+53*c^3+87*a^3*c+87*a*c^3+28*b*c^3+23*a^2*b^2*c+15*b^4*c+65*b^2*c^3])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(4*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] - +ideals =[] push!( ideals, Singular.Ideal( - R, - [37+33*b+64*a^2+40*b*c+86*c^2+19*a*c^2+30*b*c^2+61*c^3+54*a^4+25*a^3*b+81*a*b^3+87*a^3*c+67*a^2*b*c+25*a*c^3+88*b*c^3+15*a^3*b^2+73*a^2*b^3+54*a^2*b^2*c+48*a*b^3*c+56*b^4*c+7*a^3*c^2+49*a^2*b*c^2+82*a^2*c^3+8*a*b*c^3+42*b*c^4, -77+13*a+7*b+72*a*b+b^2+72*b*c+85*c^2+90*a^2*b+6*b^3+51*a^2*c+41*a*b*c+8*a*c^2+56*b*c^2+81*a^3*c+39*a^2*b*c+34*b^2*c^2+55*a*c^3+75*a^3*b*c+61*a^2*b^2*c+48*b^4*c+76*a^2*b*c^2+18*a*b^2*c^2+7*b^3*c^2+53*b^2*c^3+35*b*c^4+12*c^5, -30*a+16*b+37*a*c+11*c^2+77*a^3+87*a^2*b+17*a*b^2+38*b^3+37*b^2*c+31*a*c^2+29*a^4+57*a^3*b+14*a*b^3+78*b^4+56*a^3*c+73*a^2*b*c+80*b^3*c+75*a^2*c^2+68*a*b*c^2+58*a*c^3+66*b*c^3+40*c^4+40*a^5+23*a^3*b^2+25*a^2*b^3+36*a*b^4+70*a^2*b^2*c+48*b^4*c+87*a^3*c^2+29*a*b^2*c^2+81*b^3*c^2+27*a^2*c^3+19*a*b*c^3+8*a*c^4+16*b*c^4])) + R,[36*b*c+80*b^3+29*c^3+70*a*b^2*c+23*a^2*c^2+86*a^3*b^2+29*b^4*c+55*b*c^4, +65+75*a*c+58*b^3+69*a^3*b+64*a*b^2*c+82*a*b^4+24*c^5, +53*b+39*a^2*b*c+42*a^3*b*c+42*a^2*b*c^2])) push!( ideals, Singular.Ideal( - R, - [23+23*b+51*c+19*a*b+49*b^2+84*b*c+32*c^2+20*a^3+a^2*b+89*a*b^2+74*b^3+44*b^2*c+19*c^3+45*a^4+38*a^3*b+47*a^2*b^2+5*a*b^3+54*b^4+35*a^3*c+13*b^3*c+72*b^2*c^2+37*a*c^3+75*b*c^3+67*a^4*b+65*a*b^4+63*a^4*c+16*a^3*b*c+32*b^4*c+58*a*b*c^3+90*a*c^4+22*b*c^4, -9*c+11*a*c+29*c^2+69*a^3+75*a^2*b+56*a*b^2+44*c^3+86*a^3*b+60*b^4+16*a^2*b*c+3*a^2*c^2+43*a*b*c^2+21*b^2*c^2+31*a^4*b+44*b^5+44*a^4*c+68*a^3*b*c+86*a*b^3*c+24*b^4*c+40*a*b^2*c^2+36*b^3*c^2+37*a^2*c^3+28*a*b*c^3+54*b^2*c^3+20*a*c^4+23*b*c^4+15*c^5, -45+44*a+69*b+40*a^2+9*b*c+52*c^2+62*a^2*b+15*a*b^2+13*b^3+19*b^2*c+88*b*c^2+30*a^4+13*a^3*b+74*a^3*c+10*a^2*b*c+42*a*b^2*c+53*a^2*c^2+88*a*c^3+59*a^5+66*a^4*b+49*a^2*b^3+44*a^4*c+65*a^3*b*c+50*b^4*c+46*a^2*b*c^2+45*a*b*c^3+69*b^2*c^3+86*a*c^4])) + R,[78+7*a*c+21*a^2*b+20*b^2*c+85*b^3*c+34*b*c^3+9*b^2*c^3, +37*a^2*b^2+89*a^3*b^2+45*a*b^4+76*a^3*c^2+21*a*c^4+22*b*c^4, +37*c+24*b^2+49*b^2*c+15*a^2*b*c+55*a*c^3+5*a^2*c^3])) push!( ideals, Singular.Ideal( - R, - [22*a+c+69*b^2+41*a*c+60*c^2+35*a^2*b+89*a*b*c+26*b^2*c+27*a*c^2+38*a^2*b^2+32*b^4+36*a^3*c+78*a^2*b*c+56*a*b^2*c+20*b^3*c+77*b^2*c^2+17*a*c^3+51*b*c^3+8*a^5+56*a^2*b^3+88*a*b^4+77*b^5+47*a^3*b*c+22*a*b^3*c+54*b^4*c+37*a^2*b*c^2+34*a*b^2*c^2+10*a^2*c^3+13*b*c^4, -87+52*a+56*b+16*a^2+14*b^2+21*a*c+47*c^2+54*a^3+30*a^2*c+87*a*b*c+34*a*c^2+2*c^3+81*a^2*b^2+46*b^4+34*a^2*b*c+24*b^3*c+89*a^2*c^2+54*a*c^3+64*b*c^3+40*a^5+65*a^3*b^2+68*a^4*c+42*a^3*b*c+49*a^2*b*c^2+29*a*b*c^3+2*b^2*c^3+26*a*c^4+12*c^5, -48+23*b+50*b^2+73*a*c+47*a^3+60*a^2*b+50*a*b^2+57*b^3+57*a*b*c+55*b^2*c+11*a^3*b+3*a^2*b^2+60*b^4+23*b^3*c+81*a*c^3+5*b*c^3+41*c^4+78*a^4*b+66*a*b^4+15*b^5+10*a^4*c+49*a^3*b*c+40*a^2*b^2*c+41*a^3*c^2+8*a^2*b*c^2+12*a*b^2*c^2+81*a^2*c^3+66*a*c^4+66*b*c^4])) + R,[18+89*b^2+80*a^3+22*a^2*c^2+75*b^2*c^2+58*b*c^3+64*a*b^3*c+85*a^3*c^2+4*a^2*b*c^2+46*a^2*c^3, +16*a*b+31*a^3+10*b^3+9*a*b^2*c+67*a^2*c^2+46*a^2*b*c^2, +86*a+19*a^5+8*b^4*c])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(5*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] - +ideals =[] push!( ideals, Singular.Ideal( - R, - [1+62*a+86*c+31*a*b+47*b^2+41*a*c+3*c^2+48*a^3+38*a^2*b+27*b^3+79*a*b*c+78*a*c^2+62*a^4+12*a^2*b^2+28*a*b^3+32*b^4+81*a^3*c+19*a^2*b*c+32*b^3*c+16*b*c^3+85*c^4+51*a^5+85*a^3*b^2+60*a^2*b^3+a^2*b^2*c+80*a*b^3*c+6*a^3*c^2+58*a^2*b*c^2+29*b^3*c^2+27*a^2*c^3+67*a*b*c^3+43*a*c^4+41*b*c^4+48*c^5, -64*a+4*b+26*c+77*a^2+27*b^2+2*b*c+30*a^3+54*a*b^2+42*a^2*c+47*a*b*c+49*b^2*c+41*b*c^2+90*c^3+64*a^4+78*a^3*b+a*b^3+51*a^3*c+27*a^2*b*c+55*a*b^2*c+26*a^2*c^2+47*a*b*c^2+44*b^2*c^2+56*c^4+20*a^4*b+53*a^2*b^3+3*a*b^4+29*a^4*c+36*a^3*b*c+60*a*b^2*c^2+87*b^3*c^2+35*b^2*c^3+11*a*c^4+36*b*c^4+11*c^5, -50+43*c+25*a^2+80*a*b+29*b^2+3*a*c+7*a^3+24*a*b^2+56*b^3+78*a^2*c+4*a*b*c+78*c^3+29*a^3*b+52*a*b^3+74*b^4+27*a^3*c+60*a*b^2*c+28*a^2*c^2+37*b^2*c^2+52*a*c^3+65*a^5+18*a^4*b+71*a^3*b^2+68*a^2*b^3+13*b^5+36*a^4*c+5*a^3*b*c+72*a^2*b^2*c+26*a*b^3*c+59*a^2*b*c^2+43*a*b*c^3+68*b^2*c^3+79*a*c^4+71*c^5])) + R,[48*a+18*a^2+90*a*c+7*b*c+81*a*b*c+2*b^2*c+69*b^4+57*a*b*c^2, +20+35*b+24*b^4+11*b^3*c+49*a*c^3+22*a^3*b^2+76*a*b^4+3*a^2*b^2*c+47*b^2*c^3, +89*a^2*b+9*a*b^2+62*a*b^3+74*a^4*b+32*a^3*b^2+87*a^2*b^3+62*b*c^4])) push!( ideals, Singular.Ideal( - R, - [47+81*a+41*c+47*a^2+62*b^2+28*a*c+59*a^3+78*b^3+41*a*b*c+20*b^2*c+18*b*c^2+10*a^4+52*a^2*b^2+19*b^4+66*a^3*c+64*a^2*b*c+14*b^3*c+71*a^2*c^2+39*a*c^3+b*c^3+26*a^4*b+38*a^3*b^2+89*a^2*b^3+39*b^5+59*a^4*c+49*b^4*c+8*a^2*b*c^2+26*a*b^2*c^2+7*a^2*c^3+25*a*c^4, -50+82*a+69*b+46*a*b+26*b^2+61*c^2+71*a^3+5*a^2*b+43*a*b^2+11*b^3+81*a^2*c+83*a*b*c+26*b^2*c+36*b*c^2+82*a^4+11*a^3*b+16*a*b^3+55*a^2*b*c+24*a*b^2*c+30*b^3*c+60*a^2*c^2+67*a*b*c^2+85*b^2*c^2+90*a*c^3+63*a^5+37*a^3*b^2+51*a*b^4+58*b^5+90*a^4*c+29*a^2*b^2*c+36*a*b^3*c+59*a*b^2*c^2+81*a*b*c^3+70*b^2*c^3+55*a*c^4+8*c^5, -30*b+62*c+6*a^2+36*a*b+22*b^2+42*b*c+23*c^2+20*a^3+88*a^2*b+55*a*b^2+56*b^2*c+75*c^3+18*a^3*b+21*a^2*b^2+65*a^2*b*c+70*a*b^2*c+47*a*b*c^2+11*b^2*c^2+69*a*c^3+82*c^4+42*a^5+25*a^4*b+19*a^3*b^2+79*a^2*b^3+19*a*b^4+44*b^5+53*a^2*b^2*c+83*b^4*c+28*a^2*b*c^2+67*a*b^2*c^2+54*b^3*c^2+6*a^2*c^3+13*b^2*c^3+64*a*c^4+52*b*c^4+76*c^5])) + R,[48+15*a+42*a^2+35*c^2+72*b^4, +37*c^2+17*a*b^2+46*a*b*c+78*a^2*b*c+33*a*b*c^2+34*b^2*c^2+63*a*c^3+71*a^3*b^2+22*a^4*c+29*a^2*b^2*c+12*a^3*c^2+66*a*c^4+86*b*c^4, +73*c+52*a*b^2+69*a*b*c+18*a*b*c^2+49*a^4*b+77*b^3*c^2])) push!( ideals, Singular.Ideal( - R, - [28+76*b+41*c+34*a^2+77*a*b+12*b^2+50*a*c+75*c^2+52*a^3+26*b^2*c+17*a*c^2+12*c^3+16*a^4+51*a^3*b+41*a^2*b^2+12*a*b^3+62*b^4+63*a^3*c+48*a^2*b*c+45*a*b^2*c+62*b^3*c+34*a^2*c^2+33*a*c^3+84*c^4+81*a^5+53*a^3*b^2+62*b^5+57*a^4*c+65*a^3*b*c+14*b^4*c+52*a^3*c^2+19*a^2*b*c^2+37*a*b^2*c^2+32*a^2*c^3+36*a*b*c^3+32*b^2*c^3+51*b*c^4+51*c^5, -54*a+42*b+14*c+41*a*b+10*b*c+10*c^2+87*a^2*b+43*a*b^2+14*a*b*c+39*b^2*c+59*a*c^2+58*b*c^2+5*c^3+10*a^4+51*a*b^3+64*b^4+73*a*b*c^2+59*b^2*c^2+a*c^3+77*b*c^3+5*a^5+31*a^4*b+88*a^2*b^3+37*a*b^4+29*a^2*b^2*c+53*a^3*c^2+2*b^3*c^2+15*a^2*c^3+38*a*c^4+20*c^5, -16+b+85*a^2+90*a*c+37*c^2+44*a^3+55*a*b^2+31*b^3+17*a*b*c+76*a*c^2+33*b*c^2+9*c^3+84*a^3*b+11*a^2*b^2+13*a*b^3+62*a^2*c^2+45*a*b*c^2+60*b^2*c^2+15*b*c^3+85*c^4+15*a^5+78*a^2*b^3+25*a*b^4+87*b^5+74*a^4*c+31*a^2*b^2*c+6*a*b^3*c+22*b^4*c+35*a^2*b*c^2+76*b^3*c^2+34*a^2*c^3+80*a*b*c^3+77*b^2*c^3+c^5])) + R,[50*b+63*c^2+51*a^3+26*b^4*c+77*a^3*c^2+67*b^3*c^2, +11*b+48*a*b+57*a^4+10*b^4+23*a^5+14*a*b^4, +19+79*a*c+3*a*b^2+27*a*b*c+74*b^2*c+62*a^3*c+31*a^2*b*c+30*a*b^2*c+43*b^3*c+8*a*b^3*c+31*a^2*b*c^2+86*b^3*c^2])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(6*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] - +ideals =[] push!( ideals, Singular.Ideal( - R, - [59+38*a+16*b+11*c+57*a^2+30*a*b+17*b^2+4*a*c+59*b*c+28*a^3+4*a^2*b+57*a*b^2+71*b^3+62*a^2*c+35*b^2*c+84*c^3+79*a^4+3*a*b^3+38*b^4+56*a^3*c+21*b^3*c+48*a^2*c^2+70*a*c^3+7*b*c^3+40*c^4+4*a^5+28*a^2*b^3+16*b^5+20*a^4*c+27*a^3*b*c+35*a*b^3*c+36*b^4*c+17*a^3*c^2+29*a^2*b*c^2+59*a*b^2*c^2+28*b^3*c^2+30*a^2*c^3+76*b*c^4+85*c^5, -49+4*a+6*c+8*a^2+55*a*b+63*b^2+57*a*c+5*c^2+8*a^3+82*a*b^2+14*b^3+6*a*b*c+53*b^2*c+90*a*c^2+74*b*c^2+8*c^3+82*a^3*b+54*a^2*b^2+39*a*b^3+37*b^4+3*a^2*b*c+49*a*b^2*c+12*a^2*c^2+25*a*b*c^2+88*b^2*c^2+30*a*c^3+41*c^4+86*a^5+13*a^4*b+58*a^2*b^3+74*b^5+64*a^4*c+25*a^2*b^2*c+52*a*b^3*c+40*a^3*c^2+73*a^2*b*c^2+55*a*b*c^3+4*b^2*c^3+10*a*c^4+16*c^5, -35*a+30*b+42*a^2+47*b*c+13*c^2+71*a^3+9*a^2*b+33*a*b^2+84*a^2*c+b*c^2+57*c^3+46*a^4+43*a^3*b+18*a*b^3+44*b^4+6*a^3*c+5*a^2*b*c+85*a*b^2*c+75*b^3*c+33*b^2*c^2+14*a*c^3+33*c^4+22*a^5+2*a^4*b+21*a^3*b^2+62*a^2*b^3+13*a*b^4+54*b^5+44*a^4*c+62*a^3*b*c+16*a^2*b^2*c+32*a*b^3*c+53*b^4*c+20*a*b^2*c^2+83*a^2*c^3+18*b^2*c^3+40*a*c^4+12*b*c^4+26*c^5])) + R,[42+23*a*b+8*a^2*b+20*a^2*c+76*a^3*b*c+78*b^3*c^2+2*a*b*c^3+6*b^2*c^3+25*b*c^4, +31*c+50*b*c+80*a^2*b+79*a^3*b+85*a*b*c^2+58*a*b^4+2*a^3*c^2+16*c^5, +88*a+52*a*b+17*b^3+78*b*c^2+40*a^2*b^2+14*b^3*c+85*a^2*c^2+85*b^2*c^2+80*c^4+19*a^2*b^2*c])) push!( ideals, Singular.Ideal( - R, - [61+81*a+73*b+17*c+9*a^2+50*a*b+84*a*c+66*c^2+20*a^3+2*a^2*b+9*a*b^2+72*a^2*c+70*a*b*c+60*b^2*c+73*a*c^2+44*b*c^2+32*a^4+50*a^3*b+53*b^4+12*a*b^2*c+33*a^2*c^2+75*b*c^3+30*a^5+42*a^2*b^3+18*a*b^4+71*b^5+26*a^3*b*c+39*a^2*b^2*c+74*a*b^3*c+81*b^4*c+38*b^3*c^2+23*a^2*c^3+7*a*b*c^3+66*b^2*c^3+30*a*c^4+7*b*c^4, -63+86*a+46*c+29*a*c+74*b*c+90*c^2+13*a^3+39*a*b^2+44*b^3+77*a^2*c+58*a*c^2+68*c^3+77*a^4+a^3*b+15*a^2*b^2+42*a*b^3+59*a^3*c+50*a^2*b*c+89*a*b^2*c+47*b^3*c+5*a^2*c^2+17*a*b*c^2+11*b^2*c^2+77*a*c^3+78*b*c^3+38*a^5+55*a^4*b+53*a^3*b^2+43*a^2*b^3+24*a*b^4+30*b^5+55*a^4*c+76*a^3*b*c+39*a^2*b^2*c+47*a*b^3*c+66*a^2*b*c^2+79*b^3*c^2+7*a^2*c^3+46*a*b*c^3+19*b^2*c^3+70*a*c^4+16*b*c^4, -31+40*b+5*a^2+a*b+49*b^2+80*a*c+54*c^2+42*a^3+20*a^2*b+86*a*b^2+9*a^2*c+61*b^2*c+53*b*c^2+66*c^3+19*a^4+6*a^3*b+79*a^2*b^2+83*a*b^3+29*b^4+2*a^3*c+24*a^2*b*c+71*a*b^2*c+47*b^3*c+31*a^2*c^2+42*b^2*c^2+58*a*c^3+77*b*c^3+74*a^4*b+33*a^3*b^2+52*a^4*c+37*a^3*b*c+74*a*b^3*c+42*b^4*c+55*a^3*c^2+84*a^2*b*c^2+14*b^3*c^2+69*a^2*c^3+43*b^2*c^3+61*a*c^4+55*b*c^4+16*c^5])) + R,[61*a*b+35*b*c^2+13*a*b*c^2+69*b^2*c^2+20*b*c^3+21*a*b^4+21*a*b^3*c+53*b^3*c^2, +90+39*a+62*a^3*c+61*b*c^3+55*c^4+22*b^4*c+35*a^3*c^2+41*a*c^4+75*c^5, +56*c+a*c+13*b*c+33*a*b^2+65*b^3+45*a^2*c+71*b*c^2+4*a*b*c^2+82*a*b^3*c+70*b^2*c^3])) push!( ideals, Singular.Ideal( - R, - [56+30*a+90*b+19*c+15*a^2+12*a*c+90*b*c+81*c^2+87*a^3+37*b^3+44*a*b*c+65*a*c^2+66*b*c^2+20*c^3+65*a^4+63*a^3*b+76*b^4+37*a^2*b*c+11*a*b^2*c+67*b^3*c+23*a^2*c^2+78*a*b*c^2+45*b^2*c^2+19*b*c^3+6*a^5+85*a^2*b^3+54*a*b^4+15*b^5+66*a^4*c+5*a^2*b^2*c+20*a*b^3*c+31*b^4*c+65*a^3*c^2+84*b^3*c^2+58*a^2*c^3+59*a*b*c^3+66*b^2*c^3+55*b*c^4, -69*c+62*a^2+51*a*b+29*b^2+86*b*c+51*a^3+16*a^2*b+37*a*b^2+23*b^3+77*a^2*c+10*a*b*c+31*a*c^2+77*b*c^2+19*a^3*b+39*a*b^3+19*b^4+76*a^2*b*c+54*b^3*c+31*a*b*c^2+8*b^2*c^2+74*a*c^3+28*b*c^3+59*c^4+23*a^5+59*a^4*b+35*a^3*b^2+8*a^2*b^3+35*b^5+72*a^4*c+24*a^3*b*c+63*a^2*b^2*c+26*b^4*c+24*a^3*c^2+68*a^2*b*c^2+14*a*b^2*c^2+33*b^3*c^2+10*a^2*c^3+63*b^2*c^3+87*c^5, -12+37*a+37*b+49*c+59*a^2+74*b^2+61*a*c+66*b*c+17*c^2+57*a^3+56*a^2*b+76*a*b^2+72*b^3+58*a^2*c+2*b*c^2+36*c^3+73*a^3*b+29*a^2*b^2+58*a*b^3+27*b^4+8*a^3*c+88*a*b^2*c+45*a^2*c^2+83*b^2*c^2+28*a*c^3+18*b*c^3+18*c^4+75*a^5+50*a^4*b+6*a^2*b^3+54*a*b^4+11*a^4*c+71*a^3*b*c+78*a^2*b^2*c+32*b^4*c+78*a^3*c^2+7*a^2*b*c^2+32*a*b^2*c^2+13*a^2*c^3+25*a*b*c^3+11*c^5])) + R,[87*a*c+73*a*b^2+62*a*c^2+55*a^2*b^2+78*b^4+77*c^4+2*a^3*b^2+40*b^2*c^3+49*b*c^4, +58+42*c+85*a*b+58*a^2*b*c, +70*c+11*b^2+20*a^2*b+47*b^2*c+69*b*c^2+4*a^3*b+72*a*b*c^2+72*a*c^3+43*a^2*b^3+76*a*b^4+22*a^3*b*c+36*a^2*b*c^2+64*b^2*c^3+28*c^5])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(7*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] +ideals =[] push!( ideals, Singular.Ideal( - R, - [82*a+26*b+37*a*b+53*b^2+22*b*c+77*c^2+88*a^3+64*a^2*b+78*a*b^2+22*b^3+56*a^2*c+9*a*b*c+66*b^2*c+21*a*c^2+51*b*c^2+11*c^3+52*a^4+44*a^3*b+10*a^2*b^2+78*a*b^3+23*a^3*c+83*a^2*b*c+30*a*b^2*c+88*a^2*c^2+27*a*b*c^2+49*b^2*c^2+77*a*c^3+8*b*c^3+89*c^4+49*a^5+15*a^4*b+38*a^3*b^2+20*a*b^4+53*b^5+64*a^4*c+42*a*b^3*c+68*b^4*c+56*a^3*c^2+43*a^2*b*c^2+85*a*b^2*c^2+9*b^3*c^2+39*a^2*c^3+20*a*b*c^3+73*b^2*c^3+82*b*c^4, -26+9*a+45*b+16*c+14*a^2+3*a*b+70*b^2+52*a*c+68*b*c+39*a^3+90*a^2*b+58*a*b^2+68*b^3+87*a^2*c+38*b^2*c+30*a*c^2+8*b*c^2+86*a^4+86*a^3*b+21*a^2*b^2+57*a*b^3+25*b^4+17*b^3*c+73*a^2*c^2+30*a*b*c^2+58*a*c^3+89*b*c^3+55*c^4+33*a^5+14*a^4*b+34*a^3*b^2+18*a^2*b^3+71*a*b^4+33*b^5+62*a^4*c+21*a^3*b*c+85*a^2*b^2*c+20*a*b^3*c+68*b^4*c+2*a^2*b*c^2+73*a^2*c^3+a*b*c^3+10*a*c^4+66*c^5, -26+37*a+73*b+c+62*a^2+11*a*b+34*a*c+20*b*c+34*c^2+35*a^3+41*b^3+15*a^2*c+17*b^2*c+89*a*c^2+75*b*c^2+21*a^4+43*a^3*b+41*a*b^3+15*b^4+38*a^3*c+87*a^2*b*c+19*a*b^2*c+43*b^3*c+54*b^2*c^2+86*a*c^3+18*b*c^3+8*c^4+58*a^5+69*a^4*b+52*a^2*b^3+78*a*b^4+55*a^4*c+5*a^3*b*c+71*a^2*b^2*c+58*a*b^3*c+80*b^4*c+82*a^3*c^2+85*a*b^2*c^2+50*b^3*c^2+27*a^2*c^3+76*a*b*c^3+12*b^2*c^3+63*a*c^4+43*b*c^4+51*c^5])) + R,[29+47*c+89*b^2+76*b*c+26*a^3+5*b^2*c^2+66*c^4+21*a^4*b+31*a^3*b^2+33*a*b^3*c+18*a*b^2*c^2+51*b^2*c^3, +22*a+57*a*c^2+56*c^3+62*a^4+10*a^3*c+22*a*c^3+68*a^3*b*c+10*a^2*c^3+34*a*b*c^3, +21*b^2+15*a*b*c+42*b^2*c+83*a^3*b+81*a*b^2*c+80*b^2*c^2+33*a*b*c^3+42*a*c^4+82*b*c^4])) push!( ideals, Singular.Ideal( - R, - [82+44*a+31*b+21*c+68*a^2+80*a*c+64*b*c+43*c^2+48*a^2*b+38*a*b^2+87*b^3+77*a^2*c+34*a*c^2+26*c^3+83*a^4+16*a^3*b+77*a^2*b^2+87*a*b^3+47*b^4+63*a^3*c+9*a*b^2*c+85*b^3*c+54*b^2*c^2+27*a*c^3+44*b*c^3+31*a^4*b+40*a^3*b^2+a^2*b^3+58*a*b^4+60*b^5+76*a^4*c+77*a^3*b*c+73*a^2*b^2*c+51*a*b^3*c+43*a^3*c^2+26*a^2*b*c^2+34*a*b^2*c^2+3*b^3*c^2+50*a^2*c^3+9*a*b*c^3+42*c^5, -10+64*a+76*c+43*b^2+67*a*c+33*b*c+26*c^2+53*a^3+65*a^2*b+4*a*b^2+6*b^3+35*a^2*c+34*a*b*c+37*b^2*c+18*a*c^2+32*b*c^2+68*c^3+51*a^4+29*a^3*b+48*a^2*b^2+3*b^4+54*a^3*c+68*a^2*b*c+87*a*b^2*c+b^3*c+88*a*b*c^2+42*b^2*c^2+32*a*c^3+52*b*c^3+59*c^4+19*a^5+81*a^3*b^2+4*a^2*b^3+87*a*b^4+34*b^5+73*a^4*c+82*a^3*b*c+69*a^2*b^2*c+7*a*b^3*c+65*a^3*c^2+34*a^2*b*c^2+90*a*b^2*c^2+24*a*b*c^3+82*b^2*c^3+58*a*c^4+55*b*c^4+31*c^5, -44*a+64*b+47*c+5*a^2+67*a*b+2*b^2+62*a*c+b*c+69*c^2+3*a^3+51*a^2*b+80*a*b^2+86*b^3+76*a^2*c+33*a*b*c+79*a*c^2+35*b*c^2+29*a^4+23*a^3*b+75*a^2*b^2+16*a*b^3+50*b^4+48*a^3*c+8*a^2*b*c+75*a*b^2*c+74*b^3*c+50*a^2*c^2+69*b*c^3+38*c^4+10*a^5+46*a^3*b^2+36*a^2*b^3+83*a*b^4+74*b^5+32*a^4*c+85*a^3*b*c+14*a^2*b^2*c+81*a*b^3*c+47*b^4*c+66*a^3*c^2+86*a*b^2*c^2+36*b^3*c^2+63*a*b*c^3+18*b^2*c^3+39*a*c^4+27*b*c^4+32*c^5])) + R,[17+21*c+67*a^2*c+70*b^2*c+84*a^2*b^2+14*a*b^2*c+66*a*b*c^2+23*a*b^4+6*b^5+22*a^2*c^3, +b+56*a^2+7*b^2+42*a^2*c+36*a*b*c+28*c^3+53*a^4+49*a^3*c+12*a^2*b^3+53*a*b^4+6*b^4*c+30*a^2*c^3+88*a*b*c^3+54*b^2*c^3, +28*b*c+16*a^3*b+65*a^2*c^2+23*a*c^3+54*b^3*c^2+38*a*b*c^3])) push!( ideals, Singular.Ideal( - R, - [79+47*b+67*c+61*a^2+20*a*b+64*b^2+11*a*c+74*b*c+68*c^2+78*a^3+20*a^2*b+17*a*b^2+15*b^3+21*a^2*c+15*a*b*c+35*b^2*c+90*a*c^2+3*b*c^2+35*a^3*b+69*a^2*b^2+3*a*b^3+51*b^4+46*a^3*c+59*a^2*b*c+61*a*b^2*c+38*b^3*c+56*a^2*c^2+33*a*b*c^2+49*b^2*c^2+42*a*c^3+48*b*c^3+57*c^4+78*a^5+77*a^4*b+75*a^3*b^2+72*a*b^4+81*a^4*c+18*a*b^3*c+78*b^4*c+81*a^3*c^2+47*a^2*b*c^2+39*a*b^2*c^2+76*b^3*c^2+57*a^2*c^3+26*a*b*c^3+2*b^2*c^3+11*a*c^4+3*b*c^4, -40*a+64*b+70*c+82*b^2+63*a*c+78*c^2+12*a^3+61*a*b^2+66*a^2*c+75*a*b*c+39*b^2*c+27*a*c^2+50*b*c^2+29*c^3+73*a^4+51*a^3*b+32*a*b^3+87*b^4+41*a^3*c+45*a^2*b*c+65*a*b^2*c+83*b^3*c+6*a^2*c^2+83*b^2*c^2+45*a*c^3+36*b*c^3+90*c^4+78*a^5+56*a^4*b+59*a^3*b^2+64*a^2*b^3+48*b^5+41*a^4*c+23*a^3*b*c+27*a^2*b^2*c+29*a*b^3*c+68*b^4*c+65*a^3*c^2+78*a^2*b*c^2+a*b^2*c^2+28*b^3*c^2+31*a^2*c^3+48*a*b*c^3+52*b^2*c^3+40*b*c^4+10*c^5, -37+33*a+66*b+68*c+49*a^2+3*a*b+48*b^2+54*a*c+85*c^2+a^2*b+20*b^3+52*a^2*c+56*a*b*c+71*b^2*c+47*b*c^2+12*c^3+25*a^4+33*a^3*b+65*a^2*b^2+53*a*b^3+14*a^3*c+7*a*b^2*c+29*b^3*c+41*b^2*c^2+83*c^4+42*a^3*b^2+3*a^2*b^3+87*a*b^4+57*b^5+31*a^3*b*c+53*a^2*b^2*c+51*a*b^3*c+34*b^4*c+22*a^3*c^2+80*a^2*b*c^2+20*a^2*c^3+85*a*b*c^3+28*b^2*c^3+15*a*c^4+62*c^5])) + R,[64*b^2+4*a^2*b+78*c^3+17*a*b^3+48*b^4+28*a*b^4+16*a^3*c^2, +49*c+25*a^2+13*c^2+87*a^2*c+34*c^3+88*a^2*b*c+8*a^3*b^2+6*a^2*b*c^2+31*a*c^4, +64+30*b+14*a*b*c+47*a^2*b^2+38*a*b^3+23*a^3*c+10*a^2*b*c+21*b^3*c+46*a^4*c+38*a^3*b*c+34*b^4*c+17*a^3*c^2+89*a^2*b*c^2+71*b^3*c^2])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(8*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(8*2),90)", i, S, StartOrd, TarOrd) end -ideals=[] +ideals =[] push!( ideals, Singular.Ideal( - R, - [73+71*a+48*b+18*c+46*a^2+75*a*b+75*b^2+51*a*c+85*b*c+67*c^2+3*a^3+90*a^2*b+41*a*b^2+40*b^3+44*a^2*c+18*a*b*c+17*b^2*c+90*a*c^2+41*b*c^2+39*c^3+3*a^4+32*a^3*b+46*a*b^3+78*b^4+26*a^3*c+66*a^2*b*c+53*a*b^2*c+38*b^3*c+69*a^2*c^2+64*b^2*c^2+51*a*c^3+38*b*c^3+32*c^4+72*a^5+19*a^4*b+24*a^3*b^2+41*a^2*b^3+30*a*b^4+b^5+4*a^4*c+40*a^3*b*c+73*a^2*b^2*c+63*a*b^3*c+78*b^4*c+27*a^3*c^2+55*a^2*b*c^2+29*b^3*c^2+75*a^2*c^3+21*a*b*c^3+50*b^2*c^3+88*b*c^4+60*c^5, -49+13*a+24*b+88*c+39*a^2+27*a*b+81*b^2+54*a*c+43*b*c+31*c^2+18*a^3+2*a^2*b+72*a*b^2+44*b^3+48*a^2*c+33*b^2*c+23*a*c^2+49*b*c^2+30*c^3+21*a^4+70*a^3*b+68*a*b^3+41*b^4+87*a^3*c+27*a^2*b*c+8*a*b^2*c+6*b^3*c+61*a^2*c^2+83*a*b*c^2+5*b^2*c^2+72*a*c^3+89*b*c^3+14*c^4+16*a^5+25*a^4*b+29*a^2*b^3+71*a*b^4+19*b^5+10*a^4*c+4*a^3*b*c+17*a^2*b^2*c+25*a*b^3*c+60*b^4*c+60*a^3*c^2+74*a*b^2*c^2+5*b^3*c^2+46*a^2*c^3+34*a*b*c^3+53*b^2*c^3+14*a*c^4+44*b*c^4+53*c^5, -32*a+58*b+21*c+46*a^2+9*a*b+78*a*c+36*b*c+11*c^2+21*a^3+7*a*b^2+84*b^3+89*a^2*c+29*a*b*c+17*a*c^2+14*b*c^2+79*c^3+63*a^4+23*a^3*b+57*a^2*b^2+17*a*b^3+79*a^3*c+69*a^2*b*c+24*a*b^2*c+5*b^3*c+79*a^2*c^2+83*a*b*c^2+22*b^2*c^2+88*a*c^3+2*b*c^3+11*c^4+5*a^5+14*a^2*b^3+51*a*b^4+57*b^5+55*a^4*c+57*a^3*b*c+61*a^2*b^2*c+47*a*b^3*c+79*b^4*c+86*a^3*c^2+11*a^2*b*c^2+77*a*b^2*c^2+42*b^3*c^2+59*a^2*c^3+4*a*b*c^3+54*b^2*c^3+72*a*c^4+62*b*c^4+48*c^5])) + R,[88*b+63*c^2+49*a*b*c+78*b*c^2+31*a^3*b+77*a*b^2*c+12*b^3*c+44*a^2*c^2+49*b^2*c^2+36*a*c^3+42*a^3*b*c+21*a^2*b^2*c+44*a*b^2*c^2, +2+55*a*b+75*a*c+75*b*c+51*a*b*c+59*a^3*b*c+39*a^2*c^3+89*c^5, +36*c+35*a^2*b+68*b^2*c+2*c^3+55*a^3*c+20*a*b^2*c+77*a^2*c^2+30*a^5+61*a^4*b+42*a^4*c+29*a*b^3*c+77*a^3*c^2+69*c^5])) push!( ideals, Singular.Ideal( - R, - [57*a+35*b+40*c+15*a^2+44*a*b+29*b^2+21*a*c+65*b*c+26*c^2+40*a^3+41*a^2*b+15*a*b^2+9*b^3+60*a^2*c+62*a*b*c+24*b^2*c+60*a*c^2+83*b*c^2+52*c^3+33*a^4+54*a^3*b+13*a^2*b^2+7*a*b^3+57*a^3*c+72*a^2*b*c+33*a*b^2*c+88*b^3*c+36*a^2*c^2+45*b^2*c^2+47*a*c^3+42*b*c^3+17*c^4+14*a^5+44*a^4*b+33*a^3*b^2+53*a^2*b^3+86*a*b^4+22*b^5+23*a^4*c+32*a^3*b*c+52*a^2*b^2*c+86*a*b^3*c+81*b^4*c+52*a^3*c^2+9*a^2*b*c^2+11*a*b^2*c^2+65*a^2*c^3+22*a*b*c^3+56*b^2*c^3+14*a*c^4+69*b*c^4+64*c^5, -26+6*a+27*b+23*c+25*a^2+8*a*b+86*b^2+28*a*c+85*c^2+54*a^3+47*a^2*b+16*b^3+57*a^2*c+2*a*b*c+30*b^2*c+28*a*c^2+90*b*c^2+5*a^3*b+11*a^2*b^2+40*a*b^3+4*b^4+35*a^3*c+66*a^2*b*c+73*a*b^2*c+21*a^2*c^2+88*a*b*c^2+54*b^2*c^2+87*a*c^3+89*b*c^3+68*c^4+58*a^5+11*a^4*b+60*a^3*b^2+48*a^2*b^3+63*a*b^4+22*b^5+63*a^4*c+42*a^2*b^2*c+65*a*b^3*c+83*b^4*c+87*a^3*c^2+4*a*b^2*c^2+33*b^3*c^2+83*a^2*c^3+67*a*b*c^3+66*b^2*c^3+81*a*c^4+84*b*c^4, -31+17*a+37*b+29*c+84*a^2+56*a*b+38*b^2+64*b*c+74*c^2+57*a^3+36*a^2*b+23*a*b^2+87*b^3+63*a^2*c+70*a*b*c+b^2*c+65*a*c^2+52*c^3+69*a^4+72*a^3*b+58*a^2*b^2+50*a*b^3+83*b^4+79*a^3*c+3*a^2*b*c+27*a*b^2*c+54*b^3*c+28*a^2*c^2+21*a*b*c^2+28*b^2*c^2+32*b*c^3+66*c^4+82*a^5+81*a^4*b+85*a^3*b^2+64*a^2*b^3+9*a*b^4+71*b^5+69*a^4*c+72*a^3*b*c+14*a^2*b^2*c+37*a*b^3*c+90*b^4*c+50*a^3*c^2+16*a^2*b*c^2+18*a*b^2*c^2+62*b^3*c^2+5*a^2*c^3+90*a*c^4+9*c^5])) + R,[44+4*a+60*c^2+35*a^3+15*a^2*c+47*b^2*c+68*b*c^2+2*a*b^3+4*a^5+7*a^3*b*c+70*a^2*b^2*c+56*a*b^3*c+70*b^2*c^3+2*a*c^4+40*c^5, +31*c+34*b*c+52*a*c^2+33*a^3*b+45*a^3*c+82*a*b*c^2+77*b*c^3+30*a^2*b^2*c+31*a^2*b*c^2+83*c^5, +33*a*c+40*b*c+25*b^2*c+78*a^4+68*a^2*b^2+65*a*b*c^2+c^4+40*a^2*c^3+49*a*c^4])) push!( ideals, Singular.Ideal( - R, - [69+46*a+19*b+58*c+4*a^2+46*a*b+22*b^2+52*a*c+85*b*c+62*c^2+78*a^3+29*a^2*b+79*a*b^2+35*b^3+41*a^2*c+4*a*b*c+53*b^2*c+4*a*c^2+33*c^3+23*a^4+27*a^2*b^2+18*b^4+32*a^3*c+52*a^2*b*c+25*a*b^2*c+34*b^3*c+12*a^2*c^2+15*a*b*c^2+90*b^2*c^2+85*a*c^3+89*b*c^3+28*c^4+62*a^5+77*a^4*b+73*a^3*b^2+a^2*b^3+40*a*b^4+27*b^5+73*a^3*b*c+10*a^2*b^2*c+73*a*b^3*c+66*b^4*c+25*a^3*c^2+83*a^2*b*c^2+2*a*b^2*c^2+61*a^2*c^3+88*a*b*c^3+23*b^2*c^3+39*a*c^4+90*b*c^4+57*c^5, -60+80*a+49*b+23*c+28*a^2+3*a*b+14*b^2+31*a*c+42*b*c+9*c^2+61*a^3+26*a^2*b+8*a*b^2+80*a^2*c+36*a*b*c+18*b^2*c+82*a*c^2+32*b*c^2+29*c^3+13*a^4+35*a^3*b+48*a^2*b^2+67*a*b^3+53*b^4+46*a^3*c+5*a*b^2*c+88*b^3*c+80*a^2*c^2+32*a*b*c^2+52*b^2*c^2+44*a*c^3+76*b*c^3+42*c^4+37*a^5+15*a^4*b+35*a^3*b^2+80*a^2*b^3+31*a*b^4+51*a^4*c+21*a^3*b*c+4*a^2*b^2*c+72*a*b^3*c+62*b^4*c+15*a^3*c^2+33*a^2*b*c^2+5*b^3*c^2+77*a^2*c^3+7*a*b*c^3+65*a*c^4+17*b*c^4+11*c^5, -75+55*a+25*c+41*a^2+39*a*b+3*b^2+53*a*c+51*c^2+35*a^2*b+79*a*b^2+21*b^3+39*a^2*c+73*a*b*c+82*b^2*c+41*a*c^2+26*b*c^2+80*c^3+88*a^4+19*a^3*b+4*a*b^3+86*b^4+76*a^3*c+70*a^2*b*c+64*a*b^2*c+66*b^3*c+2*a^2*c^2+31*a*b*c^2+5*b^2*c^2+76*a*c^3+42*b*c^3+22*c^4+64*a^5+87*a^4*b+34*a^3*b^2+18*a^2*b^3+56*a*b^4+82*a^4*c+2*a^3*b*c+86*a^2*b^2*c+81*a*b^3*c+18*b^4*c+9*a^3*c^2+9*a^2*b*c^2+60*a*b^2*c^2+42*b^3*c^2+89*a^2*c^3+50*a*b*c^3+49*b^2*c^3+13*a*c^4+12*b*c^4])) + R,[21*c^2+42*a^2*b+12*a*b^2+15*a*c^2+43*b*c^2+34*a*b^3+10*a^3*c+57*a^2*b*c+36*b^2*c^2+64*b^5+86*a^3*b*c+7*b^4*c+78*a*b*c^3+52*b^2*c^3+82*c^5, +45*a*c+63*a^3+8*a^4+80*b^2*c^2+76*a^4*b+46*a*b^2*c^2+9*b^3*c^2+11*a*c^4, +54+73*a+24*c+70*a^2+7*a*b+15*a^2*c+89*a^4+57*b^4+26*b*c^3+38*a^2*b^2*c+81*b^4*c])) for i in ideals - runAll("Var3 - sparseid(3,0,5,100-(9*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(9*2),90)", i, S, StartOrd, TarOrd) end +ideals =[] +push!( + ideals, + Singular.Ideal( + R,[8*c+50*b^2+29*b*c+55*a^3+8*a^2*c+27*b^2*c+67*a*c^2+55*b^3*c+26*a^4*b+85*a^2*b^3+10*b^5+15*a*b^2*c^2+64*a^2*c^3, +76*a+64*a*b+20*b^2+24*a^3*b+79*b^4+11*b^2*c^2+5*a*c^3+88*b*c^3+3*c^4+67*a^3*b^2+37*a^2*b^3+47*a*b^3*c+51*a^2*c^3, +46+35*a*b^2+26*a*c^2+27*a^4+54*a*c^3+31*a^5+42*a^2*b^3+74*b^2*c^3+33*b*c^4])) +push!( + ideals, + Singular.Ideal( + R,[62+85*b+37*c+9*a*c+56*a*c^2+76*b*c^2+55*c^3+70*a^4+20*a*b^3+21*a*c^3+73*a*b^2*c^2+69*a*c^4, +36*b^3+30*b^2*c+61*a^3*b+54*a^2*b^2+10*a*b^3+87*b^5+49*a^3*c^2+49*a*b^2*c^2+76*a^2*c^3+11*a*b*c^3+49*b^2*c^3, +74*b^2+12*a*c+11*b*c+40*a^2*c+63*a^4+86*b^4+17*a^2*c^2+86*a^3*b^2+88*b^5+56*a^2*b^2*c+13*a*b^2*c^2+22*c^5])) +push!( + ideals, + Singular.Ideal( + R,[30*a+86*a*b*c+74*b^2*c+9*c^3+57*a^4+65*a^3*b+46*a*b^3+23*b^3*c+13*a*c^3+65*b*c^3+3*b^4*c+15*a^3*c^2+69*b^3*c^2+86*b*c^4, +1+57*a^2+7*a*b+37*a^3+15*a^2*c+79*a*b^3+80*b*c^3+42*a^3*b^2+38*a^2*b*c^2+15*b^2*c^3+32*a*c^4, +77*b+76*b^2+2*c^2+15*a*c^2+9*a^4+40*a^3*b^2+8*a^2*b^2*c+16*a^3*c^2+76*a^2*c^3+24*a*b*c^3])) +for i in ideals + runAll("sparseid(3,0,5,100-(10*2),90)", i, S, StartOrd, TarOrd) +end +ideals =[] + end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl index 9c762582f..0f48d2d35 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl @@ -1,11 +1,9 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("readWriteHelper.jl") -include("parser.jl") -include("runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") - - - +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") +include("readWriteHelper.jl") using DataFrames using CSV @@ -13,6 +11,7 @@ function benchmarkVar4() cd("/Users/JordiWelp/Results") prepare() prepare2() + prepareAlloc() dim = 4 ve = [1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) @@ -24,3428 +23,224 @@ function benchmarkVar4() ) S = change_order(R, TarOrd) ideals = [] + push!( + ideals, + Singular.Ideal( + R,87+55*b+17*a^3+82*a^4+17*b^2*c^2*d+71*a*b^2*d^2, + 26*c*d+14*a^3+89*b^4*c, + 88*a^2*b*c+61*a^2*d^2+48*c^5)) + push!( + ideals, + Singular.Ideal( + R,27*a^2*b^2*d+60*a*b*c*d^2, + 23+31*b*d^2+42*a^2*c*d+32*b*c^2*d+29*a*b^3*c, + d+6*a*d+67*a^3+48*a*b^3+86*a^2*b*d^2)) + push!( + ideals, + Singular.Ideal( + R,85*c*d^2+10*d^3+11*a^3*c+31*a^2*c*d+61*a^2*c*d^2, + 57+86*a^2*d^2+86*b^3*c^2+58*b^2*c^2*d, + 76*d+90*c*d+40*a*c^3*d)) + for i in ideals + runAll("sparseid(3,0,5,100-(1*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,3+35*a*d+78*c*d+47*a*c^2+30*c*d^2+65*a*c^3+55*a*b*c*d+25*a*b^3*c+52*b^2*c^3+52*a*c*d^3, + 71*a^3+65*a^4+9*a^2*b*c+65*b*c^2*d+25*a^4*c+32*a^3*c*d+45*a^2*c*d^2, + 49*d+16*a^2*b^3)) + push!( + ideals, + Singular.Ideal( + R,38*b^4+80*a^2*b^2*c+41*b*c^3*d+7*b^2*d^3, + 4+57*d+44*b*c+50*a^4+24*a*b^3+29*a^3*c+55*b*c^3*d+82*a*c^2*d^2+77*c^3*d^2, + 79*d^2+13*a*c^2+82*c^3+14*a*c*d+37*b^2*d^2+68*b^2*d^3)) + push!( + ideals, + Singular.Ideal( + R,70*b+4*a^2*c+85*c^4+21*a^2*b^2*c+17*a*b^3*c+31*a^2*c*d^2+14*c^3*d^2, + 2*c^2+35*d^2+44*b^3+34*a*b^2*c+87*b^2*c*d+31*a*c^2*d+6*a*c^4, + 16+88*a*c^2+50*c^2*d^2+70*a^3*b*c+62*a^3*c^2)) + for i in ideals + runAll("sparseid(3,0,5,100-(2*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,67*a*c*d+3*b*d^2+85*c*d^2+71*a^2*c^2+45*a*d^3+39*b*d^3+77*b^5+42*a^2*b*c*d+54*b^3*c*d+3*b^2*c*d^2+35*b*c^2*d^2+65*a*c*d^3, + 40+47*b+66*a*b+47*a*b^2*d+78*a*b*c*d+41*c^2*d^2+80*a^4*d+7*c*d^4, + 49*d^2+89*a^3+36*a*b*c^2+24*a^2*c^3+82*a*b^3*d+33*b^3*d^2)) + push!( + ideals, + Singular.Ideal( + R,62*d^2+44*a^3+43*a*b*d^2+13*a*c*d^2+14*b*c*d^2+65*a^3*b*d+74*a^2*c^2*d, + 5+57*b+14*a^3+65*a^2*b+79*a*c^2+65*a^3*d+82*b^2*c*d+44*a^2*b^2*c+55*b^4*c+34*a*b^2*d^2, + 30*b^2+29*b*c^2*d+49*b*c*d^2+22*a^3*b*c+21*a^2*c^3+19*a^2*b^2*d+61*b^2*c*d^2+50*a*b*d^3+9*b*d^4)) + push!( + ideals, + Singular.Ideal( + R,46+79*b^2*c^2+54*a^5+5*a*b^4+34*a*b^2*c^2+19*a^2*b*d^2+11*a*b^2*d^2, + 69*b*c+86*a^3+52*c*d^2+87*b^2*c^2+82*a*c^2*d+51*a^2*b^2*d+72*b^2*c^2*d+42*d^5, + 77*b+77*d^2+50*a^2*c+55*a*c^2+67*b^4+b^2*c^2+17*a*c^3+39*b*c^2*d+70*a^3*b*c+50*b^3*c^2+24*a*b*c^3)) + for i in ideals + runAll("sparseid(3,0,5,100-(3*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,6*c^2+49*b*d+54*a^3+35*a*b^2+6*c*d^3+28*c^5+7*a*c^3*d+3*b*c*d^3, + 80*a^2*b+82*a*b^3+8*b^3*d+6*b^2*d^2+42*b*c*d^2+80*a^5+42*a*b^4+50*a^4*d+69*a*b*c^2*d+87*c^3*d^2+13*a*c*d^3+72*b*d^4, + 27+16*b+81*c*d+53*a^3+41*b^2*c+63*a*b^2*c+21*a^3*d+5*c^3*d+12*a^2*d^2+36*a^3*b^2+85*b^2*c^3+28*a^2*b*c*d+77*b^2*c^2*d)) + push!( + ideals, + Singular.Ideal( + R,33*a+6*c*d+38*a*b^3+82*a^3*c+61*a^2*b*c+48*b*c^3+32*a^4*c+25*a^2*b^2*c+34*a^3*b*d+54*a*b^3*d+90*a^2*b*d^2+74*a*c^2*d^2+3*c*d^4, + 55+80*b^2+74*d^2+77*a*b^2+71*b^2*c+63*c^3+b*c*d+75*b^4+32*a^3*d+46*c^2*d^2+73*a*b^2*c^2+40*c^5+43*a^2*b^2*d+43*b^4*d+75*a^2*d^3, + 51*a^2*d+10*b^3*d+52*c*d^3+61*b^4*c+77*a^2*b*c^2)) + push!( + ideals, + Singular.Ideal( + R,80*c+68*b^2+52*b*c^2+53*b*d^2+14*d^3+63*b*c^3+34*a^2*c*d+42*b^2*c^2*d+14*a*c*d^3, + 11*b^2+75*a*b^2+77*a^2*b^2+88*b^3*c+71*b*c^2*d+74*a*b^2*c*d+51*a*c^3*d+67*b^2*d^3+68*a*d^4+83*b*d^4, + 38+28*b*d+22*b*d^2+27*a*b^3+39*b^2*c^2+26*a*b^2*d+81*c^3*d+16*a^5+81*b^3*c^2+45*a*c^4+27*a^4*d+80*a*b^3*d+11*a*c^2*d^2+21*b*c*d^3)) + for i in ideals + runAll("sparseid(3,0,5,100-(4*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,25*a^2+7*a*b^2+5*a^2*c+25*c^3+83*a*b^2*d+49*a^2*c*d+72*a*b*c*d+32*c*d^3+30*a*c^4+53*b^3*d^2+37*a^2*c*d^2+73*b^2*c*d^2, + 67*b^2+48*a*c*d+55*b*c*d+61*a^2*c*d+24*a^3*b*c+32*a^2*c^3+78*a^4*d+33*a*b*c^2*d+29*b^3*d^2+40*a*b*c*d^2+36*c^3*d^2, + 36+72*a+11*d+77*a*d+85*b^2*d+4*a^3*b+65*a^2*c*d+15*b^2*c*d+70*b*c^2*d+52*c^3*d+57*c*d^3+38*a*b^4+6*a^2*b^2*c+15*a*b*c^2*d+48*c^4*d+83*a*b^2*d^2+78*b^2*c*d^2)) + push!( + ideals, + Singular.Ideal( + R,5*c*d+48*a^3*b+29*a*b^3+30*a^2*c^2+7*a*b*c^2+29*b*c*d^2+80*a*b^4+75*b*c^4+35*b^2*c*d^2+14*a^2*d^3+51*b*d^4+82*c*d^4, + 23+18*b+64*d+70*c*d+67*d^2+12*a^2*b+36*a*c*d+19*b^3*c+50*b*c^2*d+73*a*c*d^2+42*a^4*c+7*a^2*c^3+9*a^2*c^2*d+23*a*b*c^2*d+88*b^2*c^2*d+68*c^4*d, + 22*a^3+40*a^2*b+59*a*b^2+10*a*b*d+90*a*b^2*c+36*a*c^3+33*a*c^2*d+75*a^2*b^3+66*a^3*b*c+60*c^3*d^2+29*a*b*d^3+2*b*d^4)) + push!( + ideals, + Singular.Ideal( + R,44*d+42*b*d+64*d^2+40*a*b*c+27*a^3*b+27*a*c^3+73*a*b^2*d+69*a*c^2*d+55*b*c*d^2+58*a*d^3+74*a^4*b+35*a*b*c^3+3*b^3*c*d+68*a*c^3*d+76*c^4*d+66*c^2*d^3, + 56*a^2*c+83*a*b*c+17*a*c^2+61*c^2*d+40*b^3*c+a*b*d^2+2*b^2*c^3+43*a^4*d+65*b^3*c*d+77*a*b*c^2*d+45*a^3*d^2+79*b^2*c*d^2+12*c*d^4, + 26+24*c+62*a^2+70*a^2*b+4*b^4+32*b*c^3+75*c^2*d^2+29*b^4*d+25*b^3*c*d+79*b*c^3*d+75*b^2*d^3)) + for i in ideals + runAll("sparseid(3,0,5,100-(5*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,17*c^2+24*b^3+71*c*d^2+38*a^3*b+90*a*b^3+90*a^2*b*c+40*a*b^2*c+27*b^2*c*d+70*a*c^2*d+52*a^3*b*d+32*a^3*c*d+12*a*b^2*c*d+78*b*c^3*d+86*c^4*d+7*a*b^2*d^2+50*a*d^4, + 44*a*c^2+2*a*b*d+80*c*d^2+60*d^3+87*a^4+85*a^2*b*c+88*a*c^3+67*b^2*d^2+17*b^5+68*a^2*b*c^2+64*b^2*c^3+86*b^2*d^3+49*c^2*d^3+46*b*d^4, + 25+77*c+77*d+75*a*d+52*c*d+89*d^2+11*b^3+65*a*c*d+64*b^3*c+10*a*b*c^2+22*b^2*d^2+14*a^5+60*a^3*b^2+22*a^2*b*c*d+34*a*b^2*c*d+81*a*b^2*d^2+20*b^3*d^2+7*b*c^2*d^2+84*a*c*d^3)) + push!( + ideals, + Singular.Ideal( + R,41*a^2+12*a*b^2+79*b^3+25*a^2*d+44*c^2*d+39*a^3*b+77*a*c^3+62*b*c^3+72*b*c^2*d+66*b^2*c^3+45*b^3*c*d+3*b*c^3*d+24*c^4*d+64*b^3*d^2+37*b*c^2*d^2+76*c*d^4, + 17*a^2+12*b^2+30*a^2*b+72*b*c*d+81*a*d^2+31*a^4+31*b^4+82*a^3*c+26*a^2*c^2+84*a^3*d+62*a^2*b*d+50*a*b^4+21*b^5+15*a^2*b^2*c+6*a*b^2*c^2+84*a*b*c^3+86*a*b^2*c*d+56*b*c^2*d^2+64*a*b*d^3)) + 88+90*a+88*b+30*c*d+19*b*d^2+86*a^2*b*d+88*b^3*d+53*b^2*c*d+62*a^3*b*c+41*b^3*c^2+28*a*b^2*d^2+48*b^3*d^2+83*a*b*c*d^2+30*c^3*d^2, + push!( + ideals, + Singular.Ideal( + R,23*a*d+45*a*b^2+9*a*d^2+53*d^3+85*b^2*c*d+42*a*c^2*d+25*a^2*d^2+12*a*b*d^2+29*b^2*d^2+45*b*c^4+48*a*b^2*d^2+52*b^3*d^2+36*a^2*d^3+14*b*d^4, + 52*c+6*c^2+24*c*d+42*a^2*b+24*a^4+41*a*c^2*d+16*a^3*b*c+55*a^2*c^3+44*b^2*c^3+66*a^2*b^2*d+11*a^3*c*d+10*a*c^2*d^2+4*a*c*d^3+87*b*c*d^3, + 59+2*d+74*c*d+b^3+83*a*b*c+73*a*b*d+a*c*d+69*a^2*b*c+40*c^4+30*a^3*d+58*a^2*c*d+14*c^3*d+22*a*d^3+35*a^3*b^2+79*b^2*c^3+15*a^3*c*d+68*a*c^3*d+10*c^4*d+31*a^2*c*d^2+44*b^2*c*d^2+17*c^2*d^3)) + for i in ideals + runAll("sparseid(3,0,5,100-(6*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,2*c^2+25*b^2*c+79*b*c^2+60*a^3*b+47*b^2*c*d+28*b*c*d^2+28*c^2*d^2+38*a*b^4+82*a^2*b*c^2+54*a^4*d+73*a*b^2*d^2+77*a*c^2*d^2+51*d^5, + 1+33*d+41*a*b+79*c*d+9*a^3+41*a*b*d+43*b*c*d+51*a^4+59*b^2*c^2+72*a*b*c*d+35*a^2*d^2+70*a*b*d^2+63*b^2*d^2+11*a^2*b^2*d+54*b^4*d+50*b^3*c*d+45*a^2*c^2*d+28*b*c^3*d+14*a^2*b*d^2+15*c^3*d^2+84*a*b*d^3+11*c^2*d^3, + 78*a+65*a*b+78*a*d+29*a*b^2+30*a^2*c+43*b*c^2+71*a*b*d+36*a^2*b*c+85*a^3*d+51*b^3*d+49*a^2*c*d+75*d^4+17*a^4*b+70*a*b^4+4*a^3*b*c+59*b*c^4+32*a^3*c*d+2*c^4*d+61*b^3*d^2+45*a*b*d^3+60*b*c*d^3)) + push!( + ideals, + Singular.Ideal( + R,40*b^2+53*c^2+13*b*c*d+54*a^4+84*a^2*c^2+83*b*c^3+38*a*b*d^2+18*a^2*b^3+76*b^3*d^2+23*b*c^2*d^2, + 10*d+63*b*c+67*b^3+69*a^2*c+84*a*c^2+31*c^3+88*b^2*d+66*b*d^2+31*b^4+42*a^3*d+46*b*c^2*d+14*c^3*d+64*a^5+30*a*b*c^3+56*b^2*c^3+37*a^2*b^2*d+85*a^2*c^2*d+10*a*c^3*d+82*c^4*d+90*a^2*b*d^2+2*a*b*d^3+87*a*c*d^3+76*b*d^4, + 50+64*d+37*a*b+9*b*c+8*a*b^2+19*c^3+68*a^4+58*a^2*c^2+68*a^3*d+34*a*b*c*d+87*b^2*c*d+64*a*c^2*d+22*a*d^3+76*a^3*b*c+82*b^4*c+53*a^2*b*c^2+10*a*c^4+81*b*c^4+57*c^5+49*a^4*d+25*a^2*b*d^2+79*b^2*d^3+47*c^2*d^3)) + push!( + ideals, + Singular.Ideal( + R,59*a+21*a*c^2+65*d^3+42*a*b^3+24*a*b*c^2+71*a*c^3+13*a*b*c*d+86*b^2*d^2+86*b^3*c^2+70*b^2*c^3+12*a*b^3*d+68*a^3*c*d+21*b^3*c*d+27*a^2*b*d^2+77*a*b*d^3+49*c^2*d^3+25*b*d^4+43*c*d^4, + 68+20*a*b+11*a*d+71*b^3+36*a*d^2+49*a^3*b+78*b^4+88*a^3*c+49*a*b^2*c+16*c^2*d^2+8*a^3*c^2+61*a^3*b*d+25*b^2*c^2*d+25*b^3*d^2+21*a^2*c*d^2+36*b^2*c*d^2+78*a*c^2*d^2, + 12*b+75*c^2+68*c*d+46*d^2+68*a^2*b+70*a*b^2+59*b^2*c+33*a*b*d+83*c^2*d+7*a^2*b*c+58*a*b*c*d+70*c^3*d+46*b*c*d^2+12*c*d^3+68*a^3*c^2+49*a^4*d+37*b^2*c^2*d+a^2*c*d^2+10*a^2*d^3+7*a*b*d^3+16*b*c*d^3)) + for i in ideals + runAll("sparseid(3,0,5,100-(7*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,89*c+37*c^3+29*b*c^3+70*a^2*c*d+38*a*c^2*d+63*a^2*d^2+73*b*d^3+40*c*d^3+59*d^4+69*a^2*b^3+86*b^4*d+26*a*c*d^3+14*c*d^4+49*d^5, + 31*d+50*a*c+56*c^2+28*c*d+46*a*b*d+74*a*c*d+12*a*d^2+57*d^3+86*a^2*b*c+6*b^2*d^2+72*a*c*d^2+26*b*d^3+20*a^4*b+83*a^3*b*c+27*b^3*c^2+a*b*c^3+67*b^2*c^3+64*a^4*d+19*a^2*c^2*d+71*a^2*c*d^2+28*a*b*c*d^2+89*b*c^2*d^2+56*c^2*d^3+74*c*d^4, + 33+6*b*c+58*d^2+87*b^2*c+3*a*b*d+11*a*c*d+64*a*d^2+83*d^3+28*a^4+11*a*b^3+21*a*b^2*c+69*b^2*c*d+44*c^2*d^2+33*a*d^3+4*b^4*c+50*a^3*c^2+29*b^3*c^2+60*a^3*b*d+63*a^2*b^2*d+11*a*b^2*c*d+82*a^2*b*d^2+43*b^3*d^2+89*c^3*d^2+16*d^5)) + push!( + ideals, + Singular.Ideal( + R,77+57*d+17*d^2+69*a^2*b+67*a*c^2+43*a^2*d+23*a^2*b^2+45*a^2*c^2+32*c^4+50*a*b^2*d+75*b^2*d^2+88*a^5+22*b^5+66*a^2*b*c^2+68*b*c^4+7*a^3*b*d+64*a^3*d^2+9*b*c^2*d^2, + 74*a^2+16*b*c+45*b^2*d+84*c^2*d+61*d^3+69*a^2*c^2+14*a*c^3+89*b*c^3+74*a*b*c*d+83*a*c^2*d+80*a*b*d^2+38*a^4*b+51*b^3*c^2+33*b^2*c^3+54*c^5+86*a^3*b*d+69*b^2*c^2*d+5*c^4*d+89*a^2*b*d^2+50*b^2*c*d^2+42*b*c^2*d^2+35*c^3*d^2+16*b^2*d^3, + 20*b+46*a*b+7*c^2+33*a^2*b+56*a^2*c+34*b^2*c+12*b*d^2+16*a*b^2*c+35*a^2*c^2+85*b*c^3+16*a^2*b*d+17*b*c*d^2+74*b*d^3+4*a*b^3*c+47*a*b*c^3+34*c^5+84*a^3*b*d+64*a*b^2*c*d+a^2*b*d^2+62*c^3*d^2+18*b*d^4)) + push!( + ideals, + Singular.Ideal( + R,54+47*b+8*a*c+30*c^2+6*a*b^2+16*b*d^2+56*c*d^2+77*a^3*c+2*a*b^2*c+71*a^2*c^2+83*a*b*c^2+13*b*c^3+63*b*c^2*d+23*b*c*d^2+68*a*d^3+65*b*d^3+82*a^5+7*a^3*b*c+58*b^4*c+25*a^2*b*c^2+81*b^2*c*d^2+65*b*c^2*d^2+12*c^3*d^2+76*b*c*d^3, + 80*a*c^2+87*a*b*d+72*c*d^2+48*b^4+72*b^3*c+75*a*b*c^2+89*a^5+25*b^5+31*a^4*c+48*a^3*b*c+55*a^2*b^2*c+56*a*b^3*c+84*a^2*b*c^2+54*a^3*d^2+46*b^2*c*d^2+19*b*c*d^3, + 62*a+66*a*b+53*a*c+2*c^2+64*a*b^2+19*b^2*c+48*c^3+42*c^2*d+77*b^2*c^2+39*a^2*c*d+50*a^2*d^2+83*b*c*d^2+14*a*d^3+26*a^5+90*a^4*b+28*a^4*c+42*b^2*c^3+28*b*c^4+25*c^5+64*a*b*c^2*d+5*a^2*c*d^2+62*b*c^2*d^2)) + for i in ideals + runAll("sparseid(3,0,5,100-(8*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,49*d+54*a^2+68*c^2+19*a^2*c+23*a*b*c+31*a*c^2+81*a*c*d+70*b*d^2+28*c*d^2+44*a^3*c+78*b^2*c^2+87*a*c^3+46*c^4+20*b*c^2*d+34*a*b*d^2+32*c^2*d^2+32*a^5+52*c^5+27*a^4*d+48*b^4*d+36*b^3*c*d+16*c^4*d+47*c*d^4, + 11*a+79*c*d+14*a^2*b+27*a*b*c+57*a*d^2+90*a^3*b+43*b^3*c+71*a^3*d+70*a^2*c*d+88*b^2*c*d+2*a*b^4+75*a^3*c^2+14*a^2*b*c^2+57*b^3*c^2+79*a*c^4+28*b*c^4+79*a^3*b*d+83*a*b^3*d+44*a*b*c^2*d+50*b^2*c^2*d+10*c^2*d^3+24*b*d^4, + 29+52*b+5*a^2+86*a*b+83*b*d+83*a*b^2+75*a*b*d+80*a^3*b+6*a^2*b^2+70*a^3*c+72*b*c^3+60*a^2*c*d+16*b*d^3+63*d^4+56*a^4*b+74*a^4*c+84*a*b^3*c+80*b^4*c+81*a^3*c^2+87*a^2*b*c^2+87*a*b^3*d+49*b^3*c*d+81*a*c^3*d+59*b*c^3*d+71*a*d^4+78*c*d^4)) + push!( + ideals, + Singular.Ideal( + R,83*a+23*b*c+54*c*d+4*d^2+69*a^2*b+31*a*b*c+6*a^2*d+47*a*b*d+76*b^2*d+5*c^2*d+56*a*b^3+18*b^2*c^2+a^2*b*d+30*a*b*d^2+34*a*c*d^2+54*d^4+63*a^2*b^3+40*a^2*b^2*c+33*a^2*b*c^2+78*c^5+52*a^4*d+90*a^3*b*d+63*a^2*b*c*d+50*a*b*c^2*d+81*a*c^3*d+60*b^2*c*d^2+45*a*b*d^3+82*b^2*d^3, + 88*a+84*a^2+61*a^2*d+36*b*c*d+37*a^2*b^2+32*a*b^2*c+19*c^4+47*a^2*b*d+66*a^2*c*d+89*b^2*c*d+21*c^2*d^2+13*a*d^3+65*a^5+87*a^3*b^2+36*a^2*b^3+85*a*b^4+85*a*b^2*c^2+33*b^3*c^2+23*b*c^4+46*a^3*b*d+86*a^3*c*d+49*a*c^3*d+25*c^4*d+15*a^2*b*d^2+56*a*b*c*d^2+70*a*d^4, + 90+52*c+12*a*c+10*b*c+75*b^3+67*b*d^2+32*c*d^2+21*b^4+44*a*b^2*d+53*b^2*c*d+54*a*b*d^2+13*a*d^3+40*a^3*b^2+89*a^2*b*c^2+62*a^2*c^3+5*a^3*c*d+28*a*c^3*d)) + push!( + ideals, + Singular.Ideal( + R,63*a*c+b^3+27*a*b*c+6*b*c^2+76*c^3+89*b^4+36*a^2*b*d+63*b*d^3+70*a^5+80*b^5+45*b^4*c+a^2*b*c^2+14*b^3*c^2+5*a*b*c^3+3*c^5+54*a*b^2*c*d+17*c^4*d+60*c^3*d^2+69*a^2*d^3+87*c^2*d^3, + 43*a+23*d+23*c^2+43*d^2+71*a^2*b+35*b^3+75*a*c^2+12*a^2*b*c+12*a*b^2*c+2*b^3*c+63*b*c^3+11*a*b^2*d+90*b^3*d+28*a*b*c*d+20*b*c^2*d+34*c*d^3+90*a^5+26*a*b^4+66*b^5+2*a^4*c+33*a^2*b^2*c+27*a*c^4+42*a^2*b*c*d+b^3*c*d+65*a*b*c^2*d+86*a*c^3*d+87*b^2*c*d^2+60*c*d^4, + 72+55*c+76*b^2+30*a*c+85*b*d+14*a*b^2+34*a^2*c+12*b^2*c+57*a*c*d+25*a^3*b+65*a^2*b^2+29*a^2*b*c+50*a*b^2*c+32*c^4+46*a^2*c*d+53*a*b*d^2+72*a*b^3*c+43*a^3*d^2+78*a^2*c*d^2+78*a^2*d^3+81*b^2*d^3+52*b*d^4+73*c*d^4)) + for i in ideals + runAll("sparseid(3,0,5,100-(9*2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,52*c+52*d+52*a^2+89*b*c+11*a^2*c+81*a^2*d+68*a*c*d+51*a^4+19*a^2*b^2+13*b^4+78*a^3*c+11*b^2*c^2+87*b*c^3+47*a*b^2*d+81*a*d^3+21*a^3*b^2+88*b^4*c+44*a^3*c^2+75*a^3*c*d+32*a^2*b*c*d+15*b*c^3*d+79*a^2*b*d^2+77*a*c^2*d^2+24*c^3*d^2+51*b*d^4, + 15*b+17*b*c+73*a^3+19*a*b*c+30*b^2*c+16*b*c^2+53*a*b*d+45*d^3+40*a^3*c+25*a*b^2*c+35*a*c*d^2+55*c^2*d^2+40*a^3*b*c+34*a*b^3*c+66*a^2*b*c^2+30*a*b*c^3+32*c^5+30*a*b^3*d+82*b^3*c*d+76*b^2*c^2*d+88*c^4*d+72*a^2*b*d^2+76*c^3*d^2+49*b*d^4, + 50+18*a*c+87*b*c+76*c*d+59*a^3+43*b^2*d+7*b*c*d+61*a^2*b^2+39*a*b^2*c+54*a*b*c^2+30*a*c^3+9*a^2*b*d+40*b^3*d+14*a^2*c*d+88*b*d^3+13*c*d^3+48*a^2*b^3+40*a^4*c+76*b^4*c+81*a*c^4+13*a^4*d+45*b^4*d+7*a^2*b*c*d+17*b*c^2*d^2+11*a*b*d^3+59*b*c*d^3+38*b*d^4+89*d^5)) + push!( + ideals, + Singular.Ideal( + R,29*b+68*a*d+6*b^3+27*a^2*c+28*b^2*c+a*d^2+27*d^3+23*a^3*b+37*b^3*c+28*a^3*d+43*b^3*d+7*a*b*c*d+59*c^3*d+44*a*b*d^2+67*a^2*c^3+62*a^2*b*c*d+75*a*b^2*c*d+52*a*c^3*d+60*a^2*b*d^2+55*b^3*d^2+72*a*b*c*d^2+69*a^2*d^3+4*c^2*d^3, + 11*c+12*c^2+38*a*b*c+68*a^2*d+3*b^2*d+54*b*d^2+80*a^2*b^2+69*a*b^3+a^2*b*d+35*b^3*d+87*a*c^2*d+80*a^2*d^2+6*b*d^3+46*a^2*b^3+23*a^4*c+84*b^3*c^2+50*b^2*c^3+33*a*c^4+5*a^2*b^2*d+69*a*b^2*c*d+89*a^3*d^2+28*a^2*b*d^2+34*b^3*d^2+22*a^2*c*d^2+52*a*b*c*d^2, + 7+35*b+69*b^2+4*a*d+74*b*d+21*d^2+39*a^2*d+9*a*b*d+53*b*d^2+66*a^3*b+86*a^2*b^2+49*a*b^3+58*a^2*b*d+51*b^3*d+87*a*c^2*d+22*a^2*d^2+27*a*b^3*c+18*a^2*b*c^2+45*a^2*c^3+12*a*b*c^3+4*a^3*b*d+78*a^2*b^2*d+19*b^3*c*d+23*a^2*c^2*d+56*c^4*d+26*b^2*c*d^2+13*a^2*d^3+87*a*b*d^3+65*c*d^4)) + push!( + ideals, + Singular.Ideal( + R,85*b^2+5*b*d+27*d^2+56*c*d^2+81*a^2*b^2+6*a*b^3+54*a^2*c^2+26*a*b*c^2+27*b^2*c^2+37*b*c^3+22*a*b^2*d+69*b*c^2*d+78*b^4*c+82*c^5+39*a^2*b^2*d+73*a*b^2*c*d+50*b^3*c*d+83*b^2*c^2*d+14*a*c^3*d+34*c^4*d+9*a^3*d^2+68*a*b^2*d^2+a*b*c*d^2+74*a^2*d^3+35*a*b*d^3+8*c*d^4, + 87*d+10*b^2+18*a*b*c+71*c^3+63*a^2*d+30*a*b*d+7*b^2*d+9*c^2*d+89*b*d^2+27*c*d^2+10*a*b^2*d+41*a^2*c*d+85*a*c^2*d+51*a^2*d^2+23*a*b*d^2+88*b^2*d^2+26*d^4+6*a^2*b^2*c+90*a*b^3*c+81*a*b^2*c^2+43*a^4*d+40*a^3*b*d+69*b^4*d+22*a*c^3*d+78*a^2*b*d^2+70*a*b^2*d^2+68*b^2*d^3+61*b*d^4+43*d^5, + 2+39*b+39*c+29*a*b+82*a*d+38*a^2*c+67*a^2*d+51*a*d^2+73*b^4+9*a^3*c+70*a*b*c*d+63*b^2*c*d+73*a*d^3+3*b*d^3+46*a^5+42*a*b^4+7*a^2*c^2*d+88*a^3*d^2+62*a^2*b*d^2+38*b^3*d^2+60*a^2*d^3+43*a*d^4)) + for i in ideals + runAll("sparseid(3,0,5,100-(10*2),90)", i, S, StartOrd, TarOrd) + end - push!( - ideals, - Singular.Ideal( - R, - [ - 75 + - 83 * b + - 51 * d^2 + - 33 * c^3 + - 60 * d^3 + - 87 * a^2 * c^2 + - 78 * c^4 + - 48 * b * c^2 * d + - 10 * a * b * d^2 + - 71 * b^2 * d^2 + - 66 * a * d^3 + - 71 * a^5 + - 76 * a^3 * b^2 + - 40 * a * b^2 * c^2 + - 40 * a^3 * d^2 + - 65 * b * c * d^3, - 21 * d + - 18 * b^2 + - 78 * b * d^2 + - 18 * a^3 * b + - 41 * b^4 + - 67 * a * b^2 * d + - 36 * b^3 * d + - 48 * b^2 * c * d + - 28 * a^4 * b + - 8 * a^4 * d + - 11 * a^2 * b^2 * d + - 85 * a * c^3 * d + - 38 * c^4 * d + - 14 * a^2 * b * d^2 + - 63 * d^5, - 37 * a * c + - 85 * a * b^2 + - 68 * a * b * d + - 52 * a * c * d + - 70 * b^4 * c + - 80 * a^3 * c^2 + - 71 * b^3 * c^2 + - 32 * a^4 * d + - 60 * a * c * d^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 18 * c + - 45 * b^2 * d + - 42 * a^2 * b^2 + - 41 * a^2 * b * d + - 60 * a * b * c * d + - 60 * c^2 * d^2 + - 90 * a * b^4 + - 46 * a * b^3 * c + - 62 * a^3 * c^2 + - 47 * a * b^2 * c * d + - 23 * a * c^3 * d + - 37 * c^3 * d^2, - 76 + - 32 * d + - 82 * a * b + - 37 * d^2 + - 79 * a * b^2 + - 22 * b^3 + - 15 * a^2 * c + - 48 * a * b * d + - 37 * b^2 * d + - 75 * a^2 * c^2 + - 7 * a^2 * d^2 + - 59 * a * c * d^2 + - 70 * b * d^3 + - 40 * b * c^4 + - 65 * a^2 * b^2 * d + - 28 * a^2 * c^2 * d + - 44 * c^4 * d + - 60 * b^2 * c * d^2, - 73 * c^2 + - 90 * b^4 + - 13 * a^2 * c^2 + - 19 * b * d^3 + - 17 * a^3 * b * d + - 77 * b^4 * d + - 17 * a^2 * b * d^2 + - 77 * a * b^2 * d^2 + - 67 * a^2 * d^3 + - 29 * a * c * d^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 72 * b^2 + - 71 * a * c + - 88 * a^4 + - 87 * a * b^3 + - 85 * a * c^3 + - 66 * b^3 * d + - 30 * b * c^2 * d + - 8 * a * b * c^3 + - 33 * a^3 * b * d + - 3 * a^2 * b * c * d + - 2 * a^2 * b * d^2 + - 90 * a * d^4 + - 27 * d^5, - 87 + - 49 * a + - 66 * b^2 + - 4 * b * c^2 + - 30 * a^2 * d + - 28 * d^3 + - 48 * a^2 * b^2 + - 87 * a * b * d^2 + - 70 * c * d^3 + - 26 * a^5 + - 83 * a^2 * b^3 + - 30 * b^4 * c + - 21 * a^2 * b * c^2 + - 80 * a^4 * d + - 18 * a^3 * d^2 + - 89 * a * b * d^3 + - 37 * b^2 * d^3, - 53 * b + - 29 * b * c^2 + - 81 * c^2 * d + - 4 * d^3 + - 85 * a^3 * b + - 40 * a^2 * c^2 + - 51 * c * d^3 + - 43 * a^3 * b * c + - 20 * b^2 * c^3 + - 74 * b^2 * d^3, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) - - end - - push!( - ideals, - Singular.Ideal( - R, - [ - 15 + - 33 * c^2 + - 45 * a * d + - 2 * c * d + - 89 * a * b * c + - 75 * a * c^2 + - 4 * c^3 + - 61 * a^2 * d + - a^3 * b + - 60 * a * b * c^2 + - 5 * a * c^3 + - 6 * b * c^3 + - 25 * c^4 + - 52 * a^2 * b * d + - 22 * b^3 * d + - 29 * b * c^2 * d + - 85 * a * c * d^2 + - 39 * a^5 + - 56 * a^4 * b + - 53 * a^3 * b^2 + - 7 * a * b^2 * c^2 + - 48 * a * b * c^3 + - 58 * b^2 * c^3 + - 89 * a * c^4 + - 8 * b^2 * c^2 * d + - 6 * c^4 * d + - 6 * a * b^2 * d^2 + - 70 * c^3 * d^2 + - 32 * a * b * d^3 + - 3 * b^2 * d^3 + - 50 * d^5, - 73 * b + - 18 * b * c + - 41 * a^2 * c + - 65 * a^2 * d + - 77 * b * d^2 + - 61 * a^2 * c^2 + - 5 * c^4 + - 2 * c^2 * d^2 + - 24 * d^4 + - 67 * a * b^2 * c^2 + - 7 * b^3 * c^2 + - 2 * a^2 * c^3 + - 60 * a * b * c^3 + - 22 * a * b * c^2 * d + - 47 * a * c^3 * d + - 2 * a^3 * d^2 + - 54 * b * c * d^3 + - 48 * b * d^4, - 85 * b + - 61 * d + - 81 * a * b + - 75 * c * d + - 50 * a^3 + - 37 * a^2 * c + - 58 * c^3 + - 16 * a * d^2 + - 88 * c * d^2 + - 50 * a^4 + - 58 * a^2 * b^2 + - 68 * a^2 * c * d + - 72 * a * b * c * d + - 54 * a * c^2 * d + - 8 * a * b * d^2 + - 51 * c^2 * d^2 + - 38 * b * d^3 + - 50 * a^5 + - 56 * a^3 * c^2 + - 31 * a^2 * b * c^2 + - 69 * b^3 * c^2 + - 33 * a^3 * b * d + - 79 * a^2 * c * d^2 + - 30 * a * b * d^3 + - 3 * b^2 * d^3 + - 61 * b * d^4 + - 71 * c * d^4 + - 21 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 44 * b + - 34 * a * c + - 45 * c^2 + - 8 * a * b^2 + - 24 * c^3 + - 14 * a * c * d + - a * b^3 + - 63 * a * c^3 + - 28 * b^2 * c * d + - 41 * a * c * d^2 + - 16 * b * c * d^2 + - 56 * a * d^3 + - 9 * b^3 * c^2 + - 6 * a^2 * c^3 + - 52 * a * b^3 * d + - 15 * a^2 * b * c * d + - 31 * a * b^2 * c * d + - 71 * b^2 * c^2 * d + - 62 * a^3 * d^2 + - 83 * a^2 * c * d^2 + - 10 * b^2 * c * d^2 + - 81 * b^2 * d^3 + - 69 * a * c * d^3, - 64 + - b + - 57 * d + - 25 * a^2 + - 28 * d^2 + - 43 * a^3 + - 50 * a * b * c + - 42 * b^2 * c + - 32 * c^3 + - 58 * a * c * d + - 45 * a * b^2 * c + - 70 * c^4 + - 75 * a * b * c * d + - 45 * b^2 * c * d + - 89 * a * c^2 * d + - 58 * b^2 * d^2 + - 43 * a * c * d^2 + - 43 * b * d^3 + - 60 * c * d^3 + - 33 * b^3 * c^2 + - 29 * a^3 * b * d + - 30 * a^3 * c * d + - 55 * b^3 * c * d + - 7 * a * b * c^2 * d + - 42 * b^2 * c^2 * d + - 70 * b * c^3 * d + - 56 * a * b^2 * d^2 + - 37 * a * d^4, - 76 * a * d + - 22 * d^2 + - 63 * b^2 * c + - 45 * b^2 * d + - 71 * b * c * d + - 6 * d^3 + - 47 * a^3 * c + - 73 * a^2 * c^2 + - 87 * a^3 * d + - 73 * a * b * d^2 + - 19 * a * c * d^2 + - 9 * b * d^3 + - 14 * a^5 + - 13 * a^4 * b + - 59 * a^3 * b^2 + - 34 * a^2 * b^2 * c + - 66 * a * c^4 + - 37 * c^5 + - 39 * a^2 * b^2 * d + - 80 * b^4 * d + - 24 * b^3 * c * d + - 24 * a * b * c^2 * d + - 14 * b * c^3 * d + - 33 * a^3 * d^2 + - 54 * b^2 * c * d^2 + - 44 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 83 + - 15 * c * d + - 78 * d^2 + - 82 * b^3 + - 9 * c^3 + - 74 * a * c * d + - 24 * a^2 * c^2 + - 50 * a * b * c^2 + - 50 * b^2 * c^2 + - 34 * b * c^3 + - 32 * a^2 * b * d + - 3 * a^2 * c * d + - 62 * a * c^2 * d + - 90 * c * d^3 + - 36 * a^5 + - 14 * a^4 * b + - 18 * a^3 * b * c + - 69 * a * c^4 + - 54 * a^2 * c^2 * d + - 28 * b^2 * c^2 * d + - 37 * b^2 * d^3 + - 27 * a * d^4 + - 60 * c * d^4, - 83 * b + - 64 * b * c + - 74 * a * d + - 16 * a^3 + - 83 * b * c * d + - 54 * c^2 * d + - 56 * d^3 + - 84 * a^2 * b^2 + - 76 * a^3 * c + - 13 * a^2 * c^2 + - 39 * a * b * c^2 + - 81 * b^2 * c^2 + - c^4 + - 9 * b * c * d^2 + - 19 * b * d^3 + - 83 * c * d^3 + - 2 * a * b^4 + - 5 * a^3 * c^2 + - 84 * a^2 * b * c^2 + - 21 * a * b * c^3 + - 25 * a^3 * b * d + - 2 * a^2 * c^2 * d + - 82 * b * c^3 * d + - 80 * c^4 * d + - 33 * a^3 * d^2 + - 81 * b^3 * d^2 + - 44 * a^2 * d^3, - 61 * a + - 63 * d + - 52 * a^2 + - 81 * c * d + - 48 * a^2 * d + - 74 * a * b * d + - 2 * a * c * d + - 11 * c^2 * d + - 39 * d^3 + - 50 * a^3 * b + - 71 * a^2 * b * d + - 41 * b * c * d^2 + - 7 * b * d^3 + - 29 * a^5 + - 11 * b^5 + - 25 * b^3 * c^2 + - a * c^4 + - 50 * a^4 * d + - 10 * a^2 * b^2 * d + - 2 * a * b^3 * d + - 49 * b^3 * c * d + - 73 * b^2 * c^2 * d + - 41 * a * c^3 * d + - 35 * a^3 * d^2 + - 75 * a * b * c * d^2 + - 13 * a * c * d^3 + - 28 * c^2 * d^3, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) - end - push!( - ideals, - Singular.Ideal( - R, - [ - 31 * a + - 61 * b + - 51 * d + - 8 * b * c + - 24 * c^2 + - 11 * a^2 * b + - 52 * a^2 * c + - 15 * a^2 * d + - 52 * a * c * d + - 19 * c^2 * d + - 82 * b * d^2 + - 2 * c * d^2 + - 85 * b^4 + - 13 * a^3 * c + - 34 * b^3 * c + - 88 * a * c^3 + - 13 * a^2 * c * d + - 22 * a * c^2 * d + - 21 * b^2 * d^2 + - 11 * a * c * d^2 + - 58 * a * d^3 + - 63 * c * d^3 + - 33 * d^4 + - 55 * a^2 * b^3 + - 4 * a * b^4 + - 17 * a * b^2 * c^2 + - 28 * a * b * c^3 + - 73 * b^2 * c^3 + - 56 * a * c^4 + - 5 * a^2 * b * c * d + - 15 * a * b^2 * c * d + - 84 * b^3 * c * d + - 29 * a * c^3 * d + - 83 * b * c^3 * d + - 31 * a * b^2 * d^2 + - 16 * b^3 * d^2 + - 75 * a^2 * c * d^2 + - 42 * a * b * c * d^2 + - 77 * b^2 * c * d^2 + - 10 * b * c^2 * d^2 + - 16 * a^2 * d^3, - 32 * c^2 + - 75 * a * d + - 62 * b * d + - 3 * a * b^2 + - 83 * a * b * c + - 70 * a * c^2 + - 34 * c^3 + - 37 * b * d^2 + - 41 * a^3 * b + - 89 * a^2 * c^2 + - 46 * a * c^3 + - 46 * a^2 * b * d + - 56 * c^3 * d + - 82 * a^2 * d^2 + - 43 * a * c * d^2 + - 62 * c * d^3 + - 85 * a^5 + - 24 * a * b^4 + - 61 * a^4 * c + - 49 * a^3 * b * c + - 63 * a^2 * b^2 * c + - 31 * b^4 * c + - 45 * a^2 * c^3 + - 24 * a * b * c^3 + - 72 * c^5 + - 13 * a^4 * d + - 30 * a^2 * b^2 * d + - a^3 * c * d + - 23 * a * b * c^2 * d + - 26 * b^3 * d^2 + - 3 * a^2 * c * d^2 + - 89 * a * b * c * d^2 + - 37 * b^2 * c * d^2 + - 19 * a^2 * d^3 + - 87 * b^2 * d^3 + - 81 * a * c * d^3 + - 67 * c * d^4, - 77 + - 75 * a + - 30 * a^2 + - 67 * c^2 + - 73 * b * d + - 46 * c * d + - 33 * a * b^2 + - 57 * b^3 + - 59 * b^2 * c + - 33 * a * c^2 + - 27 * c^3 + - 82 * c * d^2 + - 78 * a^3 * b + - 43 * a^2 * b^2 + - 78 * a^3 * c + - 24 * a * b * c^2 + - 60 * a^2 * b * d + - 50 * b^3 * d + - 66 * a^2 * c * d + - 42 * a * c^2 * d + - 3 * c^3 * d + - 45 * a^2 * d^2 + - 9 * a * c * d^2 + - 70 * a * d^3 + - 59 * b * d^3 + - 76 * a * b^4 + - 70 * b^5 + - 48 * a * b^2 * c^2 + - 48 * b * c^4 + - 38 * a^4 * d + - 8 * a * c^3 * d + - 50 * c^4 * d + - 82 * a^2 * b * d^2 + - a * b * c * d^2 + - 5 * c^3 * d^2 + - 12 * a * b * d^3 + - 32 * b^2 * d^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 52 + - 40 * c + - 90 * b * c + - 28 * a^2 * c + - 75 * b^2 * c + - 19 * a * c^2 + - 54 * b * c * d + - 81 * a^4 + - 46 * a * b^3 + - 30 * a^2 * b * c + - 19 * a * b^2 * c + - 45 * b^2 * c^2 + - 82 * b * c^3 + - 77 * a^3 * d + - 17 * b^3 * d + - 62 * a * c^2 * d + - 73 * b * c * d^2 + - 55 * c^2 * d^2 + - 60 * a^4 * b + - 7 * b^4 * c + - 82 * a * b^2 * c^2 + - 45 * a^2 * c^3 + - 66 * a * b * c^3 + - 28 * b * c^4 + - 73 * c^5 + - 30 * a^4 * d + - 18 * a * b^3 * d + - 43 * a^3 * c * d + - 25 * a * b * c^2 * d + - 49 * c^4 * d + - 35 * a^3 * d^2 + - 49 * a^2 * b * d^2 + - 23 * b^3 * d^2 + - 27 * a * c^2 * d^2 + - 12 * b * c^2 * d^2 + - 49 * a * b * d^3, - 4 * a + - 64 * b + - 90 * d + - 9 * a^2 + - 36 * a * b + - 83 * b^2 + - 51 * d^2 + - 5 * a^3 + - 10 * b^3 + - 73 * a^2 * c + - 2 * a * c^2 + - 43 * b * c^2 + - 56 * a * b * d + - 81 * c * d^2 + - 52 * a^4 + - 9 * a * b^2 * c + - 55 * a * b * c * d + - 38 * a * c^2 * d + - 20 * c^2 * d^2 + - 54 * a * d^3 + - 81 * b * d^3 + - 41 * a^5 + - 58 * a^2 * b^3 + - 53 * b^5 + - 81 * a^3 * b * c + - 87 * a^2 * b^2 * c + - 44 * a^3 * c^2 + - 74 * a^3 * b * d + - 86 * a * b * c^2 * d + - 42 * a * c^3 * d + - 50 * c^4 * d + - 66 * b^3 * d^2 + - 9 * b^2 * c * d^2 + - 45 * c^3 * d^2 + - 58 * a * b * d^3 + - 81 * b^2 * d^3 + - 48 * b * c * d^3, - 80 * a * b + - 49 * a * c + - 67 * b * d + - 76 * c * d + - 56 * a * b^2 + - 85 * a^2 * c + - 86 * a * b * c + - 26 * a^2 * d + - 48 * a * b * d + - 27 * a * c * d + - 22 * a * d^2 + - 40 * a^3 * c + - 40 * a^2 * c^2 + - 31 * a * b * c^2 + - 19 * b^2 * c^2 + - 76 * a * b^2 * d + - 20 * b^3 * d + - 55 * a^2 * c * d + - 52 * a * b * c * d + - 10 * c^3 * d + - 89 * a^2 * d^2 + - 56 * a * b * d^2 + - 2 * a * c * d^2 + - 76 * c^2 * d^2 + - 33 * a * d^3 + - 83 * a * b^3 * c + - 74 * b^4 * c + - 63 * a * b * c^3 + - 64 * a^3 * b * d + - 69 * a^2 * b * c * d + - 68 * a * b * c^2 * d + - 44 * b^2 * c^2 * d + - 38 * b * c^3 * d + - 10 * a * b^2 * d^2 + - 29 * b^3 * d^2 + - 72 * c^3 * d^2 + - 71 * a * b * d^3 + - 19 * b * c * d^3 + - 58 * c^2 * d^3 + - 46 * a * d^4 + - b * d^4 + - 52 * c * d^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 66 * b + - 33 * a^2 + - 72 * a * d + - 34 * b * d + - 48 * a^2 * c + - 70 * a * b * c + - 17 * b * c^2 + - 55 * c^3 + - 81 * b * d^2 + - 75 * d^3 + - 49 * a^4 + - 89 * a * b^3 + - 28 * b^3 * c + - 50 * a^2 * c^2 + - 52 * a * c^3 + - 72 * b * c^3 + - 60 * c^4 + - 59 * a * b^2 * d + - 36 * b^3 * d + - 39 * a * c^2 * d + - 7 * a * b * d^2 + - 3 * c^2 * d^2 + - 87 * b * d^3 + - 52 * b^5 + - 41 * a^3 * b * c + - 55 * a^2 * b^2 * c + - 70 * a * b^3 * c + - 50 * a^2 * b * c^2 + - 22 * a * b^2 * c^2 + - 41 * b^2 * c^3 + - 54 * a * c^4 + - 47 * a^2 * b^2 * d + - 86 * b^4 * d + - 27 * a^2 * b * c * d + - 15 * b * c^3 * d + - 21 * a^2 * c * d^2 + - 81 * b * c^2 * d^2 + - 89 * a * b * d^3 + - 62 * b * c * d^3 + - 54 * a * d^4 + - 14 * c * d^4, - 87 * b + - 81 * a^2 + - 26 * a * b + - 81 * b * d + - 44 * a * b^2 + - 90 * b^3 + - 11 * a * b * d + - 78 * b^2 * d + - 35 * a^4 + - 27 * a^3 * b + - 85 * a * b^3 + - 30 * b^4 + - 10 * b * c^3 + - 85 * a^2 * b * d + - 41 * b^2 * c * d + - 27 * a^2 * d^2 + - 72 * c^2 * d^2 + - 19 * b * d^3 + - 72 * d^4 + - 40 * a^5 + - 71 * a^2 * b^3 + - 5 * a * b^4 + - 48 * b^5 + - 25 * a^4 * c + - 42 * a^3 * b * c + - 66 * a^2 * b^2 * c + - 48 * b^3 * c^2 + - 87 * b^2 * c^3 + - 6 * a * c^4 + - 87 * a^3 * b * d + - 80 * b^2 * c^2 * d + - 9 * a^2 * b * d^2 + - 14 * b^3 * d^2 + - 87 * a^2 * c * d^2 + - 50 * c^2 * d^3 + - 88 * d^5, - 62 + - 83 * c + - 45 * d + - 38 * b * c + - 34 * c^2 + - 43 * d^2 + - 68 * b^3 + - 61 * a * b * c + - 59 * a * c^2 + - 76 * c^3 + - 69 * a * c * d + - 46 * b * c * d + - 84 * c^2 * d + - 39 * a * d^2 + - 87 * a^4 + - 83 * a^2 * b^2 + - 65 * b^4 + - 69 * a^2 * c^2 + - 67 * b * c^3 + - 2 * a * c^2 * d + - 32 * a * c * d^2 + - 53 * a * d^3 + - 89 * a^4 * b + - 86 * a^4 * c + - 47 * a^3 * b * c + - 76 * a^2 * b^2 * c + - 70 * b^3 * c^2 + - 3 * a^2 * c^3 + - 8 * b^2 * c^3 + - 88 * c^5 + - 65 * a^4 * d + - 9 * a^2 * b^2 * d + - 56 * b^4 * d + - 83 * a^2 * b * c * d + - 8 * a * b^2 * c * d + - 89 * a^2 * b * d^2 + - 87 * b * c * d^3 + - 33 * d^5, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) - - - end - push!( - ideals, - Singular.Ideal( - R, - [ - 64 * c + - 52 * b^2 + - 65 * b * d + - 59 * d^2 + - 17 * a * b^2 + - 42 * b^3 + - 21 * a^2 * c + - 67 * a * c^2 + - 50 * a^2 * d + - 23 * a * b * d + - 6 * b^2 * d + - 53 * b * c * d + - 46 * c^2 * d + - 85 * a * d^2 + - 73 * a * b^3 + - 5 * a^3 * c + - 46 * a * b^2 * c + - 89 * a^2 * c^2 + - 8 * a * b * c^2 + - 20 * b^2 * c^2 + - 11 * b * c^3 + - 71 * c^4 + - 76 * a^3 * d + - 66 * a * b^2 * d + - 16 * b^3 * d + - 42 * a * b * c * d + - 89 * a * b * d^2 + - 35 * c * d^3 + - 29 * d^4 + - 32 * a^4 * c + - 53 * a^3 * b * c + - 68 * a^2 * b^2 * c + - 72 * b^4 * c + - 54 * a^3 * c^2 + - 65 * a^2 * b * c^2 + - 29 * a * b^2 * c^2 + - 67 * a^2 * c^3 + - 35 * a * b * c^3 + - 22 * a^3 * c * d + - 40 * b^3 * c * d + - 26 * a * b * c^2 * d + - 24 * b^2 * c^2 * d + - 24 * a * c^3 * d + - 10 * c^4 * d + - 14 * a^2 * c * d^2 + - 2 * a * b * c * d^2 + - 18 * b^2 * c * d^2 + - 78 * c^3 * d^2 + - 77 * c^2 * d^3, - 34 + - 8 * a + - 33 * b + - 85 * c + - 60 * d + - 48 * a^2 + - 44 * a * b + - 25 * a * c + - 81 * a * d + - 56 * b * d + - 17 * a^2 * d + - 77 * a * c * d + - 7 * b * c * d + - 18 * c^2 * d + - 10 * a * d^2 + - b * d^2 + - 76 * c * d^2 + - 39 * a^2 * b * c + - 58 * b * c^3 + - 18 * a^3 * d + - 83 * a * b^2 * d + - 43 * b^3 * d + - 7 * a^2 * c * d + - 51 * a * b * c * d + - 30 * a * c * d^2 + - 78 * b * d^3 + - 71 * c * d^3 + - 74 * d^4 + - 64 * a^5 + - 55 * a * b^4 + - 85 * a^4 * c + - 6 * a^2 * b^2 * c + - 81 * a * b^3 * c + - 65 * a * b * c^3 + - 7 * b * c^4 + - 32 * a^2 * b^2 * d + - 58 * b^4 * d + - 75 * a^3 * c * d + - 35 * a^2 * c^2 * d + - 16 * a * b * c^2 * d + - 14 * b^2 * c * d^2 + - 33 * a * c^2 * d^2 + - 68 * b * c^2 * d^2 + - 54 * c^3 * d^2 + - 77 * a^2 * d^3 + - 59 * a * b * d^3 + - 81 * a * c * d^3 + - 12 * c^2 * d^3 + - 4 * a * d^4 + - b * d^4 + - 39 * c * d^4, - 25 + - 61 * a * b + - 8 * a * c + - 36 * c^2 + - 73 * a * d + - 6 * a^3 + - 44 * a^2 * b + - 19 * a * b^2 + - 22 * b^3 + - 74 * a * c^2 + - 16 * b * c * d + - 9 * c^2 * d + - 78 * a * b^3 + - 20 * b^4 + - 32 * a^2 * b * c + - 52 * b^3 * c + - 65 * a^2 * c^2 + - 4 * a * b * c^2 + - 56 * b^2 * c^2 + - 62 * a * c^3 + - 40 * b * c^3 + - 2 * a^3 * d + - 9 * b^3 * d + - 60 * a * b * c * d + - 33 * a * c^2 * d + - 3 * b * c^2 * d + - 8 * a * b * d^2 + - 7 * a * d^3 + - 7 * a^2 * b^3 + - 56 * a * b^4 + - 53 * a^3 * b * c + - 47 * a^2 * b^2 * c + - 17 * a^3 * c^2 + - 37 * a * b^2 * c^2 + - 4 * b^3 * c^2 + - 79 * a * b * c^3 + - 15 * b^2 * c^3 + - 41 * a * c^4 + - 15 * a * b^3 * d + - 48 * b^4 * d + - 23 * a^3 * c * d + - 78 * b^3 * c * d + - 40 * a^2 * c^2 * d + - 42 * b^2 * c^2 * d + - 14 * a * c^3 * d + - 28 * b * c^3 * d + - 80 * a * c^2 * d^2 + - 67 * b * c^2 * d^2 + - 9 * a * b * d^3 + - 83 * b^2 * d^3 + - 57 * b * c * d^3 + - 3 * c * d^4 + - 68 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 68 + - 21 * a + - 4 * c + - 82 * d + - 68 * b^2 + - 31 * b * c + - 37 * a * d + - 80 * a^3 + - 30 * a * b^2 + - 86 * b^3 + - 23 * a^2 * c + - 10 * a * b * d + - 46 * c^2 * d + - 51 * a * d^2 + - 69 * a * b^2 * c + - 25 * a^2 * c^2 + - 40 * a * c^3 + - 63 * c^4 + - 70 * a^3 * d + - 27 * a^2 * b * d + - 75 * b^3 * d + - 22 * a^2 * c * d + - 6 * a * c^2 * d + - 30 * a * b * d^2 + - 86 * a * c * d^2 + - 70 * c^2 * d^2 + - 35 * a^5 + - 74 * a^3 * b^2 + - 23 * a * b^4 + - 46 * a^3 * b * c + - 73 * b^4 * c + - 74 * a^3 * c^2 + - 57 * a^4 * d + - 40 * a^3 * b * d + - 48 * a^2 * b^2 * d + - 56 * a * b^3 * d + - 60 * a^3 * c * d + - 54 * a^2 * b * c * d + - 33 * a^2 * c^2 * d + - 50 * a * c^3 * d + - 29 * a^3 * d^2 + - 85 * a * b^2 * d^2 + - 90 * a^2 * d^3 + - 21 * a * b * d^3 + - 52 * b^2 * d^3 + - 83 * b * c * d^3 + - 87 * c^2 * d^3 + - 72 * b * d^4 + - 33 * c * d^4, - 28 * d + - 39 * b^2 + - 70 * a * d + - 39 * b * d + - 17 * c * d + - 27 * a^2 * b + - 85 * a^2 * c + - 50 * b^2 * d + - 77 * a * c * d + - 90 * b * c * d + - 47 * c^2 * d + - 41 * a * d^2 + - 4 * b * d^2 + - 64 * d^3 + - 85 * a^4 + - 27 * a * b^3 + - 72 * b^2 * c^2 + - 83 * c^4 + - 29 * a^3 * d + - 31 * b^3 * d + - 31 * a^2 * c * d + - 9 * a * c^2 * d + - 7 * c^3 * d + - 28 * a^2 * d^2 + - 89 * a * b * d^2 + - 82 * b^2 * d^2 + - 88 * a * c * d^2 + - 3 * b * c * d^2 + - 80 * a * d^3 + - 2 * b * d^3 + - 3 * a^2 * b^3 + - 50 * b^5 + - 50 * b^4 * c + - 58 * a^3 * c^2 + - 16 * b^3 * c^2 + - 24 * a^2 * c^3 + - 35 * a * b * c^3 + - 64 * b * c^4 + - 12 * c^5 + - 65 * a^4 * d + - 7 * a^3 * c * d + - 21 * a * b^2 * c * d + - 82 * b^3 * c * d + - 50 * a^2 * c^2 * d + - 63 * b * c^3 * d + - 56 * c^4 * d + - 37 * a^2 * c * d^2 + - 45 * a * c^2 * d^2 + - 29 * b * c^2 * d^2 + - 51 * b^2 * d^3 + - 3 * b * c * d^3 + - 27 * b * d^4, - 9 + - 48 * a + - 23 * a * b + - 42 * b^2 + - 9 * b * c + - 66 * a * d + - 56 * c * d + - 71 * a^3 + - 52 * a^2 * b + - 11 * a * b^2 + - 65 * a * b * c + - 53 * b^2 * c + - 81 * b * c^2 + - 18 * a * c * d + - 76 * a * d^2 + - 35 * b^4 + - 64 * a^3 * c + - 4 * a^2 * c^2 + - 40 * b^2 * c^2 + - 69 * a * c^3 + - 67 * b * c^3 + - 74 * a * b^2 * d + - 84 * b^3 * d + - 27 * a^2 * c * d + - 73 * a * c^2 * d + - 74 * b * c^2 * d + - 5 * a * c * d^2 + - 45 * b * c * d^2 + - 82 * b * d^3 + - 4 * a^4 * b + - 76 * a^3 * b^2 + - 23 * a * b^3 * c + - 75 * b^3 * c^2 + - 3 * a^2 * c^3 + - 24 * a * b * c^3 + - 37 * b^2 * c^3 + - 61 * a * c^4 + - 40 * a^4 * d + - 71 * a^3 * b * d + - 22 * a^3 * c * d + - 73 * a^2 * b * c * d + - 33 * a * b * c^2 * d + - 49 * b^2 * c^2 * d + - 2 * a * c^3 * d + - 39 * b * c^3 * d + - 83 * a^3 * d^2 + - 17 * a^2 * c * d^2 + - 77 * a * b * c * d^2 + - 87 * c^3 * d^2 + - 45 * b^2 * d^3 + - 71 * c^2 * d^3 + - 88 * c * d^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 1 + - 25 * b + - 18 * a * b + - 67 * a * c + - 79 * a * d + - 80 * b * c^2 + - 71 * a * c * d + - 66 * c^2 * d + - 51 * a * d^2 + - 65 * a^4 + - 81 * a^3 * c + - 72 * a * b * c^2 + - 19 * a * c^3 + - 69 * b * c^3 + - 69 * a^3 * d + - 51 * a^2 * b * d + - 33 * a * b^2 * d + - 26 * a * b * c * d + - 4 * c^3 * d + - 34 * a^2 * d^2 + - 46 * a * b * d^2 + - 87 * c * d^3 + - 71 * a^2 * b^3 + - 20 * b^4 * c + - 31 * a^2 * b * c^2 + - 33 * a^2 * c^3 + - 56 * b * c^4 + - 52 * c^5 + - 5 * a^4 * d + - 61 * a^2 * b^2 * d + - 41 * a^2 * b * c * d + - 18 * b^3 * c * d + - 13 * a * c^3 * d + - 6 * b * c^3 * d + - 36 * c^4 * d + - 31 * a^2 * b * d^2 + - 24 * a * b^2 * d^2 + - 43 * a * b * c * d^2 + - 55 * b^2 * c * d^2 + - 50 * c^3 * d^2 + - 42 * a^2 * d^3 + - 76 * b * c * d^3 + - 69 * c^2 * d^3, - 22 * a + - 80 * b + - 77 * c + - 20 * d + - 80 * a * c + - 85 * a * d + - 68 * a * b * c + - 2 * b^2 * c + - 17 * b * c^2 + - 19 * a * b * d + - 40 * b^2 * d + - 43 * c^2 * d + - 9 * c * d^2 + - 50 * a^2 * b^2 + - 79 * a * b^3 + - 6 * b^4 + - 32 * a^3 * c + - 70 * b^3 * c + - 11 * a * c^3 + - 47 * b * c^3 + - 29 * c^4 + - 50 * a^3 * d + - 42 * a * b * c * d + - 31 * a * c^2 * d + - 86 * b * c^2 * d + - 17 * c^3 * d + - 53 * a * b * d^2 + - 13 * a * c * d^2 + - 28 * a^3 * b^2 + - 12 * a^2 * b^3 + - 15 * a * b^4 + - 16 * a^4 * c + - 52 * b^4 * c + - 22 * b^3 * c^2 + - 77 * a^3 * b * d + - 82 * b^4 * d + - 33 * a^2 * b * c * d + - 36 * b^2 * c^2 * d + - 87 * b * c^3 * d + - 84 * a^2 * b * d^2 + - 39 * a * b^2 * d^2 + - 65 * a * b * d^3 + - 53 * a * c * d^3 + - 13 * b * c * d^3 + - 90 * a * d^4 + - 32 * b * d^4 + - 59 * c * d^4, - 75 + - 65 * a * b + - 33 * b^2 + - 38 * a * c + - 79 * c^2 + - 50 * a * d + - 52 * b * d + - 42 * c * d + - 40 * a^2 * b + - 54 * b^3 + - 63 * a^2 * c + - 20 * a * b * c + - 60 * b^2 * c + - 67 * b * c^2 + - 22 * c^3 + - 35 * a^2 * d + - 71 * a * b * d + - 14 * a * c * d + - 33 * c^2 * d + - 80 * c * d^2 + - 48 * d^3 + - 70 * a^2 * b^2 + - 72 * b^4 + - 48 * a^3 * c + - 27 * a^2 * c^2 + - 18 * a * b * c^2 + - 36 * a * c^3 + - b * c^3 + - 63 * c^4 + - 21 * a^2 * b * d + - 18 * b * c^2 * d + - 54 * a^2 * d^2 + - 51 * b^2 * d^2 + - 39 * b * c * d^2 + - 17 * d^4 + - 21 * a^5 + - 51 * a^2 * b^3 + - 80 * a^3 * b * c + - 85 * b^4 * c + - 22 * a * b^2 * c^2 + - 47 * b^3 * c^2 + - 71 * a^2 * c^3 + - 82 * b^2 * c^3 + - 43 * a * c^4 + - 64 * b * c^4 + - 13 * c^5 + - 77 * a^2 * b^2 * d + - 60 * a * b^3 * d + - b^4 * d + - 34 * a * b^2 * c * d + - 12 * b^3 * c * d + - 67 * a * b * c^2 * d + - 37 * b * c^3 * d + - 80 * a^2 * b * d^2 + - 38 * a * b^2 * d^2 + - 82 * a * b * c * d^2 + - 23 * a * c^2 * d^2 + - 9 * b^2 * d^3 + - 11 * a * c * d^3 + - 80 * c^2 * d^3 + - 82 * a * d^4 + - 49 * b * d^4 + - 76 * d^5, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) - end - push!( - ideals, - Singular.Ideal( - R, - [ - 25 + - 59 * a + - 15 * a^2 + - 87 * a * b + - 83 * c^2 + - 26 * a * d + - 89 * b * d + - 6 * d^2 + - 60 * a^3 + - 7 * a^2 * c + - 75 * a * c^2 + - 74 * b * c^2 + - 34 * c^3 + - 3 * c^2 * d + - 41 * a * d^2 + - 54 * b * d^2 + - 70 * d^3 + - 89 * a * b^3 + - 64 * b^4 + - 62 * a^3 * c + - 86 * a^2 * b * c + - 35 * b^3 * c + - 41 * b^2 * c^2 + - 22 * c^4 + - 40 * a^3 * d + - 47 * a^2 * b * d + - 9 * b^3 * d + - 83 * a^2 * c * d + - 56 * a * c^2 * d + - 26 * b * c^2 * d + - 33 * a^2 * d^2 + - 31 * b^2 * d^2 + - 12 * c^2 * d^2 + - 89 * c * d^3 + - 85 * a^3 * b * c + - 45 * a^3 * c^2 + - 57 * a * b^2 * c^2 + - 40 * b^3 * c^2 + - 30 * a^2 * c^3 + - 63 * a * b * c^3 + - 68 * b^2 * c^3 + - 77 * a * c^4 + - 10 * a^4 * d + - 30 * a^2 * b^2 * d + - 84 * a * b^3 * d + - 52 * a^2 * b * c * d + - 33 * b^2 * c^2 * d + - 25 * a^3 * d^2 + - 27 * a^2 * b * d^2 + - 57 * a * b^2 * d^2 + - 51 * b^3 * d^2 + - 57 * a^2 * c * d^2 + - 12 * a * b * c * d^2 + - a * c^2 * d^2 + - 17 * c^3 * d^2 + - 34 * a * b * d^3 + - 13 * b^2 * d^3 + - 70 * c^2 * d^3 + - 57 * a * d^4 + - 47 * c * d^4 + - 89 * d^5, - 10 * a + - 25 * b + - 59 * d + - 10 * c^2 + - 80 * a * d + - 80 * b * d + - 64 * c * d + - 17 * d^2 + - 84 * b^3 + - 47 * a^2 * c + - 79 * b^2 * c + - 90 * a * c^2 + - 37 * a^2 * d + - b^2 * d + - 15 * a * c * d + - 2 * b * c * d + - 18 * b * d^2 + - 20 * d^3 + - 5 * a^3 * b + - 21 * a^2 * b^2 + - 56 * b^4 + - 62 * a^3 * c + - 70 * a^2 * b * c + - 77 * a * b^2 * c + - 39 * b^3 * c + - 39 * a * b * c^2 + - 51 * c^4 + - 80 * a^3 * d + - 36 * a * b^2 * d + - 67 * a^2 * c * d + - 25 * a * b * c * d + - 52 * b^2 * c * d + - 42 * a * c^2 * d + - 29 * b * c^2 * d + - 37 * a^2 * d^2 + - 52 * a * b * d^2 + - 23 * b^2 * d^2 + - 3 * b * d^3 + - 43 * a^4 * b + - 90 * a * b^4 + - 58 * a^3 * b * c + - 79 * a^2 * b^2 * c + - 44 * a * b^3 * c + - 57 * a^3 * c^2 + - 32 * a * b^2 * c^2 + - 10 * a^2 * c^3 + - 34 * a * b * c^3 + - 55 * b * c^4 + - 60 * a^4 * d + - 62 * a^3 * b * d + - 29 * a^2 * b^2 * d + - 12 * a * b^3 * d + - 56 * b^4 * d + - 76 * a^3 * c * d + - 15 * a^2 * b * c * d + - 30 * a * b^2 * c * d + - 25 * b^3 * c * d + - 35 * a^2 * c^2 * d + - 84 * a * b * c^2 * d + - 23 * b^2 * c^2 * d + - 36 * a * c^3 * d + - 39 * b * c^3 * d + - 87 * c^4 * d + - 84 * a^3 * d^2 + - 54 * a^2 * b * d^2 + - 31 * a * b^2 * d^2 + - 90 * b^3 * d^2 + - 81 * a^2 * c * d^2 + - 17 * a * b * c * d^2 + - 45 * b * c^2 * d^2 + - 47 * c^3 * d^2 + - 29 * a * d^4 + - 42 * b * d^4 + - 31 * d^5, - 5 + - 37 * a + - 66 * c + - 29 * b^2 + - 55 * a * c + - 78 * c * d + - 81 * d^2 + - 11 * a * b^2 + - 4 * a^2 * c + - 80 * a * b * c + - 2 * b^2 * c + - 69 * a * c^2 + - 25 * a^2 * d + - 36 * a * b * d + - 21 * a * c * d + - 19 * b * c * d + - 28 * a * d^2 + - 81 * d^3 + - 77 * a^4 + - 24 * a^3 * b + - 51 * a^2 * b^2 + - 27 * b^3 * c + - 88 * a^2 * c^2 + - 14 * b * c^3 + - 71 * a^3 * d + - 75 * a^2 * b * d + - 2 * a * b^2 * d + - 11 * a * b * c * d + - 53 * b^2 * c * d + - 84 * b * c^2 * d + - 44 * c^3 * d + - 69 * a * c * d^2 + - 11 * b * c * d^2 + - 61 * d^4 + - 82 * a^2 * b^3 + - 62 * a * b^4 + - 31 * a^4 * c + - 69 * a^3 * b * c + - 47 * a * b^3 * c + - 50 * b^4 * c + - 47 * b^3 * c^2 + - 38 * a^2 * c^3 + - 17 * a * b * c^3 + - 70 * b^2 * c^3 + - 90 * b * c^4 + - 15 * b^4 * d + - 26 * a^3 * c * d + - 73 * a^2 * b * c * d + - 49 * a * b^2 * c * d + - 78 * b^3 * c * d + - 53 * a^2 * c^2 * d + - 69 * a^2 * c * d^2 + - 56 * b * c^2 * d^2 + - 2 * a^2 * d^3 + - 44 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 54 + - 80 * a + - 61 * d + - 64 * a * b + - 22 * b^2 + - 42 * a * d + - 60 * c * d + - 76 * d^2 + - 5 * a^3 + - 90 * a^2 * b + - 15 * a^2 * c + - 23 * a * b * c + - 17 * b^2 * c + - 69 * c^3 + - 79 * a^2 * d + - 31 * a * b * d + - 81 * a * c * d + - 34 * b * d^2 + - 10 * a^3 * b + - 11 * a^2 * b^2 + - 44 * a * b^3 + - 50 * b^4 + - 44 * a^2 * b * c + - 65 * a^2 * c^2 + - 68 * a * b * c^2 + - 53 * b^2 * c^2 + - 19 * a * c^3 + - 56 * b * c^3 + - 85 * a^2 * b * d + - 88 * a * b^2 * d + - 15 * b * c^2 * d + - 62 * a^2 * d^2 + - 30 * a * b * d^2 + - 86 * b^2 * d^2 + - 25 * b * c * d^2 + - 38 * c^2 * d^2 + - 15 * a * d^3 + - 45 * b * d^3 + - 13 * c * d^3 + - 38 * d^4 + - 38 * a^4 * b + - 32 * a^4 * c + - 79 * a^2 * b^2 * c + - 81 * b^4 * c + - 53 * a^3 * c^2 + - 42 * a * b^2 * c^2 + - 37 * a^2 * c^3 + - 39 * a * b * c^3 + - 49 * a * c^4 + - 85 * a^4 * d + - 53 * a^3 * b * d + - 77 * a * b^3 * d + - 30 * a^3 * c * d + - 62 * a^2 * b * c * d + - 70 * a * b^2 * c * d + - 6 * b^3 * c * d + - 62 * a^2 * c^2 * d + - 89 * a * b * c^2 * d + - 2 * b * c^3 * d + - 63 * a^3 * d^2 + - 11 * a * b^2 * d^2 + - 62 * a^2 * c * d^2 + - 22 * a * b * c * d^2 + - 26 * b^2 * c * d^2 + - 19 * a * c^2 * d^2 + - 63 * a^2 * d^3 + - 80 * c^2 * d^3 + - 39 * a * d^4, - 51 * a + - 15 * b + - 24 * d + - 16 * c^2 + - 29 * a * d + - 35 * a^2 * b + - 65 * a * b * c + - 86 * b^2 * c + - 46 * a * c^2 + - 52 * b * c^2 + - 18 * a^2 * d + - 15 * b^2 * d + - 68 * a * c * d + - 3 * b * d^2 + - 66 * c * d^2 + - 58 * d^3 + - 44 * a^4 + - 88 * a^3 * c + - 43 * a^2 * b * c + - 84 * a * b^2 * c + - 41 * b^3 * c + - 6 * a * c^3 + - 20 * b * c^3 + - 89 * a^2 * b * d + - 9 * b * c^2 * d + - 34 * a^2 * d^2 + - 76 * b^2 * d^2 + - 46 * a * c * d^2 + - 73 * c^2 * d^2 + - 73 * c * d^3 + - 32 * d^4 + - 40 * a^5 + - 48 * a^4 * b + - 46 * a * b^4 + - 7 * a^3 * b * c + - 80 * a^2 * b^2 * c + - 82 * b^4 * c + - 86 * a^3 * c^2 + - 86 * a^2 * b * c^2 + - 85 * a * b^2 * c^2 + - 84 * b^3 * c^2 + - 55 * a^2 * c^3 + - b^2 * c^3 + - 84 * a * c^4 + - 2 * b * c^4 + - 65 * c^5 + - 14 * a^4 * d + - 28 * a^3 * b * d + - a * b^3 * d + - 44 * b^4 * d + - 80 * a^2 * b * c * d + - 11 * a * b^2 * c * d + - 70 * b^3 * c * d + - 86 * a^2 * c^2 * d + - 43 * b^2 * c^2 * d + - 88 * c^4 * d + - 41 * a^2 * b * d^2 + - 5 * a * b^2 * d^2 + - 18 * a * b * c * d^2 + - 62 * b * c^2 * d^2 + - 35 * a^2 * d^3 + - 27 * a * d^4 + - 56 * b * d^4 + - 2 * d^5, - 31 + - 25 * b + - 81 * a * b + - 62 * b^2 + - 81 * a * c + - 89 * b * c + - 26 * c^2 + - 48 * a * d + - 22 * c * d + - 90 * d^2 + - 19 * b^3 + - 68 * a^2 * c + - 39 * a * b * c + - 11 * b^2 * c + - 5 * a * c^2 + - 23 * a^2 * d + - 82 * a * b * d + - 30 * c^2 * d + - 49 * a * d^2 + - 45 * a^2 * b^2 + - 78 * a^3 * c + - 46 * a^2 * b * c + - 77 * b^3 * c + - a * b * c^2 + - 66 * a^3 * d + - 56 * a^2 * b * d + - 14 * b^3 * d + - 11 * a^2 * c * d + - 2 * a * b * c * d + - 71 * b * c^2 * d + - 66 * a^2 * d^2 + - 41 * b^2 * d^2 + - 5 * b * d^3 + - 78 * c * d^3 + - 84 * d^4 + - 57 * a^5 + - 21 * a^3 * b^2 + - 36 * a^2 * b^3 + - 80 * b^5 + - 85 * a^4 * c + - 19 * a^2 * b^2 * c + - 19 * a * b^3 * c + - 68 * b * c^4 + - 52 * c^5 + - 76 * b^4 * d + - 22 * a^3 * c * d + - 24 * a^2 * b * c * d + - 17 * a * b^2 * c * d + - 25 * b^3 * c * d + - 6 * a * b * c^2 * d + - 43 * b^2 * c^2 * d + - 14 * a^3 * d^2 + - 9 * a * b^2 * d^2 + - 33 * b^2 * c * d^2 + - 45 * b * c^2 * d^2 + - 15 * c^3 * d^2 + - 26 * a^2 * d^3 + - 22 * a * c * d^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 50 + - 55 * a + - 62 * b + - 15 * c + - 75 * b^2 + - 49 * a * c + - 56 * b * c + - 74 * b * d + - 70 * d^2 + - 55 * a^3 + - 5 * a * b^2 + - 3 * b^3 + - 39 * a * c^2 + - 69 * a * c * d + - 52 * a * d^2 + - 62 * d^3 + - a^4 + - 71 * a^2 * b^2 + - 28 * a * b^3 + - 4 * a * b^2 * c + - 34 * b^2 * c^2 + - 23 * a * c^3 + - c^4 + - 46 * a^3 * d + - 52 * a * b^2 * d + - 60 * b^3 * d + - 52 * a * b * c * d + - 77 * b * c^2 * d + - 59 * b^2 * d^2 + - 35 * a * c * d^2 + - 86 * c^2 * d^2 + - 21 * b * d^3 + - 41 * a^5 + - 8 * a^4 * b + - 18 * a^3 * b^2 + - 37 * a^2 * b^3 + - 66 * a^4 * c + - 6 * a^3 * b * c + - 24 * a^2 * b * c^2 + - a * b^2 * c^2 + - 18 * b^2 * c^3 + - 50 * c^5 + - 19 * a^2 * b^2 * d + - 36 * a * b^3 * d + - 23 * b^4 * d + - 27 * a^2 * b * c * d + - 73 * b^3 * c * d + - 6 * a^2 * c^2 * d + - 53 * a * b * c^2 * d + - 55 * c^4 * d + - 6 * a^3 * d^2 + - 10 * a^2 * b * d^2 + - 84 * a * b^2 * d^2 + - 41 * a^2 * d^3 + - 5 * a * b * d^3 + - 57 * b^2 * d^3 + - 55 * b * d^4 + - 5 * c * d^4, - 62 + - 43 * a + - 20 * c + - 47 * a^2 + - 25 * b^2 + - 3 * a * c + - 49 * c^2 + - 53 * d^2 + - 65 * a^2 * b + - 65 * b^3 + - 56 * a * b * c + - 4 * b^2 * c + - 87 * b * c^2 + - 45 * c^3 + - 11 * a^2 * d + - 83 * a * b * d + - 73 * a * c * d + - 36 * b * c * d + - 36 * b * d^2 + - 86 * c * d^2 + - 70 * a^4 + - 20 * a^2 * b^2 + - 35 * a^3 * c + - 52 * a^2 * b * c + - 75 * b^3 * c + - a^2 * c^2 + - 9 * b * c^3 + - 89 * a^2 * b * d + - 44 * a * b^2 * d + - 66 * b^3 * d + - 2 * a^2 * c * d + - 35 * b^2 * c * d + - 55 * a * b * d^2 + - 26 * a * c * d^2 + - 31 * a * d^3 + - 56 * b * d^3 + - 23 * c * d^3 + - 24 * d^4 + - 67 * a^5 + - 36 * a^4 * b + - 8 * a * b^4 + - 86 * a^4 * c + - 29 * a^2 * b^2 * c + - 33 * b^4 * c + - 79 * a^2 * b * c^2 + - 41 * a * b^2 * c^2 + - 73 * b^3 * c^2 + - 74 * b^2 * c^3 + - 59 * a * c^4 + - 29 * b * c^4 + - 81 * a^4 * d + - 36 * a^3 * b * d + - 12 * a * b^3 * d + - 15 * a * b^2 * c * d + - 22 * b^3 * c * d + - 57 * c^4 * d + - 90 * a^3 * d^2 + - 3 * a * b^2 * d^2 + - 37 * b^2 * c * d^2 + - 43 * b * c^2 * d^2 + - 8 * a^2 * d^3 + - 41 * b^2 * d^3 + - 42 * a * c * d^3 + - 26 * c^2 * d^3 + - 8 * c * d^4, - 5 * b + - 48 * b * c + - 25 * c^2 + - 45 * a * d + - 71 * b * d + - 2 * c * d + - 16 * a^2 * b + - 22 * a * b^2 + - 35 * b^3 + - 39 * b^2 * c + - 5 * a * c^2 + - 30 * a^2 * d + - 40 * a * b * d + - 63 * b^2 * d + - 48 * a * c * d + - 17 * b * c * d + - 73 * c * d^2 + - 50 * a^3 * b + - 16 * a^2 * b^2 + - 36 * a * b^3 + - 83 * a^3 * c + - 15 * a^2 * b * c + - 67 * a * b^2 * c + - 9 * a^2 * c^2 + - 59 * b^2 * c^2 + - 29 * a * c^3 + - 28 * b * c^3 + - 39 * c^4 + - 62 * a^2 * c * d + - 72 * b^2 * c * d + - 25 * a * c^2 * d + - 76 * b * c^2 * d + - 33 * a * b * d^2 + - 59 * a * c * d^2 + - 10 * b * c * d^2 + - 83 * d^4 + - 55 * a^4 * b + - 50 * a^3 * b^2 + - 6 * a^2 * b^3 + - 43 * a * b^4 + - 10 * b^5 + - 80 * a^2 * b^2 * c + - 86 * a * b^3 * c + - 49 * b^4 * c + - 33 * a^2 * b * c^2 + - 31 * b * c^4 + - 58 * a^4 * d + - 89 * a^3 * b * d + - 83 * a^2 * b^2 * d + - 19 * a * b^3 * d + - 50 * b^4 * d + - 58 * a^3 * c * d + - 39 * a^2 * b * c * d + - 65 * b^3 * c * d + - 34 * a^2 * c^2 * d + - 59 * a * b * c^2 * d + - b^2 * c^2 * d + - 62 * a * c^3 * d + - 77 * a^3 * d^2 + - 45 * a^2 * b * d^2 + - 74 * a^2 * c * d^2 + - 87 * a * b * c * d^2 + - 10 * c^3 * d^2 + - 63 * a^2 * d^3 + - 80 * b * c * d^3 + - 83 * c^2 * d^3 + - 26 * c * d^4, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) - end - push!( - ideals, - Singular.Ideal( - R, - [ - 68 + - 63 * b + - 27 * c + - 83 * d + - 43 * a^2 + - 24 * a * b + - 34 * a * c + - 87 * b * c + - 27 * a * d + - 52 * b * d + - 78 * a^3 + - 22 * a^2 * b + - 28 * b^3 + - 75 * a * b * c + - 8 * a * c^2 + - 64 * a * c * d + - 24 * c^2 * d + - 22 * a * d^2 + - 89 * b * d^2 + - 17 * c * d^2 + - 8 * d^3 + - 81 * a^4 + - 8 * a^2 * b^2 + - 38 * b^4 + - 86 * a^3 * c + - 36 * a^2 * b * c + - 48 * b^3 * c + - 83 * a^2 * c^2 + - 43 * a * c^3 + - 44 * c^4 + - 65 * a * c^2 * d + - 85 * c^3 * d + - 25 * a^2 * d^2 + - 40 * a * b * d^2 + - 49 * a * c * d^2 + - 53 * b * c * d^2 + - 19 * c^2 * d^2 + - 89 * d^4 + - 86 * a^5 + - 34 * a^4 * b + - 88 * a * b^4 + - b^5 + - 89 * a^4 * c + - 31 * b^4 * c + - 70 * a * b^2 * c^2 + - 84 * b^3 * c^2 + - 74 * a * b * c^3 + - 43 * a * c^4 + - 30 * b * c^4 + - 53 * a^4 * d + - 8 * a^3 * b * d + - 2 * a^2 * b^2 * d + - 83 * b^4 * d + - 50 * a^3 * c * d + - 78 * a * b * c^2 * d + - 42 * b^2 * c^2 * d + - 68 * a * c^3 * d + - 31 * b * c^3 * d + - 66 * c^4 * d + - 42 * a^3 * d^2 + - 86 * a^2 * b * d^2 + - 42 * a * b^2 * d^2 + - 74 * a^2 * c * d^2 + - 7 * a * b * c * d^2 + - 67 * a * c^2 * d^2 + - 2 * c^3 * d^2 + - 23 * a * b * d^3 + - 40 * b^2 * d^3 + - 51 * a * c * d^3 + - 23 * a * d^4 + - 44 * c * d^4, - 64 + - 22 * b + - 57 * c + - 49 * a^2 + - 86 * a * b + - 49 * b * c + - 39 * c^2 + - 37 * a * d + - 89 * c * d + - 51 * a^2 * b + - 89 * a^2 * c + - 43 * a * b * c + - 7 * b^2 * c + - 21 * b * c^2 + - 79 * a * c * d + - 13 * b * c * d + - 26 * c^2 * d + - 52 * a * d^2 + - 31 * c * d^2 + - 27 * d^3 + - 12 * a^3 * b + - 36 * a^2 * b^2 + - 8 * a * b^3 + - 4 * b^4 + - 39 * a^3 * c + - 9 * a^2 * b * c + - 81 * a * b^2 * c + - 75 * b^3 * c + - 18 * a^2 * c^2 + - 80 * b^2 * c^2 + - 64 * a * c^3 + - 26 * b * c^3 + - 50 * c^4 + - 15 * a^2 * b * d + - 31 * a * b^2 * d + - 73 * a^2 * c * d + - 45 * a * c^2 * d + - 62 * b * c^2 * d + - 19 * c^3 * d + - 49 * a^2 * d^2 + - 34 * a * b * d^2 + - 50 * b^2 * d^2 + - 36 * c^2 * d^2 + - 18 * a * d^3 + - 84 * d^4 + - 74 * a^5 + - 54 * a^4 * b + - 14 * a^3 * b^2 + - 56 * b^5 + - 71 * a^2 * b^2 * c + - 29 * a * b^3 * c + - 31 * a^3 * c^2 + - 6 * a * b^2 * c^2 + - 67 * a^2 * c^3 + - 82 * c^5 + - 30 * a^4 * d + - 86 * a^3 * b * d + - 46 * a * b^3 * d + - 47 * a^2 * b * c * d + - 4 * a * b^2 * c * d + - 76 * a^2 * c^2 * d + - 86 * a * b * c^2 * d + - b^2 * c^2 * d + - 2 * a * c^3 * d + - 21 * b * c^3 * d + - 34 * a^2 * b * d^2 + - 56 * a^2 * c * d^2 + - 15 * a * b * c * d^2 + - 12 * c^3 * d^2 + - a^2 * d^3 + - 74 * a * b * d^3 + - 29 * b^2 * d^3 + - 8 * c^2 * d^3 + - 34 * a * d^4 + - 24 * b * d^4 + - 79 * c * d^4, - 89 * a + - 87 * c + - 32 * d + - 54 * a^2 + - 20 * b^2 + - 60 * a * c + - 68 * c^2 + - 14 * c * d + - 70 * d^2 + - 54 * a^3 + - 87 * a * b^2 + - 59 * b^3 + - 82 * a^2 * c + - 72 * a * b * c + - 80 * b^2 * c + - 47 * b * c^2 + - 76 * c^3 + - 61 * b^2 * d + - 64 * a * c * d + - 12 * a * d^2 + - 42 * b * d^2 + - 48 * c * d^2 + - 83 * d^3 + - 72 * a^2 * b^2 + - 12 * a * b^2 * c + - 85 * a^2 * c^2 + - 13 * b^2 * c^2 + - 5 * b * c^3 + - 44 * c^4 + - 6 * a^3 * d + - 80 * a^2 * b * d + - 58 * a * b^2 * d + - 52 * b^3 * d + - 12 * a * b * c * d + - 12 * b^2 * c * d + - 66 * a * c^2 * d + - 9 * b * c^2 * d + - 63 * c^3 * d + - 85 * a^2 * d^2 + - 36 * a * c * d^2 + - 15 * b * c * d^2 + - 45 * b * d^3 + - 57 * c * d^3 + - 72 * d^4 + - 78 * a^4 * b + - 13 * a^2 * b^3 + - 38 * a * b^4 + - 59 * a^4 * c + - 60 * a^3 * b * c + - 18 * a * b^3 * c + - 78 * b^4 * c + - 59 * a^3 * c^2 + - 73 * a * b^2 * c^2 + - 89 * b^3 * c^2 + - 48 * a * b * c^3 + - 29 * b^2 * c^3 + - 24 * a * c^4 + - 78 * b * c^4 + - 76 * a^4 * d + - 56 * a^3 * b * d + - 27 * a^2 * b^2 * d + - 58 * b^4 * d + - 71 * a^3 * c * d + - 89 * a^2 * b * c * d + - 48 * a * b^2 * c * d + - 28 * b^3 * c * d + - 15 * a^2 * c^2 * d + - 20 * b^2 * c^2 * d + - 39 * c^4 * d + - 29 * a^3 * d^2 + - 88 * a^2 * b * d^2 + - 39 * a * b^2 * d^2 + - 74 * b^3 * d^2 + - 11 * a * b * c * d^2 + - 13 * b^2 * c * d^2 + - 50 * b * c^2 * d^2 + - 41 * a^2 * d^3 + - 51 * b^2 * d^3 + - 25 * c^2 * d^3 + - 32 * b * d^4 + - 45 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 88 * a + - 73 * c + - 42 * a * b + - 89 * a * c + - 66 * d^2 + - 89 * a^3 + - 21 * a * b^2 + - 6 * a^2 * c + - 34 * a * b * c + - 10 * b^2 * c + - 34 * b * c^2 + - 78 * c^2 * d + - 37 * a * d^2 + - 80 * c * d^2 + - 66 * a^4 + - 86 * a^3 * b + - 89 * a^2 * b^2 + - 90 * b^4 + - 79 * a^3 * c + - 50 * a^2 * b * c + - 54 * b^3 * c + - 26 * a^2 * c^2 + - 15 * a * b * c^2 + - 54 * b^2 * c^2 + - 47 * a * c^3 + - 53 * a^3 * d + - 49 * a^2 * b * d + - 84 * a * b^2 * d + - 25 * b^3 * d + - 88 * a * b * c * d + - 75 * b^2 * c * d + - 68 * a * c^2 * d + - 35 * b * c^2 * d + - 2 * a^2 * d^2 + - 43 * b * c * d^2 + - 61 * c^2 * d^2 + - 66 * d^4 + - 76 * a^5 + - 71 * a^3 * b^2 + - 34 * a * b^4 + - 9 * b^5 + - 89 * a^4 * c + - 80 * a^3 * b * c + - 8 * a * b^3 * c + - 4 * b^4 * c + - 68 * a^3 * c^2 + - 84 * a^2 * b * c^2 + - 46 * a * b^2 * c^2 + - 40 * b^3 * c^2 + - 41 * a^2 * c^3 + - 57 * a * b * c^3 + - 76 * b^2 * c^3 + - 66 * b * c^4 + - 90 * a^4 * d + - 87 * a * b^3 * d + - 31 * b^4 * d + - 71 * b^3 * c * d + - 67 * b^2 * c^2 * d + - 75 * a * c^3 * d + - 64 * b * c^3 * d + - 84 * c^4 * d + - 79 * a^2 * b * d^2 + - 52 * c^3 * d^2 + - 65 * a^2 * d^3 + - 41 * a * b * d^3 + - 12 * b^2 * d^3 + - 7 * b * c * d^3 + - 22 * a * d^4, - 8 + - 73 * b + - 64 * d + - 55 * a^2 + - 10 * a * b + - 77 * b^2 + - 74 * a * c + - b * c + - 82 * c^2 + - 12 * a * d + - 38 * b^3 + - 27 * a^2 * c + - 37 * b * c^2 + - 72 * a^2 * d + - 61 * a * b * d + - 56 * a * c * d + - 29 * b * c * d + - 32 * c^2 * d + - 90 * a * d^2 + - 38 * b * d^2 + - 49 * c * d^2 + - 11 * a^4 + - 71 * a^2 * b^2 + - 25 * a * b^3 + - 57 * b^4 + - 40 * a^2 * b * c + - 19 * b^3 * c + - 87 * a^2 * c^2 + - 23 * a * b * c^2 + - 6 * b^2 * c^2 + - 55 * b * c^3 + - 20 * a^3 * d + - 74 * a^2 * b * d + - 84 * b^3 * d + - 51 * a^2 * c * d + - 12 * a * b * c * d + - 42 * a * c^2 * d + - 57 * c^3 * d + - 83 * a^2 * d^2 + - 60 * b * c * d^2 + - 22 * c^2 * d^2 + - 23 * a^5 + - 44 * a^3 * b^2 + - 80 * a^2 * b^3 + - 88 * a * b^4 + - 18 * b^5 + - 37 * a * b^3 * c + - 59 * a^3 * c^2 + - 47 * a^2 * b * c^2 + - 8 * a * b^2 * c^2 + - 20 * b^3 * c^2 + - 33 * a^4 * d + - 30 * a^3 * b * d + - 49 * a^2 * b^2 * d + - 31 * a * b^3 * d + - 25 * b^4 * d + - 32 * a^2 * b * c * d + - 86 * a * b^2 * c * d + - 36 * b^3 * c * d + - 74 * a * b * c^2 * d + - 86 * b^2 * c^2 * d + - 45 * a * c^3 * d + - 87 * b * c^3 * d + - 47 * c^4 * d + - 40 * a^3 * d^2 + - 10 * a^2 * b * d^2 + - 81 * a * b^2 * d^2 + - 69 * b^3 * d^2 + - 14 * b^2 * c * d^2 + - 44 * b * c^2 * d^2 + - 33 * a^2 * d^3 + - 60 * b^2 * d^3 + - 10 * a * c * d^3 + - 88 * b * c * d^3 + - 68 * c^2 * d^3 + - 55 * a * d^4 + - 16 * b * d^4 + - 62 * d^5, - 31 + - 72 * a + - 75 * b + - 19 * c + - 53 * d + - 54 * a^2 + - 23 * a * b + - 41 * a * c + - 3 * b * c + - 28 * c^2 + - 33 * a * d + - 4 * b * d + - 21 * c * d + - 22 * a^3 + - 21 * a^2 * b + - 54 * a * b^2 + - 47 * a^2 * c + - 30 * b^2 * c + - 19 * a * c^2 + - 71 * c^3 + - 71 * a^2 * d + - 61 * b^2 * d + - 73 * a * c * d + - 18 * b * c * d + - 87 * c^2 * d + - 3 * a * d^2 + - 7 * b * d^2 + - 22 * c * d^2 + - 46 * d^3 + - 80 * b^4 + - 66 * a^3 * c + - 76 * a * b^2 * c + - 43 * b^3 * c + - 52 * a * b * c^2 + - 50 * b^2 * c^2 + - 38 * a * c^3 + - 11 * c^4 + - 59 * a * b^2 * d + - 34 * b^3 * d + - 15 * a^2 * c * d + - 58 * a * b * c * d + - 5 * b^2 * c * d + - 73 * b * c^2 * d + - 88 * c^3 * d + - 42 * a^2 * d^2 + - 82 * a * b * d^2 + - 90 * b^2 * d^2 + - 29 * a * d^3 + - 12 * d^4 + - 8 * a * b^4 + - 61 * b^5 + - 82 * a^3 * b * c + - 20 * a * b^3 * c + - 46 * b^4 * c + - 53 * a^3 * c^2 + - 65 * a * b^2 * c^2 + - 86 * b^3 * c^2 + - 59 * a^2 * c^3 + - 31 * b^2 * c^3 + - 16 * a * c^4 + - 64 * b * c^4 + - 12 * a^3 * b * d + - 20 * a^2 * b^2 * d + - 27 * a^2 * b * c * d + - 85 * a * b^2 * c * d + - 88 * a^2 * c^2 * d + - 85 * a * b * c^2 * d + - 58 * b^2 * c^2 * d + - 85 * a * c^3 * d + - 9 * b * c^3 * d + - 49 * a^2 * b * d^2 + - 90 * a * b^2 * d^2 + - 16 * b^3 * d^2 + - 27 * a^2 * c * d^2 + - 83 * b^2 * c * d^2 + - 73 * a * c^2 * d^2 + - 2 * b * c^2 * d^2 + - 44 * c^3 * d^2 + - 56 * b * c * d^3 + - 79 * c^2 * d^3 + - 88 * a * d^4 + - 3 * c * d^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 72 + - 8 * a + - 37 * b + - 30 * c + - 7 * d + - 73 * a^2 + - 56 * b^2 + - 53 * a * c + - 83 * b * c + - 19 * c^2 + - 33 * b * d + - 57 * a^2 * b + - 8 * b^3 + - 80 * a * b * c + - 33 * a * c^2 + - 53 * a^2 * d + - 65 * a * b * d + - 46 * b^2 * d + - 84 * a * c * d + - 7 * b * c * d + - 53 * c^2 * d + - 83 * b * d^2 + - 16 * a^4 + - 68 * a^3 * b + - 26 * a * b^3 + - 38 * a^2 * b * c + - 79 * a * b^2 * c + - 41 * b^3 * c + - 8 * a^2 * c^2 + - 77 * a * b * c^2 + - 68 * b^2 * c^2 + - 46 * a * c^3 + - 46 * b * c^3 + - 18 * a^2 * b * d + - 31 * b^3 * d + - 62 * a * b * c * d + - 14 * a * c^2 * d + - 58 * a * b * d^2 + - 73 * b * c * d^2 + - 71 * a * d^3 + - 56 * d^4 + - 56 * a^5 + - 25 * a^3 * b^2 + - 74 * a^2 * b^3 + - 63 * b^5 + - 89 * a^3 * b * c + - 43 * a * b^3 * c + - 83 * b^4 * c + - 82 * a^3 * c^2 + - 68 * a^2 * b * c^2 + - 30 * a * b^2 * c^2 + - 44 * b^3 * c^2 + - 30 * a^2 * c^3 + - 46 * a * b * c^3 + - 36 * a * c^4 + - 31 * c^5 + - 64 * a^4 * d + - 49 * a^3 * b * d + - 4 * a^2 * b^2 * d + - 11 * a * b^3 * d + - 32 * a^2 * b * c * d + - 12 * a * b^2 * c * d + - 60 * b^3 * c * d + - 66 * a * b * c^2 * d + - 80 * b^2 * c^2 * d + - 44 * b^3 * d^2 + - 57 * a^2 * c * d^2 + - 28 * b * c^2 * d^2 + - 70 * c^3 * d^2 + - 85 * a^2 * d^3 + - 32 * b * c * d^3, - 46 + - 25 * a + - 50 * a^2 + - 82 * a * b + - 72 * b^2 + - 53 * a * c + - 19 * c^2 + - 67 * a * d + - 67 * b * d + - 21 * a^2 * b + - 70 * a^2 * c + - 49 * a * b * c + - 53 * b^2 * c + - 67 * a * c^2 + - 40 * b * c^2 + - 5 * a^2 * d + - 71 * a * b * d + - 36 * b * c * d + - 50 * c^2 * d + - 72 * a * d^2 + - 24 * b * d^2 + - 78 * c * d^2 + - 42 * a^4 + - 53 * a^2 * b^2 + - 76 * a * b^3 + - 56 * b^4 + - 41 * a^3 * c + - 39 * a^2 * b * c + - 3 * a * b^2 * c + - 85 * a^2 * c^2 + - 32 * a * b * c^2 + - 9 * b^2 * c^2 + - 60 * b * c^3 + - 57 * a^2 * b * d + - 40 * b^3 * d + - 64 * b^2 * c * d + - 2 * a * c^2 * d + - 49 * b * c^2 * d + - 12 * a * b * d^2 + - 18 * a * c * d^2 + - 78 * c^2 * d^2 + - 8 * b * d^3 + - 25 * d^4 + - 35 * a^5 + - 37 * a^4 * b + - 51 * a^2 * b^3 + - 45 * a * b^4 + - 59 * b^5 + - 64 * a^4 * c + - 18 * a^3 * b * c + - 26 * a^2 * b^2 * c + - 60 * b^4 * c + - 85 * a^2 * b * c^2 + - 36 * a^2 * c^3 + - 33 * a * b * c^3 + - b^2 * c^3 + - 71 * a * c^4 + - 82 * a^3 * b * d + - 11 * a * b^3 * d + - 81 * a^3 * c * d + - 82 * a * b^2 * c * d + - 10 * a^2 * c^2 * d + - 75 * b^2 * c^2 * d + - 79 * a * c^3 * d + - 21 * b * c^3 * d + - 72 * c^4 * d + - 60 * a^3 * d^2 + - 13 * a^2 * b * d^2 + - 31 * a * b^2 * d^2 + - 68 * b^3 * d^2 + - 44 * a^2 * c * d^2 + - 69 * a * b * c * d^2 + - 66 * b^2 * c * d^2 + - 78 * b * c^2 * d^2 + - 76 * c^3 * d^2 + - 41 * b^2 * d^3 + - 5 * a * c * d^3 + - 78 * b * c * d^3 + - 80 * c * d^4 + - 5 * d^5, - 58 * a + - 80 * b + - 84 * d + - 11 * a^2 + - 87 * b^2 + - 33 * c^2 + - 36 * b * d + - 3 * c * d + - 8 * a^3 + - 32 * a * b^2 + - 74 * a^2 * c + - 50 * a * b * c + - 47 * b * c^2 + - 25 * c^3 + - 38 * a * b * d + - 77 * a * c * d + - 63 * a * d^2 + - 44 * b * d^2 + - 52 * c * d^2 + - 73 * d^3 + - 77 * a^3 * b + - 69 * a * b^3 + - 35 * a^3 * c + - 74 * a^2 * b * c + - 68 * a * b^2 * c + - 27 * b^3 * c + - 61 * a^2 * c^2 + - 67 * a * b * c^2 + - 50 * b^2 * c^2 + - 84 * a * c^3 + - 88 * b * c^3 + - 76 * c^4 + - 30 * a^3 * d + - 38 * b^2 * c * d + - 87 * a * c^2 * d + - 16 * c^3 * d + - 89 * a^2 * d^2 + - 35 * b^2 * d^2 + - 11 * b * c * d^2 + - 66 * c^2 * d^2 + - 8 * b * d^3 + - 2 * c * d^3 + - 43 * d^4 + - 28 * a^4 * b + - 18 * a * b^4 + - 63 * a^4 * c + - 68 * a^2 * b^2 * c + - 89 * a * b^3 * c + - 75 * a^3 * c^2 + - 78 * a * b^2 * c^2 + - 4 * b^3 * c^2 + - 68 * a^2 * c^3 + - 82 * a * b * c^3 + - 28 * b^2 * c^3 + - 87 * b * c^4 + - 36 * c^5 + - 44 * a^3 * b * d + - 69 * a^2 * b^2 * d + - 52 * a * b^3 * d + - 15 * b^4 * d + - 60 * a^3 * c * d + - 82 * a^2 * b * c * d + - 55 * b^3 * c * d + - 54 * a^2 * c^2 * d + - 18 * a * b * c^2 * d + - 8 * b * c^3 * d + - 64 * c^4 * d + - 66 * a^3 * d^2 + - 33 * b^3 * d^2 + - 45 * a^2 * c * d^2 + - 66 * a * c^2 * d^2 + - 61 * a * b * d^3 + - 57 * a * c * d^3 + - 54 * b * c * d^3 + - 13 * c^2 * d^3 + - 17 * a * d^4 + - 15 * d^5, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) - - end - push!( - ideals, - Singular.Ideal( - R, - [ - 34 + - 16 * b + - 80 * a * b + - 15 * a * c + - 18 * a * d + - 29 * b * d + - 7 * c * d + - 77 * d^2 + - 60 * a^3 + - 44 * a^2 * b + - 41 * a * b^2 + - 8 * b^3 + - 70 * a^2 * c + - 80 * a * b * c + - 42 * b^2 * c + - 60 * b * c^2 + - 3 * c^3 + - 89 * a^2 * d + - 68 * a * b * d + - 65 * b^2 * d + - 12 * a * c * d + - 2 * b * c * d + - 6 * c^2 * d + - 17 * a * d^2 + - 29 * b * d^2 + - 18 * c * d^2 + - 25 * a^4 + - 70 * a^3 * b + - 19 * a^2 * b^2 + - 88 * a * b^3 + - 23 * b^4 + - 17 * a^2 * b * c + - 84 * a * b^2 * c + - 40 * b^3 * c + - 39 * a^2 * c^2 + - 48 * a * b * c^2 + - 18 * a^2 * b * d + - 30 * a * b^2 * d + - 43 * b^3 * d + - 30 * a^2 * c * d + - 74 * b^2 * c * d + - 16 * b * c^2 * d + - 7 * a^2 * d^2 + - 62 * a * b * d^2 + - 79 * b^2 * d^2 + - 67 * a * c * d^2 + - 60 * b * c * d^2 + - 88 * c^2 * d^2 + - 31 * a * d^3 + - 67 * b * d^3 + - 72 * c * d^3 + - 64 * d^4 + - 66 * a^5 + - 43 * a^3 * b^2 + - 90 * a^2 * b^3 + - 49 * b^5 + - 32 * a^4 * c + - 41 * a^3 * b * c + - 66 * a * b^3 * c + - 36 * b^4 * c + - 24 * a^3 * c^2 + - 15 * a^2 * b * c^2 + - 44 * a * b^2 * c^2 + - 47 * b^3 * c^2 + - 81 * a * b * c^3 + - 11 * b^2 * c^3 + - 29 * a * c^4 + - 45 * c^5 + - 22 * a^4 * d + - 50 * a^3 * b * d + - a^2 * b^2 * d + - 59 * b^4 * d + - 15 * a^2 * b * c * d + - 31 * b^3 * c * d + - 74 * a^2 * c^2 * d + - 29 * a * b * c^2 * d + - 44 * b^2 * c^2 * d + - 26 * a * c^3 * d + - 30 * b * c^3 * d + - 18 * c^4 * d + - 78 * a^2 * b * d^2 + - 35 * a * b^2 * d^2 + - 61 * b^2 * c * d^2 + - 24 * a * c^2 * d^2 + - 68 * b * c^2 * d^2 + - 59 * a * b * d^3 + - 54 * b^2 * d^3 + - 21 * a * c * d^3 + - 82 * b * c * d^3 + - 49 * c^2 * d^3 + - 11 * b * d^4 + - 65 * d^5, - 31 + - 6 * a + - 89 * b + - 41 * c + - 62 * d + - 47 * a^2 + - 58 * b^2 + - 31 * b * c + - 62 * c^2 + - 76 * a * d + - 5 * b * d + - 21 * c * d + - 71 * a^3 + - 13 * a^2 * b + - 51 * a * b^2 + - 75 * a^2 * c + - 15 * a * b * c + - 71 * b^2 * c + - 9 * b * c^2 + - 36 * a * c * d + - 89 * c^2 * d + - 70 * a * d^2 + - 88 * b * d^2 + - 35 * d^3 + - 78 * a^4 + - 27 * a^3 * b + - 28 * a^2 * b^2 + - 42 * a * b^3 + - 18 * b^4 + - 40 * a^3 * c + - 34 * b^3 * c + - 61 * a * b * c^2 + - 79 * b^2 * c^2 + - 59 * a^2 * b * d + - 58 * a * c^2 * d + - 19 * b * c^2 * d + - 48 * c^3 * d + - 49 * a * b * d^2 + - 22 * b^2 * d^2 + - 68 * b * c * d^2 + - 60 * c^2 * d^2 + - 77 * a * d^3 + - 25 * b * d^3 + - 49 * c * d^3 + - 8 * d^4 + - 32 * a^5 + - 43 * a^4 * b + - 47 * a^2 * b^3 + - 44 * a * b^4 + - 43 * a^4 * c + - 16 * a^3 * b * c + - 89 * a^2 * b^2 * c + - 16 * a * b^3 * c + - 35 * a^3 * c^2 + - 51 * a^2 * c^3 + - 12 * a * b * c^3 + - 62 * a * c^4 + - 10 * a^4 * d + - 22 * a^3 * b * d + - 60 * a * b^3 * d + - 75 * b^4 * d + - 86 * b^3 * c * d + - 88 * a^2 * c^2 * d + - 34 * a * b * c^2 * d + - 54 * b^2 * c^2 * d + - 80 * a * c^3 * d + - 13 * c^4 * d + - 52 * a^3 * d^2 + - 9 * a^2 * b * d^2 + - 28 * b^3 * d^2 + - 12 * a^2 * c * d^2 + - 86 * a * b * c * d^2 + - 36 * b^2 * c * d^2 + - 8 * a * c^2 * d^2 + - 87 * c^3 * d^2 + - 64 * a * b * d^3 + - 85 * b^2 * d^3 + - 81 * a * c * d^3 + - 2 * b * c * d^3 + - 87 * c^2 * d^3 + - 16 * b * d^4 + - 19 * c * d^4, - 8 + - 52 * a + - 34 * b + - 51 * c + - 34 * d + - 57 * a^2 + - 88 * a * b + - 20 * b^2 + - 32 * c^2 + - 56 * a * d + - 51 * b * d + - 88 * c * d + - 34 * d^2 + - 84 * a^2 * b + - 23 * a * b^2 + - 37 * b * c^2 + - 35 * c^3 + - 41 * a * b * d + - 32 * b^2 * d + - 14 * a * c * d + - 17 * c^2 * d + - 40 * a * d^2 + - 29 * b * d^2 + - 81 * c * d^2 + - 70 * d^3 + - 90 * a^4 + - 57 * a^3 * b + - 83 * a^2 * b^2 + - 64 * a * b^3 + - 41 * b^4 + - 23 * a^3 * c + - 10 * a * b^2 * c + - 87 * b^3 * c + - 88 * a^2 * c^2 + - 74 * a * c^3 + - 23 * a^3 * d + - 20 * a^2 * b * d + - 46 * a * b^2 * d + - 2 * b^3 * d + - 16 * a^2 * c * d + - 31 * a * b * c * d + - 64 * b^2 * c * d + - 64 * a * c^2 * d + - 57 * b * c^2 * d + - 40 * c^3 * d + - 38 * a^2 * d^2 + - 69 * a * b * d^2 + - 18 * b^2 * d^2 + - 18 * b * c * d^2 + - 4 * c^2 * d^2 + - 25 * b * d^3 + - 46 * d^4 + - 72 * a^3 * b^2 + - 67 * a^2 * b^3 + - 32 * a * b^4 + - 13 * b^5 + - 79 * a^4 * c + - 40 * a^3 * b * c + - 2 * b^4 * c + - 18 * a^3 * c^2 + - 77 * a^2 * b * c^2 + - 45 * a * b^2 * c^2 + - 78 * a^2 * c^3 + - 33 * a * b * c^3 + - 48 * a * c^4 + - 32 * b * c^4 + - 38 * c^5 + - 60 * a^4 * d + - 74 * a^3 * b * d + - 25 * a * b^3 * d + - 41 * b^4 * d + - 25 * a^3 * c * d + - 19 * a^2 * b * c * d + - 17 * a * b^2 * c * d + - 27 * a^2 * c^2 * d + - 13 * b^2 * c^2 * d + - 82 * a * c^3 * d + - 10 * b * c^3 * d + - 18 * a * b^2 * d^2 + - 25 * a * b * c * d^2 + - 56 * b^2 * c * d^2 + - 3 * c^3 * d^2 + - 62 * a^2 * d^3 + - 88 * a * b * d^3 + - 39 * b^2 * d^3 + - 80 * a * c * d^3 + - 90 * b * c * d^3 + - 49 * c^2 * d^3 + - 77 * a * d^4 + - 62 * b * d^4 + - 86 * c * d^4 + - 53 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 90 + - 79 * a + - 89 * b + - 65 * c + - 27 * d + - 64 * a * b + - 70 * b^2 + - 8 * b * c + - 58 * c^2 + - 47 * a * d + - 14 * b * d + - 21 * c * d + - 14 * d^2 + - 44 * a^3 + - 79 * a^2 * b + - 63 * a * b^2 + - 87 * b^3 + - 80 * a^2 * c + - 49 * a * b * c + - 89 * b * c^2 + - 33 * a * b * d + - 68 * b^2 * d + - 45 * a * c * d + - 85 * b * c * d + - 69 * c^2 * d + - 16 * b * d^2 + - 85 * c * d^2 + - 83 * d^3 + - 34 * a^4 + - 7 * a^3 * b + - 3 * a^2 * b^2 + - 51 * b^4 + - 78 * a^3 * c + - 50 * a^2 * b * c + - 86 * a * b^2 * c + - 63 * a * c^3 + - 42 * b * c^3 + - 17 * c^4 + - 6 * a^3 * d + - 40 * a^2 * b * d + - 69 * b^3 * d + - 2 * a^2 * c * d + - 90 * a * b * c * d + - 48 * b^2 * c * d + - 38 * a * c^2 * d + - 36 * c^3 * d + - 33 * a^2 * d^2 + - 38 * a * b * d^2 + - 22 * b^2 * d^2 + - 77 * a * c * d^2 + - 27 * c^2 * d^2 + - 40 * a * d^3 + - 80 * b * d^3 + - 23 * d^4 + - 17 * a^5 + - 37 * a^4 * b + - 79 * a^3 * b^2 + - 29 * a^2 * b^3 + - 80 * a * b^4 + - 66 * b^5 + - 5 * a^4 * c + - 53 * a^2 * b^2 * c + - 41 * a * b^3 * c + - 13 * b^4 * c + - 15 * a^3 * c^2 + - 19 * a^2 * b * c^2 + - 19 * a * b^2 * c^2 + - 76 * b^3 * c^2 + - 78 * a^2 * c^3 + - 36 * b^2 * c^3 + - 67 * a^3 * b * d + - 7 * a^2 * b^2 * d + - 38 * a * b^3 * d + - 10 * a^3 * c * d + - 33 * a * b^2 * c * d + - 40 * a * b * c^2 * d + - 71 * a * c^3 * d + - 49 * c^4 * d + - 79 * a^3 * d^2 + - 43 * a^2 * b * d^2 + - 11 * a * b^2 * d^2 + - 87 * b^3 * d^2 + - 20 * a * b * c * d^2 + - 10 * a * c^2 * d^2 + - 89 * b * c^2 * d^2 + - 78 * a^2 * d^3 + - 4 * a * b * d^3 + - 81 * a * c * d^3 + - 70 * c^2 * d^3 + - 60 * a * d^4 + - 68 * b * d^4 + - 30 * c * d^4 + - 62 * d^5, - 67 + - 51 * a + - 90 * c + - 82 * d + - 33 * a * b + - 72 * b^2 + - 70 * b * c + - 10 * a * d + - 68 * c * d + - 35 * a^3 + - 62 * a^2 * b + - 40 * b^3 + - 11 * a * b * c + - 40 * b^2 * c + - 22 * b * c^2 + - 65 * c^3 + - 84 * a^2 * d + - 48 * a * b * d + - 12 * a * c * d + - 19 * b * c * d + - 31 * c^2 * d + - 43 * b * d^2 + - 13 * c * d^2 + - 68 * d^3 + - 27 * a^4 + - 54 * a^3 * b + - 28 * a^2 * b^2 + - 32 * b^4 + - 23 * b^3 * c + - 31 * a^2 * c^2 + - 30 * b^2 * c^2 + - 42 * a * c^3 + - 31 * b * c^3 + - 7 * a^2 * b * d + - 13 * a * b^2 * d + - 31 * b^3 * d + - 49 * a^2 * c * d + - 26 * b^2 * c * d + - 84 * b * c^2 * d + - 64 * c^3 * d + - 42 * a^2 * d^2 + - 67 * a * c * d^2 + - 45 * b * c * d^2 + - 70 * c^2 * d^2 + - 33 * a * d^3 + - 17 * b * d^3 + - 83 * c * d^3 + - 61 * d^4 + - 69 * a^5 + - 5 * a^4 * b + - 76 * a^3 * b^2 + - 38 * a^2 * b^3 + - 31 * b^5 + - 45 * a^3 * b * c + - 76 * a^2 * b^2 * c + - 74 * a * b^3 * c + - 54 * b^4 * c + - 69 * a^3 * c^2 + - 41 * b^3 * c^2 + - 51 * a * b * c^3 + - 41 * a * c^4 + - 25 * b * c^4 + - 58 * c^5 + - 28 * a^4 * d + - 17 * a^2 * b^2 * d + - 62 * a * b^3 * d + - 26 * b^4 * d + - 29 * a^3 * c * d + - 78 * a^2 * b * c * d + - 75 * b^3 * c * d + - 41 * a^2 * c^2 * d + - 78 * a * b * c^2 * d + - 16 * b^2 * c^2 * d + - 33 * a * c^3 * d + - 90 * b * c^3 * d + - 80 * c^4 * d + - 30 * a * b^2 * d^2 + - 84 * b^3 * d^2 + - 59 * a^2 * c * d^2 + - 68 * a * b * c * d^2 + - 9 * c^3 * d^2 + - 80 * a^2 * d^3 + - 89 * a * b * d^3 + - 16 * a * c * d^3 + - 50 * b * c * d^3 + - 44 * c^2 * d^3 + - 38 * a * d^4 + - 90 * b * d^4 + - 72 * c * d^4, - 53 + - 37 * c + - 79 * a^2 + - 43 * a * b + - 83 * a * c + - 27 * b * c + - 11 * c^2 + - 5 * a * d + - b * d + - 83 * d^2 + - 28 * a^3 + - 57 * a^2 * b + - 88 * a * b^2 + - 4 * a * c^2 + - 74 * c^3 + - 35 * a^2 * d + - 5 * a * b * d + - 48 * b * c * d + - 59 * c^2 * d + - 24 * a * d^2 + - 23 * b * d^2 + - 16 * d^3 + - 42 * a^4 + - 86 * a^3 * b + - 39 * a * b^3 + - 79 * a^2 * b * c + - 87 * b^2 * c^2 + - 47 * b * c^3 + - 22 * c^4 + - 32 * a^3 * d + - 46 * a^2 * b * d + - 8 * a^2 * c * d + - 30 * b^2 * c * d + - 20 * b * c^2 * d + - 55 * c^3 * d + - 64 * a^2 * d^2 + - 54 * a * b * d^2 + - 59 * b^2 * d^2 + - 79 * a * c * d^2 + - 6 * b * c * d^2 + - 18 * c^2 * d^2 + - 72 * a * d^3 + - 47 * b * d^3 + - 41 * c * d^3 + - 67 * d^4 + - 42 * a^4 * b + - 25 * a^3 * b^2 + - 61 * a * b^4 + - 28 * a^4 * c + - 40 * a^3 * b * c + - 57 * a * b^3 * c + - 17 * b^4 * c + - 89 * a^2 * b * c^2 + - 32 * a * b^2 * c^2 + - 9 * b^3 * c^2 + - 60 * a^2 * c^3 + - 12 * a * b * c^3 + - 49 * b^2 * c^3 + - 11 * a * c^4 + - 47 * b * c^4 + - 7 * c^5 + - 15 * a^4 * d + - 38 * a^3 * b * d + - 61 * b^4 * d + - 63 * a^3 * c * d + - 8 * a * b^2 * c * d + - a^2 * c^2 * d + - 38 * a * b * c^2 * d + - 43 * b^2 * c^2 * d + - 69 * a * c^3 * d + - 72 * a * b^2 * d^2 + - 18 * b^3 * d^2 + - 75 * a^2 * c * d^2 + - 67 * a * b * c * d^2 + - 58 * b^2 * c * d^2 + - 13 * c^3 * d^2 + - 49 * a^2 * d^3 + - 37 * a * b * d^3 + - 36 * b^2 * d^3 + - 88 * a * c * d^3 + - 32 * b * c * d^3 + - 35 * b * d^4 + - 19 * d^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 45 + - 21 * a + - 90 * b + - 74 * c + - 57 * d + - 36 * a^2 + - 64 * a * b + - 89 * a * c + - 56 * b * c + - 35 * c^2 + - 11 * b * d + - 48 * c * d + - 72 * d^2 + - 70 * a^3 + - 13 * a^2 * b + - 43 * a * b^2 + - 30 * b^3 + - 53 * a^2 * c + - 37 * a * b * c + - 85 * a * c^2 + - 85 * c^3 + - 45 * a^2 * d + - 71 * a * b * d + - 64 * a * c * d + - 72 * b * c * d + - 11 * c^2 * d + - 83 * a * d^2 + - 68 * b * d^2 + - 30 * c * d^2 + - 30 * a^4 + - 79 * a^3 * b + - 54 * b^4 + - 19 * a^2 * b * c + - 68 * b^3 * c + - 52 * a * b * c^2 + - 39 * a * c^3 + - 2 * b * c^3 + - 54 * c^4 + - 65 * a^3 * d + - 43 * a^2 * b * d + - 57 * b^3 * d + - 85 * a^2 * c * d + - 88 * a * b * c * d + - 14 * a * c^2 * d + - 58 * c^3 * d + - 52 * a * c * d^2 + - 86 * b * c * d^2 + - 42 * c^2 * d^2 + - 74 * a * d^3 + - 3 * c * d^3 + - 27 * a^5 + - 41 * a^4 * b + - 22 * a^2 * b^3 + - 40 * a * b^4 + - 35 * b^5 + - 56 * a^4 * c + - 38 * a^3 * b * c + - 10 * a * b^3 * c + - 84 * b^4 * c + - 6 * a^3 * c^2 + - 43 * b^3 * c^2 + - 8 * a^2 * c^3 + - 24 * b^2 * c^3 + - 81 * c^5 + - 11 * a^2 * b^2 * d + - 73 * a * b^3 * d + - 64 * a^3 * c * d + - 58 * a^2 * b * c * d + - 32 * b^3 * c * d + - 47 * b^2 * c^2 * d + - 75 * b * c^3 * d + - 80 * c^4 * d + - 69 * a^3 * d^2 + - 72 * a^2 * b * d^2 + - 74 * b^3 * d^2 + - 75 * a^2 * c * d^2 + - 82 * a * c^2 * d^2 + - 48 * b * c^2 * d^2 + - 5 * c^3 * d^2 + - 54 * a^2 * d^3 + - 33 * a * b * d^3 + - 28 * a * c * d^3 + - 15 * b * c * d^3 + - 73 * c^2 * d^3 + - 37 * a * d^4 + - 9 * b * d^4 + - 39 * c * d^4 + - 19 * d^5, - 4 + - 14 * a + - 58 * b + - 30 * a^2 + - 75 * a * b + - 38 * b^2 + - 34 * a * c + - 81 * b * c + - 34 * c^2 + - 25 * a * d + - 19 * c * d + - 22 * a^3 + - 36 * a^2 * b + - 41 * a * b^2 + - 3 * b^3 + - 9 * a^2 * c + - 86 * b^2 * c + - 7 * a * c^2 + - 59 * a * b * d + - 64 * b^2 * d + - 67 * c^2 * d + - 3 * a * d^2 + - 5 * b * d^2 + - 8 * c * d^2 + - 31 * d^3 + - 84 * a^4 + - 16 * a^2 * b^2 + - 66 * b^4 + - 12 * a^3 * c + - 86 * a^2 * b * c + - 48 * a * b^2 * c + - 17 * b^3 * c + - 65 * a * c^3 + - 28 * c^4 + - 36 * a^3 * d + - 89 * a^2 * b * d + - 15 * b^3 * d + - 84 * a^2 * c * d + - 26 * a * b * c * d + - 3 * b^2 * c * d + - 54 * a * c^2 * d + - 46 * b * c^2 * d + - 80 * c^3 * d + - 71 * a^2 * d^2 + - 62 * a * b * d^2 + - 89 * b^2 * d^2 + - 36 * a * c * d^2 + - 49 * b * c * d^2 + - 71 * c^2 * d^2 + - 56 * a * d^3 + - 90 * b * d^3 + - 21 * d^4 + - 3 * a^3 * b^2 + - 2 * a^2 * b^3 + - 34 * a * b^4 + - 60 * b^5 + - 81 * a^3 * b * c + - 73 * a^2 * b^2 * c + - 32 * b^4 * c + - 60 * a^3 * c^2 + - 67 * a^2 * b * c^2 + - 29 * a * b^2 * c^2 + - 85 * a^2 * c^3 + - 20 * b^2 * c^3 + - 47 * a * c^4 + - 86 * b * c^4 + - 76 * c^5 + - 88 * a^4 * d + - 7 * a^3 * b * d + - 69 * a^2 * b^2 * d + - 57 * a * b^3 * d + - 44 * b^4 * d + - 31 * a^2 * b * c * d + - 63 * a * b^2 * c * d + - 22 * a^2 * c^2 * d + - 65 * a * b * c^2 * d + - 64 * b^2 * c^2 * d + - 59 * b * c^3 * d + - 30 * c^4 * d + - 54 * a^3 * d^2 + - 61 * a^2 * b * d^2 + - 32 * a * b^2 * d^2 + - 67 * b^3 * d^2 + - 68 * a^2 * c * d^2 + - 42 * a * b * c * d^2 + - 3 * a * c^2 * d^2 + - 84 * b * c^2 * d^2 + - 60 * c^3 * d^2 + - 58 * a^2 * d^3 + - 79 * a * b * d^3 + - 28 * a * d^4 + - 24 * b * d^4, - 31 + - 42 * b + - 12 * c + - 7 * d + - 75 * a^2 + - 73 * a * b + - 78 * c^2 + - 49 * a * d + - 13 * b * d + - 44 * a^3 + - 11 * a^2 * b + - 53 * a * b^2 + - 52 * b^3 + - 23 * b^2 * c + - 17 * c^3 + - 46 * a * b * d + - 54 * a * c * d + - 23 * b * c * d + - 17 * a * d^2 + - 53 * b * d^2 + - 59 * c * d^2 + - 89 * a^4 + - 83 * a^3 * b + - 59 * b^4 + - 24 * a^2 * b * c + - 45 * a * b^2 * c + - 74 * b^3 * c + - 76 * a^2 * c^2 + - 10 * a * b * c^2 + - 40 * b^2 * c^2 + - 29 * a * c^3 + - 19 * b * c^3 + - 3 * a^2 * b * d + - 54 * a * b^2 * d + - 14 * a * b * c * d + - 9 * b^2 * c * d + - 88 * a * c^2 * d + - 41 * c^3 * d + - 72 * a^2 * d^2 + - 44 * a * b * d^2 + - 76 * b^2 * d^2 + - 73 * a * c * d^2 + - 19 * b * c * d^2 + - 21 * c^2 * d^2 + - 70 * a * d^3 + - 16 * b * d^3 + - 3 * c * d^3 + - 9 * a^5 + - 57 * a^4 * b + - 75 * a^3 * b^2 + - 76 * a * b^4 + - 59 * a^4 * c + - 84 * a^3 * b * c + - 74 * a^2 * b^2 * c + - 50 * b^4 * c + - 38 * a^3 * c^2 + - 48 * a^2 * b * c^2 + - 30 * b^3 * c^2 + - 6 * a^2 * c^3 + - 89 * a * c^4 + - 64 * b * c^4 + - 86 * c^5 + - 87 * a^3 * b * d + - 7 * a^2 * b^2 * d + - 10 * a * b^3 * d + - 87 * b^4 * d + - 23 * a^2 * b * c * d + - 20 * a * b^2 * c * d + - 84 * b^3 * c * d + - 67 * a * b * c^2 * d + - 57 * b * c^3 * d + - 65 * c^4 * d + - 10 * a^3 * d^2 + - 62 * a^2 * b * d^2 + - 12 * a * b^2 * d^2 + - 17 * b^3 * d^2 + - 58 * a * b * c * d^2 + - 20 * b^2 * c * d^2 + - 37 * a * c^2 * d^2 + - 89 * b * c^2 * d^2 + - 2 * a^2 * d^3 + - 12 * a * b * d^3 + - 51 * b^2 * d^3 + - 65 * a * d^4 + - 9 * b * d^4 + - 84 * c * d^4 + - 41 * d^5, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) - end - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, - ) - df = DataFrame(a = ["test1"], b = ["test2"]) - savew(df, "correct.txt") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b]) - savea(df, "correct.txt") - end end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl index 099851511..578bef97b 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl @@ -1,9 +1,9 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("readWriteHelper.jl") -include("parser.jl") -include("runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") - +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") +include("readWriteHelper.jl") using DataFrames using CSV @@ -11,7 +11,8 @@ using CSV function benchmarkVar5() cd("/Users/JordiWelp/Results") prepare() - prepare() + prepare2() + prepareAlloc() dim = 5 ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(ve, :lex) @@ -24,6598 +25,225 @@ function benchmarkVar5() S = change_order(R, TarOrd) ideals = [] - push!( ideals, Singular.Ideal( - R, - [ - 41 + - 3 * a * d + - 12 * d * e + - 87 * a^2 * d + - 75 * b * c * e + - 89 * b * d * e + - 65 * a^3 * b + - 77 * b * c * d^2 + - 25 * c^2 * d^2 + - 41 * c * d^3 + - a * b * d * e + - 81 * c * d^2 * e + - 10 * d * e^3 + - 62 * a * c^4 + - 41 * a * b * c^2 * d + - 59 * b * c^2 * d^2 + - 25 * a * b^2 * c * e + - 26 * a * b * d^2 * e + - 50 * a * b^2 * e^2 + - 20 * a^2 * c * e^2 + - 75 * a * b * c * e^2 + - 68 * a * d^2 * e^2 + - 8 * b^2 * e^3 + - 48 * c * d * e^3, - 35 * a * b^2 + - 68 * b^2 * d + - 54 * d^3 + - 81 * b * c * e + - 53 * a * d * e + - 88 * a^3 * b + - 43 * a * c * d^2 + - 69 * b * c * d^2 + - 35 * c^2 * d * e + - 81 * a^2 * b^2 * c + - 13 * a^4 * d + - 30 * a * c^3 * d + - 27 * b * c * d^3 + - 29 * c * d^4 + - 19 * c^4 * e + - 67 * a * b^2 * d * e + - 45 * a * c * d^2 * e + - 64 * a * b^2 * e^2 + - 83 * a^2 * e^3 + - 68 * b * c * e^3 + - 16 * a * e^4 + - 52 * b * e^4, - 8 * a + - 45 * c + - 74 * a * c + - 36 * b * c + - 75 * a * d + - 56 * a * b * c + - 4 * a * c^2 + - 32 * a^2 * d + - 23 * a^3 * c + - 20 * a * b * c^2 + - 51 * a^2 * d^2 + - 8 * a^2 * b * e + - 60 * a * b * e^2 + - 39 * b^2 * e^2 + - 67 * a * c * e^2 + - 77 * b * c * e^2 + - 32 * d^2 * e^2 + - 77 * e^4 + - 50 * a^4 * b + - 63 * a * b^3 * c + - 77 * a^3 * c^2 + - 39 * a^3 * c * e + - 54 * a^2 * b * c * e + - 19 * b^3 * c * e + - 5 * a^3 * d * e + - 23 * a^2 * b * d * e + - 44 * a * b^2 * d * e + - 27 * a^2 * d^2 * e + - 36 * a * b * d^2 * e + - 34 * a^2 * b * e^2 + - 10 * c^3 * e^2 + - 19 * c^2 * e^3, - ], - ), - ) + R,[5*b*e^4, +14+16*b+37*a*b*d+88*a*e^2+20*c^2*e^2+83*a^2*b*c*e+19*b^2*d^2*e+41*b*e^4, +50*b^2+41*b*c^3+20*a*c*e^2])) + push!( + ideals, + Singular.Ideal( + R,[49*c^3*d+46*a^3*b*d+78*d^5, +12+73*b*d^2+82*a*d*e+90*b*c*e^2+67*b^3*c^2+73*b^2*c^2*e, +20*a+87*b*c+55*a^3*c])) + push!( + ideals, + Singular.Ideal( + R,[23*d^2*e, +68+5*b*c+46*b*c*d+61*b^4+69*b^3*e+23*b^2*c^3+9*d^4*e, +64*a+74*a*c*d^2+4*a*c^3*d+4*c*d*e^3])) + for i in ideals + runAll("sparseid(3,0,5,100-(1),90)", i, S, StartOrd, TarOrd) + end + ideals =[] + push!( + ideals, + Singular.Ideal( + R,[45*c*d^2+78*a*b*c*d+16*c*d^2*e+24*b^5+55*a^3*b*d+57*b^2*d^2*e, +89*b+80*a*d+59*b*d^2+31*e^3+40*c^3*d+29*a*b*d*e^2, +35+47*a*b*d^2+55*c*d^2*e+13*b^3*c^2+27*a*b*c*d^2+84*b^2*c*e^2+43*b*c*d*e^2])) +push!( + ideals, + Singular.Ideal( + R,[a^2*c+87*a^2*c^2+43*b^3*e+27*a*d^2*e+15*a^3*b*d+35*b*c*d^3+60*a*e^4, +67+40*b+11*a*d^2+59*a*b*e+50*b*e^4, +44*a*e+76*a^2*b^2+53*a*b^2*e+9*a*d^4+29*a*b*c*d*e+87*a*b*c*e^2+35*a*d*e^3])) + push!( + ideals, + Singular.Ideal( + R,[27+61*c^3*e+23*b*c*d*e+83*a*d^2*e+84*b^4*c+71*b*c^2*d^2+64*b^3*c*e+81*a*b*c^2*e, +42*b*e+82*a*b*d+47*a*b^2*d+39*b^2*e^2, +37*d+31*a^2*c+5*a*e^2+81*a^3*b*e+84*a^2*c*e^2+50*a*b*d*e^2+23*e^5])) + for i in ideals + runAll("sparseid(3,0,5,100-(2),90)", i, S, StartOrd, TarOrd) + end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 87 * c + - 47 * c * d + - 53 * e^2 + - 86 * a * b^2 + - 77 * b^2 * c + - 88 * b * d^2 + - 47 * b * d * e + - 55 * a * b^2 * c + - 71 * c^2 * d^2 + - 70 * a^3 * e + - 61 * a^2 * b * e + - 81 * b * e^3 + - 6 * c * e^3 + - 59 * a^5 + - 26 * a^2 * b^2 * c + - 72 * a^4 * d + - 24 * a^3 * c * d + - 62 * b * c^2 * d^2 + - 82 * a * d^4 + - 88 * a * c^3 * e + - 85 * d^4 * e + - 47 * a * c^2 * e^2 + - 87 * c * d^2 * e^2 + - 53 * b * e^4, - 89 + - 6 * c * e + - 5 * a^2 * c + - 17 * b * c * e + - 83 * c * e^2 + - 18 * a^3 * b + - 21 * a * c^3 + - 56 * b * c^3 + - 61 * a * b * c * d + - 33 * c^3 * e + - 41 * a * d^2 * e + - 70 * c * d^2 * e + - 32 * a * d * e^2 + - 9 * b * e^3 + - 39 * a^5 + - 48 * a^4 * b + - 21 * a^3 * b * c + - 50 * a^3 * b * d + - 76 * b^3 * d^2 + - 59 * b^2 * c * d^2 + - 14 * a * c * d^3 + - 40 * a * d^4 + - 28 * c * d^4 + - 55 * a^2 * b * d * e + - 63 * b * d^3 * e + - 85 * d^4 * e + - 22 * a * b * d * e^2 + - 68 * c * d * e^3, - 43 * e + - 77 * a * e + - 72 * e^2 + - 72 * a^2 * b + - 88 * a^2 * c + - 21 * b^2 * d + - 80 * a * b * e + - 48 * a^4 + - 50 * a * b^2 * d + - 76 * a * d^3 + - 42 * c * d^3 + - 53 * a^3 * e + - 78 * a * e^3 + - 72 * a^5 + - 14 * a^3 * b^2 + - 13 * a^3 * b * c + - 56 * a^2 * b * c * d + - 72 * b^3 * c * d + - 83 * a^2 * c^2 * d + - 50 * b^2 * c^2 * d + - 73 * c^3 * d^2 + - 41 * a * c * d^3 + - 45 * a^2 * b * c * e + - 19 * b^3 * c * e + - 24 * c^3 * e^2 + - 86 * d^3 * e^2, - ], - ), - ) + R,[55+90*c*d+64*d^2*e+16*d*e^2+77*a^2*b*c+90*b^3*d+73*a*b^2*e+c^5+69*b^2*c*d^2+42*a*c^2*d^2, +86*b^2+88*c*e^2+45*a^3*b+69*c^3*d+35*a*c^2*e+4*b^3*d^2+52*c*d^4+50*a^2*c^2*e+79*b^2*c*e^2+74*b*c^2*e^2, +78*d+61*a*c*d+23*b*d^3+7*a^3*c^2+70*b^2*c*e^2+77*a^2*d*e^2+78*c*d^2*e^2])) push!( ideals, Singular.Ideal( - R, - [ - 89 + - 14 * a * b + - 90 * a * e + - 36 * b * c^2 + - 9 * c^3 + - 67 * a^2 * d + - 16 * a * b * e + - 8 * c^2 * e + - 7 * c * d * e + - 76 * a * b^2 * c + - 16 * c^4 + - 6 * c^3 * d + - b^2 * d^2 + - 54 * a^2 * d * e + - 90 * a * c * d * e + - 47 * b * d^2 * e + - 41 * b^3 * c^2 + - 10 * a^2 * c^3 + - 4 * a * b^3 * d + - 46 * b^4 * d + - 47 * a^2 * c^2 * d + - 65 * b^3 * d^2 + - 74 * a * b * c * d^2 + - 73 * b * c * d^3 + - 50 * a^2 * b^2 * e + - 46 * c^4 * e + - 7 * b^2 * d^2 * e + - 78 * a * c^2 * e^2 + - 45 * b * c * d * e^2 + - 4 * a^2 * e^3 + - 90 * b^2 * e^3 + - 10 * a * e^4, - 41 * a + - 74 * e + - 89 * b^3 + - 20 * b * c^2 + - 14 * b * c * d + - 21 * c^2 * d + - 4 * b^2 * d^2 + - 87 * a^3 * e + - 24 * a * c * e^2 + - 62 * b^2 * c^3 + - 4 * c^5 + - 25 * a * b^3 * d + - 25 * a * c^3 * d + - 84 * a * c * d^3 + - 60 * c^4 * e + - 51 * a^2 * b * d * e + - 17 * a^2 * c * d * e + - 55 * b^2 * c * d * e + - 46 * a * d^3 * e + - 65 * a^2 * e^3 + - 62 * a * d * e^3, - 75 * b * c + - 68 * c * e + - 47 * e^2 + - 57 * b * d^2 + - 23 * a * b^3 + - 14 * a^2 * c^2 + - 81 * a * b^2 * d + - 34 * b * c^2 * d + - 25 * b^2 * d^2 + - 71 * c * d^3 + - 67 * a * b^2 * e + - 17 * a * c^2 * e + - 63 * a^2 * d * e + - 17 * a^2 * e^2 + - 90 * a * d * e^2 + - 84 * a^4 * b + - 29 * a^3 * c^2 + - 28 * a^2 * b * c^2 + - 65 * b^3 * c * d + - 3 * a * b * c * d^2 + - 35 * c^3 * d^2 + - 46 * a^2 * c^2 * e + - 61 * a^2 * d^2 * e + - 29 * a * d^2 * e^2 + - 45 * b^2 * e^3, - ], - ), - ) + R,[44*c^2*d+15*b*c^3+80*a*d*e^2+87*a*c^3*d+14*a^4*e+51*a^3*c*e, +20*a*c*d+13*a^3*b+86*b*c^2*d+27*d^3*e+42*a*b*c^2*d+35*a*b^2*d*e+61*a*b*d*e^2+72*d^3*e^2+44*a*d*e^3+59*d*e^4, +84+9*d+50*b^2+2*b*d+44*b*c*d+77*e^3+46*d^3*e+a^2*e^2+87*b^3*c*d+57*a*b*c*e^2+78*a^2*e^3])) + push!( + ideals, + Singular.Ideal( + R,[83+19*d+7*a^2*c+26*b*d^2+61*d^3+2*a*d*e+83*a^2*c^2+49*b*d^3+3*a*c*d*e+33*a*b^2*d^2+55*a*b*d^2*e+35*a^2*c*e^2+45*a*d^2*e^2, +36*a^2*b*d+72*b*c^2*d+69*a*b^3*c+69*c^3*d^2+33*a^2*b^2*e+7*b^2*c^2*e+85*b*e^4, +37*b*e+80*e^2+66*a^2*c*e+46*b*d*e^2+79*c^3*d*e+31*b^2*d^2*e+82*b^2*e^3])) for i in ideals - runb("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(1*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(3),90)", i, S, StartOrd, TarOrd) end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 31 * d + - 70 * c * e + - 64 * b^2 * c + - 26 * a * c * d + - 78 * a * d^2 + - 42 * b * d^2 + - 79 * a^3 * c + - 31 * b^3 * c + - 10 * c^4 + - 43 * a^3 * d + - 40 * a * c * d^2 + - a * d^3 + - 83 * d^4 + - 51 * a * c^2 * e + - 67 * a * d^2 * e + - 7 * d * e^3 + - 86 * b^5 + - 21 * a^2 * b^2 * c + - 57 * a * b^3 * c + - 76 * a * b^2 * c^2 + - 17 * a * c^4 + - 84 * c^5 + - 30 * a^3 * b * d + - 48 * a * b^2 * c * d + - 27 * b^2 * c^2 * d + - 16 * a^2 * c * d^2 + - 85 * c^2 * d^3 + - 15 * b * d^4 + - 44 * b * c^3 * e + - 5 * c^4 * e + - 81 * a * b^2 * d * e + - 14 * a * b * c * d * e + - 44 * b^2 * c * d * e + - 23 * a^2 * d^2 * e + - 41 * a^2 * b * e^2 + - 45 * b^3 * e^2 + - 8 * a^2 * c * e^2 + - 62 * a * b * d * e^2 + - 37 * a * d^2 * e^2 + - 17 * b * d^2 * e^2 + - 23 * b * e^4, - 3 * b + - 80 * b^2 + - 12 * b * c + - 80 * c * d + - 9 * b * c^2 + - 65 * c^3 + - 49 * b^2 * d + - 88 * a * d^2 + - 13 * b * c * e + - 38 * d^2 * e + - 86 * a * e^2 + - 64 * c * e^2 + - 9 * a^4 + - 89 * a^2 * b * c + - 23 * b^3 * c + - 83 * a^3 * d + - 47 * b^2 * c * d + - 79 * b^3 * e + - 2 * c * d^2 * e + - 77 * c * d * e^2 + - 14 * a * e^3 + - 48 * d * e^3 + - 30 * a^4 * b + - 86 * a^2 * b^2 * c + - 16 * a^4 * d + - 34 * a^3 * d^2 + - 19 * a^2 * b * d^2 + - 48 * b^3 * d^2 + - 90 * c^3 * d^2 + - 88 * a * d^4 + - 27 * a^4 * e + - 55 * a * b^3 * e + - 77 * a^2 * b * c * e + - 27 * a^2 * c^2 * e + - 21 * a * c^3 * e + - 73 * a^3 * d * e + - 9 * a^2 * b * d * e + - 41 * a * b * c * d * e + - 18 * a * c^2 * d * e + - 14 * a * c * d^2 * e + - 74 * b * d^3 * e + - 36 * a * c^2 * e^2 + - 63 * b * d * e^3 + - 59 * a * e^4 + - 62 * c * e^4 + - 4 * d * e^4, - 48 + - 13 * a + - 72 * a * c + - 65 * b * c + - 50 * b * d + - 11 * a * e + - 76 * c * e + - 20 * a^2 * c + - 43 * b * c * d + - 79 * c * d^2 + - 4 * d^3 + - 3 * a * b * e + - 67 * c^2 * e + - 20 * a * d * e + - 74 * c * e^2 + - 84 * d * e^2 + - 2 * a^2 * b^2 + - 25 * b^4 + - 54 * a^3 * c + - 74 * a * b^2 * c + - 3 * a^2 * c^2 + - 87 * a * b * c^2 + - 38 * c^4 + - 7 * a * c^2 * d + - 49 * b^2 * d^2 + - 21 * b * c * d^2 + - 65 * a^2 * b * e + - 61 * a * b^2 * e + - 61 * b^3 * e + - 86 * a^2 * c * e + - 13 * b^2 * c * e + - 30 * c^3 * e + - 3 * a^2 * d * e + - 50 * c * d^2 * e + - 85 * d^3 * e + - 53 * b * c * e^2 + - 88 * c * e^3 + - 53 * e^4 + - 60 * a^5 + - 84 * a^3 * c^2 + - 14 * a * b^2 * c^2 + - 31 * b^3 * c^2 + - 63 * c^5 + - 38 * b^4 * d + - 72 * a * b^2 * c * d + - 11 * a^2 * b * d^2 + - 21 * a * b^2 * d^2 + - 84 * c^3 * d^2 + - 43 * b^2 * d^3 + - 32 * d^5 + - 44 * a * b^2 * c * e + - 58 * a^2 * c^2 * e + - 44 * b^3 * d * e + - 10 * a * c^2 * d * e + - 71 * c^3 * d * e + - 21 * a^2 * d^2 * e + - 46 * b * c * d^2 * e + - 33 * a * d^3 * e + - 9 * b * d^3 * e + - 62 * a * c^2 * e^2 + - 10 * a^2 * d * e^2 + - 65 * a^2 * e^3 + - 78 * b * c * e^3 + - 22 * b * d * e^3 + - 74 * d * e^4, - ], - ), - ) + R,[69*b*d+51*a*b*c+46*a*c*d^2+28*b*c*d^2+34*b^3*e+73*b*c^2*e+74*d*e^3+61*e^4+79*a*b^2*c^2+3*b*c^2*d*e+16*a*c*d*e^2+52*b^2*e^3, +79+81*a+7*a*c^2+17*a^2*d+78*b^2*d+41*c*d^2+57*c^4+90*a^3*b^2+7*b*c*d^3+38*b^2*c^2*e+44*c^4*e, +53*d^2+81*b*c*d^2+16*a^2*c*e+48*a^4*c+55*a^2*b^2*c+18*a*b^2*c*d+9*d^5+87*b*c^2*d*e+62*a*d^3*e+7*a^2*d*e^2+87*a*b*e^3])) push!( ideals, Singular.Ideal( - R, - [ - 77 + - 82 * b + - 74 * a^2 + - 10 * b * c + - 10 * a * d + - 19 * a^3 + - 25 * a^2 * b + - 52 * a * c^2 + - 28 * a^2 * d + - 47 * a * c * d + - 72 * a * d^2 + - 20 * b * d^2 + - 24 * a * d * e + - 72 * a * e^2 + - 38 * d * e^2 + - 21 * a^3 * c + - 57 * a * b^2 * c + - 73 * b^2 * c^2 + - 34 * a * b * c * d + - 19 * c * d^3 + - 25 * a^3 * e + - 14 * a^2 * b * e + - 33 * a * b^2 * e + - 15 * a^2 * d * e + - 57 * b^2 * d * e + - 31 * b * d * e^2 + - 71 * d^2 * e^2 + - 88 * d * e^3 + - 49 * e^4 + - 53 * a^5 + - 2 * a^4 * c + - 24 * a * b^2 * c^2 + - 65 * b^3 * c^2 + - 38 * a * b * c^3 + - 2 * a^4 * d + - 64 * a^3 * b * d + - 87 * a^2 * b^2 * d + - 26 * b^4 * d + - 24 * a^2 * c^2 * d + - 81 * b * c^3 * d + - 14 * a * b^2 * d^2 + - 59 * a * b * c * d^2 + - 44 * a^2 * b * c * e + - 74 * a^2 * c^2 * e + - 3 * c^4 * e + - 13 * a^2 * d^2 * e + - 5 * a * c * d^2 * e + - 73 * b * c * d^2 * e + - 33 * c^2 * d^2 * e + - 66 * a^3 * e^2 + - 60 * a^2 * e^3 + - 79 * c * d * e^3, - 22 * c + - 38 * d + - 32 * a * b + - 31 * b * c + - 87 * c * e + - 33 * a^3 + - 71 * a * b^2 + - 7 * a * d^2 + - 40 * b * d * e + - 38 * d^2 * e + - 29 * a * b^3 + - 56 * b^3 * c + - 87 * b^2 * c * d + - 83 * b * c^2 * d + - 84 * b^2 * d^2 + - 44 * b * d^3 + - 90 * a * b * c * e + - 48 * a^2 * d * e + - 38 * a * b * d * e + - 35 * a * c * d * e + - 29 * d^3 * e + - 69 * b^2 * e^2 + - 68 * d^2 * e^2 + - 52 * a^3 * b^2 + - 88 * a^3 * b * c + - 76 * a^2 * b * c^2 + - a * b^2 * c^2 + - 41 * b^3 * c^2 + - 33 * a^2 * c^3 + - 12 * a * c^4 + - 20 * a^2 * b^2 * d + - 4 * a * c^3 * d + - 8 * b * c^2 * d^2 + - 83 * b^2 * d^3 + - 23 * a * c * d^3 + - 27 * b * c * d^3 + - 61 * b * d^4 + - 79 * d^5 + - 68 * a^3 * b * e + - 49 * a * c^3 * e + - 18 * a * b^2 * d * e + - 61 * b^2 * c * d * e + - 90 * b * c^2 * d * e + - 19 * b * c * d^2 * e + - 37 * a^3 * e^2 + - 55 * a^2 * b * e^2 + - 86 * b * c^2 * e^2 + - 35 * c^3 * e^2 + - 55 * b * c * d * e^2 + - 18 * a * c * e^3 + - 17 * a * d * e^3 + - 62 * e^5, - 4 * a^2 + - 45 * b^2 + - 71 * a * c + - 17 * a * b^2 + - 53 * a * c^2 + - 14 * a * c * d + - 51 * c * d * e + - 35 * d^2 * e + - 42 * c * e^2 + - 70 * a^4 + - 65 * a^2 * b * c + - 46 * b * c^2 * d + - 21 * a * b * d^2 + - 17 * a * c * d^2 + - 3 * a * d^3 + - 8 * b * d^3 + - 10 * a^3 * e + - 25 * b^2 * c * e + - 89 * a * c^2 * e + - 84 * a^2 * d * e + - 17 * a * c * d * e + - 65 * b * c * d * e + - 31 * a * b * e^2 + - 12 * d * e^3 + - 55 * a^3 * b^2 + - 5 * a * b^4 + - 34 * a * b^3 * c + - 34 * b^4 * c + - 74 * a^3 * c^2 + - 72 * a^2 * c^3 + - 34 * b^4 * d + - 82 * a * b^2 * c * d + - 33 * a * b^2 * d^2 + - 69 * a * b * c * d^2 + - 31 * a^4 * e + - 20 * a^3 * b * e + - 3 * a^2 * b^2 * e + - 85 * a^3 * c * e + - 61 * a * b * c * d * e + - 35 * c^2 * d^2 * e + - 30 * a * d^3 * e + - 29 * d^4 * e + - 19 * a^2 * b * e^2 + - 71 * b^3 * e^2 + - 27 * b * d^2 * e^2 + - 63 * a^2 * e^3 + - 4 * a * e^4 + - 43 * d * e^4, - ], - ), - ) + R,[90*c+56*a*e+81*c^2*e+36*b*d*e+55*a^2*b*d+60*a*b*e^2+37*a^2*b*c^2+65*b^4*d+36*a*b*c*e^2+46*d*e^4, +72+25*a*d+72*a*b^2*c+30*a^2*c^2+11*a^3*d+68*c^2*e^2+4*a*b^2*c*d+86*a^3*c*e+40*b^3*d*e+19*a*c*d^2*e+74*a*b*c*e^2, +87*a^2*b+27*b^2*c+41*d^3+86*b^4+3*a*c^2*e+75*a*d^2*e+22*a^4*c+11*a^3*b*c+89*a^2*c*d^2+18*b*c^2*d^2+61*a*c*d^3+4*b^3*d*e+38*b^2*d*e^2])) push!( ideals, Singular.Ideal( - R, - [ - 8 * b + - 54 * c + - 3 * b * d + - 42 * d * e + - 81 * a^2 * b + - 39 * a * b * c + - 45 * b^2 * c + - 39 * a * b * d + - 88 * a * c * d + - 88 * c * d^2 + - 8 * d^3 + - 73 * a * b * e + - 62 * a * c * e + - 61 * b * d * e + - 28 * c * d * e + - 34 * e^3 + - 73 * a^4 + - 45 * a^2 * b * c + - 45 * a^3 * d + - a^2 * c * d + - 90 * b^2 * c * d + - 25 * c^3 * d + - 27 * b * c * d^2 + - 48 * c^2 * d^2 + - 13 * a^3 * e + - 43 * a^2 * b * e + - 64 * a * b^2 * e + - 73 * b^3 * e + - 9 * b^2 * c * e + - 47 * a^2 * b^3 + - 85 * a * b^3 * c + - 4 * b^4 * c + - 41 * a^2 * b * c^2 + - 41 * a^2 * b * c * d + - 50 * a * b^2 * c * d + - 44 * b * c^3 * d + - 30 * a^3 * d^2 + - 14 * a * b^2 * d^2 + - 54 * a^2 * d^3 + - 49 * a^2 * b^2 * e + - 16 * b^3 * c * e + - 22 * a * b * c * d * e + - 13 * a * c^2 * d * e + - 70 * c^3 * d * e + - 80 * b * d^3 * e + - 7 * a * b^2 * e^2 + - 59 * a^2 * c * e^2 + - 6 * a^2 * d * e^2 + - 70 * a * b * d * e^2 + - 84 * c^2 * d * e^2 + - 74 * a * d^2 * e^2 + - 64 * a^2 * e^3 + - 90 * a * b * e^3, - 44 * e + - 13 * a * c + - 10 * b * d + - c * d + - 42 * d^2 + - 75 * d * e + - 14 * c^3 + - 69 * b^2 * d + - 56 * c * d * e + - 56 * a * e^2 + - 22 * a^3 * b + - 46 * a^3 * c + - 61 * a * b^2 * c + - 85 * b^2 * c^2 + - 73 * a^3 * d + - 64 * a^2 * b * d + - 13 * a * d^3 + - 42 * a^3 * e + - 15 * a * b * c * e + - 4 * a * d^2 * e + - 55 * a * c * e^2 + - 36 * b * d * e^2 + - 49 * c * e^3 + - 33 * d * e^3 + - 40 * a^5 + - 39 * a^3 * b * c + - 82 * b^4 * c + - 68 * a^3 * c^2 + - 53 * a * b * c^3 + - 67 * a^4 * d + - 36 * a^2 * c^2 * d + - 81 * a * b * c^2 * d + - 71 * a * c^3 * d + - 70 * a^2 * c * d^2 + - b * d^4 + - 65 * a^4 * e + - 6 * a * b^3 * e + - 30 * a^2 * b * c * e + - 74 * a * c^2 * d * e + - 81 * a * b * d^2 * e + - 79 * c^2 * d^2 * e + - 12 * b * d^3 * e + - 7 * d^4 * e + - 27 * a^2 * b * e^2 + - 28 * a * b * c * e^2 + - 51 * c^2 * d * e^2 + - 60 * c^2 * e^3 + - 76 * b * d * e^3 + - 42 * a * e^4 + - 33 * e^5, - 85 + - 28 * b * d + - 12 * d * e + - 84 * a * c^2 + - 70 * c^3 + - 12 * b * c * d + - 53 * b * e^2 + - 48 * d * e^2 + - 4 * b^4 + - 51 * b^3 * c + - 90 * b * c^3 + - a * b * c * d + - 68 * a * c^2 * d + - 75 * b * c^2 * d + - 22 * a^3 * e + - 72 * a * c^2 * e + - 32 * b^2 * d * e + - 36 * a * d^2 * e + - 17 * c * d^2 * e + - 21 * a^2 * e^2 + - 66 * a * b * e^2 + - 65 * c * d * e^2 + - 79 * c * e^3 + - 5 * a^5 + - 52 * a * b^4 + - 22 * a * c^4 + - 80 * c^5 + - 77 * a^4 * d + - 81 * a^3 * b * d + - 60 * a * b^3 * d + - 68 * a * b^2 * c * d + - 25 * b^2 * c^2 * d + - 83 * a^2 * b * d^2 + - 30 * a * b * d^3 + - 13 * b^2 * d^3 + - 4 * c * d^4 + - 49 * a^3 * c * e + - 85 * a * b^2 * c * e + - 23 * b^3 * d * e + - 48 * b * c * d^2 * e + - 16 * c * d^3 * e + - 82 * b^2 * c * e^2 + - 67 * c^3 * e^2 + - 30 * b * c * e^3 + - 39 * c^2 * e^3 + - 35 * a * d * e^3 + - 32 * d^2 * e^3 + - c * e^4 + - 53 * e^5, - ], - ), - ) + R,[36+11*a*b*d+6*b^2*e+74*a*b^2*c+85*a^3*e+24*a^2*e^2+40*c*d*e^2+42*a^4*c+5*a*b^2*c^2+67*a^3*c*d+33*a^2*c*d^2, +11*b*d+34*a*e+34*c*d^2+33*a*c*e+86*b*c*d*e+73*a^3*c^2+45*a*c*d^3+55*b^2*c^2*e+11*d^4*e+9*a^2*c*e^2, +56*c+30*b*c*e+48*a^2*c^2+82*c^3*d+75*b^2*d^2+23*c*e^3+51*a^2*b^3+71*a^4*d+14*a^2*c*d^2+29*c^2*d^3+54*a^3*b*e+36*a^3*d*e+4*a^2*d^2*e])) for i in ideals - runb("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(2*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(4),90)", i, S, StartOrd, TarOrd) end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 33 * b + - 68 * d + - 5 * e + - 38 * b * c + - 67 * c * d + - 3 * c * e + - 85 * b^3 + - 24 * a * b * c + - 49 * c^3 + - 87 * a^2 * d + - 55 * b * d^2 + - 43 * d^3 + - 28 * b^2 * e + - 64 * a * e^2 + - 26 * b * e^2 + - 2 * c * e^2 + - 79 * d * e^2 + - 83 * a^4 + - 60 * a^2 * c^2 + - 32 * a * c^3 + - 66 * b * c^3 + - 52 * c^4 + - 51 * a * b * c * d + - 6 * b^2 * c * d + - 67 * a * b * d^2 + - 80 * d^4 + - 4 * a^2 * c * e + - 56 * a * c^2 * e + - 59 * b^2 * d * e + - 6 * a * d^2 * e + - 55 * b * d^2 * e + - 11 * c * d^2 * e + - 33 * d^3 * e + - 50 * a * c * e^2 + - 51 * b * c * e^2 + - 9 * c^2 * e^2 + - 15 * b * d * e^2 + - 21 * a * e^3 + - 19 * e^4 + - 82 * a^3 * b^2 + - 15 * a * b^4 + - 26 * a^4 * c + - 81 * a^3 * b * c + - 39 * a^2 * b^2 * c + - 46 * a^3 * c^2 + - 64 * a * b^2 * c^2 + - 78 * a^2 * b^2 * d + - 56 * a * b^3 * d + - 39 * b^4 * d + - 53 * a * b^2 * c * d + - 78 * b^2 * c^2 * d + - 74 * b * c^3 * d + - 22 * c^4 * d + - 5 * b^3 * d^2 + - 53 * a^2 * c * d^2 + - 18 * a^2 * d^3 + - 71 * a * b * d^3 + - 21 * c^2 * d^3 + - 77 * b * d^4 + - 74 * d^5 + - 76 * a * b^3 * e + - 82 * b^4 * e + - 75 * a^2 * c^2 * e + - 9 * b * c^3 * e + - 62 * a * b^2 * d * e + - 88 * a^2 * c * d * e + - 59 * a * b * c * d * e + - 32 * a * c * d^2 * e + - 44 * b * c * d^2 * e + - 24 * a^3 * e^2 + - 48 * b^3 * e^2 + - 34 * a^2 * c * e^2 + - 48 * a * b * c * e^2 + - 13 * b^2 * c * e^2 + - 70 * b * c^2 * e^2 + - 61 * a^2 * d * e^2 + - 21 * a * c * d * e^2 + - 5 * b * c * d * e^2 + - 81 * b * d^2 * e^2 + - 7 * c * d^2 * e^2 + - 53 * b * c * e^3 + - 52 * c^2 * e^3 + - 71 * d * e^4 + - 66 * e^5, - 51 + - 88 * a^2 + - 30 * a * c + - 59 * b * c + - 77 * b * d + - 27 * d^2 + - 86 * c * e + - 37 * a^2 * b + - 73 * a * b^2 + - 61 * a^2 * c + - 72 * b^2 * c + - 20 * a^2 * d + - 29 * b * d^2 + - 76 * a * b * e + - 72 * a * c * e + - 29 * c^2 * e + - 28 * e^3 + - 26 * a^2 * c^2 + - 21 * b^2 * c^2 + - 89 * a^3 * d + - 66 * b^3 * d + - 29 * a * c^2 * d + - 46 * c^3 * d + - 19 * a * b * d^2 + - 63 * b^2 * d^2 + - 73 * a * d^3 + - 78 * b * d^3 + - 53 * a^3 * e + - 66 * a * c^2 * e + - 15 * b * c^2 * e + - 24 * c^3 * e + - 21 * a * c * d * e + - 51 * c * d^2 * e + - 40 * b * c * e^2 + - 56 * c * d * e^2 + - 25 * a * e^3 + - 53 * b * e^3 + - 30 * e^4 + - 80 * b^5 + - 62 * b^3 * c^2 + - 76 * a^2 * c^3 + - 23 * b * c^4 + - 42 * c^5 + - 72 * a * b^3 * d + - 39 * a^2 * b * c * d + - 88 * b^3 * c * d + - 76 * a^2 * c^2 * d + - 68 * a * b * c^2 * d + - 2 * a^3 * d^2 + - 22 * a^2 * b * d^2 + - 50 * a * b^2 * d^2 + - 59 * a^2 * c * d^2 + - 45 * a^2 * d^3 + - 90 * b * d^4 + - 17 * a^2 * b^2 * e + - 89 * b^4 * e + - 31 * a^2 * c * d * e + - 64 * a * b * c * d * e + - 24 * b^2 * c * d * e + - 62 * a * c^2 * d * e + - 25 * a^2 * d^2 * e + - 11 * a^2 * b * e^2 + - 28 * a * b^2 * e^2 + - 39 * b^2 * c * e^2 + - 19 * b * c^2 * e^2 + - 85 * a^2 * d * e^2 + - 39 * a * b * d * e^2 + - 29 * a * c * d * e^2 + - 53 * c * d^2 * e^2 + - 90 * a * c * e^3 + - 38 * c * d * e^3 + - 58 * c * e^4, - 85 * a + - 75 * e + - 80 * a^2 + - 68 * b * d + - 7 * c * d + - 21 * a * e + - 71 * e^2 + - 38 * b^2 * c + - 9 * a^2 * d + - 44 * b^2 * d + - 76 * a * c * d + - 63 * c^2 * d + - 41 * a * d^2 + - 34 * a^2 * e + - 75 * b * c * e + - 16 * c^2 * e + - 19 * b * d * e + - 88 * d^2 * e + - 69 * a^4 + - 76 * a^3 * b + - 15 * a * b^3 + - 19 * b^4 + - 67 * a * b * c^2 + - 27 * b^2 * c^2 + - 47 * a^2 * b * d + - 40 * a * b^2 * d + - a * c^2 * d + - 18 * b * c^2 * d + - 51 * a * c * d^2 + - 40 * a * d^3 + - 3 * b * d^3 + - d^4 + - 65 * a^2 * b * e + - 23 * a^2 * c * e + - 19 * b^2 * c * e + - 66 * b * c^2 * e + - 42 * c^2 * d * e + - 24 * a^2 * e^2 + - 24 * a^4 * b + - 80 * a^4 * c + - 83 * b^3 * c^2 + - 62 * a * b * c^3 + - 4 * b * c^4 + - 34 * a^3 * c * d + - 3 * a * b^2 * c * d + - 9 * a * c^3 * d + - 44 * c^4 * d + - 58 * a^3 * d^2 + - 23 * a^2 * c * d^2 + - 77 * a * b * c * d^2 + - 83 * b^2 * c * d^2 + - 40 * c^3 * d^2 + - 20 * a * c * d^3 + - 35 * a * d^4 + - 12 * b * d^4 + - 12 * a^2 * b^2 * e + - 30 * a^2 * b * c * e + - 79 * b^3 * d * e + - 9 * a * c^2 * d * e + - 10 * a^2 * d^2 * e + - 53 * a * b * d^2 * e + - 13 * b^2 * d^2 * e + - 81 * c^2 * d^2 * e + - 89 * d^4 * e + - 80 * a * b^2 * e^2 + - 58 * c^3 * e^2 + - 63 * a^2 * d * e^2 + - 65 * c * d^2 * e^2 + - 45 * d^3 * e^2 + - 81 * a^2 * e^3 + - 85 * b^2 * e^3 + - 5 * b * c * e^3 + - 67 * d^2 * e^3, - ], - ), - ) + R,[46*d+22*a*b*c+71*a^2*e+18*a^4+69*b^3*d+47*a^2*c^3+37*c^5+88*a^3*d^2+13*a^2*c^2*e+88*a*c^2*d*e+19*b^2*c*e^2+48*a*b*d*e^2, +9+30*b*d+38*a^2*e+87*b^2*c*d+25*a*d^3+82*d^4+40*a^2*d^3+74*b*c^2*e^2+70*a*c*d*e^2+45*a*b*e^3, +74*a*c+46*e^2+19*a^2*b+12*b^3+64*a*c*d+76*b*c^3+90*b^2*d^2+40*c*d^3+38*b^3*e+35*b*c*e^2+5*a*e^3+79*b^4*c+44*a*b^3*e+69*a*c^3*e+39*a*b*d^2*e+35*b*c*d*e^2+9*b^2*e^3+71*b*d*e^3+54*e^5])) push!( ideals, Singular.Ideal( - R, - [ - 86 + - 66 * a + - 27 * c + - 82 * e + - 81 * a * c + - 33 * d * e + - 3 * a^3 + - 66 * a^2 * c + - 59 * b^2 * c + - 60 * b * c^2 + - 37 * a * b * d + - 88 * b^2 * d + - 13 * c^2 * d + - 4 * c * d^2 + - 60 * d^3 + - 78 * a * b * e + - 82 * b^2 * e + - 37 * c^2 * e + - 27 * c * d * e + - 39 * b * e^2 + - 75 * d * e^2 + - 3 * e^3 + - 34 * a^4 + - 6 * a^2 * b^2 + - 77 * b^4 + - 30 * a^3 * c + - 21 * a^2 * b * c + - 27 * a * b * c^2 + - 48 * a * c^3 + - 33 * c^4 + - 4 * a * c^2 * d + - 74 * a * b * d^2 + - 42 * b^2 * d^2 + - 78 * a * d^3 + - 13 * b^3 * e + - 79 * b^2 * c * e + - 21 * c^3 * e + - 34 * a^2 * d * e + - 63 * a * d^2 * e + - 77 * a^2 * e^2 + - 18 * a * d * e^2 + - 60 * c * d * e^2 + - 40 * a^2 * b^2 * c + - 48 * a^2 * b * c^2 + - c^5 + - 79 * a * b^3 * d + - 59 * b * c^3 * d + - 24 * a * b * c * d^2 + - 49 * b * c^2 * d^2 + - 47 * a * b * d^3 + - 32 * b * c * d^3 + - 5 * a * d^4 + - 35 * b * d^4 + - 70 * a^4 * e + - 43 * a^2 * b * c * e + - 71 * a * b^2 * c * e + - 20 * c^4 * e + - 41 * a^3 * d * e + - 3 * a^2 * c * d * e + - 64 * a * b * c * d * e + - 55 * a * c^2 * d * e + - 11 * b * c^2 * d * e + - 31 * b^2 * d^2 * e + - 12 * c^2 * d^2 * e + - 59 * a * d^3 * e + - 26 * d^4 * e + - 8 * a * b^2 * e^2 + - 39 * b^2 * c * e^2 + - 15 * a^2 * d * e^2 + - 27 * a * b * d * e^2 + - 78 * b * d^2 * e^2 + - 86 * d^3 * e^2 + - 83 * d * e^4, - 28 * d + - 26 * a * c + - 2 * c^2 + - 46 * c * d + - 8 * c * e + - 82 * d * e + - 11 * a * b^2 + - 35 * a * b * c + - 61 * c^3 + - 7 * a * c * d + - 83 * d^3 + - 34 * b * c * e + - 18 * c^2 * e + - 13 * b * e^2 + - 35 * a^4 + - 72 * a^3 * b + - 16 * b^4 + - 59 * a^3 * c + - 70 * a^2 * c^2 + - 32 * a * b * c^2 + - 55 * b^2 * c^2 + - 57 * a * c^3 + - 27 * a^2 * c * d + - 20 * c^3 * d + - 31 * a^2 * d^2 + - 81 * a * c * d^2 + - 32 * c^2 * d^2 + - 69 * a * b * c * e + - 32 * b * c^2 * e + - 81 * a * b * d * e + - 47 * a * d^2 * e + - 77 * a * c * e^2 + - 34 * a * d * e^2 + - 58 * c * d * e^2 + - 43 * a * e^3 + - 73 * c * e^3 + - 87 * d * e^3 + - 69 * e^4 + - 14 * a^3 * b^2 + - 19 * a^2 * b^3 + - 20 * a^4 * c + - 64 * a^2 * b^2 * c + - 58 * b^4 * c + - 13 * a^3 * c^2 + - b^2 * c^3 + - 38 * a^4 * d + - 88 * b^3 * c * d + - 32 * a * b * c^2 * d + - a^3 * d^2 + - 87 * a^2 * b * d^2 + - 71 * b^3 * d^2 + - 54 * a * b * c * d^2 + - 52 * b^2 * c * d^2 + - 64 * b * c^2 * d^2 + - 78 * a^2 * d^3 + - 43 * b^2 * d^3 + - 47 * b * c * d^3 + - 84 * c^2 * d^3 + - 10 * b * d^4 + - 14 * a^3 * c * e + - 78 * a^2 * b * c * e + - 10 * a * c^3 * e + - 77 * b * c^3 * e + - 17 * a^3 * d * e + - 75 * a^2 * b * d * e + - 71 * a * b^2 * d * e + - 70 * b^2 * c * d * e + - 31 * b * d^3 * e + - 76 * d^4 * e + - 68 * a^3 * e^2 + - 70 * a * b^2 * e^2 + - 8 * b * c^2 * e^2 + - 60 * b * c * d * e^2 + - 73 * c^2 * d * e^2 + - 12 * a * c * e^3 + - 40 * b * c * e^3 + - 36 * a * d * e^3 + - 9 * c * e^4, - 69 * e + - 21 * a^2 + - 59 * a * c + - 54 * c^2 + - 7 * d^2 + - 81 * a * e + - 28 * b * e + - 82 * e^2 + - 32 * a^2 * c + - 25 * a * c^2 + - 42 * b * c^2 + - b * d^2 + - 31 * a * b * e + - 77 * b^2 * e + - 87 * a * d * e + - 78 * d^2 * e + - 81 * a^3 * b + - 8 * b^2 * c^2 + - b * c^3 + - 59 * a * b^2 * d + - 5 * a * b * c * d + - 84 * c^3 * d + - 35 * b^2 * d^2 + - 18 * c^2 * d^2 + - 23 * b * d^3 + - 46 * d^4 + - 62 * a * b^2 * e + - 41 * b^3 * e + - 70 * b * c^2 * e + - 48 * a^2 * d * e + - 50 * b^2 * d * e + - 18 * a * c * e^2 + - 84 * c^2 * e^2 + - 75 * b * d * e^2 + - 59 * e^4 + - 43 * a^5 + - 44 * a^4 * b + - 42 * a^2 * b^3 + - 33 * a * b^4 + - 13 * a^2 * b^2 * c + - 21 * a^2 * c^3 + - 7 * b^2 * c^3 + - 52 * a^4 * d + - 77 * a^3 * c * d + - 70 * a^2 * b * c * d + - 52 * a^2 * b * d^2 + - 69 * a * b^2 * d^2 + - 29 * a^2 * c * d^2 + - 14 * a * c^2 * d^2 + - 54 * b * c^2 * d^2 + - 87 * a^2 * d^3 + - 90 * b^2 * d^3 + - 84 * a * d^4 + - 4 * d^5 + - 36 * a^4 * e + - 48 * a^2 * b^2 * e + - 8 * a * b^2 * c * e + - 16 * a^2 * c^2 * e + - 17 * a * b * c^2 * e + - 52 * b^2 * c^2 * e + - 88 * c^4 * e + - 86 * a * b^2 * d * e + - 35 * b^2 * c * d * e + - 80 * c^3 * d * e + - 33 * b^2 * d^2 * e + - 87 * c * d^3 * e + - 61 * a^3 * e^2 + - 73 * a * b^2 * e^2 + - 70 * b^3 * e^2 + - 40 * b^2 * c * e^2 + - 5 * a^2 * d * e^2 + - 66 * a * b * d * e^2 + - 19 * b^2 * d * e^2 + - 65 * b * d^2 * e^2 + - 20 * c * d^2 * e^2 + - 12 * a^2 * e^3 + - 68 * b * e^4 + - 80 * e^5, - ], - ), - ) + R,[84*e+34*a*b*c*d+69*b*c*d^2+70*a^2*e^2+9*a^5+47*a^2*b*c*d+63*a^2*d*e^2+45*b*c*d*e^2, +83+29*a*b+46*b^3+18*c*d*e+82*d^2*e+a^2*b^2+19*b^4+26*a*d^2*e+31*a*e^3+85*d*e^3+78*a^4*c+89*a*b^3*e+76*a*b*d*e^2+41*a*c*d*e^2+16*b*c*d*e^2+90*a*d^2*e^2+90*c*d^2*e^2+37*c^2*e^3+33*c*e^4, +85*a*c+83*c*e+17*a^3+82*a*b*d+65*c*e^2+82*a^3*b+86*a*b*c^2+77*b^2*d^2+19*a*b^4+27*b*c^4+47*a*b^2*c*d+86*b*c^2*d^2+25*b^3*c*e+53*a*c*e^3])) push!( ideals, Singular.Ideal( - R, - [ - 41 + - 17 * a + - 34 * b * c + - 37 * d^2 + - 25 * a^2 * c + - 39 * a * b * c + - 29 * b * c^2 + - 77 * c^3 + - 67 * b^2 * d + - 18 * c * d^2 + - 7 * b^2 * e + - 81 * c^2 * e + - 75 * d^2 * e + - 89 * b * e^2 + - 16 * d * e^2 + - 58 * a^2 * b * c + - 43 * b^3 * c + - 29 * a * b * c^2 + - 82 * a * c^3 + - 87 * a * b^2 * d + - 10 * b^3 * d + - 8 * a * b * d^2 + - 17 * b^2 * d^2 + - 35 * a * c * d^2 + - b * c * d^2 + - 44 * b * d^3 + - 52 * c * d^3 + - 83 * a^2 * c * e + - 6 * a * b * c * e + - 47 * a^2 * d * e + - 10 * c^2 * d * e + - 58 * a * d^2 * e + - 21 * c^2 * e^2 + - 21 * a^4 * b + - 19 * a^2 * b^3 + - 63 * a^3 * b * c + - 75 * a^2 * b^2 * c + - 26 * a * b^3 * c + - 6 * a * c^4 + - 22 * c^5 + - 3 * a^3 * b * d + - 62 * a * b^3 * d + - 80 * b^4 * d + - 75 * a^2 * c^2 * d + - 35 * a * c^3 * d + - 49 * a * b^2 * d^2 + - 78 * a * b * c * d^2 + - 86 * a * c^2 * d^2 + - 86 * a * c * d^3 + - 6 * a^3 * b * e + - 5 * a^2 * b^2 * e + - 19 * b^4 * e + - 73 * a * c^3 * e + - 89 * b * c^3 * e + - 22 * a^3 * d * e + - 74 * a^2 * c * d * e + - 90 * a * b * c * d * e + - 52 * b * c^2 * d * e + - 14 * a^2 * d^2 * e + - 28 * b^2 * d^2 * e + - 28 * b * c * d^2 * e + - 62 * a * d^3 * e + - 69 * d^4 * e + - 66 * a * b^2 * e^2 + - 67 * b * c^2 * e^2 + - 13 * a^2 * d * e^2 + - 24 * a * d^2 * e^2 + - 79 * a * c * e^3 + - 74 * b * c * e^3 + - 6 * a * d * e^3 + - 39 * b * e^4, - 45 * c + - 11 * a^2 + - 84 * b^2 + - 5 * c^2 + - 36 * c * d + - 21 * a * e + - 54 * e^2 + - 35 * a^3 + - 45 * a * b^2 + - 88 * b^3 + - 74 * b^2 * c + - 72 * a^2 * d + - 22 * a * b * e + - 41 * a * c * e + - 54 * a * d * e + - 53 * a * e^2 + - 61 * d * e^2 + - 17 * a^3 * c + - 69 * a * b^2 * c + - 9 * b * c^3 + - 37 * a * c^2 * d + - 52 * b * c^2 * d + - 11 * c^3 * d + - 76 * a * d^3 + - 86 * d^4 + - 13 * a^3 * e + - 78 * a^2 * b * e + - 13 * a * b^2 * e + - 89 * b^3 * e + - 31 * a * b * c * e + - 26 * b^2 * c * e + - 14 * c^3 * e + - 46 * b * c * d * e + - 73 * a * d^2 * e + - 33 * c * d^2 * e + - 42 * a * b * e^2 + - 77 * b^2 * e^2 + - 10 * a * c * e^2 + - 66 * a^3 * b^2 + - 24 * a^3 * c^2 + - 12 * a^2 * b * c^2 + - 54 * a * b^2 * c^2 + - 63 * b^2 * c^3 + - 43 * b^4 * d + - 34 * a^3 * c * d + - 30 * a * b^2 * c * d + - b^3 * c * d + - 54 * b^2 * c^2 * d + - 34 * a * c^3 * d + - 70 * a * b^2 * d^2 + - 4 * b^3 * d^2 + - 61 * a^2 * c * d^2 + - 21 * a * b * c * d^2 + - 46 * b^2 * c * d^2 + - 70 * a^2 * d^3 + - 5 * b^2 * d^3 + - 51 * a^3 * b * e + - 78 * a^2 * b^2 * e + - 64 * a * b^3 * e + - 9 * a^2 * b * c * e + - 69 * a * b^2 * c * e + - 17 * a * b * c^2 * e + - 15 * b^2 * c^2 * e + - 84 * a * c^3 * e + - 11 * b^2 * c * d * e + - 44 * b * c^2 * d * e + - 25 * a * d^3 * e + - 8 * a * b^2 * e^2 + - 30 * b^2 * c * e^2 + - 53 * b * c^2 * e^2 + - 12 * c^3 * e^2 + - 63 * a^2 * d * e^2 + - 19 * b^2 * d * e^2 + - 79 * c^2 * d * e^2 + - 4 * a * d^2 * e^2 + - 15 * c * d^2 * e^2 + - 41 * a^2 * e^3 + - 6 * b^2 * e^3 + - 7 * a * c * e^3 + - 84 * c * d * e^3, - 66 * b + - 54 * c + - 5 * d + - 87 * a * c + - 9 * c^2 + - 16 * c * d + - 69 * d^2 + - 83 * b * e + - 26 * d * e + - 24 * b^3 + - 43 * a * b * c + - 8 * a^2 * d + - 14 * b^2 * d + - 15 * a * c * d + - 44 * a * d^2 + - 59 * a^2 * e + - 17 * a * b * e + - 28 * a * c * e + - 5 * a * d * e + - 32 * e^3 + - 15 * a^3 * b + - 31 * a^2 * b^2 + - 40 * a * b^3 + - 73 * b^3 * c + - 56 * b^2 * c^2 + - 84 * a * c^3 + - 13 * a * b^2 * d + - 17 * a^2 * c * d + - 73 * c^3 * d + - 46 * b^2 * d^2 + - 85 * b * d^3 + - 75 * c * d^3 + - 52 * a * b^2 * e + - 5 * b^2 * c * e + - 58 * c^3 * e + - 78 * a * b * d * e + - 83 * b^2 * d * e + - b * d^2 * e + - 85 * c * d^2 * e + - 30 * a * c * e^2 + - 2 * c^2 * e^2 + - 37 * a * e^3 + - 6 * b * e^3 + - 63 * e^4 + - 7 * a^2 * b^3 + - b^5 + - 40 * b^3 * c^2 + - 10 * a^2 * c^3 + - 7 * b * c^4 + - 81 * a^3 * c * d + - 71 * a^2 * b * c * d + - 33 * a * b * c^2 * d + - 19 * a * c^3 * d + - 4 * a * b * c * d^2 + - 52 * c^3 * d^2 + - 12 * a * d^4 + - 43 * c * d^4 + - 46 * d^5 + - 14 * a^3 * b * e + - 40 * a^2 * b * c * e + - 88 * a^2 * c^2 * e + - 24 * b^2 * c^2 * e + - 9 * b * c^3 * e + - 90 * a^2 * c * d * e + - 38 * a * c^2 * d * e + - 82 * b * c^2 * d * e + - 35 * a * b * c * e^2 + - 10 * b^2 * c * e^2 + - 10 * a * c^2 * e^2 + - 51 * c^3 * e^2 + - 20 * c^2 * d * e^2 + - 46 * d^3 * e^2 + - 42 * a * d * e^3 + - 70 * c * d * e^3 + - 68 * a * e^4 + - 38 * c * e^4 + - 63 * d * e^4 + - 80 * e^5, - ], - ), - ) + R,[13*b+44*a^2+39*a^2*b^2+12*a^2*b*e+56*d*e^3+41*e^4+3*a*b*c^3+85*b^4*d+42*a^2*d*e^2, +21*a*b+47*b*c^2+31*b*d^2+39*c*d^2+86*e^3+53*a*c^2*d+74*a*d^3+15*a*d*e^2+51*a^2*b^3+60*a^4*c+22*a*b*c^3+14*a*b*c*d^2+75*b*c*d^3+61*a*b^2*c*e+7*b^3*c*e+24*a*c*d^2*e+87*b*c*d*e^2+78*c^2*d*e^2+82*c*e^4, +13+68*d*e+26*a^2*d+23*b^2*d+12*a^3*d+40*a*b^2*e+5*b*c^2*e+57*b*e^3+60*a^2*b^2*d+b^3*d^2+31*a*c^3*e+61*b^2*d*e^2+4*a*b*e^3])) for i in ideals - runb("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(3*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(5),90)", i, S, StartOrd, TarOrd) end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 83 * b + - 2 * d + - 75 * e + - 38 * a^2 + - 88 * a * b + - 87 * c^2 + - 11 * b * e + - 33 * c * e + - 68 * e^2 + - 4 * a^2 * b + - 2 * a^2 * c + - 75 * a * b * c + - 56 * b * c^2 + - 13 * a^2 * d + - 19 * a * b * d + - 66 * b^2 * d + - 80 * c^2 * d + - 89 * b * d^2 + - 72 * a * b * e + - 2 * b^2 * e + - 21 * c^2 * e + - 84 * d^2 * e + - 15 * a * e^2 + - 74 * b * e^2 + - 14 * a^3 * b + - 48 * a * b^3 + - 25 * a^3 * c + - 67 * a * b * c^2 + - 74 * a * c^3 + - 63 * c^4 + - 11 * a^3 * d + - 32 * a^2 * b * d + - 83 * a^2 * c * d + - 3 * a * c^2 * d + - 8 * a * c * d^2 + - 46 * b * c * d^2 + - 57 * c^2 * d^2 + - 16 * b * d^3 + - 4 * a^2 * b * e + - 41 * b^3 * e + - 33 * b^2 * c * e + - 50 * b * c^2 * e + - 35 * a * b * d * e + - 55 * a * c * d * e + - 54 * c^2 * d * e + - 54 * b * d^2 * e + - 26 * d^3 * e + - 81 * b^2 * e^2 + - 72 * a * c * e^2 + - 71 * b * c * e^2 + - 37 * a * d * e^2 + - 2 * c * e^3 + - 17 * e^4 + - 50 * a * b^4 + - 39 * b^5 + - 8 * a * b^3 * c + - 69 * a^3 * c^2 + - 21 * a * b^2 * c^2 + - 24 * b^2 * c^3 + - 8 * a * c^4 + - 49 * a^4 * d + - 53 * a * b^3 * d + - 69 * a^2 * c^2 * d + - 23 * a * b * c^2 * d + - 18 * b^2 * c^2 * d + - 32 * b * c^3 * d + - 27 * b^3 * d^2 + - 14 * a * b * c * d^2 + - 12 * a * c^2 * d^2 + - 51 * a^2 * d^3 + - 32 * a * b * d^3 + - 7 * b^2 * d^3 + - 23 * d^5 + - 61 * a^3 * b * e + - 11 * a^3 * c * e + - 78 * b^2 * c^2 * e + - 13 * c^4 * e + - 64 * b^3 * d * e + - 48 * a * b * c * d * e + - 42 * a * c^2 * d * e + - 6 * b * c^2 * d * e + - 30 * b^2 * d^2 * e + - 65 * b * c * d^2 * e + - 64 * a * d^3 * e + - 38 * b * d^3 * e + - 83 * a^3 * e^2 + - 4 * a^2 * b * e^2 + - 7 * a * b * c * e^2 + - 8 * a * c^2 * e^2 + - 79 * b * c^2 * e^2 + - 6 * c^3 * e^2 + - 4 * a^2 * d * e^2 + - 80 * a * c * d * e^2 + - 48 * b^2 * e^3 + - 55 * c^2 * e^3 + - 72 * a * d * e^3 + - 76 * b * d * e^3 + - 33 * b * e^4, - 37 + - 60 * a * b + - 68 * c^2 + - 62 * a * d + - 34 * b * d + - 53 * a * e + - 23 * d * e + - 64 * e^2 + - 20 * a^3 + - 78 * b^3 + - 21 * a^2 * c + - 87 * b^2 * c + - 39 * a * c^2 + - 80 * a^2 * d + - 10 * b * c * d + - 63 * c^2 * d + - 36 * d^3 + - 85 * b^2 * e + - 50 * a * c * e + - 30 * d^2 * e + - 88 * a * e^2 + - 87 * e^3 + - 80 * a^3 * b + - 36 * a^2 * b^2 + - 36 * b^4 + - 67 * b^3 * c + - 77 * a^2 * c^2 + - 43 * a^3 * d + - 41 * a * b^2 * d + - 27 * b^3 * d + - 22 * a * b * c * d + - 87 * b^2 * c * d + - 74 * a * c^2 * d + - 64 * a * b * d^2 + - 69 * a * c * d^2 + - 61 * a * d^3 + - 62 * c * d^3 + - 71 * a^3 * e + - 41 * b * c^2 * e + - 67 * a * c * d * e + - 18 * b * c * d * e + - 51 * a * d^2 * e + - 73 * b * d^2 * e + - 14 * c * d^2 * e + - 82 * a * b * e^2 + - 60 * c^2 * e^2 + - 12 * b * d * e^2 + - 21 * b * e^3 + - 21 * c * e^3 + - 6 * e^4 + - 71 * a^5 + - 16 * a^2 * b^3 + - 6 * a * b^4 + - 65 * a^3 * b * c + - 19 * b^4 * c + - 46 * a^3 * c^2 + - 3 * a^2 * b * c^2 + - 21 * a * b^2 * c^2 + - 51 * a^2 * c^3 + - 36 * b * c^4 + - 32 * a^4 * d + - 33 * a^2 * b^2 * d + - 26 * b^4 * d + - 62 * a^2 * b * c * d + - 42 * b^3 * c * d + - 88 * a^2 * c^2 * d + - 39 * a * b * c^2 * d + - 32 * a^3 * d^2 + - 66 * a^2 * b * d^2 + - 70 * b^3 * d^2 + - 16 * b^2 * c * d^2 + - 12 * a * c^2 * d^2 + - 42 * c^3 * d^2 + - 37 * b^2 * d^3 + - 67 * a * c * d^3 + - 4 * a * d^4 + - 31 * b * d^4 + - 15 * d^5 + - 82 * b^3 * c * e + - 14 * a^2 * c^2 * e + - 56 * a * b * c^2 * e + - 55 * b^2 * c^2 * e + - 70 * b * c^3 * e + - 32 * a^3 * d * e + - 35 * a^2 * b * d * e + - 38 * b^3 * d * e + - 15 * a^2 * c * d * e + - 29 * b^2 * c * d * e + - 30 * c^3 * d * e + - 60 * a * b * d^2 * e + - 82 * b^2 * d^2 * e + - 87 * a * c * d^2 * e + - 16 * c^2 * d^2 * e + - 50 * b * d^3 * e + - 67 * a^3 * e^2 + - b^3 * e^2 + - 68 * a * b * c * e^2 + - 39 * c^3 * e^2 + - 50 * a * b * d * e^2 + - 41 * a * d^2 * e^2 + - 73 * b * d^2 * e^2 + - 46 * c * d^2 * e^2 + - 44 * a * b * e^3 + - 30 * a * c * e^3 + - 43 * c^2 * e^3 + - 33 * b * e^4 + - 26 * c * e^4 + - 46 * e^5, - 44 + - 34 * a + - 72 * c + - 81 * d + - 68 * a^2 + - 56 * a * b + - 3 * b^2 + - 79 * c^2 + - 49 * c * e + - 88 * a^2 * b + - 28 * a * b^2 + - 83 * a^2 * c + - 7 * a * b * c + - 88 * b * c^2 + - 61 * c^3 + - 4 * a * b * d + - 5 * b * d^2 + - 50 * c * d^2 + - 83 * d^3 + - 83 * a^2 * e + - 6 * c * d * e + - 72 * a * e^2 + - 46 * a^3 * c + - 41 * a^2 * b * c + - 17 * a^2 * c^2 + - 50 * a * b * c^2 + - 22 * b * c^3 + - 18 * a^3 * d + - 58 * a^2 * c * d + - 35 * b^2 * c * d + - 35 * b * c^2 * d + - 46 * a^2 * d^2 + - 11 * a * b * d^2 + - 29 * b^2 * d^2 + - 78 * b * c * d^2 + - 3 * c * d^3 + - 58 * a * b^2 * e + - 36 * b^3 * e + - 23 * a^2 * c * e + - 11 * a * c^2 * e + - b * c^2 * e + - 60 * c^3 * e + - 46 * a * c * d * e + - 50 * c * d^2 * e + - 57 * a^2 * e^2 + - 7 * a * c * e^2 + - c * d * e^2 + - 19 * a * e^3 + - 11 * b * e^3 + - 41 * a^3 * b^2 + - 46 * a^2 * b^3 + - 13 * a * b^4 + - 57 * a^3 * b * c + - 23 * a * b^3 * c + - 61 * a^4 * d + - 54 * a^3 * b * d + - 2 * b^4 * d + - 83 * a^2 * b * c * d + - 32 * a^2 * c^2 * d + - 59 * a * b * c^2 * d + - 62 * b^2 * c^2 * d + - 84 * a * c^3 * d + - 85 * b * c^3 * d + - 70 * a^3 * d^2 + - 25 * a^2 * b * d^2 + - 76 * b^2 * c * d^2 + - 57 * a^2 * d^3 + - 89 * a * b * d^3 + - 79 * d^5 + - 56 * b^4 * e + - 83 * a^3 * c * e + - 9 * b^3 * c * e + - 33 * c^4 * e + - 58 * a^2 * b * d * e + - 50 * a * b^2 * d * e + - 60 * a^2 * c * d * e + - 50 * a * b * c * d * e + - 12 * b * c^2 * d * e + - 73 * c^3 * d * e + - 89 * a * c * d^2 * e + - 15 * c^2 * d^2 * e + - 13 * b * d^3 * e + - 38 * c * d^3 * e + - 19 * b^3 * e^2 + - 70 * a * b * d * e^2 + - 48 * b^2 * d * e^2 + - 55 * a * c * d * e^2 + - 29 * b * c * d * e^2 + - 72 * d^3 * e^2 + - 74 * a^2 * e^3 + - 62 * a * b * e^3 + - 43 * b * c * e^3 + - 17 * c^2 * e^3 + - 56 * a * d * e^3 + - 41 * a * e^4 + - 54 * b * e^4 + - 44 * c * e^4 + - 26 * e^5, - ], - ), - ) + R,[70*b^2*d+45*a*b^2*c+90*b^3*c+49*a^2*c^2+22*c*d^3+81*b*d^2*e+62*b^5+68*a^3*b*c+86*a^2*b^2*c+70*a*b^3*c+15*a*c^4+21*a*b^3*d+20*a*b^2*c*d+44*b*c^3*d+33*a*b*d^3+17*a^2*b*c*e+53*d^4*e+90*c^2*e^3, +65*b+16*c*d+31*d*e+68*e^2+19*a^2*b+47*c^4+18*a*b*c*d+64*a^2*c*e+67*a*d^2*e+63*a^2*e^2+79*a^4*c+11*a^2*b^2*e+31*c^2*d^2*e+9*c*e^4, +31+26*a*b^2+86*a^2*d+71*a*b*e+26*a*c*e+63*b*e^2+87*a*c*d^2+59*b*c*d^2+23*a*e^3+18*a*b^2*c*d+88*b*c^2*d^2+33*c^2*d^3+28*a^4*e+5*b*c^2*e^2+17*b*d^2*e^2+86*c*e^4])) push!( ideals, Singular.Ideal( - R, - [ - 9 + - 10 * a^2 + - 25 * a * b + - 11 * a * c + - 74 * b * c + - 25 * a * d + - 25 * b * d + - 9 * a * e + - 17 * b * e + - 53 * b^3 + - 15 * a^2 * c + - 23 * c^3 + - 69 * b^2 * d + - 77 * a * c * d + - 11 * b * d^2 + - 79 * c * d^2 + - 79 * d^3 + - 16 * a * b * e + - 46 * c^2 * e + - 88 * b * d * e + - 33 * d * e^2 + - 55 * e^3 + - 32 * a^3 * b + - 26 * a * b^2 * c + - 70 * a^2 * c^2 + - 18 * b * c^3 + - 50 * b^2 * c * d + - 57 * c^3 * d + - 63 * b * c * d^2 + - 15 * c^2 * d^2 + - 25 * b^3 * e + - 37 * a^2 * c * e + - 33 * a * c^2 * e + - 19 * c^3 * e + - 22 * a^2 * d * e + - 2 * a * b * d * e + - 16 * b^2 * d * e + - 47 * b * c * d * e + - 22 * c^2 * d * e + - 89 * b * d^2 * e + - 45 * c * d^2 * e + - 24 * a * c * e^2 + - 55 * a * d * e^2 + - b * d * e^2 + - 29 * c * e^3 + - 73 * d * e^3 + - 83 * a^5 + - 65 * a^4 * b + - 42 * a * b^4 + - 15 * b^5 + - 33 * b^4 * c + - 37 * a^3 * c^2 + - 59 * b * c^4 + - 62 * a^2 * b^2 * d + - 79 * a * b^2 * c * d + - 9 * b^2 * c^2 * d + - 26 * c^4 * d + - 89 * a * b^2 * d^2 + - 60 * a^2 * c * d^2 + - 53 * a * c^2 * d^2 + - 49 * b * c^2 * d^2 + - 58 * a * b * d^3 + - 65 * b * c * d^3 + - 90 * c^2 * d^3 + - 22 * a * d^4 + - 35 * b * d^4 + - 2 * c * d^4 + - 81 * d^5 + - 49 * a^3 * b * e + - 28 * a^2 * b^2 * e + - 20 * a^3 * c * e + - 2 * a * b^2 * c * e + - 85 * b^3 * c * e + - 85 * a * b * c^2 * e + - 20 * a * c^3 * e + - 85 * c^4 * e + - 53 * a^3 * d * e + - 26 * a^2 * b * d * e + - 18 * a^2 * c * d * e + - 45 * a * c^2 * d * e + - 76 * a^2 * d^2 * e + - 72 * a * b * d^2 * e + - 88 * a * c * d^2 * e + - 82 * c * d^3 * e + - 3 * a^2 * b * e^2 + - 89 * a * c^2 * e^2 + - 23 * b * c^2 * e^2 + - 2 * a * c * d * e^2 + - 87 * b * c * d * e^2 + - 13 * c^2 * d * e^2 + - 54 * c * d^2 * e^2 + - 44 * c^2 * e^3 + - 4 * a * d * e^3 + - 54 * b * d * e^3 + - 45 * c * d * e^3 + - 14 * e^5, - 35 * a + - 75 * b + - 23 * b^2 + - a * c + - 52 * c^2 + - 66 * a * d + - 90 * b * d + - 59 * a^3 + - 42 * a^2 * c + - 57 * b^2 * c + - 35 * c^3 + - 86 * a^2 * d + - 46 * a * b * d + - 54 * b^2 * d + - 49 * b * d^2 + - 59 * c * d^2 + - 48 * d^3 + - 2 * a^2 * e + - 12 * b * c * e + - 33 * c * d * e + - 34 * d^2 * e + - 55 * a * e^2 + - 36 * a^2 * b^2 + - 64 * b^4 + - 54 * b^3 * c + - 22 * c^4 + - 25 * a^2 * b * d + - 80 * b^3 * d + - 28 * a^2 * c * d + - 47 * a * c^2 * d + - 24 * a * d^3 + - 73 * b * d^3 + - 40 * c * d^3 + - 82 * d^4 + - 31 * a^2 * b * e + - 52 * a * b^2 * e + - 72 * b^3 * e + - 47 * a^2 * c * e + - 39 * a * b * c * e + - 88 * b^2 * c * e + - 63 * c^3 * e + - 47 * a * b * d * e + - 69 * b^2 * d * e + - 10 * b * c * d * e + - 38 * c^2 * d * e + - 65 * b^2 * e^2 + - 72 * a * d * e^2 + - 11 * b * d * e^2 + - 70 * a * e^3 + - 59 * b * e^3 + - 13 * e^4 + - 89 * a^5 + - 59 * a^2 * b^3 + - 67 * a^3 * b * c + - 14 * a * b^3 * c + - 55 * a^3 * c^2 + - 10 * a * b^2 * c^2 + - 70 * a^2 * c^3 + - 41 * a * b * c^3 + - 33 * b * c^4 + - 59 * a^4 * d + - 23 * b^4 * d + - 19 * a^2 * b * c * d + - 20 * a * b^2 * c * d + - 8 * b^3 * c * d + - 78 * c^4 * d + - 61 * a^3 * d^2 + - 12 * a^2 * b * d^2 + - 6 * a * b^2 * d^2 + - 79 * b * c^2 * d^2 + - 56 * c^3 * d^2 + - 51 * a^2 * d^3 + - 4 * b * c * d^3 + - 18 * c^2 * d^3 + - 21 * a * d^4 + - 10 * d^5 + - 38 * a^2 * b^2 * e + - 11 * b^4 * e + - 3 * a^3 * c * e + - 57 * b^3 * c * e + - 40 * a * c^3 * e + - 78 * b * c^3 * e + - 52 * a^3 * d * e + - 19 * a^2 * b * d * e + - 9 * a * b^2 * d * e + - 54 * b^3 * d * e + - 22 * c^3 * d * e + - 66 * a * b * d^2 * e + - 23 * a * c * d^2 * e + - 47 * b * c * d^2 * e + - 11 * b * d^3 * e + - 59 * a^3 * e^2 + - 72 * a^2 * b * e^2 + - 56 * b^2 * c * e^2 + - 11 * c^3 * e^2 + - 23 * a^2 * d * e^2 + - 4 * a * b * d * e^2 + - 84 * c^2 * d * e^2 + - 41 * b * d^2 * e^2 + - 66 * a^2 * e^3 + - 20 * b * c * e^3 + - 73 * c^2 * e^3 + - 66 * b * e^4 + - 30 * c * e^4, - 60 + - 3 * a + - 12 * c + - 33 * d + - 26 * e + - 49 * a * b + - 64 * b^2 + - 68 * a * c + - 3 * c * d + - 42 * d^2 + - 24 * a^2 * b + - 28 * a^2 * c + - 48 * a * b * c + - 68 * b^2 * c + - 89 * b * c^2 + - 4 * a * b * d + - 13 * b^2 * d + - 23 * c^2 * d + - 54 * a * b * e + - 75 * a * c * e + - 14 * b * d * e + - 8 * c * d * e + - 16 * d^2 * e + - 65 * c * e^2 + - 77 * a^4 + - 47 * a * b^3 + - 21 * b^4 + - 5 * a^3 * c + - 48 * b^3 * c + - 76 * a^2 * c^2 + - 68 * a * b * c^2 + - 8 * a * c^3 + - 3 * c^4 + - 27 * a * b^2 * d + - 30 * a * b * c * d + - 40 * a * c^2 * d + - 61 * a^2 * d^2 + - 74 * a * c * d^2 + - 50 * c^2 * d^2 + - 25 * b * d^3 + - 67 * c * d^3 + - 58 * a^3 * e + - 66 * a^2 * c * e + - 2 * a * b * c * e + - 64 * b^2 * c * e + - 40 * b * c * d * e + - 47 * c^2 * d * e + - 36 * a * d^2 * e + - 38 * c * d^2 * e + - 54 * a^2 * e^2 + - 39 * a * b * e^2 + - 46 * b^2 * e^2 + - 11 * a * c * e^2 + - 82 * a * d * e^2 + - 75 * b * e^3 + - 67 * a^5 + - 35 * a^3 * b^2 + - 90 * a^2 * b^3 + - 26 * a * b^4 + - 8 * a^3 * c^2 + - 13 * b^3 * c^2 + - 5 * a^2 * c^3 + - 65 * b^2 * c^3 + - 45 * b * c^4 + - 65 * c^5 + - 10 * a^4 * d + - 56 * b^3 * c * d + - 29 * a^2 * c^2 * d + - 51 * a^2 * b * d^2 + - 9 * a^2 * c * d^2 + - a * b * d^3 + - 28 * b^2 * d^3 + - 3 * a * c * d^3 + - 48 * b^4 * e + - 4 * a^3 * c * e + - 32 * b^3 * c * e + - 15 * a^2 * c^2 * e + - 9 * a * c^3 * e + - 73 * a^3 * d * e + - 32 * a * b^2 * d * e + - 66 * b^3 * d * e + - 87 * a^2 * c * d * e + - 87 * c^3 * d * e + - 50 * a^2 * d^2 * e + - 10 * a * c * d^2 * e + - 4 * a * d^3 * e + - 63 * b * d^3 * e + - 43 * c * d^3 * e + - 90 * d^4 * e + - 32 * a^2 * b * e^2 + - 5 * a * b^2 * e^2 + - 79 * a^2 * c * e^2 + - 74 * a^2 * d * e^2 + - 50 * b^2 * d * e^2 + - 2 * b * c * d * e^2 + - 31 * c^2 * d * e^2 + - 60 * d^3 * e^2 + - 68 * a^2 * e^3 + - 46 * a * b * e^3 + - 66 * b^2 * e^3 + - 38 * a * c * e^3 + - 47 * b * c * e^3 + - 54 * b * d * e^3 + - 30 * c * e^4, - ], - ), - ) + R,[90*a+56*a*c+3*a^2*c+53*b*d^2+90*b^4+60*a*b*c^2+38*c*d^3+66*a^2*d*e+4*b^2*d*e+11*a*e^3+34*b^3*c^2+16*b^3*c*d+59*a*b*c^2*d+12*a*b^2*d^2+23*b*d^4+29*a^3*d*e+90*c^2*d^2*e, +48+57*a*b+25*b^3+17*a^2*d+77*a*d^2+41*a*b*c*d+45*b*d^3+64*d^3*e+4*a*d*e^2+6*a*b^3*c+51*a*b^2*c^2+69*b^2*c^2*d+54*a*c^2*d^2+26*c^3*d^2+51*c*d^4+65*b*d^3*e+46*c*d^3*e+55*b^3*e^2+19*b*c^2*e^2+47*d*e^4, +30*b*d+40*a^2*b+69*c*d*e+15*a*b*c^2+23*c^3*d+85*d*e^3+64*a^3*c^2+75*b^3*c^2+39*c^5+49*a*c^3*d+49*c*d^4])) push!( ideals, Singular.Ideal( - R, - [ - 6 + - 23 * a + - 57 * c + - 19 * a * b + - 36 * b^2 + - 44 * b * d + - c * d + - 78 * d * e + - 69 * e^2 + - 56 * a^3 + - 58 * b * c^2 + - 65 * a * b * d + - 23 * b^2 * d + - 66 * b * c * d + - 12 * a * d^2 + - 60 * d^3 + - 69 * a^2 * e + - 74 * a * c * e + - 36 * a * d * e + - 28 * c * d * e + - 11 * c * e^2 + - 4 * d * e^2 + - 14 * e^3 + - 36 * a^4 + - 72 * a * b^3 + - 29 * b^3 * c + - 37 * a * c^3 + - 63 * b * c^3 + - 39 * a^2 * b * d + - 73 * a * b^2 * d + - 12 * b * c^2 * d + - 60 * b * d^3 + - 79 * a^3 * e + - 8 * a^2 * c * e + - a * b * c * e + - 82 * c^3 * e + - 44 * a * b * d * e + - 88 * a * d^2 * e + - 42 * c * d^2 * e + - 80 * d^3 * e + - 69 * a^2 * e^2 + - 13 * a * b * e^2 + - 40 * a * c * e^2 + - 58 * b * d * e^2 + - 27 * c * d * e^2 + - 8 * d^2 * e^2 + - 15 * c * e^3 + - 86 * e^4 + - 38 * a^5 + - 7 * a^3 * b^2 + - 67 * a^2 * b^3 + - 76 * b^5 + - 51 * a^3 * b * c + - 54 * a^2 * b * c^2 + - 82 * a^2 * c^3 + - 50 * a * b * c^3 + - 70 * b^2 * c^3 + - 67 * a * c^4 + - 49 * b * c^4 + - 8 * a^4 * d + - 35 * a^3 * b * d + - 61 * a^3 * c * d + - 87 * a^2 * c^2 * d + - 89 * a * b * c^2 * d + - 4 * b^2 * c^2 * d + - 40 * b^3 * d^2 + - 22 * a^2 * c * d^2 + - 62 * a * b * c * d^2 + - 55 * b^2 * c * d^2 + - 83 * b * c^2 * d^2 + - 73 * a * b * d^3 + - 65 * b * c * d^3 + - 8 * d^5 + - 73 * a^3 * b * e + - 75 * a^2 * b^2 * e + - 51 * a * b^3 * e + - 5 * a^3 * c * e + - 5 * a^2 * b * c * e + - 4 * a * b^2 * c * e + - 12 * a^2 * c^2 * e + - 48 * a * b * c^2 * e + - 20 * b^2 * c^2 * e + - 26 * c^4 * e + - 29 * b^2 * c * d * e + - 14 * c^3 * d * e + - 7 * a * d^3 * e + - 67 * b * d^3 * e + - 19 * d^4 * e + - 44 * a^3 * e^2 + - 21 * a^2 * b * e^2 + - 84 * b^3 * e^2 + - 85 * b^2 * c * e^2 + - 33 * a * c^2 * e^2 + - 64 * a^2 * d * e^2 + - 29 * b^2 * d * e^2 + - 23 * a * c * d * e^2 + - 79 * c * d^2 * e^2 + - 24 * d^3 * e^2 + - 28 * e^5, - 32 + - 41 * b + - 40 * d + - 56 * c^2 + - 42 * a * d + - 75 * b * d + - 90 * a * e + - 21 * b * e + - 68 * d * e + - 86 * e^2 + - 70 * a^2 * c + - 35 * a * b * c + - 20 * b * c^2 + - 14 * b^2 * d + - 38 * a * c * d + - 61 * b * c * d + - 39 * d^3 + - 66 * a^2 * e + - 42 * a * c * e + - 10 * b * c * e + - 42 * a * d * e + - 65 * b * e^2 + - 37 * a^3 * b + - 49 * a^3 * c + - 59 * a^2 * c^2 + - 17 * a * b * c^2 + - 40 * c^4 + - 41 * a^2 * b * d + - 26 * b^3 * d + - 83 * a^2 * c * d + - 89 * b^2 * c * d + - 8 * a * c^2 * d + - 24 * b * c^2 * d + - 16 * a^2 * d^2 + - 12 * a * c * d^2 + - 10 * a * d^3 + - 22 * c * d^3 + - 26 * d^4 + - 21 * a * b^2 * e + - 55 * a^2 * c * e + - 46 * a * b * c * e + - 37 * b^2 * c * e + - 59 * b^2 * d * e + - 83 * c * d^2 * e + - 25 * a^2 * e^2 + - 58 * c * d * e^2 + - 31 * d^2 * e^2 + - 35 * e^4 + - 79 * a^5 + - 38 * a^3 * b^2 + - 64 * a * b^4 + - 70 * b^5 + - a^2 * b^2 * c + - 54 * b^3 * c^2 + - 73 * a * b * c^3 + - 10 * b^2 * c^3 + - 56 * a * c^4 + - 50 * a * b^3 * d + - 27 * a^3 * c * d + - 80 * a^2 * b * c * d + - 36 * a * b * c^2 * d + - 17 * a * c^3 * d + - 32 * c^4 * d + - 18 * a^2 * c * d^2 + - 30 * a * b * c * d^2 + - 50 * a^2 * d^3 + - 45 * b^2 * d^3 + - 48 * c^2 * d^3 + - 28 * d^5 + - 45 * a^4 * e + - 49 * a * b^3 * e + - 62 * a^3 * c * e + - 64 * a * b^2 * c * e + - 57 * b * c^3 * e + - 24 * a^3 * d * e + - 7 * a * b^2 * d * e + - 22 * a * c^2 * d * e + - 76 * a * b * d^2 * e + - 77 * b^2 * d^2 * e + - 18 * c^2 * d^2 * e + - 46 * c * d^3 * e + - 26 * a^2 * b * e^2 + - 62 * b^3 * e^2 + - 37 * a * b * c * e^2 + - 48 * b^2 * c * e^2 + - 64 * a * c^2 * e^2 + - 35 * c^3 * e^2 + - 84 * a^2 * d * e^2 + - 3 * a * b * d * e^2 + - 5 * c^2 * d * e^2 + - 10 * a * b * e^3 + - 5 * a * c * e^3 + - 25 * c^2 * e^3 + - 81 * a * e^4 + - 75 * c * e^4 + - d * e^4, - 28 * a + - 13 * c + - 85 * a * b + - 50 * b^2 + - 16 * a * c + - 65 * b * d + - 65 * b * e + - 5 * a * b^2 + - 90 * b^3 + - 58 * b^2 * c + - 86 * a * c^2 + - 80 * a * b * d + - 13 * a * c * d + - 61 * b * c * d + - 73 * a * d^2 + - 88 * b * c * e + - 67 * c^2 * e + - 21 * b * d * e + - 82 * c * d * e + - 84 * a * e^2 + - 7 * b * e^2 + - 61 * d * e^2 + - 66 * e^3 + - 31 * a^4 + - 82 * a^2 * b^2 + - 7 * a * b^3 + - 55 * b^4 + - 72 * a^3 * c + - 65 * a^2 * c^2 + - 51 * b * c^3 + - 66 * c^4 + - 5 * a^2 * c * d + - 56 * b^2 * c * d + - 26 * c^3 * d + - 58 * a^2 * d^2 + - 18 * a * b * d^2 + - 14 * a * c * d^2 + - 19 * c^2 * d^2 + - 80 * c * d^3 + - 76 * a^3 * e + - 51 * a^2 * b * e + - 63 * a * b^2 * e + - 20 * a * c^2 * e + - 32 * c^3 * e + - 38 * b^2 * d * e + - 12 * a * c * d * e + - 40 * b * c * d * e + - 60 * a * d^2 * e + - 76 * c * d^2 * e + - 32 * d^3 * e + - 25 * a^2 * e^2 + - 82 * a * c * e^2 + - 26 * b * c * e^2 + - 8 * c^2 * e^2 + - 67 * b * d * e^2 + - 31 * e^4 + - 49 * a^4 * b + - 41 * a^2 * b^3 + - 22 * b^5 + - 69 * a^4 * c + - 8 * b^3 * c^2 + - a^2 * c^3 + - 90 * a * c^4 + - 49 * c^5 + - 50 * a^3 * b * d + - 8 * a * b^3 * d + - 65 * a * b^2 * c * d + - 55 * b^3 * c * d + - 23 * a^2 * c^2 * d + - 55 * b^2 * c^2 * d + - 50 * a * c^3 * d + - 28 * c^4 * d + - 62 * a^3 * d^2 + - 10 * a * b^2 * d^2 + - 34 * b^3 * d^2 + - 3 * a * b * c * d^2 + - 63 * a * c^2 * d^2 + - 6 * c^3 * d^2 + - 40 * a^2 * d^3 + - 17 * b * d^4 + - 72 * a^3 * b * e + - 3 * a * b^2 * d * e + - 24 * b^3 * d * e + - 3 * a^2 * c * d * e + - 35 * c^3 * d * e + - 24 * a * b * d^2 * e + - 54 * b^2 * d^2 * e + - 52 * a * d^3 * e + - 33 * c * d^3 * e + - 21 * a * b^2 * e^2 + - 88 * a * b * c * e^2 + - 50 * c^3 * e^2 + - 86 * a * b * d * e^2 + - 4 * b^2 * d * e^2 + - 25 * c^2 * d * e^2 + - 59 * a * d^2 * e^2 + - 64 * b * d^2 * e^2 + - 12 * c * d^2 * e^2 + - 29 * d^3 * e^2 + - a^2 * e^3 + - 12 * a * b * e^3 + - 2 * b^2 * e^3 + - 28 * a * c * e^3 + - 77 * b * c * e^3 + - 59 * c^2 * e^3 + - 38 * b * d * e^3 + - 4 * c * d * e^3 + - 51 * a * e^4 + - 20 * b * e^4, - ], - ), - ) + R,[63*b*e+76*e^2+60*a*c*d+76*e^3+22*a^3*c+72*a*c*e^2+83*c^2*e^2+33*a^2*b^2*c+45*a^2*b*c*d+90*b*c^3*e+3*a^3*d*e+15*c^3*d*e+75*a*c*e^3+28*b*c*e^3+77*c^2*e^3, +35+83*d*e+65*b*c^2+29*c*d^2+33*d^2*e+20*a^2*c^2+67*a^3*d+20*a^2*b*d+4*d^4+54*a*c*d*e+50*b*c*d*e+77*a^4*c+22*b^4*c+62*a*b*c^3+11*a^2*b^2*d+19*a^2*b*c*d+19*c^4*d+24*a*b*c*d^2+32*a*b*d^3+45*c*d^3*e+29*b^2*e^3+23*b*d*e^3, +45*a+74*b^2*c+17*d*e^2+26*a*b^2*d+22*c^3*d+2*c*e^3+17*d*e^3+46*a*b^3*c+73*b^3*c*d+3*a^2*b^2*e+4*c^4*e])) for i in ideals - runb("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(4*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(6),90)", i, S, StartOrd, TarOrd) end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 67 + - 51 * b + - 20 * d + - 40 * a * b + - a * c + - 30 * c * d + - 21 * a * e + - 19 * b * e + - 30 * c * e + - 84 * a^2 * b + - 29 * a * b^2 + - 90 * b^2 * c + - 36 * c^3 + - 65 * a * c * d + - 4 * b * c * d + - 80 * a * b * e + - 23 * a * c * e + - 55 * b * c * e + - 39 * c^2 * e + - 57 * b * d * e + - 59 * d^2 * e + - 76 * a * e^2 + - 83 * d * e^2 + - 37 * e^3 + - 10 * a^3 * b + - 49 * a^2 * b^2 + - 58 * a * b^3 + - 25 * b^4 + - 58 * a^2 * b * c + - 4 * b^3 * c + - 57 * a * c^3 + - 85 * b * c^3 + - 58 * a * b^2 * d + - 62 * a^2 * c * d + - 63 * b^2 * c * d + - 6 * a * c * d^2 + - 57 * a * d^3 + - 15 * b * d^3 + - 2 * c * d^3 + - 31 * b^3 * e + - 80 * a * b * c * e + - 63 * c^3 * e + - 46 * b^2 * d * e + - 5 * c^2 * d * e + - 43 * c * d^2 * e + - 85 * d^3 * e + - 42 * a * b * e^2 + - 6 * b^2 * e^2 + - 59 * a * c * e^2 + - a * d * e^2 + - 86 * b * d * e^2 + - 2 * c * d * e^2 + - 69 * d^2 * e^2 + - 48 * a * e^3 + - 30 * b * e^3 + - 74 * c * e^3 + - 61 * d * e^3 + - 23 * a^5 + - 71 * a^3 * b^2 + - 19 * a^2 * b^3 + - 69 * a * b^4 + - 88 * b^5 + - 90 * b^4 * c + - 46 * a^2 * b * c^2 + - 42 * a * b^2 * c^2 + - 43 * b^3 * c^2 + - 60 * a^2 * c^3 + - 8 * a * b * c^3 + - 17 * b^2 * c^3 + - 76 * a * c^4 + - 79 * b * c^4 + - 26 * c^5 + - 58 * a^4 * d + - 22 * a^3 * b * d + - 15 * a * b^3 * d + - 30 * a^3 * c * d + - 38 * a^2 * b * c * d + - 67 * a * b^2 * c * d + - 13 * a * b * c^2 * d + - 76 * b * c^3 * d + - 57 * c^4 * d + - 77 * a^3 * d^2 + - 29 * a^2 * b * d^2 + - 20 * a * b^2 * d^2 + - 40 * a * c^2 * d^2 + - 41 * a^2 * d^3 + - 84 * b^2 * d^3 + - 6 * a * c * d^3 + - 32 * c^2 * d^3 + - 12 * d^5 + - 45 * a^4 * e + - 59 * a^3 * c * e + - 14 * b^3 * c * e + - 27 * a^2 * c^2 * e + - 17 * a * b * c^2 * e + - 78 * b^2 * c^2 * e + - 15 * a^2 * b * d * e + - 4 * b^3 * d * e + - 7 * a^2 * c * d * e + - a * b * c * d * e + - 82 * b * c * d^2 * e + - 10 * c^2 * d^2 * e + - 38 * a * d^3 * e + - 20 * d^4 * e + - 77 * a^3 * e^2 + - 80 * a^2 * c * e^2 + - 83 * a * c^2 * e^2 + - 12 * b * c^2 * e^2 + - 56 * a * c * d * e^2 + - 70 * c^2 * d * e^2 + - 83 * a * d^2 * e^2 + - 43 * c * d^2 * e^2 + - 85 * d^3 * e^2 + - 14 * a * b * e^3 + - 77 * b^2 * e^3 + - 59 * a * c * e^3 + - 29 * b * c * e^3 + - 89 * c^2 * e^3 + - 63 * a * d * e^3 + - 38 * b * d * e^3 + - 49 * d^2 * e^3 + - 76 * a * e^4 + - 18 * c * e^4 + - 69 * d * e^4, - 17 * a + - 79 * c + - 73 * e + - 73 * a * b + - 68 * b^2 + - 5 * a * c + - 18 * b * c + - 90 * a * d + - 29 * b * d + - 63 * d^2 + - 86 * b * e + - 25 * c * e + - 53 * d * e + - 10 * a^3 + - 24 * a * b^2 + - 53 * b^3 + - 13 * a^2 * c + - 32 * a * b * c + - 64 * b^2 * c + - 86 * b * c^2 + - 27 * c^3 + - 37 * a^2 * d + - 43 * a * d^2 + - 52 * c * d^2 + - 14 * a^2 * e + - 44 * a * b * e + - 75 * a * c * e + - 54 * b * c * e + - 90 * c^2 * e + - 25 * d^2 * e + - 86 * a * e^2 + - 77 * d * e^2 + - 10 * a^4 + - 6 * a^3 * b + - 38 * a^2 * b^2 + - 14 * a * b^3 + - 29 * b^4 + - 67 * a^2 * b * c + - 71 * b^3 * c + - 36 * b^2 * c^2 + - 49 * a^2 * b * d + - 63 * a * b^2 * d + - 65 * b^3 * d + - 24 * a^2 * c * d + - 76 * a * c^2 * d + - 56 * c^3 * d + - 79 * a^2 * d^2 + - 19 * b^2 * d^2 + - 79 * a * c * d^2 + - 44 * b * d^3 + - 8 * c * d^3 + - 62 * a^2 * b * e + - 86 * a * b^2 * e + - 17 * a * b * c * e + - a * c^2 * e + - 63 * b * c^2 * e + - 70 * a * b * d * e + - 65 * b^2 * d * e + - 63 * a * c * d * e + - 73 * c * d^2 * e + - 71 * a^2 * e^2 + - 33 * a * b * e^2 + - 85 * b^2 * e^2 + - 14 * a * c * e^2 + - 56 * b * c * e^2 + - 36 * c^2 * e^2 + - 25 * b * d * e^2 + - 84 * d^2 * e^2 + - 38 * b * e^3 + - 28 * d * e^3 + - 24 * a^2 * b^3 + - 85 * a^4 * c + - 39 * a^2 * b^2 * c + - 18 * a * b^3 * c + - 52 * b^4 * c + - 50 * a^3 * c^2 + - 49 * a^2 * b * c^2 + - 28 * a * b * c^3 + - 52 * a^4 * d + - 90 * b^4 * d + - 17 * a^2 * b * c * d + - 43 * a * b^2 * c * d + - 80 * a^2 * c^2 * d + - 86 * a * c^3 * d + - 75 * a^2 * b * d^2 + - 70 * a^2 * c * d^2 + - 33 * a * b * c * d^2 + - 4 * b^2 * c * d^2 + - 6 * a * c^2 * d^2 + - 15 * b * c^2 * d^2 + - 10 * a * b * d^3 + - 85 * b^2 * d^3 + - 8 * a * c * d^3 + - 74 * b * d^4 + - 32 * d^5 + - 33 * a^3 * b * e + - 12 * a * b^3 * e + - 23 * a^3 * c * e + - 9 * a^2 * b * c * e + - 10 * a * b^2 * c * e + - 74 * a * b * c^2 * e + - 21 * b^2 * c^2 * e + - 78 * a^3 * d * e + - 50 * a^2 * c * d * e + - 14 * b * c^2 * d * e + - 67 * c^3 * d * e + - 38 * b^2 * d^2 * e + - 31 * a * c * d^2 * e + - 35 * a * d^3 * e + - 51 * b * d^3 * e + - 85 * c * d^3 * e + - 50 * a^2 * b * e^2 + - 89 * a^2 * c * e^2 + - 17 * b^2 * c * e^2 + - b * c^2 * e^2 + - 89 * c^3 * e^2 + - 29 * a * c * d * e^2 + - 11 * a * d^2 * e^2 + - 30 * c * d^2 * e^2 + - 62 * d^3 * e^2 + - 67 * a^2 * e^3 + - 90 * a * b * e^3 + - 75 * b^2 * e^3 + - 47 * c * d * e^3 + - 16 * a * e^4 + - 2 * b * e^4 + - 65 * c * e^4 + - 49 * e^5, - 79 + - 81 * c + - 45 * d + - 2 * e + - 41 * b^2 + - 70 * a * c + - 60 * c^2 + - a * d + - 88 * a * e + - 19 * b * e + - 23 * e^2 + - a^3 + - 85 * a * b^2 + - 17 * a * b * c + - 20 * a * c^2 + - 38 * b * c^2 + - 67 * c^3 + - 6 * a^2 * d + - 40 * a * b * d + - 2 * a * c * d + - 9 * b * d^2 + - 65 * a^2 * e + - 20 * a * b * e + - 89 * b^2 * e + - 42 * b * c * e + - 55 * c^2 * e + - 73 * a * d * e + - 28 * b * d * e + - 70 * b * e^2 + - c * e^2 + - 17 * a^4 + - 88 * a^3 * b + - 44 * b^4 + - 41 * a^3 * c + - a^2 * b * c + - 53 * a * b^2 * c + - 89 * a * b * c^2 + - 83 * a * c^3 + - 84 * c^4 + - 24 * a^3 * d + - 67 * a^2 * b * d + - 20 * a^2 * c * d + - 36 * b * c^2 * d + - 24 * a * b * d^2 + - 18 * a * d^3 + - 41 * b * d^3 + - 12 * c * d^3 + - 29 * a^2 * b * e + - 73 * b^3 * e + - 19 * a * b * c * e + - 27 * b^2 * c * e + - 15 * b * c^2 * e + - 61 * c^3 * e + - 40 * a * b * d * e + - 61 * b^2 * d * e + - 67 * c^2 * d * e + - 14 * a * d^2 * e + - 11 * a^2 * e^2 + - 51 * a * b * e^2 + - 85 * b * c * e^2 + - 19 * c * d * e^2 + - 7 * a * e^3 + - 88 * b * e^3 + - 36 * d * e^3 + - 51 * a^5 + - 17 * a^4 * b + - 59 * a^3 * b^2 + - 85 * a * b^4 + - 83 * a^3 * b * c + - 76 * a^2 * b^2 * c + - 33 * b^4 * c + - 42 * a^2 * c^3 + - 32 * b^2 * c^3 + - 42 * a * c^4 + - 25 * b * c^4 + - 78 * a^4 * d + - 29 * a^3 * b * d + - 18 * a^2 * b^2 * d + - 49 * b^4 * d + - 48 * a^3 * c * d + - 81 * a^2 * c^2 * d + - 55 * b^2 * c^2 * d + - 71 * a * c^3 * d + - 9 * a^2 * b * d^2 + - 69 * a * b * c * d^2 + - 47 * b * c^2 * d^2 + - 52 * a * b * d^3 + - 39 * b^2 * d^3 + - 16 * b * c * d^3 + - 50 * c^2 * d^3 + - 10 * a * d^4 + - 19 * a^4 * e + - 14 * a^2 * b^2 * e + - 14 * b^4 * e + - 63 * a^3 * c * e + - 57 * a^2 * b * c * e + - 60 * b^3 * c * e + - 80 * a * b * c^2 * e + - 21 * a^2 * b * d * e + - 22 * b^3 * d * e + - 73 * a * b * c * d * e + - 43 * a * c^2 * d * e + - 49 * b * c^2 * d * e + - 61 * c^3 * d * e + - 73 * a^2 * d^2 * e + - 24 * a * b * d^2 * e + - 84 * a * c * d^2 * e + - 39 * b * c * d^2 * e + - 18 * c^2 * d^2 * e + - 61 * a * d^3 * e + - 84 * c * d^3 * e + - 51 * d^4 * e + - 50 * a^2 * c * e^2 + - 57 * a * c^2 * e^2 + - 59 * b * c^2 * e^2 + - 4 * c^3 * e^2 + - 48 * a^2 * d * e^2 + - 22 * b * c * d * e^2 + - 33 * c^2 * d * e^2 + - a * b * e^3 + - 76 * b^2 * e^3 + - 34 * b * c * e^3 + - 59 * a * d * e^3 + - 7 * b * d * e^3 + - 27 * d^2 * e^3 + - 79 * a * e^4 + - 7 * c * e^4 + - 39 * e^5, - ], - ), - ) + R,[4+25*d+56*b^2+48*b*d+22*a*b^2+88*b^2*d+37*a*b*e+80*c^4+10*b*c*d^2+60*c*d^2*e+39*c^2*e^2+60*a*b^3*c+53*a*c^4+29*c^5+32*a*b*c^2*d+8*a*c*d^3+21*a^2*b^2*e+14*a*b^3*e+68*c*e^4, +5*b*c+84*d^2+55*a*b^2+31*b^2*c+7*b^3*d+14*a^2*d^2+81*b^3*e+67*b*d^2*e+64*a*c*e^2+24*a^2*b^2*c+83*b^3*c^2+40*a^4*d+80*b^4*d+23*b*c^3*d+76*a^3*d^2+50*b*d^4+3*a^4*e+62*c^3*e^2+53*b^2*d*e^2+60*c^2*d*e^2+35*d^3*e^2+77*d*e^4, +86*b+81*c^2*d+72*b*d^2+63*d^3+10*a*b^3+14*b^2*c^2+64*b^3*d+47*a^3*e+61*a^2*c*e+25*c*d*e^2+48*c^4*d+88*a^2*c*d^2+58*a*c^2*d^2+20*b*c*d^3+82*b^3*c*e+85*b*d*e^3])) push!( ideals, Singular.Ideal( - R, - [ - 83 * a + - 51 * c + - 76 * d + - 52 * e + - 25 * a * b + - 31 * b * c + - 48 * c^2 + - 61 * a * d + - 75 * c * d + - 27 * d^2 + - 13 * a * e + - 4 * d * e + - 57 * e^2 + - 64 * a * b^2 + - 19 * a * c^2 + - 52 * c^3 + - 11 * a * b * d + - 42 * b^2 * d + - 72 * b * c * d + - 51 * c * d^2 + - 16 * d^3 + - 13 * b^2 * e + - 31 * a * c * e + - 28 * c^2 * e + - 50 * b * d * e + - c * d * e + - 82 * b * e^2 + - 67 * c * e^2 + - 53 * d * e^2 + - 17 * e^3 + - 32 * a^3 * b + - 14 * a * b^3 + - 84 * b^4 + - 6 * a^2 * c^2 + - 19 * a * c^3 + - 2 * c^4 + - 75 * a^3 * d + - 64 * a * b^2 * d + - 45 * b^3 * d + - 43 * a * c^2 * d + - 39 * b * c^2 * d + - 57 * c^3 * d + - 46 * a * b * d^2 + - 27 * c^2 * d^2 + - 86 * a * d^3 + - 31 * c * d^3 + - 88 * d^4 + - 46 * a^3 * e + - 88 * a^2 * c * e + - 65 * a * b * c * e + - 33 * b^2 * c * e + - 69 * a * c^2 * e + - 15 * c^3 * e + - 58 * b^2 * d * e + - 26 * b * c * d * e + - 83 * a * b * e^2 + - 60 * b^2 * e^2 + - 40 * b * c * e^2 + - 83 * c^2 * e^2 + - 27 * b * d * e^2 + - 3 * d * e^3 + - 18 * e^4 + - 45 * a^5 + - 80 * a^4 * b + - 45 * a^4 * c + - 75 * a * b^3 * c + - 40 * b^4 * c + - 30 * a^3 * c^2 + - 66 * a^2 * c^3 + - 54 * a * b * c^3 + - 2 * b^2 * c^3 + - 71 * b * c^4 + - 88 * a^4 * d + - 61 * a * b^3 * d + - 38 * a^3 * c * d + - 49 * b^3 * c * d + - 39 * a^2 * c^2 * d + - 26 * b * c^3 * d + - 86 * a^3 * d^2 + - 72 * a^2 * b * d^2 + - 65 * a * b^2 * d^2 + - 56 * b^3 * d^2 + - 43 * b^2 * c * d^2 + - 24 * a * c^2 * d^2 + - 38 * c^3 * d^2 + - 3 * a^2 * d^3 + - 2 * a * c * d^3 + - 14 * b * c * d^3 + - 67 * c^2 * d^3 + - 76 * a * d^4 + - 65 * c * d^4 + - 3 * a^4 * e + - 14 * a^3 * b * e + - 6 * a^3 * c * e + - 31 * b^3 * c * e + - 40 * a * b * c^2 * e + - 24 * a * c^3 * e + - 48 * c^4 * e + - 86 * a * b * c * d * e + - 9 * a * c^2 * d * e + - 55 * b * c^2 * d * e + - 27 * c^3 * d * e + - 62 * a * b * d^2 * e + - 78 * a * c * d^2 * e + - 39 * c^2 * d^2 * e + - 50 * b * d^3 * e + - 55 * a^2 * b * e^2 + - 37 * a^2 * c * e^2 + - 73 * a * b * c * e^2 + - 48 * b^2 * c * e^2 + - 29 * b * c^2 * e^2 + - 61 * a * b * d * e^2 + - 66 * a * c * d * e^2 + - 27 * b * c * d * e^2 + - 18 * b * d^2 * e^2 + - 45 * c * d^2 * e^2 + - 31 * a^2 * e^3 + - 59 * b^2 * e^3 + - 27 * a * d * e^3 + - 66 * b * d * e^3 + - 3 * c * d * e^3 + - 70 * a * e^4 + - 77 * b * e^4, - 24 + - b + - 26 * e + - 14 * a^2 + - 84 * a * c + - 73 * c^2 + - 54 * a * e + - 88 * b * e + - 60 * c * e + - 87 * d * e + - 5 * a^3 + - 35 * b^3 + - 53 * b^2 * c + - 87 * a * c^2 + - 13 * b * c^2 + - 19 * a^2 * d + - 53 * b^2 * d + - 73 * a * c * d + - 70 * b * c * d + - 49 * b * d^2 + - 64 * d^3 + - 69 * a * b * e + - 62 * b^2 * e + - 63 * a * c * e + - 16 * b * c * e + - 39 * c^2 * e + - 88 * a * d * e + - 54 * c * d * e + - 49 * b * e^2 + - 63 * c * e^2 + - 45 * d * e^2 + - 56 * a^3 * b + - 65 * a * b^3 + - 42 * a^3 * c + - 48 * a^2 * b * c + - 5 * b^3 * c + - 76 * a^2 * c^2 + - 77 * b^2 * c^2 + - 39 * a * c^3 + - 41 * b * c^3 + - 72 * c^4 + - 49 * a^3 * d + - 5 * a^2 * b * d + - 42 * b^3 * d + - 73 * a^2 * c * d + - 9 * a * b * c * d + - 72 * b^2 * c * d + - 11 * a * c^2 * d + - 58 * b * c^2 * d + - 60 * a * b * d^2 + - 3 * b^2 * d^2 + - 58 * a * c * d^2 + - 23 * a^3 * e + - 54 * a^2 * b * e + - 51 * b^3 * e + - 12 * a^2 * c * e + - 69 * b^2 * c * e + - 12 * a * b * d * e + - 42 * a * c * d * e + - 87 * b * c * d * e + - 62 * c^2 * d * e + - 35 * c * d^2 * e + - 44 * a^2 * e^2 + - 15 * a * b * e^2 + - 43 * a * c * e^2 + - 6 * b * c * e^2 + - 14 * c * d * e^2 + - 8 * d^2 * e^2 + - 74 * a * e^3 + - 42 * d * e^3 + - 31 * a^5 + - 49 * a^4 * b + - 41 * a^3 * b^2 + - 83 * a * b^4 + - 41 * b^5 + - 81 * a^3 * b * c + - 64 * a^2 * b^2 * c + - 12 * a * b^3 * c + - 31 * a^3 * c^2 + - 64 * a^2 * b * c^2 + - 33 * b^3 * c^2 + - 43 * b^2 * c^3 + - 15 * b * c^4 + - 49 * c^5 + - 48 * a^4 * d + - 4 * a^3 * b * d + - 38 * a^3 * c * d + - 80 * a * b^2 * c * d + - 37 * b^3 * c * d + - 58 * b * c^3 * d + - 67 * a^2 * b * d^2 + - 58 * a * b^2 * d^2 + - 19 * b^3 * d^2 + - 33 * a^2 * c * d^2 + - 24 * a * b * c * d^2 + - 4 * b^2 * c * d^2 + - 18 * a * c^2 * d^2 + - 74 * c^3 * d^2 + - 64 * a^2 * d^3 + - 4 * b^2 * d^3 + - 24 * b * c * d^3 + - 20 * b * d^4 + - 14 * d^5 + - 20 * a^2 * b^2 * e + - 78 * a * b^3 * e + - 67 * a^3 * c * e + - 22 * a^2 * c^2 * e + - 4 * a * b * c^2 * e + - 79 * a * c^3 * e + - 52 * b * c^3 * e + - 76 * a * b^2 * d * e + - 39 * b^3 * d * e + - 26 * a^2 * c * d * e + - 46 * a * b * c * d * e + - 47 * b * c^2 * d * e + - 31 * c^3 * d * e + - 85 * a^2 * d^2 * e + - 3 * b^2 * d^2 * e + - 37 * a * c * d^2 * e + - 58 * b * c * d^2 * e + - 55 * a * d^3 * e + - 83 * b * d^3 * e + - 85 * c * d^3 * e + - 12 * b^3 * e^2 + - 15 * a^2 * c * e^2 + - 16 * a * b * c * e^2 + - 74 * a * c^2 * e^2 + - 69 * a * b * d * e^2 + - 19 * a * d^2 * e^2 + - 48 * b * d^2 * e^2 + - 45 * b^2 * e^3 + - 26 * b * d * e^3, - 31 + - 59 * c + - 41 * e + - 17 * a * b + - 51 * a * d + - 72 * b * d + - 80 * c * d + - 57 * b * e + - 81 * d * e + - 23 * e^2 + - 79 * a^3 + - 20 * a * b^2 + - 6 * a^2 * c + - 6 * b^2 * c + - 15 * a * c * d + - 88 * c^2 * d + - 4 * d^3 + - 42 * a^2 * e + - 68 * b * c * e + - 42 * c^2 * e + - 35 * b * d * e + - 82 * c * d * e + - 38 * d^2 * e + - 65 * a * e^2 + - 69 * b * e^2 + - 58 * a^4 + - 63 * a^2 * b^2 + - 18 * b^3 * c + - 48 * b^2 * c^2 + - 83 * a * c^3 + - 47 * b * c^3 + - 67 * a^2 * b * d + - 59 * a^2 * c * d + - 48 * a * b * c * d + - 6 * a * c^2 * d + - 64 * b * c^2 * d + - 2 * c^3 * d + - 70 * a^2 * d^2 + - 26 * a * b * d^2 + - 45 * b * c * d^2 + - 29 * c^2 * d^2 + - 11 * a * d^3 + - 45 * c * d^3 + - 89 * a^3 * e + - 57 * a^2 * b * e + - 80 * a * b^2 * e + - 5 * a * b * c * e + - 76 * c^3 * e + - 5 * a^2 * d * e + - 49 * d^3 * e + - 16 * a * b * e^2 + - 83 * a * c * e^2 + - 64 * b * c * e^2 + - 5 * c^2 * e^2 + - 37 * b * d * e^2 + - 81 * c * d * e^2 + - 73 * d^2 * e^2 + - 32 * c * e^3 + - 4 * d * e^3 + - 47 * a^5 + - 56 * a^4 * b + - 20 * b^5 + - 38 * a^3 * b * c + - 69 * a^2 * b^2 * c + - 27 * a * b^3 * c + - 31 * a^3 * c^2 + - 27 * a^2 * b * c^2 + - 22 * a * b^2 * c^2 + - 80 * b^3 * c^2 + - 76 * a^2 * c^3 + - 11 * a * b * c^3 + - 75 * a * c^4 + - 12 * b * c^4 + - 24 * c^5 + - 7 * a^4 * d + - 17 * a^3 * b * d + - 79 * a^2 * b^2 * d + - 80 * a * b^3 * d + - 45 * a^3 * c * d + - 45 * a^2 * b * c * d + - 6 * a * b * c^2 * d + - 64 * a * c^3 * d + - 49 * b * c^3 * d + - 15 * c^4 * d + - 90 * b^3 * d^2 + - 69 * a * c^2 * d^2 + - 66 * c^3 * d^2 + - 26 * b^2 * d^3 + - 28 * b * c * d^3 + - 77 * b * d^4 + - 52 * c * d^4 + - 32 * d^5 + - 3 * a^3 * b * e + - 42 * a^3 * c * e + - 41 * b^3 * c * e + - 46 * a * b * c^2 * e + - a * b^2 * d * e + - 72 * b^3 * d * e + - 13 * a^2 * c * d * e + - 47 * a * b * c * d * e + - 56 * a * c^2 * d * e + - 66 * c^3 * d * e + - 68 * a^2 * d^2 * e + - 15 * a * b * d^2 * e + - 58 * a * c * d^2 * e + - 36 * c * d^3 * e + - 57 * d^4 * e + - 90 * b^3 * e^2 + - 90 * a * b * c * e^2 + - 7 * b^2 * c * e^2 + - 67 * a * c^2 * e^2 + - 71 * c^3 * e^2 + - 46 * a^2 * d * e^2 + - 32 * b * c * d * e^2 + - 36 * c^2 * d * e^2 + - 43 * a * d^2 * e^2 + - 78 * c * d^2 * e^2 + - 16 * a * b * e^3 + - 49 * b^2 * e^3 + - 64 * a * c * e^3 + - 59 * a * d * e^3 + - 20 * d^2 * e^3 + - 72 * a * e^4 + - 36 * b * e^4 + - 70 * c * e^4, - ], - ), - ) + R,[7*c*d+81*a^3+48*a*c*e+32*a*b^2*e+75*a^2*c*e+59*a*c^2*e+41*a*b*d*e+57*d^2*e^2+8*b*e^3+33*c^4*d+45*a^2*b*d^2+40*b^4*e+39*a*d*e^3, +63+80*a+28*b+24*c*d+24*a^3*c+56*a*c^3+23*c^3*d+74*a^2*d^2+62*c*d^2*e+78*a^2*b^2*d+18*a^2*c*d^2+2*c*d^4+42*a^2*d^2*e+24*c*d^3*e+18*b^3*e^2+27*a*c^2*e^2+34*c^3*e^2+57*a^2*d*e^2+90*a*c*d*e^2+42*a*d*e^3+13*c*d*e^3, +75*a^2+60*b^2+68*c*d^2+88*d^3+86*a^2*e+4*a*b*e+65*c*d*e+73*e^3+71*b^3*d+65*b*c*d^2+85*c^3*e+21*c*d*e^2+29*a^2*b^3+20*a^2*b^2*c+90*a^2*b^2*d+5*a*b*d^3+26*a^2*b*c*e+87*a^3*d*e+25*a*b^2*d*e+90*a^2*c*e^2+34*b^2*e^3+55*c*d*e^3+83*a*e^4])) push!( ideals, Singular.Ideal( - R, - [ - 41 + - 30 * a + - b + - 56 * d + - 75 * a^2 + - 39 * b * c + - 86 * b * d + - 51 * c * d + - 37 * a * e + - c * e + - 23 * d * e + - 49 * e^2 + - 12 * a^3 + - 41 * a^2 * b + - 55 * a^2 * c + - 57 * a * b * c + - 8 * a * b * d + - 44 * b * c * d + - 38 * a * d^2 + - 81 * d^3 + - 75 * a^2 * e + - 83 * a * b * e + - 55 * b^2 * e + - 69 * a * c * e + - 34 * b * c * e + - 86 * c^2 * e + - 11 * a * d * e + - 46 * b * d * e + - 28 * c * d * e + - 55 * d^2 * e + - 57 * a * e^2 + - 83 * b * e^2 + - 19 * c * e^2 + - 54 * e^3 + - a^3 * b + - 86 * a^2 * b^2 + - 59 * a * b^3 + - 74 * a^2 * c^2 + - 73 * c^4 + - 66 * a^3 * d + - 38 * a^2 * b * d + - 70 * a * b^2 * d + - 45 * a * b * c * d + - 38 * a * c^2 * d + - 47 * b * c^2 * d + - 81 * a^2 * d^2 + - 14 * b^2 * d^2 + - 72 * c^2 * d^2 + - 22 * a^3 * e + - 90 * b^3 * e + - 44 * a^2 * c * e + - 20 * a * c^2 * e + - 44 * a * b * d * e + - 24 * b^2 * d * e + - 63 * a * c * d * e + - 37 * c^2 * d * e + - 17 * c * d^2 * e + - 2 * d^3 * e + - 18 * a^2 * e^2 + - 53 * c^2 * e^2 + - 76 * c * d * e^2 + - 81 * d^2 * e^2 + - 20 * a * e^3 + - 16 * d * e^3 + - 62 * a^5 + - 18 * a * b^4 + - 62 * b^5 + - 49 * a^3 * b * c + - 29 * b^4 * c + - 30 * a^2 * b * c^2 + - 22 * b^3 * c^2 + - 40 * a^2 * c^3 + - 85 * a^3 * b * d + - 29 * b^4 * d + - 45 * a^2 * b * c * d + - 74 * a * b^2 * c * d + - 34 * a^2 * c^2 * d + - 83 * a^3 * d^2 + - 15 * b^2 * c * d^2 + - 67 * b * c^2 * d^2 + - 33 * a * b * d^3 + - 89 * b^2 * d^3 + - 49 * a * c * d^3 + - 30 * b * c * d^3 + - 81 * c^2 * d^3 + - 6 * b * d^4 + - 76 * c * d^4 + - 57 * d^5 + - 35 * a^4 * e + - 26 * a^3 * b * e + - 40 * a^3 * c * e + - 18 * b^3 * c * e + - 61 * a^2 * c^2 * e + - 40 * b^2 * c^2 * e + - 66 * c^4 * e + - 11 * a^3 * d * e + - 67 * a^2 * b * d * e + - 78 * a * b^2 * d * e + - 67 * b^3 * d * e + - 15 * a^2 * c * d * e + - 85 * a * b * c * d * e + - 67 * a * c^2 * d * e + - 4 * b * c^2 * d * e + - 43 * b * c * d^2 * e + - 32 * a * d^3 * e + - 64 * d^4 * e + - 17 * a^3 * e^2 + - 79 * a^2 * b * e^2 + - 42 * a * b^2 * e^2 + - 32 * a^2 * c * e^2 + - 43 * a * b * c * e^2 + - 59 * b^2 * c * e^2 + - 49 * b * c^2 * e^2 + - 6 * c^3 * e^2 + - 22 * b^2 * d * e^2 + - 77 * a * d^2 * e^2 + - 43 * c * d^2 * e^2 + - 44 * b^2 * e^3 + - 83 * a * c * e^3 + - b * c * e^3 + - 70 * c^2 * e^3 + - 29 * a * d * e^3 + - 12 * b * d * e^3 + - 54 * e^5, - 17 * b + - 29 * c + - 32 * e + - 54 * a * c + - 2 * b * c + - 32 * a * d + - 7 * c * d + - 15 * a * e + - 78 * b * e + - 10 * d * e + - 49 * e^2 + - 17 * b^3 + - 37 * a * b * c + - 11 * c^3 + - 20 * a^2 * d + - 67 * a * b * d + - 40 * a * c * d + - 53 * a * d^2 + - 62 * c * d^2 + - 43 * d^3 + - 8 * a * c * e + - 54 * a * d * e + - 27 * d^2 * e + - 6 * a * e^2 + - 55 * d * e^2 + - 29 * e^3 + - 89 * a^2 * b^2 + - 41 * a * b^3 + - 46 * b^4 + - 77 * a^3 * c + - 70 * a^2 * b * c + - 12 * b^3 * c + - 15 * a * b * c^2 + - 80 * b * c^3 + - 15 * c^4 + - 32 * a^2 * b * d + - 63 * b^3 * d + - 81 * a * b * c * d + - 5 * b * c^2 * d + - 55 * a * b * d^2 + - 54 * b^2 * d^2 + - 16 * a * c * d^2 + - 6 * b * c * d^2 + - 82 * a * d^3 + - 16 * c * d^3 + - 32 * d^4 + - 79 * a^3 * e + - 45 * a * b^2 * e + - 34 * b^3 * e + - 66 * a^2 * c * e + - 50 * b * c^2 * e + - 24 * c^3 * e + - 7 * b^2 * d * e + - 35 * a * c * d * e + - 73 * a * d^2 * e + - 51 * b * d^2 * e + - 61 * b^2 * e^2 + - 47 * a * c * e^2 + - 23 * b * c * e^2 + - 73 * a * d * e^2 + - 76 * b * d * e^2 + - 55 * b * e^3 + - 70 * c * e^3 + - 30 * d * e^3 + - 66 * e^4 + - 17 * a^4 * c + - 12 * a * b^3 * c + - 37 * a^3 * c^2 + - 35 * a^2 * b * c^2 + - 8 * a * b^2 * c^2 + - 12 * b^3 * c^2 + - 78 * a^2 * c^3 + - 29 * a * b * c^3 + - 72 * b^2 * c^3 + - 12 * a * c^4 + - 83 * b * c^4 + - 16 * b^4 * d + - 17 * b^3 * c * d + - 50 * b^2 * c^2 * d + - 37 * a * c^3 * d + - 55 * c^4 * d + - 67 * a^2 * c * d^2 + - 67 * a * b * c * d^2 + - 34 * b^2 * c * d^2 + - 2 * c^3 * d^2 + - 33 * a^2 * d^3 + - 52 * a * b * d^3 + - 78 * b^2 * d^3 + - 74 * a * c * d^3 + - 10 * b * c * d^3 + - 22 * c^2 * d^3 + - 17 * b * d^4 + - 22 * c * d^4 + - 80 * a^3 * b * e + - 85 * b^4 * e + - 60 * a^3 * c * e + - 72 * a^2 * b * c * e + - 21 * b^3 * c * e + - 28 * a * b * c^2 * e + - 79 * a^3 * d * e + - 14 * a^2 * b * d * e + - 25 * b^2 * c * d * e + - 55 * a * c^2 * d * e + - 41 * c^3 * d * e + - 54 * a^2 * d^2 * e + - 9 * a * b * d^2 * e + - 51 * b^2 * d^2 * e + - 49 * a * c * d^2 * e + - 36 * a * d^3 * e + - 77 * b * d^3 * e + - 44 * c * d^3 * e + - 78 * d^4 * e + - 86 * a^3 * e^2 + - 80 * b^3 * e^2 + - 39 * b^2 * c * e^2 + - 90 * c^3 * e^2 + - 10 * a^2 * d * e^2 + - 71 * b^2 * d * e^2 + - 20 * b * c * d * e^2 + - 61 * a * d^2 * e^2 + - 70 * b * d^2 * e^2 + - 5 * a * b * e^3 + - 21 * b^2 * e^3 + - 64 * a * d * e^3 + - 84 * c * e^4 + - 34 * d * e^4 + - 76 * e^5, - 35 + - 14 * a + - 43 * e + - 71 * a * b + - 28 * b * c + - 33 * b * d + - 90 * a * e + - 61 * b * e + - 51 * c * e + - 80 * d * e + - 20 * a^2 * b + - 11 * a * b^2 + - 76 * b^2 * c + - 86 * a * c^2 + - 11 * a^2 * d + - 36 * b^2 * d + - 12 * b * c * d + - 2 * c * d^2 + - 29 * d^3 + - 35 * a^2 * e + - 49 * a * c * e + - 22 * c^2 * e + - 43 * d^2 * e + - 75 * a * e^2 + - 52 * c * e^2 + - 22 * e^3 + - 62 * a^4 + - 88 * a^3 * b + - 9 * a * b^3 + - 5 * b^4 + - 46 * a^3 * c + - 7 * a^2 * b * c + - 52 * a * b * c^2 + - 64 * b * c^3 + - 33 * c^4 + - 63 * a^3 * d + - 50 * a^2 * b * d + - 76 * a * b^2 * d + - 47 * a * b * c * d + - 30 * b^2 * c * d + - 53 * a * c^2 * d + - 17 * a^2 * d^2 + - 20 * b^2 * d^2 + - 40 * b * c * d^2 + - 11 * a * d^3 + - 32 * c * d^3 + - 21 * d^4 + - 16 * a^3 * e + - 89 * a^2 * b * e + - 23 * a * b * c * e + - 60 * b^2 * c * e + - 29 * b * c^2 * e + - 11 * c^3 * e + - 71 * a^2 * d * e + - 45 * a * c * d * e + - 37 * c^2 * d * e + - 33 * c * d^2 * e + - 2 * a * c * e^2 + - 41 * a * d * e^2 + - 57 * b * d * e^2 + - 36 * c * d * e^2 + - 49 * d^2 * e^2 + - 23 * a^3 * b^2 + - 72 * a^2 * b^3 + - 19 * b^5 + - 13 * a^4 * c + - 45 * a^2 * b^2 * c + - 77 * a * b^3 * c + - 88 * b^4 * c + - 19 * a^2 * b * c^2 + - 33 * a * b^2 * c^2 + - 65 * a * b * c^3 + - 14 * b^2 * c^3 + - 24 * c^5 + - 13 * a^4 * d + - 37 * a * b^3 * d + - 67 * b^4 * d + - 85 * a^3 * c * d + - 30 * a^2 * b * c * d + - 2 * a * b^2 * c * d + - 22 * a^2 * c^2 * d + - 73 * a * b * c^2 * d + - 22 * b^2 * c^2 * d + - 56 * b * c^3 * d + - 7 * a * b^2 * d^2 + - 22 * b^3 * d^2 + - 2 * a^2 * c * d^2 + - 45 * a * c^2 * d^2 + - 33 * a^2 * d^3 + - 19 * b * d^4 + - 67 * a^4 * e + - 87 * a^3 * b * e + - 41 * a^2 * b^2 * e + - 58 * a * b^3 * e + - 19 * b^4 * e + - 36 * b^2 * c^2 * e + - 60 * b * c^3 * e + - 22 * c^4 * e + - 59 * a^2 * b * d * e + - 17 * a * b^2 * d * e + - 82 * b^2 * c * d * e + - 9 * b * c^2 * d * e + - 59 * a^2 * d^2 * e + - 72 * a * b * d^2 * e + - 55 * b^2 * d^2 * e + - 47 * b * c * d^2 * e + - 12 * c^2 * d^2 * e + - 32 * c * d^3 * e + - 40 * d^4 * e + - 77 * a^3 * e^2 + - 35 * a^2 * b * e^2 + - 29 * a * b^2 * e^2 + - 13 * a^2 * c * e^2 + - 4 * a * b * c * e^2 + - 5 * a * c^2 * e^2 + - 59 * b * c^2 * e^2 + - 89 * c^3 * e^2 + - 14 * b^2 * d * e^2 + - 55 * a * c * d * e^2 + - 50 * a * d^2 * e^2 + - 65 * d^3 * e^2 + - 33 * a^2 * e^3 + - 21 * a * b * e^3 + - 82 * a * c * e^3 + - 7 * a * d * e^3 + - 48 * c * d * e^3 + - 43 * b * e^4 + - 62 * c * e^4 + - 37 * d * e^4, - ], - ), - ) + R,[25*a^2+13*c*d+33*d^3+28*a^2*e+22*a*b*e+29*a*b^3+62*a^2*c^2+37*a^3*d+5*b^2*c*d+64*b^2*c*e+59*a^2*d*e+54*a*d^2*e+62*d^3*e+8*a*b^3*c+43*a^2*c^3+64*a*b^2*c*e+28*a^2*c^2*e+39*c*d^2*e^2+26*d^3*e^2, +14*a*c+4*a*d+47*a*b*c+18*c^2*d+28*c*d^2+28*a*b^2*d+20*a^2*d^2+53*a*d*e^2+7*a^2*b^2*e+21*a*c^3*e+58*b*c*d^2*e+58*c^2*d^2*e+13*a^2*c*e^2+47*b*c*d*e^2+61*b*d*e^3, +46+70*b+76*c+3*a*c*d+50*c*d^2+2*a^2*b^2+34*b^3*d+34*b*c*d*e+2*d^2*e^2+21*b^4*c+44*a^3*c*d+54*a*b^2*c*d+39*b^3*c*d+27*a*b*c^2*d+6*a*c^3*d+83*c*d^4+66*d^5+55*b^4*e+66*b^2*c^2*e+27*a*b*c*d*e+43*c^2*d^2*e+45*a*b^2*e^2+52*b^2*d*e^2])) for i in ideals - runb("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(5*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(7),90)", i, S, StartOrd, TarOrd) end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 59 + - 64 * a + - 76 * b + - 16 * c + - 66 * d + - 4 * a^2 + - 72 * b^2 + - 34 * b * c + - 12 * c^2 + - 26 * a * d + - 87 * c * d + - 63 * d^2 + - 52 * a * e + - 7 * b * e + - 45 * a^3 + - 70 * a^2 * b + - 89 * a^2 * c + - 7 * a * b * c + - 79 * b * c^2 + - 19 * c^3 + - 61 * a * b * d + - 74 * a * c * d + - 77 * b * c * d + - 47 * c^2 * d + - 66 * a * d^2 + - 62 * b^2 * e + - 8 * a * c * e + - 47 * b * c * e + - 21 * a * d * e + - 86 * b * d * e + - 81 * c * d * e + - 6 * d^2 * e + - 40 * a * e^2 + - 33 * b * e^2 + - 84 * d * e^2 + - 90 * a^4 + - 82 * a^2 * b^2 + - 64 * a * b^3 + - 87 * a^3 * c + - 14 * a * b^2 * c + - 20 * a^2 * c^2 + - 23 * a * c^3 + - 70 * a^3 * d + - 10 * a^2 * c * d + - 29 * a * b * c * d + - 62 * b^2 * c * d + - 50 * a * b * d^2 + - 25 * b * c * d^2 + - 78 * a * d^3 + - 33 * c * d^3 + - 27 * d^4 + - 16 * a^3 * e + - 81 * a^2 * b * e + - 20 * a^2 * c * e + - a * c^2 * e + - 71 * b * c^2 * e + - 52 * c^3 * e + - 48 * a * b * d * e + - 83 * b^2 * d * e + - 73 * c^2 * d * e + - 82 * a * d^2 * e + - 58 * b * d^2 * e + - 57 * d^3 * e + - 89 * a * b * e^2 + - 45 * a * c * e^2 + - 40 * c^2 * e^2 + - 74 * a * d * e^2 + - 37 * b * d * e^2 + - 83 * c * d * e^2 + - 5 * d^2 * e^2 + - 74 * b * e^3 + - 62 * c * e^3 + - 45 * d * e^3 + - 89 * e^4 + - 85 * a^3 * b^2 + - 27 * b^5 + - 37 * a^4 * c + - 23 * a^3 * b * c + - 40 * a^2 * b^2 * c + - 27 * b^4 * c + - 49 * a^3 * c^2 + - 14 * a^2 * b * c^2 + - 16 * a * b^2 * c^2 + - 10 * a * b * c^3 + - 41 * b^2 * c^3 + - 39 * a * c^4 + - 44 * a^4 * d + - 52 * a^2 * b^2 * d + - 36 * b^4 * d + - 6 * a^3 * c * d + - 12 * a^2 * b * c * d + - 48 * b^2 * c^2 * d + - 89 * b * c^3 * d + - 18 * c^4 * d + - 33 * a^2 * b * d^2 + - 34 * b^3 * d^2 + - 9 * a^2 * c * d^2 + - 27 * a * b * c * d^2 + - 72 * c^3 * d^2 + - 11 * a^2 * d^3 + - 63 * a * b * d^3 + - 65 * b^2 * d^3 + - 26 * a * c * d^3 + - 65 * b * c * d^3 + - 4 * a * d^4 + - 81 * c * d^4 + - 66 * a^4 * e + - 60 * a^3 * b * e + - 72 * a * b^3 * e + - 48 * a * b^2 * c * e + - 38 * a^2 * c^2 * e + - 38 * a * b * c^2 * e + - 67 * b^2 * c^2 * e + - 39 * b * c^3 * e + - 85 * c^4 * e + - 28 * a^3 * d * e + - 90 * a^2 * b * d * e + - 73 * b^3 * d * e + - 89 * a * b * c * d * e + - 31 * a * c^2 * d * e + - 79 * b * c^2 * d * e + - 83 * c^3 * d * e + - 51 * a^2 * d^2 * e + - 76 * a * b * d^2 * e + - 43 * b^2 * d^2 * e + - 74 * a * c * d^2 * e + - 44 * c^2 * d^2 * e + - 4 * b * d^3 * e + - 13 * c * d^3 * e + - 61 * d^4 * e + - 49 * a^2 * b * e^2 + - 22 * a * b^2 * e^2 + - 33 * b^3 * e^2 + - 71 * a^2 * c * e^2 + - 53 * a * b * c * e^2 + - 62 * b^2 * c * e^2 + - 3 * a * c^2 * e^2 + - 79 * b * c^2 * e^2 + - 12 * a^2 * d * e^2 + - 79 * a * b * d * e^2 + - 43 * b^2 * d * e^2 + - 55 * a * c * d * e^2 + - 43 * b * c * d * e^2 + - 70 * a * d^2 * e^2 + - 80 * b * d^2 * e^2 + - 69 * d^3 * e^2 + - 52 * a^2 * e^3 + - 26 * b^2 * e^3 + - 63 * c^2 * e^3 + - 29 * a * d * e^3 + - 88 * b * d * e^3 + - 7 * a * e^4 + - 40 * c * e^4 + - 70 * e^5, - 9 + - 86 * a + - 59 * c + - 19 * d + - 61 * e + - 26 * a^2 + - 72 * b^2 + - a * c + - 62 * a * d + - 80 * d^2 + - 81 * a * e + - 31 * c * e + - 5 * d * e + - 26 * a^3 + - 39 * a^2 * b + - 73 * a * b^2 + - 44 * a * b * c + - 26 * b * c^2 + - 65 * b^2 * d + - 43 * b * c * d + - 21 * c^2 * d + - 30 * a * d^2 + - 81 * b * d^2 + - 44 * c * d^2 + - 76 * d^3 + - 55 * a * c * e + - 71 * b * c * e + - 81 * c^2 * e + - 79 * a * d * e + - 44 * b * d * e + - 63 * c * d * e + - 46 * a * e^2 + - 47 * c * e^2 + - 85 * d * e^2 + - 77 * e^3 + - 24 * a^3 * b + - 52 * a^2 * b^2 + - 12 * b^4 + - 51 * a * b^2 * c + - 17 * b^3 * c + - 64 * a^2 * c^2 + - 87 * a * c^3 + - 54 * b * c^3 + - 72 * a^2 * c * d + - 24 * a * b * c * d + - 43 * b^2 * c * d + - 29 * a * c^2 * d + - 51 * c^3 * d + - 68 * a * b * d^2 + - 49 * b^2 * d^2 + - 84 * b * c * d^2 + - 52 * c^2 * d^2 + - 31 * a * d^3 + - 15 * c * d^3 + - 6 * d^4 + - 54 * a^3 * e + - 28 * a^2 * b * e + - 88 * b^3 * e + - 44 * a * b * c * e + - 9 * a * c^2 * e + - 58 * b * c^2 * e + - 4 * c^3 * e + - 47 * a * b * d * e + - 6 * b^2 * d * e + - 9 * a * c * d * e + - 27 * c^2 * d * e + - 72 * a * d^2 * e + - 61 * b * d^2 * e + - 64 * c * d^2 * e + - 5 * a^2 * e^2 + - 32 * a * b * e^2 + - 56 * b^2 * e^2 + - 30 * b * c * e^2 + - 48 * c^2 * e^2 + - 64 * a * d * e^2 + - 70 * c * d * e^2 + - 16 * d^2 * e^2 + - 90 * a * e^3 + - 22 * b * e^3 + - 90 * c * e^3 + - 15 * d * e^3 + - 20 * e^4 + - 66 * a^5 + - 74 * a^4 * b + - 87 * a^3 * b^2 + - 88 * a * b^4 + - 14 * b^5 + - 47 * a^4 * c + - 57 * a^3 * b * c + - 34 * a^2 * b^2 * c + - 45 * b^3 * c^2 + - 38 * a^2 * c^3 + - 42 * a * b * c^3 + - 69 * a * c^4 + - 57 * c^5 + - 78 * a^3 * b * d + - 61 * a * b^3 * d + - 48 * b^4 * d + - 14 * a^3 * c * d + - 4 * b^3 * c * d + - 11 * a * b * c^2 * d + - 14 * b^2 * c^2 * d + - 57 * a * c^3 * d + - 87 * a^2 * b * d^2 + - 41 * a * b^2 * d^2 + - 36 * b^3 * d^2 + - 54 * b^2 * c * d^2 + - 20 * a * c^2 * d^2 + - 88 * c^3 * d^2 + - 20 * a^2 * d^3 + - 23 * a * b * d^3 + - 13 * a * c * d^3 + - 49 * b * c * d^3 + - 5 * a * d^4 + - 55 * b * d^4 + - 14 * c * d^4 + - 38 * d^5 + - 87 * a^3 * b * e + - 4 * b^4 * e + - 18 * a^2 * b * c * e + - 4 * a * b^2 * c * e + - 39 * a * b * c^2 * e + - 89 * b^2 * c^2 * e + - 43 * a * c^3 * e + - 46 * c^4 * e + - 19 * a * b^2 * d * e + - 18 * b^3 * d * e + - 49 * a * b * c * d * e + - 14 * b^2 * c * d * e + - 7 * a * c^2 * d * e + - 6 * b * c * d^2 * e + - 74 * b * d^3 * e + - 89 * c * d^3 * e + - 58 * a^3 * e^2 + - 50 * a * b^2 * e^2 + - 38 * b^3 * e^2 + - 42 * a * c^2 * e^2 + - 12 * b * c^2 * e^2 + - 57 * a^2 * d * e^2 + - 18 * a * b * d * e^2 + - 70 * a * c * d * e^2 + - 11 * b * c * d * e^2 + - 75 * c^2 * d * e^2 + - 78 * a * d^2 * e^2 + - 52 * b * d^2 * e^2 + - 20 * c * d^2 * e^2 + - 81 * d^3 * e^2 + - 8 * a^2 * e^3 + - 31 * a * b * e^3 + - 36 * b^2 * e^3 + - 19 * b * c * e^3 + - 10 * c^2 * e^3 + - 63 * a * d * e^3 + - 44 * c * d * e^3 + - 19 * b * e^4 + - 80 * c * e^4, - 54 * a + - 27 * a^2 + - 8 * a * b + - 82 * b^2 + - 48 * a * c + - 26 * b * c + - 43 * c^2 + - 27 * b * d + - 68 * c * d + - 27 * d^2 + - 37 * d * e + - 70 * a^2 * b + - 21 * a * b^2 + - 78 * b^3 + - 2 * a * b * c + - 52 * b^2 * c + - 67 * a * c^2 + - 31 * a^2 * d + - 34 * a * b * d + - 31 * b^2 * d + - 69 * a * c * d + - 82 * b * c * d + - 46 * b * d^2 + - 19 * c * d^2 + - 59 * a^2 * e + - 62 * b * c * e + - 33 * c * d * e + - 77 * a * e^2 + - 72 * b * e^2 + - 6 * d * e^2 + - 63 * e^3 + - 60 * a^3 * b + - 5 * b^4 + - 12 * a^3 * c + - 68 * a * b^2 * c + - 80 * a^2 * c^2 + - 45 * a * b * c^2 + - 25 * a * c^3 + - 63 * a^2 * b * d + - 55 * a * b^2 * d + - 43 * b^3 * d + - 54 * b^2 * c * d + - 43 * a * c^2 * d + - 52 * b * c^2 * d + - 82 * c^3 * d + - 45 * a^2 * d^2 + - 18 * c^2 * d^2 + - 69 * b * d^3 + - 39 * c * d^3 + - 62 * d^4 + - 48 * a^3 * e + - 73 * a^2 * b * e + - 60 * a * b^2 * e + - 82 * b^3 * e + - a^2 * c * e + - 72 * a * b * c * e + - 27 * a^2 * d * e + - 58 * a * b * d * e + - 62 * c^2 * d * e + - 80 * a * d^2 * e + - 86 * b * d^2 * e + - 85 * a^2 * e^2 + - 55 * a * b * e^2 + - 10 * b^2 * e^2 + - 54 * b * c * e^2 + - 18 * a * d * e^2 + - 79 * d^2 * e^2 + - 38 * a * e^3 + - 35 * c * e^3 + - 74 * d * e^3 + - 27 * e^4 + - 19 * a^5 + - 84 * a^4 * b + - 42 * a^3 * b^2 + - 32 * a * b^4 + - 54 * b^5 + - 85 * a^4 * c + - 59 * a^3 * b * c + - 58 * b^4 * c + - 25 * a^2 * b * c^2 + - 16 * a * b^2 * c^2 + - 84 * b^3 * c^2 + - 2 * a * b * c^3 + - 71 * a * c^4 + - 32 * b * c^4 + - 63 * c^5 + - 39 * a^3 * b * d + - 70 * a * b^3 * d + - 83 * a^2 * b * c * d + - 62 * a * c^3 * d + - 17 * c^4 * d + - 39 * a * b^2 * d^2 + - 89 * b^3 * d^2 + - 55 * a * b * c * d^2 + - 37 * b * c^2 * d^2 + - 19 * a^2 * d^3 + - 40 * b^2 * d^3 + - 27 * a * c * d^3 + - 65 * b * c * d^3 + - 15 * a * d^4 + - 59 * c * d^4 + - 61 * a^4 * e + - 50 * a^2 * b^2 * e + - 7 * b^4 * e + - 17 * a^3 * c * e + - 84 * a^2 * b * c * e + - 62 * a * b^2 * c * e + - 87 * a^2 * c^2 * e + - 35 * a * b * c^2 * e + - 10 * a * c^3 * e + - 21 * b * c^3 * e + - 88 * c^4 * e + - 47 * a^2 * b * d * e + - 29 * b^3 * d * e + - 66 * a * b * c * d * e + - 34 * b * c^2 * d * e + - 27 * c^3 * d * e + - 89 * a^2 * d^2 * e + - 38 * a * b * d^2 * e + - 67 * b^2 * d^2 * e + - 60 * c^2 * d^2 * e + - 37 * a * d^3 * e + - 50 * b * d^3 * e + - 72 * c * d^3 * e + - 26 * d^4 * e + - 2 * a^2 * b * e^2 + - 21 * a * b^2 * e^2 + - 6 * a^2 * c * e^2 + - 31 * a * b * c * e^2 + - 28 * b^2 * c * e^2 + - 52 * a * c^2 * e^2 + - 45 * b^2 * d * e^2 + - 77 * c^2 * d * e^2 + - 79 * a * d^2 * e^2 + - 63 * b * d^2 * e^2 + - 34 * a^2 * e^3 + - 44 * a * b * e^3 + - 4 * a * c * e^3 + - 47 * c^2 * e^3 + - 88 * b * d * e^3 + - 30 * c * d * e^3 + - 25 * d^2 * e^3 + - 40 * a * e^4 + - 44 * d * e^4, - ], - ), - ) + R,[22+50*b*c+74*a*d+7*d^2+33*b*e^2+37*d*e^2+73*b^2*c^2+33*b^2*d^2+47*c*e^3+59*a^3*b^2+30*a*c*d^3+62*c^2*d^3+68*a*d^4+35*a*b^2*e^2+7*b*c*e^3+89*a*e^4, +31*b*d+42*a*b*c+50*a*c^2+89*b*c*d+68*b^2*c^2+27*a*b*c*d+79*b*c^2*d+44*b*c*e^2+80*b*d*e^2+71*a*e^3+14*b^5+9*a^2*c^3+5*a*c^4+2*a^3*b*d+3*a^3*d^2+26*c^3*d^2+40*b*d^4+53*a^2*c^2*e+24*a^2*d^2*e+22*d^4*e+79*a*b*c*e^2+33*b*c^2*e^2+76*c^2*d*e^2, +33*b+50*e+61*a*b*c+74*c^3+52*a^2*e+8*a*b*e+75*a*d^3+19*a*b*d*e+7*a*d^2*e+36*d^3*e+55*a^2*e^2+57*a*c*e^2+83*c*d*e^2+16*b*e^3+13*a^3*b^2+33*b*c^4+4*c^5+51*a^2*b*d^2+82*b^2*c*d^2+62*a*b^2*c*e+47*c^3*d*e+90*a*b*d^2*e+55*a^2*d*e^2+14*a*b*e^3+71*d*e^4])) push!( ideals, Singular.Ideal( - R, - [ - 84 * a + - 17 * b + - 4 * d + - 33 * a^2 + - 82 * a * b + - 11 * b^2 + - 51 * b * d + - 33 * a * e + - 14 * b * e + - 87 * d * e + - 53 * a^3 + - 16 * a^2 * b + - 42 * a * b^2 + - 78 * a^2 * c + - 10 * a * b * c + - 63 * a * c^2 + - 74 * c^3 + - 13 * a^2 * d + - 26 * b * c * d + - 32 * c^2 * d + - 59 * a * d^2 + - 64 * b * d^2 + - 56 * c * d^2 + - 86 * d^3 + - 35 * a^2 * e + - 85 * a * b * e + - 80 * b^2 * e + - 52 * a * c * e + - 25 * b * d * e + - 54 * b * e^2 + - 42 * c * e^2 + - 42 * d * e^2 + - 63 * e^3 + - 71 * a^4 + - 27 * a^2 * b^2 + - 22 * a * b^3 + - 65 * b^4 + - 68 * a^3 * c + - 13 * a * b^2 * c + - 22 * b^2 * c^2 + - 25 * a * c^3 + - 72 * b * c^3 + - 45 * a^2 * b * d + - 75 * b^3 * d + - 20 * a * b * c * d + - 6 * a * c^2 * d + - 22 * b * c^2 * d + - 19 * c^3 * d + - 54 * a * b * d^2 + - 45 * b^2 * d^2 + - 22 * c^2 * d^2 + - a * d^3 + - 26 * c * d^3 + - 26 * d^4 + - 82 * a^3 * e + - 3 * a^2 * b * e + - 63 * b^3 * e + - 10 * b^2 * c * e + - 32 * b * c^2 * e + - 61 * c^3 * e + - 65 * a * b * d * e + - 49 * b^2 * d * e + - 72 * a * c * d * e + - 62 * b * c * d * e + - 78 * c^2 * d * e + - 11 * a * d^2 * e + - 26 * a^2 * e^2 + - 63 * a * b * e^2 + - 56 * b^2 * e^2 + - 44 * a * c * e^2 + - 87 * b * c * e^2 + - 29 * a * d * e^2 + - 70 * b * d * e^2 + - 49 * c * d * e^2 + - 2 * a * e^3 + - 52 * b * e^3 + - 17 * c * e^3 + - 45 * d * e^3 + - 57 * a^3 * b^2 + - 43 * a^2 * b^3 + - 88 * b^5 + - 3 * a^4 * c + - 18 * b^4 * c + - 48 * a^3 * c^2 + - 49 * a^2 * b * c^2 + - 79 * a * b^2 * c^2 + - 77 * b^3 * c^2 + - 42 * a * c^4 + - 15 * b * c^4 + - 18 * b^4 * d + - 5 * a^2 * b * c * d + - 22 * a * b^2 * c * d + - 45 * b^3 * c * d + - 7 * a * b * c^2 * d + - 30 * b^2 * c^2 * d + - 6 * a * c^3 * d + - 34 * b * c^3 * d + - 86 * a^3 * d^2 + - 59 * a^2 * b * d^2 + - 8 * a * b^2 * d^2 + - 77 * b^3 * d^2 + - 20 * a^2 * c * d^2 + - 22 * a * c^2 * d^2 + - 64 * c^3 * d^2 + - 55 * a * b * d^3 + - 29 * c^2 * d^3 + - 48 * b * d^4 + - 45 * a^4 * e + - 11 * a^2 * b^2 * e + - 22 * a * b^3 * e + - 81 * a^3 * c * e + - 28 * a^2 * b * c * e + - 66 * a * b^2 * c * e + - 7 * b^2 * c^2 * e + - 76 * b * c^3 * e + - 18 * a^3 * d * e + - 60 * a^2 * b * d * e + - 16 * a * b^2 * d * e + - 23 * b^3 * d * e + - 62 * a^2 * c * d * e + - 3 * a * b * c * d * e + - 17 * b * c^2 * d * e + - 16 * c^3 * d * e + - 59 * a^2 * d^2 * e + - 62 * b^2 * d^2 * e + - 85 * a * c * d^2 * e + - 51 * b * c * d^2 * e + - 54 * a * d^3 * e + - 17 * a^3 * e^2 + - 28 * a^2 * b * e^2 + - 8 * b^3 * e^2 + - 64 * a^2 * c * e^2 + - 88 * a * b * c * e^2 + - 63 * c^3 * e^2 + - 19 * a^2 * d * e^2 + - 18 * a * d^2 * e^2 + - 89 * b * d^2 * e^2 + - 59 * b * c * e^3 + - 59 * c^2 * e^3 + - 87 * a * d * e^3 + - 79 * c * d * e^3 + - 84 * b * e^4 + - 43 * c * e^4 + - 79 * e^5, - 49 + - 43 * a + - 65 * b + - 33 * c + - 75 * a^2 + - 53 * a * b + - 31 * a * c + - 27 * b * c + - 37 * c^2 + - 40 * a * d + - 14 * b * d + - 69 * d^2 + - 45 * a * e + - 51 * b * e + - 60 * e^2 + - 49 * a^3 + - 53 * a^2 * b + - 10 * b^3 + - 38 * b^2 * c + - 72 * a^2 * d + - 21 * a * b * d + - 71 * b^2 * d + - 57 * a * c * d + - 26 * b * c * d + - 5 * c^2 * d + - 56 * b * d^2 + - 83 * c * d^2 + - 10 * c^2 * e + - 35 * a * d * e + - 19 * c * d * e + - 5 * d^2 * e + - 83 * a * e^2 + - 87 * b * e^2 + - 36 * c * e^2 + - 53 * d * e^2 + - 10 * e^3 + - 32 * a^3 * b + - 25 * a^2 * b^2 + - 64 * b^4 + - 57 * a^3 * c + - 88 * a^2 * b * c + - 28 * a^2 * c^2 + - 55 * b * c^3 + - 39 * a^2 * b * d + - 44 * a * b^2 * d + - 44 * a^2 * c * d + - 80 * a * b * c * d + - 59 * b^2 * c * d + - 18 * a * c^2 * d + - 56 * b * c^2 * d + - 64 * c^3 * d + - 27 * a * b * d^2 + - 88 * b * c * d^2 + - 70 * c^2 * d^2 + - 7 * a * d^3 + - 5 * d^4 + - 49 * a^3 * e + - 76 * a^2 * b * e + - 19 * b^3 * e + - 51 * a^2 * c * e + - 30 * a * b * c * e + - 49 * b^2 * c * e + - 68 * a * c^2 * e + - 24 * b * c^2 * e + - 52 * a^2 * d * e + - 71 * a * b * d * e + - 6 * b^2 * d * e + - 79 * b * c * d * e + - 43 * c^2 * d * e + - 32 * b * d^2 * e + - 30 * c * d^2 * e + - 35 * b^2 * e^2 + - 51 * a * c * e^2 + - 12 * b * c * e^2 + - 59 * a * d * e^2 + - 78 * b * d * e^2 + - 46 * c * d * e^2 + - 63 * a * e^3 + - 89 * d * e^3 + - 51 * a^5 + - 17 * a^4 * b + - 84 * a^3 * b^2 + - 89 * a^4 * c + - 27 * a^3 * b * c + - 51 * a^2 * b^2 * c + - 79 * a * b^3 * c + - 8 * b^4 * c + - 85 * a^3 * c^2 + - 55 * a^2 * b * c^2 + - 30 * a * b^2 * c^2 + - 25 * b^2 * c^3 + - 59 * a^4 * d + - 41 * a^2 * b^2 * d + - 37 * a * b^3 * d + - 73 * b^4 * d + - 22 * a^3 * c * d + - 7 * a * b^2 * c * d + - 80 * b^3 * c * d + - 62 * a^2 * c^2 * d + - 12 * b^2 * c^2 * d + - 60 * b * c^3 * d + - 18 * a^2 * b * d^2 + - 45 * a * b * c * d^2 + - 90 * b^2 * c * d^2 + - 88 * a * c^2 * d^2 + - 82 * a^2 * d^3 + - 76 * b^2 * d^3 + - 25 * a * c * d^3 + - 7 * c * d^4 + - 19 * d^5 + - 65 * a^3 * b * e + - 66 * a^2 * b^2 * e + - 43 * a * b^3 * e + - 33 * b^4 * e + - 26 * a^2 * b * c * e + - 68 * a * b * c^2 * e + - 46 * b^2 * c^2 * e + - 7 * a * c^3 * e + - 65 * b * c^3 * e + - 62 * a^3 * d * e + - 35 * a * b^2 * d * e + - 87 * a^2 * c * d * e + - 6 * a * b * c * d * e + - 67 * b^2 * c * d * e + - 39 * a * c^2 * d * e + - 47 * b * c^2 * d * e + - 61 * c^3 * d * e + - 19 * a^2 * d^2 * e + - 73 * a * c * d^2 * e + - 84 * c^2 * d^2 * e + - 56 * c * d^3 * e + - 39 * d^4 * e + - 88 * a^3 * e^2 + - 21 * a^2 * b * e^2 + - 50 * b^3 * e^2 + - 21 * a^2 * c * e^2 + - 86 * b * c^2 * e^2 + - 80 * c^3 * e^2 + - 54 * a^2 * d * e^2 + - 63 * a * b * d * e^2 + - 41 * b^2 * d * e^2 + - 59 * a * c * d * e^2 + - 45 * b * c * d * e^2 + - 68 * a * d^2 * e^2 + - 11 * c * d^2 * e^2 + - 60 * d^3 * e^2 + - 86 * a^2 * e^3 + - 79 * a * b * e^3 + - 56 * b * c * e^3 + - 82 * c^2 * e^3 + - 44 * a * d * e^3 + - 54 * b * d * e^3 + - 48 * c * d * e^3 + - 90 * d^2 * e^3 + - 58 * a * e^4 + - 25 * b * e^4 + - 59 * c * e^4 + - 29 * e^5, - 54 + - 16 * a + - 21 * c + - 44 * e + - 44 * a^2 + - 40 * b^2 + - 29 * a * c + - 3 * b * c + - 83 * c * d + - 65 * d^2 + - 43 * b * e + - 62 * c * e + - 34 * e^2 + - 63 * a^3 + - 33 * a * c^2 + - 32 * a^2 * d + - 44 * b^2 * d + - 47 * a * d^2 + - 83 * b * d^2 + - 42 * c * d^2 + - 82 * d^3 + - 11 * a^2 * e + - 82 * a * b * e + - 6 * a * c * e + - 70 * b * c * e + - 27 * c^2 * e + - 54 * c * d * e + - 34 * d^2 * e + - 68 * b * e^2 + - 38 * c * e^2 + - 46 * d * e^2 + - 53 * e^3 + - 90 * a^4 + - 47 * a^3 * b + - 59 * a^2 * b^2 + - 50 * a * b^3 + - 12 * b^4 + - 79 * a^2 * b * c + - 39 * a^2 * c^2 + - 21 * b^2 * c^2 + - 10 * a * c^3 + - 62 * b * c^3 + - 40 * c^4 + - 41 * a^2 * b * d + - 27 * a * b^2 * d + - 67 * a^2 * c * d + - 68 * a * b * c * d + - 43 * b^2 * c * d + - 22 * b * c^2 * d + - 77 * c^3 * d + - 76 * a^2 * d^2 + - 30 * b^2 * d^2 + - 89 * a * c * d^2 + - 14 * c^2 * d^2 + - 76 * b * d^3 + - 3 * c * d^3 + - 17 * a^2 * b * e + - 65 * b^3 * e + - 63 * a^2 * c * e + - 49 * a * b * c * e + - 17 * a * c^2 * e + - 60 * c^2 * d * e + - 18 * b * d^2 * e + - 74 * a^2 * e^2 + - 22 * c^2 * e^2 + - 33 * a * d * e^2 + - 22 * b * d * e^2 + - 90 * d^2 * e^2 + - 82 * a * e^3 + - 12 * d * e^3 + - 70 * a * b^4 + - 36 * b^5 + - 71 * a^4 * c + - 8 * a^2 * b^2 * c + - 25 * a * b^3 * c + - 13 * a^3 * c^2 + - 21 * a^2 * b * c^2 + - 53 * b^3 * c^2 + - 69 * a^2 * c^3 + - 43 * a * b * c^3 + - 53 * a * c^4 + - 16 * b * c^4 + - 41 * a^2 * b^2 * d + - 20 * a * b^3 * d + - 40 * b^4 * d + - 84 * a^2 * c^2 * d + - 52 * a * b * c^2 * d + - 58 * b^2 * c^2 * d + - 85 * a * c^3 * d + - 41 * a^2 * b * d^2 + - 34 * a * b^2 * d^2 + - 53 * b^3 * d^2 + - 17 * a * b * c * d^2 + - 68 * b^2 * c * d^2 + - 16 * a * c^2 * d^2 + - 39 * b * c^2 * d^2 + - 6 * a * b * d^3 + - 88 * a * c * d^3 + - 34 * b * c * d^3 + - 65 * c^2 * d^3 + - 38 * a * d^4 + - 47 * b * d^4 + - c * d^4 + - 56 * d^5 + - 29 * a^4 * e + - 12 * a^3 * b * e + - 54 * a * b^3 * e + - 7 * a^3 * c * e + - 83 * a^2 * b * c * e + - 75 * a * b^2 * c * e + - 87 * a^2 * c^2 * e + - 66 * a * b * c^2 * e + - 14 * a * c^3 * e + - 44 * b * c^3 * e + - 78 * a^3 * d * e + - 9 * a * b^2 * d * e + - 89 * b^3 * d * e + - 27 * a * b * c * d * e + - 28 * b^2 * c * d * e + - 27 * a * c^2 * d * e + - 75 * b * c^2 * d * e + - 83 * c^3 * d * e + - 4 * a^2 * d^2 * e + - 31 * a * b * d^2 * e + - 88 * b^2 * d^2 * e + - 24 * a * c * d^2 * e + - 72 * b * c * d^2 * e + - 7 * c^2 * d^2 * e + - 37 * b * d^3 * e + - 3 * c * d^3 * e + - 38 * a^3 * e^2 + - 10 * a * b^2 * e^2 + - 57 * b^3 * e^2 + - 66 * a^2 * c * e^2 + - 61 * a * b * c * e^2 + - 28 * a * c^2 * e^2 + - 84 * b * c^2 * e^2 + - 66 * a^2 * d * e^2 + - 42 * a * c * d * e^2 + - 44 * b * c * d * e^2 + - 47 * a * d^2 * e^2 + - 26 * c * d^2 * e^2 + - 50 * d^3 * e^2 + - 59 * a * b * e^3 + - 83 * a * c * e^3 + - 57 * c^2 * e^3 + - 53 * a * d * e^3 + - 34 * b * d * e^3 + - 48 * c * d * e^3 + - 42 * a * e^4 + - 87 * b * e^4 + - 57 * d * e^4, - ], - ), - ) + R,[85*b+55*c+18*b*c+66*b*d+70*a^3+7*a*b*c+79*d^2*e+33*a^2*b^2+31*a*b^3+55*a*b^2*c+36*d^4+80*a^3*e+29*b^2*c*e+74*d^3*e+12*c*e^3+78*a^2*b^2*c+25*a*b^2*c^2+53*c^3*d*e+15*a*c*d^2*e+3*b^3*e^2+69*a*c^2*e^2+67*c*e^4, +73+64*a*b^2+75*c^2*d+81*b^4+70*a^2*c^2+58*a^3*c^2+71*a*b^3*d+77*a^4*e+83*a^3*c*e+83*a*b^2*c*e+50*b*c*d^2*e+23*a^2*c*e^2+45*a*b*d*e^2+33*a*d*e^3, +11*a*b+24*a*e+a*c*d+29*b*d^2+70*b^2*e+33*c^2*e+26*b^3*c+54*b^2*c^2+73*a*b*c*d+59*b*c^2*d+11*d^4+39*d^2*e^2+42*c*e^3+15*a^2*b^3+46*a^4*c+7*a^3*b*c+51*b^3*c^2+60*a^4*d+64*a^2*c^2*d+64*a*b*c*d^2+85*b^2*d^3+30*d^5+23*a^4*e+83*b^3*c*e+41*a*b^2*d*e+86*b*c*d^2*e+2*a*b^2*e^2+23*b*c*e^3])) push!( ideals, Singular.Ideal( - R, - [ - 34 * a + - 68 * d + - 49 * a^2 + - 11 * b^2 + - 12 * c^2 + - 26 * b * d + - 20 * b * e + - 17 * c * e + - 34 * e^2 + - 76 * a^2 * b + - 67 * b^3 + - 69 * a^2 * c + - 63 * a * b * c + - 69 * b^2 * c + - 14 * a * c^2 + - 62 * b^2 * d + - 46 * a * c * d + - 56 * c^2 * d + - 61 * c * d^2 + - 13 * a * b * e + - 64 * b^2 * e + - 25 * b * d * e + - 27 * c * d * e + - 8 * d^2 * e + - 29 * a * e^2 + - 5 * c * e^2 + - 57 * e^3 + - a^4 + - 75 * a^2 * b^2 + - 9 * a * b^3 + - 34 * b^4 + - 73 * a^2 * b * c + - 15 * a * b^2 * c + - 11 * a^2 * c^2 + - 40 * a * b * c^2 + - 69 * a * c^3 + - 69 * c^4 + - 81 * a^3 * d + - 38 * a^2 * b * d + - 50 * a * b^2 * d + - 89 * a^2 * c * d + - 30 * b^2 * c * d + - 70 * a * c^2 * d + - 74 * a^2 * d^2 + - 25 * a * b * d^2 + - 7 * a * c * d^2 + - 55 * b * c * d^2 + - 90 * c^2 * d^2 + - 71 * a * d^3 + - 85 * a * b^2 * e + - 82 * b^3 * e + - 14 * a^2 * c * e + - 72 * a * b * c * e + - 2 * b^2 * c * e + - 25 * c^3 * e + - 84 * a * c * d * e + - 31 * b * c * d * e + - 39 * c^2 * d * e + - 18 * d^3 * e + - 28 * a * b * e^2 + - 76 * b^2 * e^2 + - 49 * a * c * e^2 + - 61 * b * c * e^2 + - 59 * c * d * e^2 + - 86 * d^2 * e^2 + - 9 * a * e^3 + - 65 * b * e^3 + - 40 * c * e^3 + - 6 * d * e^3 + - 16 * e^4 + - 6 * a^4 * b + - 64 * b^5 + - 68 * a^2 * b^2 * c + - 28 * b^4 * c + - 86 * a^3 * c^2 + - 71 * a * b^2 * c^2 + - 63 * a * b * c^3 + - 15 * b^2 * c^3 + - 55 * a * c^4 + - 81 * c^5 + - 2 * a^4 * d + - 38 * a^3 * b * d + - 34 * a^2 * b^2 * d + - 69 * b^4 * d + - 17 * b^3 * c * d + - 45 * b^2 * c^2 * d + - 87 * a * c^3 * d + - 40 * b * c^3 * d + - 29 * a^3 * d^2 + - 81 * a * b^2 * d^2 + - 62 * b^3 * d^2 + - 4 * a^2 * c * d^2 + - 25 * b^2 * c * d^2 + - 75 * a * c^2 * d^2 + - 45 * b * c^2 * d^2 + - 36 * c^3 * d^2 + - 44 * a * b * d^3 + - 65 * c^2 * d^3 + - 52 * a * d^4 + - 19 * b * d^4 + - 58 * a^4 * e + - 72 * a^2 * b^2 * e + - 38 * a * b^3 * e + - 15 * b^4 * e + - 62 * a^3 * c * e + - 88 * a * b^2 * c * e + - 86 * b^3 * c * e + - 37 * a^2 * c^2 * e + - 70 * a * b * c^2 * e + - 25 * c^4 * e + - 89 * a^3 * d * e + - 5 * a^2 * b * d * e + - 37 * a * b^2 * d * e + - 39 * b^3 * d * e + - 43 * a^2 * c * d * e + - 81 * a * b * c * d * e + - 61 * a * c^2 * d * e + - 59 * c^3 * d * e + - 89 * a^2 * d^2 * e + - 23 * a * b * d^2 * e + - 48 * b^2 * d^2 * e + - 9 * a * c * d^2 * e + - 14 * c^2 * d^2 * e + - 48 * a * d^3 * e + - 53 * b * d^3 * e + - 76 * c * d^3 * e + - 69 * a^2 * b * e^2 + - 89 * a * b^2 * e^2 + - 23 * b^3 * e^2 + - 79 * b^2 * c * e^2 + - 43 * a * c^2 * e^2 + - 18 * b * c^2 * e^2 + - 57 * c^3 * e^2 + - 22 * a^2 * d * e^2 + - 23 * b^2 * d * e^2 + - 44 * b * c * d * e^2 + - 66 * c^2 * d * e^2 + - 46 * a * d^2 * e^2 + - 63 * a * c * e^3 + - 62 * c^2 * e^3 + - 4 * a * d * e^3 + - 15 * b * d * e^3 + - 27 * c * d * e^3 + - 24 * d^2 * e^3 + - 67 * a * e^4 + - 33 * b * e^4 + - 21 * d * e^4, - 31 + - 18 * a + - 47 * c + - 29 * d + - 17 * e + - 52 * a^2 + - 10 * a * b + - 74 * a * c + - 36 * b * c + - 53 * b * d + - 51 * c * d + - 70 * d^2 + - 75 * a * e + - 52 * b * e + - 70 * c * e + - 2 * e^2 + - 81 * a^3 + - 17 * a^2 * b + - 73 * a * b^2 + - 79 * b^3 + - 27 * a^2 * c + - 75 * a * b * c + - 25 * b^2 * c + - 86 * b * c^2 + - 5 * c^3 + - 42 * a * b * d + - 16 * b^2 * d + - 80 * b * c * d + - 49 * c^2 * d + - 85 * b * d^2 + - 28 * c * d^2 + - 64 * a^2 * e + - 27 * b^2 * e + - 15 * a * c * e + - 38 * b * c * e + - 85 * c^2 * e + - 35 * a * d * e + - 14 * b * d * e + - 19 * c * d * e + - 17 * a * e^2 + - 57 * b * e^2 + - 71 * e^3 + - 5 * a^3 * b + - 18 * a * b^3 + - 44 * b^4 + - 84 * a^3 * c + - 48 * a * b^2 * c + - 46 * b^3 * c + - 80 * a^2 * c^2 + - 63 * b^2 * c^2 + - 52 * a * c^3 + - 15 * b * c^3 + - 19 * c^4 + - 32 * a^3 * d + - 27 * a^2 * b * d + - 12 * a * b * c * d + - 16 * a * c^2 * d + - 47 * b * c^2 * d + - 61 * c^3 * d + - 11 * a^2 * d^2 + - 10 * b^2 * d^2 + - 25 * a * c * d^2 + - 32 * b * c * d^2 + - 50 * c^2 * d^2 + - 12 * b * d^3 + - 52 * c * d^3 + - 51 * a^3 * e + - 50 * a^2 * b * e + - 17 * b^2 * c * e + - 23 * a * c^2 * e + - 9 * b * c^2 * e + - 11 * c^3 * e + - 80 * a * b * d * e + - 49 * b^2 * d * e + - 24 * b * c * d * e + - 8 * a * d^2 * e + - 39 * b * d^2 * e + - 5 * d^3 * e + - 62 * b^2 * e^2 + - 9 * a * c * e^2 + - 75 * a * d * e^2 + - 83 * c * d * e^2 + - 11 * d^2 * e^2 + - 16 * a * e^3 + - 5 * c * e^3 + - 56 * a^4 * b + - a^3 * b^2 + - 2 * a^2 * b^3 + - 10 * a * b^4 + - 4 * a^2 * b^2 * c + - a * b^3 * c + - 74 * b^4 * c + - 68 * a^3 * c^2 + - 25 * b^3 * c^2 + - 6 * a * b * c^3 + - 87 * b * c^4 + - 36 * a^3 * b * d + - 68 * a^2 * b^2 * d + - 83 * a * b^3 * d + - 34 * b^4 * d + - 23 * a^3 * c * d + - 85 * a * b^2 * c * d + - 14 * b^3 * c * d + - 72 * a^2 * c^2 * d + - 11 * b^2 * c^2 * d + - 74 * a * c^3 * d + - 21 * a^3 * d^2 + - 66 * b^3 * d^2 + - 24 * a * b * c * d^2 + - 46 * a * c^2 * d^2 + - 43 * c^3 * d^2 + - 39 * a^2 * d^3 + - 76 * a * b * d^3 + - 69 * b^2 * d^3 + - 61 * a * d^4 + - 78 * c * d^4 + - 82 * d^5 + - 72 * a^3 * b * e + - 42 * b^4 * e + - 16 * a^2 * b * c * e + - 17 * a * b^2 * c * e + - 52 * b^2 * c^2 * e + - 13 * a * c^3 * e + - 8 * b * c^3 * e + - 62 * a^3 * d * e + - 26 * b^3 * d * e + - 50 * a^2 * c * d * e + - 18 * a * b * c * d * e + - 77 * a * c^2 * d * e + - 86 * b * c^2 * d * e + - 56 * a^2 * d^2 * e + - 65 * a * b * d^2 * e + - 48 * a * c * d^2 * e + - 57 * b * c * d^2 * e + - 88 * c^2 * d^2 * e + - 49 * a * d^3 * e + - 63 * b * d^3 * e + - 33 * c * d^3 * e + - a * b^2 * e^2 + - 65 * b^3 * e^2 + - 58 * a^2 * c * e^2 + - 21 * a * c^2 * e^2 + - 64 * c^3 * e^2 + - 31 * a^2 * d * e^2 + - 11 * a * b * d * e^2 + - 69 * b * c * d * e^2 + - 41 * c^2 * d * e^2 + - 13 * a * d^2 * e^2 + - 26 * c * d^2 * e^2 + - 56 * d^3 * e^2 + - 25 * a * b * e^3 + - 79 * c * d * e^3 + - 20 * d^2 * e^3 + - 56 * b * e^4 + - 47 * c * e^4, - 71 + - 32 * a + - 70 * d + - 25 * e + - 9 * a^2 + - 90 * a * b + - 34 * b^2 + - 18 * b * c + - 75 * a * d + - 41 * c * d + - 14 * b * e + - 50 * c * e + - 55 * e^2 + - 76 * b^3 + - 41 * a * b * c + - 73 * b^2 * c + - 22 * a * c^2 + - 3 * b * c^2 + - 77 * a * b * d + - 47 * b^2 * d + - 79 * a * c * d + - 36 * b * c * d + - 76 * c^2 * d + - 81 * a * d^2 + - 67 * c * d^2 + - 53 * b^2 * e + - 16 * a * c * e + - 69 * b * c * e + - 42 * c * d * e + - 67 * c * e^2 + - 15 * d * e^2 + - 7 * e^3 + - 58 * a * b^3 + - 5 * b^4 + - 43 * a^3 * c + - 87 * a^2 * b * c + - 51 * b^3 * c + - 87 * a * c^3 + - 84 * b * c^3 + - 45 * c^4 + - 54 * a^3 * d + - 73 * a^2 * b * d + - 75 * a * b^2 * d + - 28 * b^3 * d + - 6 * a * b * c * d + - 13 * b^2 * c * d + - 68 * c^3 * d + - 55 * a * b * d^2 + - 40 * b^2 * d^2 + - a * c * d^2 + - 17 * b * c * d^2 + - 30 * c^2 * d^2 + - 89 * a * d^3 + - 47 * b * d^3 + - 54 * d^4 + - 33 * b^3 * e + - 48 * a^2 * c * e + - 60 * b^2 * c * e + - 88 * a * c^2 * e + - b * c^2 * e + - 37 * a^2 * d * e + - 21 * a * b * d * e + - a * c * d * e + - 45 * c^2 * d * e + - 40 * c * d^2 * e + - 41 * d^3 * e + - 28 * a * b * e^2 + - 80 * b * c * e^2 + - 33 * c^2 * e^2 + - 73 * c * d * e^2 + - 33 * d^2 * e^2 + - 56 * a * e^3 + - 53 * a^4 * b + - 84 * a^3 * b^2 + - 59 * a * b^4 + - a^4 * c + - 3 * a * b^3 * c + - 60 * a^3 * c^2 + - 21 * a * b^2 * c^2 + - 70 * b^3 * c^2 + - 57 * a^2 * c^3 + - 65 * a * b * c^3 + - 78 * b * c^4 + - 87 * c^5 + - 25 * a^3 * b * d + - 39 * a * b^3 * d + - 75 * b^4 * d + - 36 * a^3 * c * d + - 56 * a^2 * b * c * d + - 31 * a * b^2 * c * d + - 56 * a * b * c^2 * d + - 72 * a * c^3 * d + - 66 * b * c^3 * d + - 85 * c^4 * d + - 56 * a^2 * b * d^2 + - 26 * b^3 * d^2 + - 60 * a^2 * c * d^2 + - 70 * a * b * c * d^2 + - 54 * b^2 * c * d^2 + - 16 * b * c^2 * d^2 + - 72 * c^3 * d^2 + - 26 * a * b * d^3 + - 53 * a * c * d^3 + - 77 * b * c * d^3 + - 63 * a * d^4 + - 61 * b * d^4 + - 43 * c * d^4 + - 86 * d^5 + - 88 * a^3 * b * e + - 78 * a^2 * b^2 * e + - 7 * a * b^3 * e + - 60 * a^3 * c * e + - 51 * a^2 * b * c * e + - 27 * b^3 * c * e + - a^2 * c^2 * e + - 36 * a * b * c^2 * e + - 31 * b^2 * c^2 * e + - 23 * a * c^3 * e + - 62 * b * c^3 * e + - 47 * c^4 * e + - 57 * a^3 * d * e + - 72 * a * b^2 * d * e + - 45 * b^3 * d * e + - 73 * b^2 * c * d * e + - 66 * a * c^2 * d * e + - 34 * c^3 * d * e + - 39 * a^2 * d^2 * e + - 71 * a * b * d^2 * e + - b^2 * d^2 * e + - 85 * a * c * d^2 * e + - 14 * a * d^3 * e + - 48 * b * d^3 * e + - 67 * c * d^3 * e + - 79 * d^4 * e + - 83 * a^3 * e^2 + - 50 * a^2 * b * e^2 + - 66 * b^3 * e^2 + - 61 * b * c^2 * e^2 + - 22 * c^3 * e^2 + - 21 * a * b * d * e^2 + - 85 * b^2 * d * e^2 + - 41 * a * c * d * e^2 + - 30 * c^2 * d * e^2 + - 76 * a * d^2 * e^2 + - 83 * b * d^2 * e^2 + - 52 * a^2 * e^3 + - 89 * b^2 * e^3 + - 43 * b * c * e^3 + - 13 * c^2 * e^3 + - 27 * a * d * e^3 + - 88 * b * e^4 + - 52 * c * e^4, - ], - ), - ) + R,[3*a+65*a*d+7*a*c^2+44*a^2*e+74*c*d*e+32*e^3+33*c^4+89*b*c^2*d+49*b^2*d^2+37*c^2*d^2+46*a^2*e^2+59*c^2*e^2+22*b^3*c^2+72*a*b*c^3+5*a*b^3*d+61*b^4*d+82*a*b^2*c*d+33*d^5+49*b^2*c^2*e+71*c^4*e+11*a^3*d*e+60*b*c^2*d*e+78*a^2*d^2*e+42*b*c^2*e^2+24*b*d*e^3, +19*a*e+60*c^3+10*c^2*d+30*b*c*e+11*d^2*e+3*b*e^2+57*a^3*c+64*a*b*d^2+88*c*d^3+80*b*c^2*e+86*b*c*d*e+53*c*d^2*e+80*a*b*e^2+30*b*e^3+74*a^3*b^2+86*a^2*b^3+71*a^2*c^2*d+8*a*b*c^2*d+46*a*b*c*d^2+57*a^2*d^3+37*b*d^4+9*b*d^2*e^2, +44+3*a+53*b*d+5*b*e+57*a^3*d+a*b^2*d+46*a*c*d^2+65*a^3*b*c+12*b^2*c^3+64*b^2*c^2*d+82*c^4*d+53*a^2*c*d*e+30*b^2*d^2*e+65*a*d^3*e+40*b*c^2*e^2+6*a*c*d*e^2+53*e^5])) for i in ideals - runb("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(6*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(8),90)", i, S, StartOrd, TarOrd) end + ideals =[] push!( ideals, Singular.Ideal( - R, - [ - 12 + - 33 * a + - 64 * b + - 43 * c + - 81 * d + - 24 * a * b + - 7 * a * c + - 78 * b * c + - 68 * c^2 + - 36 * b * d + - 69 * d^2 + - 17 * a * e + - 74 * b * e + - e^2 + - 62 * a^3 + - 16 * a^2 * b + - 82 * a * b^2 + - 24 * a^2 * c + - 60 * a * b * c + - 20 * a * c^2 + - 32 * c^3 + - 27 * b^2 * d + - 59 * a * c * d + - 28 * c^2 * d + - 27 * a * d^2 + - 18 * b * d^2 + - 13 * a^2 * e + - 15 * b * c * e + - 25 * c^2 * e + - 67 * a * d * e + - 19 * b * d * e + - 72 * c * d * e + - 45 * d^2 * e + - 78 * a * e^2 + - 34 * c * e^2 + - 40 * d * e^2 + - 11 * e^3 + - 40 * a^3 * b + - 55 * a * b^3 + - 59 * b^4 + - 2 * a^3 * c + - 28 * a^2 * b * c + - 87 * a * b^2 * c + - 36 * b^3 * c + - 87 * a^2 * c^2 + - 3 * b^2 * c^2 + - 30 * a * c^3 + - 41 * b * c^3 + - 88 * a * b^2 * d + - 41 * a^2 * c * d + - 39 * a * b * c * d + - 88 * b^2 * c * d + - 81 * a * c^2 * d + - 86 * c^3 * d + - 36 * a * b * d^2 + - 76 * b^2 * d^2 + - 56 * a * c * d^2 + - 32 * b * c * d^2 + - 26 * c^2 * d^2 + - 14 * a * d^3 + - 75 * b * d^3 + - 43 * c * d^3 + - 82 * d^4 + - 19 * a^2 * b * e + - 60 * b^3 * e + - 88 * a^2 * c * e + - 56 * a * b * c * e + - 13 * b^2 * c * e + - 71 * b * c^2 * e + - 21 * c^3 * e + - 18 * a^2 * d * e + - 40 * a * b * d * e + - 66 * b^2 * d * e + - 78 * a * c * d * e + - 83 * b * c * d * e + - 89 * c^2 * d * e + - 36 * d^3 * e + - 17 * a^2 * e^2 + - 11 * a * b * e^2 + - 30 * b^2 * e^2 + - 65 * b * c * e^2 + - 12 * b * d * e^2 + - 19 * c * d * e^2 + - 82 * d^2 * e^2 + - 3 * b * e^3 + - 54 * c * e^3 + - 89 * d * e^3 + - e^4 + - a^3 * b^2 + - 69 * a^2 * b^3 + - 5 * b^5 + - a^4 * c + - 59 * a^2 * b^2 * c + - 73 * a * b^3 * c + - 36 * b^4 * c + - 77 * a^2 * b * c^2 + - 21 * b^3 * c^2 + - 4 * a^2 * c^3 + - 83 * a * b * c^3 + - 18 * a * c^4 + - 82 * b * c^4 + - 66 * c^5 + - 39 * a^4 * d + - 20 * a^2 * b^2 * d + - 43 * a * b^3 * d + - 79 * b^4 * d + - 23 * a^3 * c * d + - 19 * a^2 * b * c * d + - 61 * b^3 * c * d + - 27 * a^2 * c^2 * d + - 58 * b^2 * c^2 * d + - 63 * b * c^3 * d + - 14 * a^3 * d^2 + - 6 * b^3 * d^2 + - 65 * a^2 * c * d^2 + - 32 * a * b * c * d^2 + - 62 * b^2 * c * d^2 + - 11 * b * c^2 * d^2 + - 4 * a^2 * d^3 + - 83 * a * c * d^3 + - 70 * b * c * d^3 + - 63 * c^2 * d^3 + - 8 * a * d^4 + - 26 * b * d^4 + - 32 * c * d^4 + - 78 * a^4 * e + - 13 * a^3 * b * e + - 8 * a^2 * b^2 * e + - 66 * a * b^3 * e + - 49 * b^4 * e + - 4 * a * b^2 * c * e + - 75 * b^3 * c * e + - 33 * b^2 * c^2 * e + - 43 * a * c^3 * e + - 32 * b * c^3 * e + - 79 * c^4 * e + - 6 * a^3 * d * e + - 38 * a * b^2 * d * e + - 22 * b^3 * d * e + - 56 * a^2 * c * d * e + - 49 * b^2 * c * d * e + - 47 * a * c^2 * d * e + - 85 * c^3 * d * e + - 5 * a^2 * d^2 * e + - 80 * a * b * d^2 * e + - 44 * a * c * d^2 * e + - 50 * b * c * d^2 * e + - 34 * c^2 * d^2 * e + - 13 * b * d^3 * e + - 17 * c * d^3 * e + - 41 * d^4 * e + - 43 * a^2 * b * e^2 + - 46 * a * b^2 * e^2 + - 41 * b^3 * e^2 + - b^2 * c * e^2 + - 44 * a * c^2 * e^2 + - 71 * c^3 * e^2 + - 10 * a * b * d * e^2 + - 66 * b^2 * d * e^2 + - 77 * a * c * d * e^2 + - 69 * b * c * d * e^2 + - 2 * a * d^2 * e^2 + - 33 * b * d^2 * e^2 + - 39 * c * d^2 * e^2 + - 69 * d^3 * e^2 + - 25 * a^2 * e^3 + - 36 * a * b * e^3 + - 56 * b^2 * e^3 + - 54 * a * c * e^3 + - 30 * c^2 * e^3 + - 4 * a * d * e^3 + - 73 * b * d * e^3 + - 30 * d^2 * e^3 + - 78 * c * e^4 + - 20 * e^5, - 40 + - 25 * b + - 73 * c + - 44 * d + - 4 * a * b + - 48 * b^2 + - 66 * a * c + - 15 * b * c + - 77 * b * d + - 36 * c * d + - 35 * c * e + - 84 * d * e + - 14 * e^2 + - 45 * a^3 + - 14 * a * b * c + - 86 * b^2 * c + - 15 * a * c^2 + - 76 * b * c^2 + - 67 * a^2 * d + - 59 * b^2 * d + - 8 * b * c * d + - 72 * c^2 * d + - 55 * a * d^2 + - 23 * b * d^2 + - 71 * c * d^2 + - 44 * d^3 + - a * b * e + - 40 * a * c * e + - 81 * c^2 * e + - 20 * a * d * e + - 79 * c * d * e + - 37 * d^2 * e + - 19 * b * e^2 + - 51 * c * e^2 + - 80 * d * e^2 + - 47 * a^3 * b + - 7 * a^3 * c + - 18 * a^2 * c^2 + - 48 * b^2 * c^2 + - 45 * b * c^3 + - 82 * c^4 + - 89 * a^3 * d + - 5 * a^2 * b * d + - 36 * a * b^2 * d + - 84 * a^2 * c * d + - 87 * b^2 * c * d + - 70 * a * c^2 * d + - 84 * b * c^2 * d + - 16 * c^3 * d + - 25 * a * b * d^2 + - 67 * a * c * d^2 + - 29 * b * c * d^2 + - 68 * c^2 * d^2 + - 72 * c * d^3 + - 65 * a^2 * b * e + - 10 * a * b^2 * e + - 13 * b^3 * e + - 72 * a^2 * c * e + - 36 * a * b * c * e + - 36 * b^2 * c * e + - 18 * a * c^2 * e + - 9 * b * c^2 * e + - 81 * c^3 * e + - 47 * a^2 * d * e + - 26 * a * b * d * e + - 61 * b^2 * d * e + - 78 * a * c * d * e + - 57 * b * c * d * e + - 40 * c^2 * d * e + - 23 * a * d^2 * e + - 82 * b * d^2 * e + - 65 * d^3 * e + - 87 * a^2 * e^2 + - 56 * a * b * e^2 + - 65 * b^2 * e^2 + - 54 * b * c * e^2 + - 90 * c^2 * e^2 + - 57 * a * d * e^2 + - 33 * b * d * e^2 + - 73 * c * d * e^2 + - 27 * d^2 * e^2 + - 43 * a * e^3 + - 12 * b * e^3 + - 88 * d * e^3 + - 69 * a^4 * b + - 25 * a^3 * b^2 + - 76 * a^2 * b^3 + - 2 * a * b^4 + - 35 * a^4 * c + - 70 * a * b^3 * c + - 48 * b^4 * c + - 29 * a^3 * c^2 + - 34 * a * b^2 * c^2 + - 29 * b^3 * c^2 + - 76 * a * b * c^3 + - 82 * a * c^4 + - 24 * b * c^4 + - 13 * a^4 * d + - 82 * b^4 * d + - 80 * a^2 * b * c * d + - 67 * a * b^2 * c * d + - 30 * b^3 * c * d + - 24 * a^2 * c^2 * d + - 89 * a * b * c^2 * d + - 6 * b^2 * c^2 * d + - 47 * a * c^3 * d + - 49 * b * c^3 * d + - 64 * c^4 * d + - 3 * a^2 * b * d^2 + - 15 * b^3 * d^2 + - 60 * a^2 * c * d^2 + - 24 * a * b * c * d^2 + - 68 * b * c^2 * d^2 + - 75 * c^3 * d^2 + - 54 * a^2 * d^3 + - 70 * a * b * d^3 + - 52 * b^2 * d^3 + - 90 * a * c * d^3 + - 83 * b * c * d^3 + - 76 * a * d^4 + - 80 * c * d^4 + - 69 * d^5 + - 71 * a^4 * e + - 79 * a^3 * b * e + - 41 * a^3 * c * e + - 85 * b^3 * c * e + - 75 * a^2 * c^2 * e + - 68 * a * b * c^2 * e + - 79 * a * c^3 * e + - 87 * c^4 * e + - 62 * a^3 * d * e + - 57 * a * b^2 * d * e + - 59 * a^2 * c * d * e + - 40 * a * b * c * d * e + - 71 * a * c^2 * d * e + - 70 * c^3 * d * e + - 19 * a^2 * d^2 * e + - 90 * b^2 * d^2 * e + - 38 * a * c * d^2 * e + - 7 * b * c * d^2 * e + - 25 * c^2 * d^2 * e + - 17 * a * d^3 * e + - 30 * b * d^3 * e + - 56 * d^4 * e + - 40 * a^2 * b * e^2 + - 80 * b^3 * e^2 + - a^2 * c * e^2 + - 34 * a * b * c * e^2 + - 52 * b^2 * c * e^2 + - 76 * b * c^2 * e^2 + - 40 * c^3 * e^2 + - 59 * a^2 * d * e^2 + - 69 * b * c * d * e^2 + - 42 * c^2 * d * e^2 + - 65 * b * d^2 * e^2 + - 61 * c * d^2 * e^2 + - 22 * d^3 * e^2 + - 76 * a^2 * e^3 + - 69 * a * b * e^3 + - 21 * b^2 * e^3 + - a * c * e^3 + - 2 * b * c * e^3 + - 9 * c^2 * e^3 + - 75 * a * d * e^3 + - 70 * b * d * e^3 + - 27 * d^2 * e^3 + - 71 * a * e^4 + - 63 * b * e^4, - 28 + - 6 * a + - 90 * c + - 55 * d + - 36 * e + - b^2 + - 24 * a * c + - 70 * b * c + - 62 * c^2 + - 29 * a * d + - 56 * b * d + - 40 * c * d + - 90 * d^2 + - 31 * a * e + - 28 * b * e + - 7 * c * e + - 78 * d * e + - 18 * e^2 + - 40 * a^3 + - 29 * a^2 * b + - 23 * b^3 + - 24 * b^2 * c + - 18 * a * c^2 + - 74 * c^3 + - 32 * a * b * d + - 57 * b^2 * d + - 81 * a * c * d + - 12 * b * c * d + - 16 * c^2 * d + - 53 * a * d^2 + - 81 * b * d^2 + - 25 * c * d^2 + - 28 * d^3 + - 22 * a^2 * e + - 6 * a * b * e + - 51 * b^2 * e + - 27 * a * c * e + - 16 * b * c * e + - 80 * c^2 * e + - 61 * a * d * e + - 59 * b * d * e + - 11 * c * d * e + - 76 * d^2 * e + - 85 * a * e^2 + - 43 * b * e^2 + - 39 * c * e^2 + - 56 * e^3 + - 48 * a^4 + - 33 * a^3 * b + - 90 * a^2 * b^2 + - 67 * a * b^3 + - 20 * a^3 * c + - 87 * a^2 * b * c + - 8 * a * b^2 * c + - 86 * b^3 * c + - 18 * a^2 * c^2 + - 46 * a * b * c^2 + - 72 * a * c^3 + - 75 * b * c^3 + - 71 * c^4 + - 74 * a^3 * d + - 59 * a^2 * b * d + - 34 * a * b^2 * d + - 13 * b^3 * d + - 34 * a^2 * c * d + - 70 * a * b * c * d + - 23 * b^2 * c * d + - 49 * a * c^2 * d + - 13 * b * c^2 * d + - 80 * c^3 * d + - 46 * a^2 * d^2 + - 39 * a * b * d^2 + - 78 * b^2 * d^2 + - 37 * a * c * d^2 + - 40 * c^2 * d^2 + - 81 * b * d^3 + - 85 * a * b^2 * e + - 31 * a * b * c * e + - 90 * b^2 * c * e + - 24 * b * c^2 * e + - 19 * c^3 * e + - 86 * b^2 * d * e + - 33 * a * c * d * e + - 65 * b * c * d * e + - 42 * a * d^2 * e + - 62 * a^2 * e^2 + - 50 * a * b * e^2 + - 48 * a * c * e^2 + - 70 * b * d * e^2 + - 77 * c * d * e^2 + - 8 * d^2 * e^2 + - 30 * b * e^3 + - 58 * c * e^3 + - 20 * d * e^3 + - 14 * a^5 + - 51 * a^4 * b + - 28 * a^3 * b^2 + - 34 * a^2 * b^3 + - 60 * a * b^4 + - 58 * a^4 * c + - 49 * b^4 * c + - 17 * a^3 * c^2 + - 13 * a^2 * b * c^2 + - 59 * a * b^2 * c^2 + - 31 * a^2 * c^3 + - 48 * a * b * c^3 + - 12 * b^2 * c^3 + - 55 * a * c^4 + - 8 * b * c^4 + - 23 * c^5 + - 34 * a^4 * d + - 52 * a^3 * b * d + - 21 * a^2 * b^2 * d + - a * b^3 * d + - 40 * a^2 * b * c * d + - 56 * a * b^2 * c * d + - 22 * b^3 * c * d + - 8 * a^2 * c^2 * d + - 55 * a * b * c^2 * d + - 89 * b^2 * c^2 * d + - 65 * a * c^3 * d + - 30 * b * c^3 * d + - 58 * c^4 * d + - 30 * a^3 * d^2 + - 64 * a^2 * b * d^2 + - 44 * a * b^2 * d^2 + - 81 * b^3 * d^2 + - 71 * a^2 * c * d^2 + - 77 * a * b * c * d^2 + - 78 * a * c^2 * d^2 + - 33 * b * c^2 * d^2 + - 29 * c^3 * d^2 + - 11 * b^2 * d^3 + - 31 * a * c * d^3 + - 56 * b * c * d^3 + - 62 * c^2 * d^3 + - 77 * a * d^4 + - 12 * c * d^4 + - 69 * d^5 + - 84 * a^4 * e + - 11 * a^3 * b * e + - 42 * a^2 * b^2 * e + - 58 * a * b^3 * e + - 82 * b^4 * e + - 34 * a^2 * b * c * e + - 69 * b^3 * c * e + - 63 * a^2 * c^2 * e + - 89 * a * b * c^2 * e + - 55 * a^2 * b * d * e + - 83 * a^2 * c * d * e + - 86 * b^2 * c * d * e + - 80 * a * c^2 * d * e + - 15 * b * c^2 * d * e + - 26 * a^2 * d^2 * e + - 44 * a * b * d^2 * e + - 71 * a * c * d^2 * e + - 35 * c^2 * d^2 * e + - 40 * a * d^3 * e + - 72 * b * d^3 * e + - 87 * c * d^3 * e + - 60 * d^4 * e + - 31 * a^2 * b * e^2 + - 25 * a * b^2 * e^2 + - 15 * b^3 * e^2 + - 39 * a^2 * c * e^2 + - 26 * a * b * c * e^2 + - 60 * b^2 * c * e^2 + - 12 * b * c^2 * e^2 + - 39 * c^3 * e^2 + - 82 * a^2 * d * e^2 + - 59 * b^2 * d * e^2 + - 72 * a * c * d * e^2 + - 13 * b * c * d * e^2 + - 47 * c^2 * d * e^2 + - 38 * a * d^2 * e^2 + - 75 * b * d^2 * e^2 + - 61 * c * d^2 * e^2 + - 58 * a^2 * e^3 + - 46 * a * b * e^3 + - 33 * b^2 * e^3 + - 13 * c^2 * e^3 + - 41 * a * d * e^3 + - 57 * b * d * e^3 + - 62 * a * e^4 + - 47 * b * e^4 + - 63 * c * e^4 + - 60 * d * e^4 + - 45 * e^5, - ], - ), - ) + R,[80*b*d+35*c^2*d+39*b*c*e+11*c^2*e+49*a*d*e+60*a^2*b^2+67*a*b^2*c+66*a*c^2*d+11*c^3*d+4*c^2*d^2+43*a^3*e+52*b^2*c*e+55*c^2*d*e+48*b*d^2*e+43*c*e^3+61*b^3*c^2+64*a*c^3*d+24*a*b*c*d^2+10*a*c^2*d^2+61*b*d^4+5*c*d^4+7*a*b*d^2*e+60*a^2*b*e^2+90*b^3*e^2+18*c^2*d*e^2+23*a*d^2*e^2+38*b*d*e^3, +a+27*a*d+75*d^2+88*b*c^2+16*a^2*d+34*b*d^2+53*a*e^2+37*a^2*b^2+39*a*b*c^2+89*a^2*b*d+14*a^2*d^2+27*b^3*e+40*a*b^3*c+33*a*b^3*d+81*b^4*d+89*a*c^3*d+27*a^4*e+72*b^2*c^2*e+65*b^2*c*d*e+38*b^2*d*e^2+46*c*d^2*e^2+83*a*c*e^3+36*d*e^4, +45+72*d+50*a^2+3*c*e+15*a^3+10*b*e^2+35*a^3*b+5*a*b^2*d+59*a*b*c*e+6*a^2*e^2+83*a*b^3*c+18*b^4*d+9*a^3*c*d+63*b^3*d^2+51*a^2*c*d^2+4*b^2*c*d^2+11*c^3*d^2+18*a*b^3*e+89*a^2*c^2*e+13*a^2*c*d*e+40*b*d^3*e+87*c^2*e^3])) push!( ideals, Singular.Ideal( - R, - [ - 77 + - 84 * a + - 85 * b + - 55 * c + - 37 * d + - 29 * a^2 + - 3 * a * b + - 86 * b^2 + - 54 * b * c + - 13 * c^2 + - 58 * a * d + - 63 * c * d + - 83 * a * e + - 52 * c * e + - 70 * d * e + - 3 * e^2 + - 50 * a * b^2 + - 70 * b^3 + - 31 * a^2 * c + - 78 * a * b * c + - 25 * a * c^2 + - 76 * b * c^2 + - 70 * c^3 + - a^2 * d + - 71 * a * b * d + - 74 * b^2 * d + - 55 * a * c * d + - 40 * b * c * d + - 17 * b * d^2 + - 23 * d^3 + - 21 * a^2 * e + - 2 * a * b * e + - 77 * b^2 * e + - 3 * a * c * e + - 41 * c^2 * e + - 16 * b * d * e + - 31 * c * d * e + - 89 * a * e^2 + - 63 * c * e^2 + - 64 * d * e^2 + - 80 * a^4 + - 78 * a^3 * b + - 19 * a^2 * b^2 + - 73 * a * b^3 + - 55 * a * b^2 * c + - 20 * a^2 * c^2 + - 23 * a * b * c^2 + - 88 * b^2 * c^2 + - 55 * a * c^3 + - 12 * b * c^3 + - 56 * c^4 + - 68 * a^3 * d + - 12 * a^2 * b * d + - 75 * b^3 * d + - 39 * a^2 * c * d + - 64 * b^2 * c * d + - 27 * a * c^2 * d + - 45 * b * c^2 * d + - 10 * a^2 * d^2 + - 60 * a * b * d^2 + - 14 * a * c * d^2 + - 85 * b * c * d^2 + - 42 * c^2 * d^2 + - 10 * a * d^3 + - 49 * c * d^3 + - 25 * a^3 * e + - 42 * a^2 * b * e + - 90 * a * b^2 * e + - 44 * a^2 * c * e + - 25 * a * b * c * e + - 53 * b^2 * c * e + - 71 * a * c^2 * e + - 89 * b * c^2 * e + - 49 * c^3 * e + - 38 * a^2 * d * e + - 54 * b^2 * d * e + - 32 * a * c * d * e + - 21 * b * c * d * e + - 60 * c^2 * d * e + - 89 * a * d^2 * e + - 65 * c * d^2 * e + - 2 * d^3 * e + - 63 * a^2 * e^2 + - 49 * a * b * e^2 + - 4 * b^2 * e^2 + - 87 * a * c * e^2 + - 34 * b * c * e^2 + - 83 * c^2 * e^2 + - 62 * a * d * e^2 + - 86 * c * d * e^2 + - 61 * d^2 * e^2 + - 19 * a * e^3 + - 6 * b * e^3 + - 24 * c * e^3 + - 62 * d * e^3 + - 39 * e^4 + - 28 * a^5 + - 36 * a^3 * b^2 + - 78 * a^2 * b^3 + - 61 * a^4 * c + - 41 * a^3 * b * c + - 49 * a^2 * b^2 * c + - 82 * a * b^3 * c + - 16 * a^3 * c^2 + - 25 * a^2 * b * c^2 + - 80 * b^3 * c^2 + - 21 * a^2 * c^3 + - 77 * b^2 * c^3 + - 76 * a * c^4 + - 55 * b * c^4 + - 44 * c^5 + - 50 * a^4 * d + - 59 * a^3 * b * d + - 42 * a^2 * b^2 * d + - 68 * a * b^3 * d + - 57 * b^4 * d + - 15 * a^3 * c * d + - 45 * a^2 * b * c * d + - 85 * a * b^2 * c * d + - 2 * a * b * c^2 * d + - 56 * a * c^3 * d + - 78 * c^4 * d + - 6 * a^3 * d^2 + - 13 * a * b^2 * d^2 + - 59 * b^3 * d^2 + - 65 * a^2 * c * d^2 + - 67 * b^2 * c * d^2 + - 82 * b * c^2 * d^2 + - 71 * c^3 * d^2 + - 40 * a^2 * d^3 + - 48 * a * b * d^3 + - 83 * b^2 * d^3 + - 41 * a * c * d^3 + - 75 * b * c * d^3 + - 45 * c^2 * d^3 + - 35 * a * d^4 + - 54 * b * d^4 + - 12 * c * d^4 + - a^3 * b * e + - 32 * a * b^3 * e + - 79 * a^2 * b * c * e + - 73 * a^2 * c^2 * e + - 27 * a * b * c^2 * e + - 54 * a * c^3 * e + - 66 * b * c^3 * e + - 66 * c^4 * e + - 69 * a^3 * d * e + - 22 * a^2 * b * d * e + - 64 * a^2 * c * d * e + - 59 * b^2 * c * d * e + - 35 * a * c^2 * d * e + - 75 * b * c^2 * d * e + - 30 * c^3 * d * e + - 75 * a^2 * d^2 * e + - 61 * a * b * d^2 * e + - 32 * a * c * d^2 * e + - 36 * b * c * d^2 * e + - 89 * a * d^3 * e + - 39 * c * d^3 * e + - 46 * a^3 * e^2 + - 74 * a^2 * b * e^2 + - 50 * a * b^2 * e^2 + - 5 * b^3 * e^2 + - 2 * a^2 * c * e^2 + - 5 * a * b * c * e^2 + - 61 * a * c^2 * e^2 + - 89 * b * c^2 * e^2 + - 69 * c^3 * e^2 + - 27 * a^2 * d * e^2 + - 57 * b^2 * d * e^2 + - 50 * a * c * d * e^2 + - 18 * c^2 * d * e^2 + - 81 * a * d^2 * e^2 + - 2 * c * d^2 * e^2 + - 71 * d^3 * e^2 + - a^2 * e^3 + - 34 * a * b * e^3 + - 27 * b^2 * e^3 + - 48 * a * c * e^3 + - 88 * c^2 * e^3 + - 71 * a * d * e^3 + - 49 * b * d * e^3 + - 54 * c * d * e^3 + - 55 * d^2 * e^3 + - 21 * b * e^4 + - 17 * c * e^4 + - 2 * e^5, - 87 + - 18 * a + - 10 * b + - 51 * d + - 36 * e + - 15 * a^2 + - 40 * a * b + - 82 * b^2 + - 35 * a * c + - 81 * b * c + - 44 * a * d + - 51 * b * d + - 23 * c * d + - 78 * d^2 + - 41 * a * e + - 71 * d * e + - 52 * a^3 + - 25 * a * b * c + - 34 * b^2 * c + - 90 * b * c^2 + - 71 * c^3 + - 26 * a * b * d + - 4 * b^2 * d + - 81 * b * c * d + - 68 * c^2 * d + - 61 * a * d^2 + - 65 * b * d^2 + - 53 * c * d^2 + - 44 * a^2 * e + - 50 * a * b * e + - 58 * b^2 * e + - 31 * c^2 * e + - 85 * c * d * e + - 84 * d^2 * e + - 64 * a * e^2 + - 47 * b * e^2 + - 27 * c * e^2 + - 35 * d * e^2 + - 17 * e^3 + - 48 * a^3 * b + - 3 * a^2 * b^2 + - 37 * b^4 + - 62 * a^2 * b * c + - 35 * a * b^2 * c + - 18 * b^3 * c + - 29 * a * b * c^2 + - 56 * b^2 * c^2 + - 55 * b * c^3 + - 88 * a^3 * d + - 73 * a^2 * b * d + - 49 * b^3 * d + - 53 * a^2 * c * d + - 67 * a * b * c * d + - 47 * b^2 * c * d + - 7 * a * c^2 * d + - 14 * a * b * d^2 + - 49 * a * c * d^2 + - 72 * c^2 * d^2 + - 33 * a * d^3 + - 31 * b * d^3 + - 81 * c * d^3 + - 49 * a^3 * e + - 24 * b^3 * e + - 54 * b * c^2 * e + - 12 * a * b * d * e + - 32 * a * c * d * e + - 12 * b * c * d * e + - 45 * c^2 * d * e + - 46 * a * d^2 * e + - 52 * b * d^2 * e + - 36 * d^3 * e + - 32 * a^2 * e^2 + - 15 * b * c * e^2 + - 83 * c^2 * e^2 + - 68 * a * d * e^2 + - 51 * c * d * e^2 + - 75 * d^2 * e^2 + - 43 * a * e^3 + - 68 * b * e^3 + - 63 * c * e^3 + - 84 * d * e^3 + - 49 * e^4 + - 11 * a^5 + - 33 * a^4 * b + - 8 * a^3 * b^2 + - 35 * a^2 * b^3 + - 7 * b^5 + - 23 * a^3 * b * c + - 74 * a * b^3 * c + - 78 * b^4 * c + - 73 * a^3 * c^2 + - 90 * a^2 * b * c^2 + - 30 * a * b^2 * c^2 + - 86 * b^2 * c^3 + - 85 * a * c^4 + - 22 * b * c^4 + - 55 * c^5 + - 10 * a^4 * d + - 15 * a^3 * b * d + - 82 * a * b^3 * d + - 12 * b^4 * d + - 39 * a^3 * c * d + - 79 * b^3 * c * d + - 72 * a * b * c^2 * d + - 44 * b^2 * c^2 * d + - 36 * a * c^3 * d + - 10 * a * b^2 * d^2 + - 73 * b^3 * d^2 + - 83 * a^2 * c * d^2 + - 61 * a * c^2 * d^2 + - 74 * c^3 * d^2 + - 22 * a^2 * d^3 + - 5 * b^2 * d^3 + - 38 * a * c * d^3 + - 84 * c^2 * d^3 + - 55 * a * d^4 + - 38 * b * d^4 + - 66 * a^4 * e + - 40 * a^2 * b^2 * e + - 62 * a * b^3 * e + - 46 * b^4 * e + - 68 * a^3 * c * e + - 25 * a * b^2 * c * e + - 57 * b^3 * c * e + - 62 * a^2 * c^2 * e + - 23 * a * b * c^2 * e + - 39 * b^2 * c^2 * e + - 29 * a * c^3 * e + - 84 * b * c^3 * e + - 52 * c^4 * e + - 38 * a^3 * d * e + - 50 * b^3 * d * e + - 4 * a^2 * c * d * e + - 5 * a * b * c * d * e + - 40 * b^2 * c * d * e + - 10 * a^2 * d^2 * e + - 52 * a * b * d^2 * e + - 86 * b^2 * d^2 * e + - 5 * a * c * d^2 * e + - 70 * b * c * d^2 * e + - 57 * b * d^3 * e + - 32 * c * d^3 * e + - 66 * d^4 * e + - 75 * a^3 * e^2 + - 28 * a^2 * b * e^2 + - 33 * a * b^2 * e^2 + - 69 * b^3 * e^2 + - 31 * a^2 * c * e^2 + - 21 * a * b * c * e^2 + - 65 * b^2 * c * e^2 + - 43 * a * c^2 * e^2 + - 16 * a^2 * d * e^2 + - 66 * a * b * d * e^2 + - 76 * b^2 * d * e^2 + - 44 * c^2 * d * e^2 + - 28 * a * d^2 * e^2 + - 89 * b * d^2 * e^2 + - 82 * c * d^2 * e^2 + - 10 * a^2 * e^3 + - 8 * a * b * e^3 + - 15 * b^2 * e^3 + - 35 * a * c * e^3 + - 78 * b * c * e^3 + - 73 * c^2 * e^3 + - 51 * a * d * e^3 + - 21 * c * d * e^3 + - 26 * d^2 * e^3 + - 66 * b * e^4 + - 34 * d * e^4 + - 75 * e^5, - 15 + - 54 * c + - 66 * e + - 67 * a * c + - 59 * b * c + - 49 * c^2 + - 72 * a * d + - 35 * b * d + - 74 * c * d + - 39 * d^2 + - 19 * b * e + - 90 * c * e + - 5 * e^2 + - 84 * a^3 + - 12 * a^2 * b + - 42 * a * b^2 + - 51 * b^3 + - 16 * b^2 * c + - 8 * a * c^2 + - 73 * b * c^2 + - 80 * a * b * d + - 69 * b * c * d + - 39 * c^2 * d + - 16 * a * d^2 + - 18 * b * d^2 + - 83 * c * d^2 + - 21 * d^3 + - 55 * a^2 * e + - 4 * b^2 * e + - 90 * a * c * e + - 12 * b * c * e + - 61 * c^2 * e + - 66 * a * d * e + - 55 * b * d * e + - 84 * d^2 * e + - 30 * a * e^2 + - 14 * b * e^2 + - 8 * c * e^2 + - 82 * d * e^2 + - 13 * e^3 + - 5 * a^4 + - 59 * a * b^2 * c + - 58 * b^3 * c + - 62 * a^2 * c^2 + - 30 * b^2 * c^2 + - 4 * a * c^3 + - 60 * b * c^3 + - 5 * a^3 * d + - 75 * a^2 * b * d + - 47 * a * b^2 * d + - 61 * b^3 * d + - 9 * a * b * c * d + - 58 * b^2 * c * d + - 85 * c^3 * d + - 48 * a * b * d^2 + - 73 * b^2 * d^2 + - 3 * a * c * d^2 + - 20 * b * c * d^2 + - 47 * c^2 * d^2 + - 41 * c * d^3 + - 69 * d^4 + - 89 * a^3 * e + - 58 * a^2 * b * e + - 55 * a * b^2 * e + - 2 * b^3 * e + - 39 * a^2 * c * e + - 4 * a * b * c * e + - 75 * a * c^2 * e + - 68 * b * c^2 * e + - 64 * c^3 * e + - 13 * a^2 * d * e + - 24 * a * b * d * e + - 58 * b^2 * d * e + - 65 * a * c * d * e + - 82 * b * c * d * e + - 55 * a * d^2 * e + - 2 * a^2 * e^2 + - 9 * b^2 * e^2 + - 42 * a * c * e^2 + - 89 * b * c * e^2 + - 77 * c^2 * e^2 + - 2 * a * d * e^2 + - 80 * b * d * e^2 + - 74 * c * d * e^2 + - 39 * d^2 * e^2 + - 2 * a * e^3 + - 8 * b * e^3 + - 73 * c * e^3 + - 9 * a^5 + - 15 * a^4 * b + - 21 * a^3 * b^2 + - 86 * a^2 * b^3 + - 72 * b^5 + - 19 * a^4 * c + - 81 * a^2 * b^2 * c + - 10 * a * b^3 * c + - 56 * b^4 * c + - 30 * a^3 * c^2 + - 21 * a^2 * b * c^2 + - 80 * a * b^2 * c^2 + - 60 * a^2 * c^3 + - 8 * b^2 * c^3 + - 78 * a * c^4 + - 18 * b * c^4 + - 67 * c^5 + - 20 * a^4 * d + - 13 * a^3 * b * d + - 71 * a * b^3 * d + - 79 * b^4 * d + - 15 * a^3 * c * d + - 46 * b^3 * c * d + - 11 * a^2 * c^2 * d + - 57 * a * b * c^2 * d + - 81 * b^2 * c^2 * d + - 47 * a * c^3 * d + - 64 * b * c^3 * d + - 30 * a^3 * d^2 + - 24 * a^2 * b * d^2 + - 90 * b^3 * d^2 + - 11 * a * b * c * d^2 + - 73 * b * c^2 * d^2 + - 84 * a^2 * d^3 + - 41 * b * c * d^3 + - 28 * c^2 * d^3 + - 55 * b * d^4 + - 35 * c * d^4 + - 57 * d^5 + - 24 * a^4 * e + - 42 * a^3 * b * e + - 50 * a * b^3 * e + - 2 * a^3 * c * e + - 34 * a^2 * b * c * e + - 81 * a * b^2 * c * e + - 43 * a^2 * c^2 * e + - 29 * a * b * c^2 * e + - 86 * b^2 * c^2 * e + - 62 * b * c^3 * e + - 42 * a^2 * b * d * e + - 51 * a * b^2 * d * e + - 83 * a^2 * c * d * e + - 5 * a * b * c * d * e + - 33 * b^2 * c * d * e + - 17 * a * c^2 * d * e + - 63 * b * c^2 * d * e + - 72 * c^3 * d * e + - 41 * a^2 * d^2 * e + - 82 * a * b * d^2 * e + - 14 * b^2 * d^2 * e + - 50 * b * c * d^2 * e + - 81 * a * d^3 * e + - 44 * b * d^3 * e + - 7 * c * d^3 * e + - 22 * d^4 * e + - 17 * a^3 * e^2 + - 77 * a^2 * b * e^2 + - 89 * b^3 * e^2 + - 52 * a * c^2 * e^2 + - 50 * b * c^2 * e^2 + - 88 * a^2 * d * e^2 + - 7 * a * b * d * e^2 + - 57 * b^2 * d * e^2 + - 66 * b * c * d * e^2 + - 58 * c^2 * d * e^2 + - 34 * a * d^2 * e^2 + - 74 * b * d^2 * e^2 + - 88 * d^3 * e^2 + - 16 * a * b * e^3 + - 36 * b * c * e^3 + - 56 * c^2 * e^3 + - 54 * b * d * e^3 + - 64 * d^2 * e^3 + - 47 * c * e^4 + - 83 * d * e^4, - ], - ), - ) + R,[16*a*c+31*b*d^2+24*a^2*e+70*a*d*e+15*d^2*e+71*d^4+b^2*c*e+58*a*c*e^2+33*b^4*c+74*a^3*c^2+86*a^2*b^2*d+7*c^3*d^2+53*b^2*d^3+86*a^4*e+48*a^2*b*c*e+64*a*b*c^2*e+88*b^2*c*d*e+42*a*c*d^2*e+a^2*b*e^2+4*a^2*d*e^2+6*c*d^2*e^2+60*b*d*e^3+7*e^5, +28*a+6*c*d+54*a^2*c+14*b^2*c+10*a^2*b^2+23*b^2*c^2+48*b^3*d+13*b*c^2*d+43*a*b*d^2+41*b^2*c*e+41*b*c^2*e+47*b^2*d*e+24*b*d^2*e+87*a^2*e^2+65*b^5+85*b^4*c+87*b^3*c*d+44*b^2*c^2*d+61*a^2*b*d^2+85*d^5+90*b*c^3*e+31*a^3*d*e+67*b*c^2*e^2+34*b*d^2*e^2+14*d^3*e^2, +46+52*d+20*a^2+56*b*e+9*d*e+88*a^3+24*a^2*b+25*a*d*e+19*b*d*e+20*a^3*b+58*b^4+40*b*c^2*d+66*a^2*d^2+14*b^2*d*e+67*a*e^3+26*a^3*b^2+55*a^3*c^2+68*a^2*b*d^2+16*a*b^3*e+4*c^2*d^2*e+5*b^2*c*e^2+89*c^3*e^2+30*a*b*e^3+31*c*e^4])) push!( ideals, Singular.Ideal( - R, - [ - 65 + - 47 * a + - 18 * b + - 58 * a^2 + - 90 * a * b + - 66 * a * c + - 64 * b * c + - 40 * c^2 + - 36 * b * d + - 76 * c * d + - 39 * d^2 + - 58 * b * e + - 38 * e^2 + - 53 * a^2 * b + - 30 * a * b^2 + - 2 * b^3 + - 42 * b^2 * c + - 82 * b * c^2 + - 70 * c^3 + - 43 * a * b * d + - 57 * b^2 * d + - 78 * b * c * d + - 23 * b * d^2 + - 22 * c * d^2 + - 69 * d^3 + - 23 * a^2 * e + - 58 * a * c * e + - 33 * c^2 * e + - 51 * a * d * e + - 32 * b * d * e + - 70 * d^2 * e + - 55 * a * e^2 + - 57 * b * e^2 + - 89 * e^3 + - 62 * a^4 + - 7 * a^3 * b + - 30 * a^2 * b^2 + - 49 * a * b^3 + - 21 * b^4 + - 67 * a^3 * c + - 85 * a^2 * b * c + - 44 * b^3 * c + - 23 * a^2 * c^2 + - 64 * a * b * c^2 + - 11 * b^2 * c^2 + - 81 * a^3 * d + - 36 * a^2 * b * d + - 55 * b^3 * d + - 66 * a^2 * c * d + - 75 * a * b * c * d + - 22 * a * c^2 * d + - b * c^2 * d + - 72 * c^3 * d + - 8 * a^2 * d^2 + - 51 * a * b * d^2 + - 39 * b^2 * d^2 + - 13 * a * c * d^2 + - 24 * b * c * d^2 + - 87 * a * d^3 + - 21 * b * d^3 + - 26 * c * d^3 + - 16 * d^4 + - 81 * a^2 * b * e + - 67 * a * b^2 * e + - 59 * b^3 * e + - 90 * b^2 * c * e + - 51 * c^3 * e + - 20 * a^2 * d * e + - 35 * a * b * d * e + - 47 * c^2 * d * e + - 88 * a * d^2 * e + - 43 * b * d^2 * e + - 31 * c * d^2 * e + - 86 * a * b * e^2 + - 24 * b^2 * e^2 + - 17 * b * c * e^2 + - 2 * c^2 * e^2 + - 31 * b * d * e^2 + - 46 * c * d * e^2 + - 27 * d^2 * e^2 + - 74 * a * e^3 + - 88 * b * e^3 + - 73 * c * e^3 + - 50 * d * e^3 + - 60 * e^4 + - 56 * a^5 + - 32 * a^4 * b + - 84 * a^3 * b^2 + - 33 * a^2 * b^3 + - 15 * a * b^4 + - 80 * a^4 * c + - 27 * a^3 * b * c + - 55 * a^2 * b^2 * c + - 76 * b^4 * c + - 15 * a^3 * c^2 + - 33 * a^2 * b * c^2 + - 51 * a * b^2 * c^2 + - 70 * b^3 * c^2 + - 78 * a^2 * c^3 + - 33 * a * b * c^3 + - 63 * b^2 * c^3 + - 87 * a * c^4 + - 28 * b * c^4 + - 83 * c^5 + - 83 * a^3 * b * d + - 50 * a * b^3 * d + - 39 * b^4 * d + - 14 * a * b^2 * c * d + - 29 * a * b * c^2 * d + - 20 * b^2 * c^2 * d + - 71 * a * c^3 * d + - b * c^3 * d + - 28 * c^4 * d + - 49 * a^3 * d^2 + - 35 * a^2 * b * d^2 + - 17 * a * b^2 * d^2 + - 27 * b^3 * d^2 + - 75 * a^2 * c * d^2 + - 16 * a * b * c * d^2 + - 33 * b^2 * c * d^2 + - 32 * a * c^2 * d^2 + - 64 * b * c^2 * d^2 + - 18 * a^2 * d^3 + - 69 * a * b * d^3 + - 66 * b^2 * d^3 + - 21 * a * c * d^3 + - 32 * b * c * d^3 + - 22 * a * d^4 + - 43 * b * d^4 + - 48 * d^5 + - 69 * a^4 * e + - 59 * a^2 * b^2 * e + - 83 * a * b^3 * e + - 9 * a^2 * c^2 * e + - 11 * a * b * c^2 * e + - 38 * b^2 * c^2 * e + - 15 * a * c^3 * e + - 46 * c^4 * e + - 73 * a^2 * b * d * e + - 8 * a * b^2 * d * e + - 20 * b^3 * d * e + - 53 * a^2 * c * d * e + - 45 * a * b * c * d * e + - 22 * a * c^2 * d * e + - 24 * b * c^2 * d * e + - 29 * c^3 * d * e + - 19 * a^2 * d^2 * e + - 46 * a * b * d^2 * e + - 11 * b^2 * d^2 * e + - 68 * c^2 * d^2 * e + - 77 * a * d^3 * e + - 59 * b * d^3 * e + - 57 * c * d^3 * e + - 30 * d^4 * e + - 55 * a^3 * e^2 + - 10 * a^2 * b * e^2 + - 15 * a * b^2 * e^2 + - 85 * a^2 * c * e^2 + - 7 * b^2 * c * e^2 + - 44 * a * c^2 * e^2 + - 85 * a^2 * d * e^2 + - 76 * a * b * d * e^2 + - 75 * b^2 * d * e^2 + - 75 * b * c * d * e^2 + - 17 * c^2 * d * e^2 + - 57 * a * d^2 * e^2 + - 18 * c * d^2 * e^2 + - 21 * d^3 * e^2 + - 76 * c^2 * e^3 + - 42 * a * d * e^3 + - 32 * b * d * e^3 + - 49 * d^2 * e^3 + - 58 * d * e^4 + - 35 * e^5, - 61 + - 22 * a + - 31 * b + - 37 * c + - 9 * d + - 76 * a * b + - 67 * b^2 + - 59 * a * c + - 21 * b * c + - 13 * a * d + - 16 * c * d + - 26 * d^2 + - 57 * b * e + - 58 * c * e + - 66 * e^2 + - 65 * a * b^2 + - 67 * b^3 + - 54 * a * b * c + - 9 * b^2 * c + - 26 * a * c^2 + - 53 * a^2 * d + - 30 * a * b * d + - 63 * b^2 * d + - 8 * a * c * d + - 4 * c^2 * d + - 40 * b * d^2 + - 77 * c * d^2 + - 55 * d^3 + - 53 * a^2 * e + - 38 * a * b * e + - 23 * a * c * e + - 64 * b * c * e + - 90 * a * d * e + - 20 * b * d * e + - 57 * c * d * e + - 49 * d^2 * e + - 76 * a * e^2 + - 41 * b * e^2 + - 46 * c * e^2 + - 39 * d * e^2 + - 73 * e^3 + - 31 * a^4 + - 71 * a^3 * b + - 41 * a^2 * b^2 + - 73 * a * b^3 + - 36 * b^4 + - 65 * b^3 * c + - 43 * a * b * c^2 + - 88 * b^2 * c^2 + - 64 * a * c^3 + - 83 * b * c^3 + - 47 * c^4 + - 56 * a^3 * d + - 51 * a^2 * b * d + - 20 * b^3 * d + - 65 * a * b * c * d + - 42 * b^2 * c * d + - 36 * a * c^2 * d + - 70 * a^2 * d^2 + - 65 * a * b * d^2 + - 77 * b^2 * d^2 + - 80 * b * c * d^2 + - 47 * c^2 * d^2 + - 3 * b * d^3 + - 15 * c * d^3 + - 83 * d^4 + - 6 * a^3 * e + - 50 * b^3 * e + - 72 * a^2 * c * e + - 36 * a * c^2 * e + - 72 * c^3 * e + - 85 * a * b * d * e + - 83 * b^2 * d * e + - 16 * a * c * d * e + - 26 * b * c * d * e + - 82 * c^2 * d * e + - 83 * b * d^2 * e + - 27 * c * d^2 * e + - 25 * d^3 * e + - 90 * a^2 * e^2 + - 2 * a * b * e^2 + - 42 * b^2 * e^2 + - 66 * a * c * e^2 + - 54 * c^2 * e^2 + - 62 * a * d * e^2 + - 78 * b * d * e^2 + - 42 * c * d * e^2 + - 6 * d^2 * e^2 + - 46 * a * e^3 + - 60 * c * e^3 + - 12 * a^5 + - 64 * a^4 * b + - 17 * a^3 * b^2 + - 61 * a^2 * b^3 + - 22 * a^3 * b * c + - 26 * a^2 * b^2 * c + - 74 * b^4 * c + - 51 * a^3 * c^2 + - 83 * a^2 * b * c^2 + - 21 * a * b^2 * c^2 + - 79 * b^3 * c^2 + - 34 * a^2 * c^3 + - 86 * a * b * c^3 + - 73 * b^2 * c^3 + - 57 * b * c^4 + - 66 * c^5 + - 65 * a^4 * d + - 11 * a^3 * b * d + - 10 * a * b^3 * d + - 71 * b^4 * d + - 4 * a^3 * c * d + - 53 * a^2 * b * c * d + - 11 * a * b^2 * c * d + - 68 * b^3 * c * d + - 45 * a^2 * c^2 * d + - 21 * a * b * c^2 * d + - 33 * c^4 * d + - 39 * a^3 * d^2 + - 59 * b^3 * d^2 + - 63 * a^2 * c * d^2 + - 6 * a * b * c * d^2 + - 32 * b^2 * c * d^2 + - 55 * b * c^2 * d^2 + - 33 * a * b * d^3 + - 8 * b^2 * d^3 + - 16 * a * c * d^3 + - 49 * a * d^4 + - 33 * c * d^4 + - 57 * d^5 + - 5 * a^3 * b * e + - 83 * b^4 * e + - 89 * a^2 * b * c * e + - 75 * a * b^2 * c * e + - 2 * b^3 * c * e + - 88 * a^2 * c^2 * e + - 26 * a * b * c^2 * e + - 13 * b^2 * c^2 * e + - 40 * b * c^3 * e + - 14 * c^4 * e + - 67 * a^3 * d * e + - 7 * a^2 * b * d * e + - 63 * a * b^2 * d * e + - 9 * b^3 * d * e + - 78 * a^2 * c * d * e + - 77 * a * b * c * d * e + - 77 * b * c^2 * d * e + - 37 * c^3 * d * e + - 49 * a^2 * d^2 * e + - 29 * a * b * d^2 * e + - 23 * b^2 * d^2 * e + - 39 * a * c * d^2 * e + - 45 * c^2 * d^2 * e + - 17 * a * d^3 * e + - 33 * b * d^3 * e + - 21 * a^3 * e^2 + - 86 * a * b^2 * e^2 + - 32 * a * b * c * e^2 + - 25 * b^2 * c * e^2 + - 35 * a * c^2 * e^2 + - 75 * a * b * d * e^2 + - 70 * b^2 * d * e^2 + - 86 * c^2 * d * e^2 + - 35 * a * d^2 * e^2 + - 56 * b * d^2 * e^2 + - 43 * c * d^2 * e^2 + - 15 * d^3 * e^2 + - 87 * a^2 * e^3 + - 50 * a * b * e^3 + - 52 * b^2 * e^3 + - 60 * b * c * e^3 + - 69 * c^2 * e^3 + - 52 * b * d * e^3 + - 33 * c * d * e^3 + - 43 * a * e^4 + - 28 * b * e^4 + - 60 * c * e^4 + - 81 * d * e^4 + - 59 * e^5, - 28 * a + - 70 * b + - 84 * c + - 3 * e + - 10 * a^2 + - 51 * a * b + - 74 * b^2 + - 54 * a * c + - 43 * b * c + - c^2 + - 55 * a * d + - 77 * d^2 + - 69 * a * e + - 15 * b * e + - 30 * c * e + - 80 * e^2 + - 87 * a^3 + - 18 * a^2 * b + - 7 * a * b^2 + - 24 * a^2 * c + - 50 * a * b * c + - 66 * b^2 * c + - 29 * a * c^2 + - 11 * b * c^2 + - 58 * c^3 + - 11 * a^2 * d + - a * b * d + - 40 * b^2 * d + - 30 * b * c * d + - 72 * c^2 * d + - 80 * b * d^2 + - 60 * d^3 + - 59 * a^2 * e + - 32 * a * b * e + - 19 * b^2 * e + - 89 * a * c * e + - 55 * b * c * e + - 11 * a * d * e + - 78 * b * d * e + - 81 * a * e^2 + - 84 * b * e^2 + - 41 * d * e^2 + - 83 * e^3 + - 49 * a^4 + - a^3 * b + - 3 * a * b^3 + - 43 * a * b^2 * c + - 62 * b^3 * c + - 61 * a * b * c^2 + - 48 * b^2 * c^2 + - 37 * a * c^3 + - 32 * c^4 + - 14 * a^3 * d + - 5 * a^2 * b * d + - 61 * b^3 * d + - 6 * a^2 * c * d + - 16 * a * b * c * d + - 29 * b^2 * c * d + - 40 * a * c^2 * d + - 81 * b * c^2 * d + - 32 * c^3 * d + - 82 * a * b * d^2 + - 45 * b^2 * d^2 + - 35 * b * c * d^2 + - 55 * c^2 * d^2 + - 3 * b * d^3 + - 2 * c * d^3 + - 80 * d^4 + - 24 * a^3 * e + - 76 * a^2 * b * e + - 18 * a * b^2 * e + - 64 * a^2 * c * e + - 61 * b * c^2 * e + - 57 * c^3 * e + - 66 * a^2 * d * e + - 73 * a * b * d * e + - 18 * b^2 * d * e + - 63 * a * c * d * e + - 3 * c^2 * d * e + - 9 * a * d^2 * e + - 3 * b * d^2 * e + - 86 * c * d^2 * e + - 58 * d^3 * e + - 73 * a * c * e^2 + - 19 * a * d * e^2 + - 36 * b * d * e^2 + - 65 * c * d * e^2 + - 64 * d^2 * e^2 + - d * e^3 + - 87 * e^4 + - 58 * a^5 + - 23 * a^3 * b^2 + - 89 * a^2 * b^3 + - 5 * a * b^4 + - 15 * a^2 * b^2 * c + - 11 * a * b^3 * c + - 53 * b^4 * c + - 44 * a^2 * b * c^2 + - 11 * a * b^2 * c^2 + - 43 * b^3 * c^2 + - 23 * a^2 * c^3 + - 37 * a * b * c^3 + - 32 * a * c^4 + - 43 * b * c^4 + - 26 * c^5 + - 48 * a^4 * d + - 88 * a^2 * b^2 * d + - 53 * b^4 * d + - 38 * a^3 * c * d + - 40 * b^3 * c * d + - 58 * a^2 * c^2 * d + - 31 * a * b * c^2 * d + - 55 * b^2 * c^2 * d + - 68 * c^4 * d + - 57 * a^3 * d^2 + - 29 * a * b^2 * d^2 + - 73 * b^3 * d^2 + - 79 * a * b * c * d^2 + - 62 * b^2 * c * d^2 + - 16 * a * c^2 * d^2 + - 19 * b * c^2 * d^2 + - 29 * c^3 * d^2 + - 37 * a^2 * d^3 + - 16 * a * b * d^3 + - 30 * b * c * d^3 + - 65 * a * d^4 + - 13 * b * d^4 + - 39 * c * d^4 + - 17 * d^5 + - 82 * a^4 * e + - 43 * a^2 * b^2 * e + - 45 * a * b^3 * e + - 87 * a^3 * c * e + - 68 * a^2 * b * c * e + - 12 * b^3 * c * e + - 65 * a * b * c^2 * e + - 25 * b^2 * c^2 * e + - 64 * a^3 * d * e + - 31 * a^2 * b * d * e + - 39 * a * b^2 * d * e + - 80 * a^2 * c * d * e + - 17 * a * b * c * d * e + - 85 * b * c^2 * d * e + - 61 * c^3 * d * e + - 66 * a^2 * d^2 * e + - 62 * a * b * d^2 * e + - 41 * b^2 * d^2 * e + - 29 * a * c * d^2 * e + - 75 * b * c * d^2 * e + - 76 * b * d^3 * e + - 43 * c * d^3 * e + - 33 * d^4 * e + - 22 * a^3 * e^2 + - 8 * a^2 * b * e^2 + - 12 * a * b^2 * e^2 + - 55 * a^2 * c * e^2 + - 39 * a * b * c * e^2 + - 18 * a * c^2 * e^2 + - 18 * a^2 * d * e^2 + - 72 * a * b * d * e^2 + - 83 * a * c * d * e^2 + - 26 * a * d^2 * e^2 + - 54 * b * d^2 * e^2 + - 75 * c * d^2 * e^2 + - 32 * d^3 * e^2 + - 25 * a^2 * e^3 + - 70 * a * b * e^3 + - 44 * b^2 * e^3 + - 72 * a * c * e^3 + - 21 * b * c * e^3 + - 7 * c^2 * e^3 + - 46 * a * d * e^3 + - 32 * d^2 * e^3 + - 45 * a * e^4 + - 86 * b * e^4 + - 61 * c * e^4 + - 56 * d * e^4, - ], - ), - ) + R,[31+89*b+9*a*c^2+76*b*e^2+51*a*b*d^2+52*c*d^3+64*a*b*c*e+77*a*b^4+32*a*b^3*d+43*b^3*c*d+62*d^5+4*a^2*b^2*e+62*a*b^2*e^2+86*a*c^2*e^2+36*a*b*d*e^2+65*a*c*e^3+72*c^2*e^3+90*a*d*e^3, +6*a^2+48*a*c+83*a*e+21*b*e+84*a*d^2+82*d^3+43*b^2*e+5*c*d*e+42*a^4+40*a^3*c+31*a^2*b*d+59*b^3*d+57*a^2*d^2+9*a*b*d*e+67*c*d^2*e+3*d^3*e+27*a*b*e^2+60*a^5+36*b^5+18*b^4*c+24*a^3*c^2+89*a^4*d+68*c^4*d+18*a*c*d^3+79*d^5+44*b^3*c*e+49*a*b*c^2*e+53*a^2*d*e^2+23*b*d^2*e^2+85*b*c*e^3+48*e^5, +87*a+39*b*e+3*a*b^2+3*b*d^2+44*c*d^2+84*b*e^2+57*b^3*c+72*a*b^2*d+5*a*d^3+17*a^2*b*e+25*a*b*c*e+11*c*d^2*e+70*d*e^3+71*a^5+58*a^4*c+35*a^3*b*d+44*a*b^2*c*d+a^3*b*e+20*a*b^3*e+a^2*c*d*e+64*a*c^2*d*e+41*a^2*b*e^2+2*c*d*e^3])) for i in ideals - runb("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) - runb2("sparseid(3,0,5,100-(7*10),90)", i, S, StartOrd, TarOrd) + runAll("sparseid(3,0,5,100-(9),90)", i, S, StartOrd, TarOrd) end - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, - ) - df = DataFrame(a = ["test1"], b = ["test2"]) - savew(df, "correct.txt") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b]) - savea(df, "correct.txt") + ideals =[] + push!( + ideals, + Singular.Ideal( + R,[53+6*a+4*a*d+15*c*d+5*d^2+20*a*e+37*c^2*d+4*d^3+43*b^2*e+55*d*e^2+55*c^4+21*b^2*d^2+11*a*b*c*e+67*a*c*e^2+12*a*e^3+47*b^2*c^2*d+35*b*c^3*d+25*b^4*e+80*a^3*c*e+8*b^2*c*d*e+45*a^2*d^2*e+11*b*c*d^2*e+41*a*b*c*e^2+73*c^2*e^3+55*b*d*e^3, +45*a*c+44*b*c*e+77*a*d*e+21*c*d*e+16*a*e^2+42*d*e^2+8*a^3*c+5*a*d^3+10*b*c*d*e+2*c*d^2*e+66*d^3*e+64*c^2*e^2+19*b^5+8*a^2*b^2*c+71*a^4*d+58*b^4*d+39*a*b^2*c*d+25*b^2*c^2*d+41*a*b*c*d^2+40*b^2*d^3+79*c^2*d^3+49*a^2*b^2*e+77*a*b^2*c*e+26*a*b*c^2*e+64*b^2*c*d*e+30*a*c*d*e^2+87*e^5, +42*b+48*a^2*e+64*b^2*e+28*a^3*b+72*b^3*c+64*b*c^3+24*c^4+77*a^3*d+17*b^3*d+18*a*c^2*d+69*a*c*d^2+41*b^2*c*e+8*c*d^2*e+71*a^5+51*a^2*b^3+8*b^5+54*a^2*c^3+24*b^2*c^2*d+9*c^4*d+25*a^3*d^2+50*b^3*d^2+24*a*b^3*e+88*b^2*c^2*e+41*b*c^3*e+48*a*b*d*e^2+40*c*d^2*e^2])) + push!( + ideals, + Singular.Ideal( + R,[14*a^3+9*b^2*c+84*a*b*d+17*a*d^2+67*c^2*e+19*b*d*e+60*a^3*c+17*a*c^2*d+10*b*c^2*d+49*a*d^3+69*a^3*e+6*b^2*c*e+67*a*c*d*e+40*b*c*d*e+74*a^3*b*c+37*a*b^3*c+55*b^3*c^2+30*a^2*b^2*d+16*a^2*b*c*d+18*b^3*c*d+85*a^2*c^2*d+90*c^4*d+21*a^2*b*d^2+11*a^2*c*d^2+59*b*c^3*e+49*a*b^2*d*e+42*a^2*c*d*e+13*a*c^2*d*e+41*b^2*d^2*e+60*b^2*d*e^2+49*b*d*e^3, +34+12*b+42*a^2+3*b^2+15*a*d+10*a*b*c+38*a*b*d+68*a*c*d+82*a^2*e+39*b*e^2+16*c^4+90*a*c*d^2+26*d^4+41*a^2*c*e+11*b^3*c^2+69*a^2*b*c*d+85*c^4*d+19*b*c^2*d^2+73*a^3*b*e+19*a^2*b*c*e+87*a*b*d^2*e+4*a*b*d*e^2+25*b^2*d*e^2+35*c^2*e^3+15*b*e^4, +79*b+87*b*c+27*c*e+78*a^2*c^2+32*c^3*d+7*b*c*d^2+43*c*d^3+30*a*b*c*e+31*b*c^2*e+29*c^3*e+57*a^2*d*e+78*d^3*e+12*a*b^4+49*a*b^3*c+28*a*c^4+80*b*d^4+42*b^4*e+55*a^2*b*c*e+32*b^3*d*e+87*b*c^2*d*e+42*a^2*d^2*e+80*b*c*d^2*e])) + push!( + ideals, + Singular.Ideal( + R,[6*c+22*b*c+11*a^3+13*b^2*c+84*a^2*d+32*a*b*d+2*a*d*e+15*a^2*b^2+49*b*c^2*d+61*b^3*e+40*a*c^2*e+12*b^2*d*e+22*c*d^2*e+72*b^2*e^2+26*b*c*e^2+54*a^3*c^2+87*a^2*b*c*d+46*c^4*d+17*a^2*d^3+17*b^3*c*e+66*b^2*c^2*e+60*b*d^3*e+12*a^2*b*e^2+32*c^2*e^3+12*b*d*e^3+57*c*d*e^3, +72+81*b+45*b*c+67*e^2+38*b*d*e+15*a*e^2+36*c*e^2+21*b^3*e+75*a*c*d*e+8*a*d^2*e+57*b*d^2*e+77*d^3*e+4*a^4*b+10*a^3*b^2+56*b^5+76*a^2*b*c^2+28*a*c^4+53*a^2*b^2*d+37*b^3*d^2+71*a*b*c*d^2+17*a^2*b^2*e+84*b^4*e+63*a*b*c^2*e+42*b^2*c*d*e+49*a*d^3*e+77*a*b^2*e^2+66*a^2*c*e^2+72*b^2*d*e^2+64*c*d^2*e^2+12*c*d*e^3, +24*d^2+85*e^2+80*b^2*d+9*c^2*d+42*a*d*e+48*a^3*c+75*a^2*b*d+81*c^3*d+6*a*b*d^2+23*c*d^2*e+47*d^3*e+53*b*c*e^2+36*e^4+10*a*b^2*c^2+61*a*b^3*d+17*a^3*c*d+46*a*c^2*d^2+5*a*b^2*d*e+65*c*d^2*e^2+89*b^2*e^3+48*d^2*e^3+42*c*e^4])) + for i in ideals + runAll("sparseid(3,0,5,100-(1),90)", i, S, StartOrd, TarOrd) end + ideals =[] end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl deleted file mode 100644 index 0eb55daf0..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar6.jl +++ /dev/null @@ -1,4340 +0,0 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("readWriteHelper.jl") -include("parser.jl") -include("runbenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") - - -using DataFrames -using CSV - -function var6() - cd("/Users/JordiWelp/Results") - prepare() - prepare2() - dim = 6 - ve = [1, 1, 1, 1, 1, 1] - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d, e, f) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c", "d", "e", "f"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 80 + - 24 * f + - 33 * a^2 + - 51 * a * c + - 2 * b^2 * d + - 37 * d^3 + - 40 * a^2 * e + - 78 * a * c * e + - 37 * b * c * e + - 15 * c * d * f + - 70 * d^2 * f + - 10 * c * e * f + - 82 * a^2 * b * d + - 58 * a * b^2 * d + - 53 * a^3 * e + - 49 * c^3 * e + - 49 * b^2 * d * e + - 64 * a^2 * e^2 + - 57 * d * e^3 + - 53 * e^4 + - 47 * a^2 * c * f + - 76 * a^2 * d * f + - 49 * b * d^2 * f + - 30 * a * b * e * f + - 49 * b^2 * f^2 + - 33 * c * e * f^2 + - 84 * a^3 * b^2 + - 72 * c^5 + - 36 * a * b^2 * c * d + - 20 * c^4 * d + - 74 * a^2 * b * d^2 + - 4 * c^3 * d^2 + - 89 * b * d^4 + - 61 * a^4 * e + - 21 * a * b^3 * e + - 22 * b^3 * c * e + - 50 * a * c^3 * e + - 85 * c^4 * e + - 17 * a * b * c * e^2 + - 78 * b * c^2 * e^2 + - 89 * b * d^2 * e^2 + - 88 * c * d^2 * e^2 + - 51 * a * b * e^3 + - 84 * c * e^4 + - 75 * a * c^3 * f + - 83 * b^2 * c * d * f + - 58 * b * c^2 * d * f + - 63 * b * c * d^2 * f + - 81 * a^3 * e * f + - 28 * a * c * d * e * f + - 10 * a * c * e^2 * f + - 52 * b * e^3 * f + - 45 * a^2 * c * f^2, - 69 * d^2 + - 68 * a * b^2 + - 77 * b * c^2 + - 65 * c * d^2 + - 89 * b^2 * c * d + - 62 * a^2 * b * e + - 66 * a * b * c * e + - 9 * c * d^2 * e + - 22 * b * d * e^2 + - 74 * a^3 * f + - 74 * a * d^2 * f + - 74 * b * d^2 * f + - 76 * b^2 * e * f + - 6 * c * e^2 * f + - 63 * a^2 * f^2 + - 2 * a * c * f^2 + - 28 * c * e * f^2 + - 48 * a * b^4 + - 57 * a * c^3 * d + - 9 * c^4 * d + - 25 * b * c^2 * d^2 + - 61 * a * d^4 + - 4 * b^4 * e + - 22 * b^2 * c^2 * e + - 83 * b^2 * c * d * e + - 48 * a * c * d^2 * e + - 8 * c^2 * d^2 * e + - 76 * a^2 * b * e^2 + - 65 * b^3 * e^2 + - 81 * a * b * c^2 * f + - 29 * c^3 * d * f + - 11 * b * d^3 * f + - 55 * b * e^3 * f + - 71 * a^2 * f^3 + - 35 * a * c * f^3 + - 51 * c * e * f^3, - 73 * d + - 54 * a * e + - 82 * e^2 + - 50 * c * f + - 37 * d * f + - 46 * b * c^2 + - 23 * a^2 * d + - 8 * d^3 + - 56 * b^2 * e + - 57 * a^2 * f + - 24 * d^2 * f + - 61 * a^3 * b + - 5 * b^2 * c^2 + - 36 * b^3 * d + - 3 * a * c * d^2 + - 35 * b * d * e^2 + - 29 * b * e^3 + - 76 * a * b * e * f + - 58 * b * c * e * f + - 9 * c * e * f^2 + - 83 * c * f^3 + - 10 * d * f^3 + - 53 * a^5 + - 63 * b^5 + - 64 * a^3 * c^2 + - 6 * a^4 * d + - 78 * a^3 * b * d + - 80 * a * b * c^2 * d + - 32 * c^4 * d + - 26 * b^3 * d^2 + - 25 * b^2 * c * d^2 + - 17 * b * c^2 * d^2 + - 38 * c^3 * d^2 + - 12 * b^2 * d^3 + - 84 * a * c * d^3 + - 16 * a^4 * e + - 3 * a^3 * b * e + - 51 * b^3 * c * e + - 35 * a * c^2 * d * e + - 59 * a * c * d^2 * e + - 50 * c * d^3 * e + - 86 * d^4 * e + - 71 * c^2 * d * e^2 + - 75 * d^2 * e^3 + - 82 * a * c^2 * e * f + - 23 * a^2 * e^2 * f + - 27 * d^2 * e^2 * f + - 14 * d * e^3 * f + - 63 * a * e^2 * f^2 + - 88 * a * f^4 + - 76 * b * f^4 + - 89 * d * f^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 16 * d + - 81 * a * f + - 69 * c * f + - 22 * b^3 + - 48 * a^2 * d + - 13 * d^3 + - 47 * a * c * e + - 85 * b * c * e + - 53 * b * d * e + - 47 * b * c * f + - 29 * a * d * f + - 89 * c * d * f + - 44 * a^3 * d + - 76 * a * c^2 * e + - 72 * a * c * e^2 + - 73 * a^2 * b * f + - 16 * a * b * c * f + - 48 * a * c * d * f + - 20 * c * d^2 * f + - 84 * d^3 * f + - 55 * b * d * e * f + - 66 * a^2 * f^2 + - 2 * b^2 * f^2 + - 10 * b * e * f^2 + - 68 * a * c^4 + - 13 * a^2 * b^2 * d + - 65 * b^3 * c * d + - 10 * a * b * c^2 * d + - 84 * a^3 * d^2 + - 15 * a * b * d^3 + - 48 * b * c * d^3 + - 3 * a * d^4 + - 57 * b * c^3 * e + - 4 * a * b^2 * d * e + - 25 * b^3 * e^2 + - 76 * a * b * c^2 * f + - 50 * b^2 * c^2 * f + - 77 * a * b^2 * d * f + - 85 * c^2 * d^2 * f + - 74 * b * c^2 * e * f + - 88 * b * c * d * e * f + - 80 * a^3 * f^2 + - 50 * a * b^2 * f^2 + - 43 * a * b * c * f^2 + - 67 * a * c * d * f^2 + - 15 * b * c * e * f^2 + - 67 * c * e^2 * f^2 + - 62 * d * e^2 * f^2 + - 15 * b * e * f^3, - 77 + - 74 * a * d + - 34 * b * e + - 74 * d * e + - 36 * d * f + - 79 * c * d^2 + - 18 * d^2 * e + - 49 * a * e * f + - 90 * b * f^2 + - 42 * a * b^3 + - 79 * b^2 * c^2 + - 4 * a * c^3 + - 15 * b * d^3 + - 80 * a^3 * f + - 50 * a * b^2 * f + - 17 * c^3 * f + - 37 * a * b * e * f + - 61 * a * b * f^2 + - 60 * b * c * f^2 + - 70 * a^2 * b * c^2 + - 22 * a^2 * c^3 + - 69 * a^3 * c * d + - 34 * c^4 * d + - 2 * b^2 * c * d^2 + - 18 * c^3 * d^2 + - 68 * a * b * d^3 + - 18 * b * c * d^3 + - 23 * c * d^4 + - 5 * a^2 * d * e^2 + - 8 * a * c * d * e^2 + - 45 * d^2 * e^3 + - 62 * d * e^4 + - 21 * a^2 * b^2 * f + - 15 * b^2 * c^2 * f + - 11 * a^3 * d * f + - 34 * c^3 * e * f + - 20 * a * b * e^2 * f + - 55 * c * e^3 * f + - 8 * a^2 * c * f^2 + - 77 * b^2 * c * f^2 + - 7 * b * c^2 * f^2 + - 57 * d^2 * f^3 + - 84 * b * f^4 + - 4 * f^5, - 43 * c + - 46 * a^2 + - 84 * a^2 * b + - 15 * b * c * d + - 34 * a^2 * e + - 29 * c^2 * f + - 82 * a^3 * b + - 51 * a * b^3 + - 12 * a^3 * c + - 63 * a^3 * d + - 43 * a * b^2 * d + - 3 * a^2 * d * e + - 22 * d^3 * e + - 28 * a^2 * c * f + - 80 * c^3 * f + - 28 * a^2 * d * f + - 6 * b^2 * d * f + - 32 * b * d^2 * f + - 27 * a^2 * e * f + - 73 * b * c * e * f + - 36 * c^2 * e * f + - 41 * e^2 * f^2 + - 47 * a^3 * b * c + - 68 * a^3 * c * d + - 35 * a^3 * d^2 + - 23 * a * b^2 * d^2 + - 5 * a * b * c * d^2 + - 42 * a * c^2 * d^2 + - 78 * a * c * d^3 + - 80 * a * c^3 * e + - 52 * b^2 * c * d * e + - 53 * a^3 * e^2 + - 86 * a^2 * b * e^2 + - 44 * a * d^2 * e^2 + - 73 * b * d^2 * e^2 + - 88 * b^2 * e^3 + - 72 * e^5 + - 67 * a^2 * c * d * f + - 2 * b^2 * c * e * f + - 70 * c^3 * e * f + - 33 * b * d * e^2 * f + - 49 * a * b^2 * f^2 + - 23 * c * d * e * f^2 + - 86 * a * d * f^3 + - 55 * b * d * f^3 + - 15 * a * e * f^3 + - 8 * c * e * f^3 + - 78 * a * f^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 37 * c * e + - 44 * e^2 + - 49 * a * f + - 57 * b * f + - 39 * a^2 * d + - 79 * a^2 * e + - 22 * b * e^2 + - 38 * a^2 * f + - 71 * b * c * f + - 9 * d * f^2 + - 28 * b^3 * d + - 22 * c * d^3 + - 11 * a * c * d * e + - 44 * a * d^2 * e + - 77 * a * b * e^2 + - 40 * e^4 + - 44 * b * c * d * f + - 32 * b * c * e * f + - 67 * b * d * e * f + - 86 * e^3 * f + - 61 * b * c * f^2 + - 53 * a * f^3 + - 58 * a * b^3 * c + - 23 * a * b * c^3 + - 54 * b * d^4 + - 71 * c * d^4 + - 79 * a^3 * b * e + - 64 * a * b^2 * c * e + - 4 * b^3 * c * e + - 6 * a^2 * b * d * e + - 41 * d^4 * e + - 62 * b * c^2 * e^2 + - 45 * a^2 * d * e^2 + - b^2 * e^3 + - 22 * d * e^4 + - 39 * c^4 * f + - 53 * b^3 * d * f + - 23 * c^2 * d^2 * f + - 10 * a^3 * e * f + - 9 * b^2 * c * e * f + - 86 * a * c^2 * e * f + - 80 * a * b * d * e * f + - 72 * c * d^2 * e * f + - 4 * b * d * e^2 * f + - 7 * b^2 * c * f^2 + - 87 * c^3 * f^2 + - 48 * c^2 * d * f^2 + - 63 * a * e^2 * f^2 + - 44 * b * e^2 * f^2 + - 5 * c^2 * f^3 + - 85 * a * e * f^3 + - 3 * b * e * f^3 + - 30 * b * f^4 + - 82 * f^5, - 25 * b + - 13 * f + - 25 * b * d + - 34 * e^2 + - 23 * a * b^2 + - 76 * c * d^2 + - 71 * b * d * e + - 55 * b * d * f + - 31 * a^3 * c + - 65 * b^3 * c + - 88 * a^2 * b * d + - 84 * a * b * d * e + - 53 * a * c * e^2 + - 55 * a^3 * f + - 87 * b * c * e * f + - 34 * c * d * e * f + - 79 * b * d * f^2 + - 9 * b * f^3 + - 15 * a * b^3 * c + - 67 * a^2 * b * c * d + - 57 * a^3 * d^2 + - 11 * b * c^2 * d^2 + - 53 * c^4 * e + - 15 * c^3 * d * e + - 77 * a * c * d^2 * e + - 86 * a * b * c * e^2 + - 74 * a * b * d * e^2 + - 61 * b * c * d * e^2 + - 90 * c^2 * d * e^2 + - 37 * a * b * e^3 + - 88 * c^2 * e^3 + - 59 * a * e^4 + - 26 * a^4 * f + - 15 * b^3 * c * f + - 16 * a * b * c * d * f + - 68 * b * c * d^2 * f + - 20 * a * b * c * e * f + - 15 * b * c * e^2 * f + - 8 * a * c^2 * f^2 + - 88 * a^2 * d * f^2 + - 24 * b * e * f^3 + - 70 * a * f^4 + - 37 * f^5, - 54 + - 60 * c * f + - 59 * a * b^2 + - 51 * b^3 + - 30 * a^2 * e + - 58 * a^2 * f + - 14 * a * b * f + - 40 * a * d * f + - 38 * d^2 * f + - 28 * a^3 * c + - 89 * b * c^2 * d + - 90 * b^2 * c * e + - 53 * b * c * d * e + - 65 * b * d^2 * e + - 58 * d^3 * e + - 29 * b * d * e^2 + - 79 * a * e^3 + - 28 * b * d^2 * f + - 80 * a * b * e * f + - 9 * b * d * e * f + - 24 * d * e^2 * f + - 52 * b * c * f^2 + - 43 * a * d * f^2 + - 38 * b * f^3 + - 17 * e * f^3 + - 11 * a * b^2 * c * d + - 60 * b * c^3 * d + - 78 * a * b * c * d^2 + - 45 * a * b * c * d * e + - 60 * a * c^2 * d * e + - 49 * c^3 * d * e + - 28 * b^2 * d^2 * e + - 83 * a^2 * b * e^2 + - 72 * b * c^2 * e^2 + - 28 * a^3 * b * f + - 26 * a * b^3 * f + - 86 * b^3 * e * f + - 13 * a^2 * d * e * f + - 82 * a * d * e^2 * f + - 2 * a * c^2 * f^2 + - 45 * b * d^2 * f^2 + - 12 * d^3 * f^2 + - 85 * a * b * e * f^2 + - 63 * d * f^4, - ], - ), - ) - - for i in ideals - runb("sparseid(3,0,5,100-(1*10),90)", i, S) - runb2("sparseid(3,0,5,100-(1*10),90)", i, S) - - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 9 * c + - 28 * f + - 49 * c^2 + - 53 * c * d + - 19 * b * e + - 82 * e^2 + - 62 * c * f + - 30 * a^3 + - 45 * a^2 * c + - 38 * a * c^2 + - 49 * a^2 * d + - 67 * a * b * d + - 71 * b^2 * d + - 43 * c^2 * d + - 10 * a * d * e + - 73 * b * e^2 + - 54 * c^2 * f + - 61 * a * d * f + - 63 * d * e * f + - 53 * b * f^2 + - 35 * a * b^3 + - 69 * b^3 * c + - 63 * a * b^2 * d + - 84 * a * c^2 * d + - 63 * a * c * d^2 + - 10 * c * d^3 + - 19 * a^2 * b * e + - 56 * c^3 * e + - 77 * a * b * d * e + - 17 * c^2 * d * e + - 23 * c * d^2 * e + - 61 * a * b * e^2 + - 45 * a * c * e^2 + - 85 * b * e^3 + - 23 * a^2 * b * f + - 15 * a * b^2 * f + - 65 * a * b * d * f + - 49 * a * d^2 * f + - 5 * c * d * e * f + - 90 * d * e * f^2 + - 46 * c * f^3 + - 90 * a^4 * c + - 79 * b^4 * c + - 47 * a^3 * c^2 + - 2 * a * b^2 * c^2 + - 8 * a * b * c^3 + - 70 * b * c^4 + - 21 * c^5 + - 87 * a^4 * d + - 23 * a^3 * c * d + - 82 * b^2 * c^2 * d + - 4 * a^2 * b * d^2 + - 44 * c^3 * d^2 + - 69 * a^2 * b * d * e + - 60 * a * b * c * d * e + - 47 * a * b * d^2 * e + - 33 * b * d^3 * e + - 40 * a * b^2 * e^2 + - 8 * a * c^2 * e^2 + - 80 * b^2 * d * e^2 + - 62 * d^3 * e^2 + - 72 * a * b * e^3 + - 80 * b * d * e^3 + - 6 * a * e^4 + - 47 * a^3 * d * f + - 3 * a^2 * b * d * f + - 30 * a * b * c * d * f + - 60 * c^3 * d * f + - a^2 * d^2 * f + - 88 * b * c * d^2 * f + - 43 * d^4 * f + - 21 * a^3 * e * f + - 72 * b^3 * e * f + - 64 * b^2 * d * e * f + - 41 * a^2 * e^2 * f + - 30 * b * c * e^2 * f + - 11 * c * d * e^2 * f + - 17 * d * e^3 * f + - 62 * a * b^2 * f^2 + - 74 * a * c * d * f^2 + - 18 * b^2 * e * f^2 + - 2 * b * d * e * f^2 + - 43 * a^2 * f^3 + - 3 * a * c * f^3 + - b * c * f^3 + - 78 * d^2 * f^3 + - 69 * d * e * f^3 + - 76 * c * f^4, - 13 + - 90 * a * d + - 82 * b * d + - 71 * c * f + - 29 * a * b * d + - 28 * a * c * d + - 50 * c^2 * d + - 48 * c * d * e + - 51 * a * b * f + - 31 * b^2 * f + - 13 * b * d * f + - 44 * b * e * f + - 84 * d * e * f + - 31 * c * f^2 + - 31 * a^4 + - 80 * a^2 * b * c + - 17 * b^2 * c^2 + - 18 * a^3 * d + - 72 * a * b * c * d + - 85 * b^2 * d^2 + - 24 * a^2 * b * e + - 75 * b^2 * c * e + - 49 * a^2 * d * e + - 77 * b^2 * d * e + - 25 * c^2 * d * e + - 79 * a * b * e^2 + - 61 * c * d * e^2 + - 13 * b * e^3 + - 15 * c * e^3 + - 40 * d * e^3 + - 55 * b^3 * f + - 87 * a^2 * c * f + - 82 * a^2 * e * f + - a * b * e * f + - 9 * a * c * e * f + - 70 * c * e^2 * f + - 66 * d * e^2 * f + - 34 * a * b * f^2 + - 50 * a * c * f^2 + - 64 * d^2 * f^2 + - 8 * b * e * f^2 + - 22 * e^2 * f^2 + - 16 * b * f^3 + - 84 * a^4 * b + - 62 * a * b^4 + - 89 * a^4 * d + - 2 * b^4 * d + - 25 * a * b^2 * c * d + - 74 * a * c^3 * d + - 21 * b * c^3 * d + - 53 * a^3 * d^2 + - 58 * a^2 * b * d^2 + - 29 * a^3 * b * e + - 39 * b^4 * e + - 55 * a^2 * c^2 * e + - 3 * a * b * c^2 * e + - 73 * a^2 * b * d * e + - 86 * a * b^2 * d * e + - 6 * c^3 * d * e + - 20 * a * c * d^2 * e + - 85 * b^3 * e^2 + - 72 * a^2 * c * e^2 + - 19 * b * c^2 * e^2 + - 88 * c^2 * d * e^2 + - 76 * c * d^2 * e^2 + - 46 * a * d * e^3 + - 82 * b * d * e^3 + - 65 * d^2 * e^3 + - 60 * d * e^4 + - 76 * e^5 + - 81 * a^3 * c * f + - 39 * b^3 * c * f + - 86 * a^2 * c * d * f + - 16 * a * b * c * d * f + - 65 * a^2 * d^2 * f + - 41 * b^2 * d^2 * f + - 24 * b * c * d^2 * f + - 64 * b * d^3 * f + - 23 * d^4 * f + - 5 * a^2 * b * e * f + - 28 * b * c^2 * e * f + - 36 * b * d^2 * e * f + - 83 * a^2 * e^2 * f + - 7 * c * d * e^2 * f + - 53 * b^3 * f^2 + - 81 * b^2 * d * f^2 + - 86 * a * c * d * f^2 + - 4 * b * c * d * f^2 + - 25 * c^2 * d * f^2 + - 2 * a * d^2 * f^2 + - 49 * a * b * e * f^2 + - 21 * c * d * e * f^2 + - 45 * a * e * f^3 + - 61 * b * f^4 + - 68 * c * f^4 + - 23 * f^5, - 43 * a + - 44 * c + - 45 * a * d + - 40 * b * d + - 24 * c * d + - d^2 + - 36 * d * f + - b^2 * c + - 88 * a * c^2 + - 61 * a * b * d + - 85 * a * c * d + - 18 * c * d^2 + - 8 * d^3 + - 19 * b^2 * e + - 33 * b * c * e + - 29 * c^2 * e + - 56 * a * e^2 + - 40 * b^2 * f + - 81 * a^2 * b^2 + - 8 * b^4 + - 2 * a^3 * c + - 36 * c^4 + - 85 * a^2 * c * d + - 75 * b^2 * c * d + - 53 * a * d^3 + - 57 * a^2 * c * e + - 26 * a * b * c * e + - 46 * a * c^2 * e + - 12 * b * c * d * e + - 11 * a^2 * e^2 + - 17 * b^2 * e^2 + - 56 * a * d * e^2 + - 59 * b * e^3 + - 26 * c * e^3 + - 40 * d * e^3 + - 75 * a^2 * b * f + - 18 * a * c^2 * f + - 67 * a * d^2 * f + - 54 * a * d * e * f + - 24 * a * b * f^2 + - 62 * b * c * f^2 + - 87 * b * d * f^2 + - 67 * a * f^3 + - 44 * b * f^3 + - 49 * a * b^4 + - 62 * a * b^2 * c^2 + - 14 * b^3 * c^2 + - 68 * c^5 + - 20 * a^4 * d + - 30 * a^3 * c * d + - 27 * a * b * c^2 * d + - 38 * b * c^3 * d + - 70 * a^2 * b * d^2 + - 76 * a^2 * c * d^2 + - 11 * a * b * d^3 + - 38 * a * c * d^3 + - 24 * b * c * d^3 + - 51 * a * d^4 + - 15 * b * d^4 + - 33 * d^5 + - 86 * a^3 * b * e + - 65 * a^3 * c * e + - 60 * a^2 * b * c * e + - 55 * c^4 * e + - 22 * a * c^2 * d * e + - 78 * b * c^2 * d * e + - 13 * c * d^3 * e + - 44 * d^4 * e + - 20 * b^2 * c * e^2 + - 7 * a * c * e^3 + - 14 * c^2 * e^3 + - 78 * c * d * e^3 + - 86 * a * e^4 + - 28 * a^2 * b * c * f + - 29 * b^3 * c * f + - 39 * b * d^3 * f + - 56 * c * d^3 * f + - 11 * a^2 * d * e * f + - 6 * a * c * d * e * f + - 15 * c^2 * d * e * f + - 3 * c^2 * e^2 * f + - 90 * c * d * e^2 * f + - 85 * a^2 * c * f^2 + - 46 * b * c^2 * f^2 + - 80 * a^2 * d * f^2 + - 49 * a * c * e * f^2 + - 11 * b * e^2 * f^2 + - 34 * d * e^2 * f^2 + - 29 * a * b * f^3 + - 62 * c * d * f^3 + - 58 * d^2 * f^3 + - 34 * a * e * f^3 + - 58 * b * e * f^3 + - 84 * c * e * f^3 + - e * f^4 + - 6 * f^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 48 + - 57 * b + - 78 * e + - 46 * b^2 + - 39 * a * e + - 65 * c * e + - 24 * d * e + - 11 * b^2 * c + - 81 * a * b * d + - 52 * a * c * d + - 4 * a * d^2 + - 48 * a * c * e + - 77 * a * d * e + - 59 * c * d * e + - 33 * c * e^2 + - 85 * d * e^2 + - 8 * c^2 * f + - 65 * c * f^2 + - 50 * e * f^2 + - 81 * a^2 * b^2 + - 22 * b^4 + - 46 * a^2 * c^2 + - 13 * a * b * c^2 + - 88 * b * c^3 + - 20 * b * c^2 * d + - 25 * b * d^3 + - 42 * a^2 * d * e + - 26 * b^2 * d * e + - 21 * c^2 * e^2 + - 5 * c * e^3 + - 16 * a^2 * c * f + - 67 * b^2 * c * f + - 48 * b * c * d * f + - 30 * a * d^2 * f + - 82 * c * e^2 * f + - 56 * a * f^3 + - 28 * b * f^3 + - 41 * e * f^3 + - 51 * b^2 * c^3 + - 57 * b^4 * d + - 59 * b^3 * c * d + - 10 * a * c^3 * d + - 70 * b^3 * d^2 + - 39 * b^2 * c * d^2 + - 63 * c * d^4 + - 20 * d^5 + - a^3 * b * e + - 54 * b^4 * e + - 5 * a * c^3 * e + - 24 * a^2 * c * d * e + - 40 * c^3 * d * e + - 15 * a^2 * b * e^2 + - 38 * b * c * d * e^2 + - 13 * b * d^2 * e^2 + - 87 * c * d^2 * e^2 + - 81 * a^2 * e^3 + - 86 * a * b * e^3 + - 61 * c * e^4 + - 17 * a * b^2 * c * f + - 41 * a^2 * c^2 * f + - 27 * a * b * c^2 * f + - 66 * b^3 * d * f + - 71 * a * c^2 * d * f + - 8 * c * d^3 * f + - 52 * d^4 * f + - 14 * b * c * d * e * f + - 42 * c * d^2 * e * f + - 25 * a * b * e^2 * f + - 82 * c * e^3 * f + - 48 * a^3 * f^2 + - 69 * a^2 * b * f^2 + - 87 * a * b^2 * f^2 + - 58 * b^2 * c * f^2 + - 2 * a * c^2 * f^2 + - 77 * b * c^2 * f^2 + - 29 * c^2 * d * f^2 + - 44 * d^3 * f^2 + - 13 * a * d * e * f^2 + - 28 * d^2 * e * f^2 + - 65 * a * e^2 * f^2 + - 74 * a * b * f^3 + - 68 * a * f^4, - 23 * f + - 17 * a^2 + - 17 * b * c + - 70 * a * e + - 73 * c * e + - 57 * c * f + - 50 * e * f + - 88 * a^2 * b + - 57 * b^3 + - 11 * a^2 * c + - 86 * c^2 * d + - 44 * a * c * e + - 56 * b * d * e + - 8 * c * d * e + - 30 * b * e^2 + - 40 * e^3 + - 87 * a * b * f + - 81 * c * e * f + - 76 * d * e * f + - 70 * a * b^3 + - 15 * a^2 * b * c + - 18 * a^2 * c^2 + - 48 * a * b * c^2 + - 59 * b^2 * c^2 + - 83 * c^4 + - 53 * a^2 * d^2 + - 35 * a * b^2 * e + - 66 * a^2 * c * e + - 33 * a * c^2 * e + - 9 * c^2 * d * e + - 5 * a^2 * e^2 + - 40 * a * b * e^2 + - 59 * a * c * e^2 + - 27 * a * d * e^2 + - 90 * b * d * e^2 + - 76 * c * e^3 + - 6 * b * c^2 * f + - 86 * c^3 * f + - 12 * d * e^2 * f + - 49 * a^2 * f^2 + - 40 * a * d * f^2 + - 20 * b * f^3 + - 36 * d * f^3 + - 2 * e * f^3 + - 64 * a^4 * c + - 19 * a^3 * b * c + - a * b^2 * c^2 + - 25 * a^2 * b^2 * d + - 20 * a^3 * c * d + - 9 * a * b * c^2 * d + - 78 * a * c^3 * d + - 87 * a^2 * c * d^2 + - 58 * a * c^2 * d^2 + - 90 * b * c^2 * d^2 + - 71 * c^2 * d^3 + - 32 * c * d^4 + - 69 * a^3 * b * e + - 34 * a * b^2 * c * e + - 19 * b * c^3 * e + - 65 * b * c^2 * d * e + - 8 * a * c * d^2 * e + - 66 * a * b * c * e^2 + - 70 * c^3 * e^2 + - 85 * c * d * e^3 + - 86 * b * e^4 + - 12 * b^4 * f + - 37 * a^3 * c * f + - 48 * a^2 * b * c * f + - 14 * b^3 * c * f + - 8 * a^2 * b * d * f + - 70 * a * b * c * d * f + - 87 * b^2 * c * d * f + - 29 * b * c^2 * d * f + - 7 * a^2 * d^2 * f + - 79 * a * d^3 * f + - 66 * a * c^2 * e * f + - 32 * c^3 * e * f + - 17 * a^3 * f^2 + - 51 * b^3 * f^2 + - 90 * a * b * d * f^2 + - 11 * b * c * d * f^2 + - 11 * a * d^2 * f^2 + - 48 * a^2 * e * f^2 + - 21 * c^2 * e * f^2 + - 36 * a * d * e * f^2 + - 30 * b * d * e * f^2 + - c * d * e * f^2 + - 48 * d^2 * e * f^2 + - 17 * b * e^2 * f^2 + - 71 * c^2 * f^3 + - 59 * a * d * f^3 + - 82 * d * e * f^3 + - 85 * a * f^4 + - 34 * e * f^4, - 19 * f + - 17 * b^2 + - 87 * a * d + - 75 * a * e + - 17 * b^3 + - 27 * a * c^2 + - 52 * c^3 + - 42 * a^2 * d + - 83 * a * c * d + - 18 * a * b * e + - 75 * a * c * e + - 45 * c^2 * e + - 56 * b * d * e + - 66 * d * f^2 + - 83 * b^4 + - 66 * a * b^2 * d + - 85 * b^3 * d + - 42 * b * c^2 * d + - 7 * a^2 * d^2 + - 62 * b * c * d^2 + - 37 * c * d^3 + - 50 * a * b^2 * e + - 56 * a * c^2 * e + - 50 * c^2 * d * e + - 73 * c * d^2 * e + - 9 * d^3 * e + - 7 * c^2 * e^2 + - 12 * a * d * e^2 + - 58 * b * d * e^2 + - 72 * c * d * e^2 + - 11 * a * e^3 + - 63 * d * e^3 + - 67 * a^2 * c * f + - 54 * a * b * c * f + - 49 * a * b * d * f + - 72 * b^2 * d * f + - 70 * a^2 * e * f + - 46 * a * b * e * f + - 73 * b * d * e * f + - 45 * c * d * e * f + - 55 * c^2 * f^2 + - 82 * a * e * f^2 + - 20 * b * e * f^2 + - 44 * a * f^3 + - 42 * c * f^3 + - 59 * d * f^3 + - 10 * a^4 * c + - 75 * a^2 * b^2 * c + - 82 * a^2 * b * c^2 + - 25 * b^2 * c^3 + - 32 * a * c^4 + - 22 * a^3 * b * d + - 86 * a^2 * b^2 * d + - 12 * b^3 * c * d + - 79 * a * b * c^2 * d + - 75 * c^3 * d^2 + - 25 * a * c * d^3 + - 68 * a^3 * c * e + - 67 * a * c^3 * e + - 70 * a^2 * b * d * e + - 86 * a * b^2 * d * e + - 76 * b^3 * d * e + - 55 * a^2 * c * d * e + - 41 * b^2 * d^2 * e + - 22 * a * d^3 * e + - 90 * a * b^2 * e^2 + - 58 * a^2 * c * e^2 + - 3 * a * b * c * e^2 + - 13 * c^3 * e^2 + - 19 * a^2 * d * e^2 + - 84 * b^2 * d * e^2 + - 17 * c^2 * d * e^2 + - 29 * c * d^2 * e^2 + - 68 * d^3 * e^2 + - a^2 * e^3 + - 64 * c * d * e^3 + - 75 * d * e^4 + - 66 * a^3 * b * f + - 80 * a^3 * c * f + - 68 * a^2 * b * c * f + - 34 * b * c^3 * f + - 23 * a^3 * d * f + - 54 * a^2 * b * d * f + - 32 * a * b^2 * d * f + - 42 * b^3 * d * f + - 6 * a * b * c * d * f + - 4 * a^2 * b * e * f + - 26 * a^2 * c * e * f + - 61 * b * c^2 * e * f + - 84 * a * b * d * e * f + - 21 * a * b * e^2 * f + - 4 * b * c * e^2 * f + - 39 * c^2 * e^2 * f + - 57 * a * d * e^2 * f + - 39 * c * d * e^2 * f + - 35 * a * e^3 * f + - 25 * a^2 * c * f^2 + - 15 * a * d^2 * f^2 + - 45 * b^2 * e * f^2 + - 48 * c^2 * e * f^2 + - 37 * c * d * e * f^2 + - 10 * b * d * f^3 + - 53 * d * e * f^3 + - 71 * b * f^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 39 * a + - 57 * a * c + - 5 * a * d + - 47 * b * e + - 85 * a * f + - 56 * b * f + - 16 * a * b^2 + - 50 * b^2 * c + - 83 * a * c^2 + - 82 * a * b * d + - 86 * b * c * d + - 7 * b * d^2 + - 72 * c * d^2 + - 73 * b * c * e + - 5 * c^2 * e + - c * e^2 + - 13 * a * d * f + - 64 * a * e * f + - 76 * c * f^2 + - 83 * d * f^2 + - 2 * c^4 + - 68 * b^3 * d + - 79 * b * c^2 * d + - 60 * a^3 * e + - 61 * b * c^2 * e + - 53 * b^2 * d * e + - 58 * a * b * e^2 + - 77 * b^2 * c * f + - 17 * b^2 * d * f + - 26 * b^2 * e * f + - 3 * a * c * e * f + - 75 * c * d * e * f + - 64 * b * e^2 * f + - 8 * d * e^2 * f + - 62 * e^3 * f + - 25 * c * d * f^2 + - 42 * f^4 + - 35 * a^3 * b^2 + - 40 * a^4 * c + - 65 * b^2 * c^3 + - 89 * a * b^3 * d + - 90 * a * c^3 * d + - 68 * b * c^2 * d^2 + - 3 * a * b * d^3 + - 32 * c * d^4 + - 27 * a^3 * c * e + - 2 * b^2 * c * d * e + - 12 * a * c^2 * d * e + - 72 * b * c^2 * d * e + - 34 * b^2 * d^2 * e + - 43 * a * c * d^2 * e + - 23 * c^2 * d^2 * e + - 77 * d^4 * e + - 67 * a^2 * d * e^2 + - 55 * c^2 * d * e^2 + - 90 * b * d^2 * e^2 + - 86 * a * b * e^3 + - 88 * a^2 * b^2 * f + - 38 * b^4 * f + - 3 * a * b^2 * c * f + - 75 * b * c^3 * f + - 34 * a^3 * e * f + - 63 * b^2 * c * e * f + - 60 * a * b * d * e * f + - 58 * a * c * d * e * f + - 53 * c^2 * d * e * f + - 19 * c * d^2 * e * f + - 37 * a * b * e^2 * f + - 57 * b * c * e^2 * f + - 24 * a * d * e^2 * f + - 73 * b * d * e^2 * f + - 83 * e^4 * f + - 32 * a^2 * c * f^2 + - 30 * a * b * d * f^2 + - 31 * b^2 * e * f^2 + - 31 * c^2 * e * f^2 + - 80 * b * d * f^3 + - 79 * c * d * f^3 + - 27 * b * e * f^3 + - 61 * a * f^4 + - 83 * b * f^4 + - 86 * c * f^4, - 39 * a + - f + - 81 * c * d + - 62 * c * e + - 60 * c * f + - 54 * f^2 + - 31 * b^2 * c + - 10 * b * d^2 + - 8 * c * d^2 + - 61 * b * c * e + - 87 * c^2 * e + - 88 * d^2 * e + - 69 * d^2 * f + - 82 * c * f^2 + - 56 * a^2 * b * c + - 71 * a * b^2 * c + - 49 * a^2 * c^2 + - 2 * b^2 * c^2 + - 30 * a^3 * d + - 22 * a^2 * d^2 + - 19 * d^4 + - 20 * c * d^2 * e + - 60 * d^3 * e + - 47 * c * e^3 + - 90 * d * e^3 + - 19 * a * b^2 * f + - 37 * b^3 * f + - 59 * b^2 * d * f + - 33 * a * c * d * f + - 82 * c^2 * d * f + - 30 * a * b * e * f + - 60 * b^2 * e * f + - 14 * a * e^2 * f + - 20 * e^3 * f + - 19 * a * c * f^2 + - 10 * c * d * f^2 + - 65 * d * e * f^2 + - 80 * a * f^3 + - 44 * f^4 + - 63 * a^2 * c^3 + - 56 * a * b * c^3 + - 31 * a^3 * b * d + - 81 * a^2 * b^2 * d + - 22 * a * b^3 * d + - 58 * a * b^2 * c * d + - 47 * a^2 * c^2 * d + - 79 * b^2 * c^2 * d + - 17 * a^2 * b * d^2 + - 15 * a * b * d^3 + - 76 * a^4 * e + - 75 * a^3 * b * e + - 9 * a^2 * b^2 * e + - 63 * a^2 * c^2 * e + - 89 * a * b * c^2 * e + - 74 * b^2 * c^2 * e + - 62 * a * c^2 * d * e + - 5 * b * c * d^2 * e + - 79 * a * d^3 * e + - 2 * c * d^3 * e + - 81 * d^4 * e + - 12 * a^3 * e^2 + - 18 * a * b^2 * e^2 + - 26 * b^3 * e^2 + - 11 * b^2 * c * e^2 + - 82 * c^3 * e^2 + - 43 * c * d^2 * e^2 + - 61 * a^2 * e^3 + - 80 * a * c * e^3 + - 65 * b * c * e^3 + - 53 * a * d * e^3 + - 80 * a * e^4 + - a^2 * b^2 * f + - 69 * b * c^3 * f + - 21 * a^3 * d * f + - 44 * a^2 * b * d * f + - 88 * b^3 * d * f + - 20 * b * c^2 * d * f + - 17 * c^3 * d * f + - 71 * a^2 * d^2 * f + - 74 * c * d^3 * f + - 6 * a^3 * e * f + - 29 * a * b^2 * e * f + - 23 * b^2 * c * e * f + - 89 * a * b * d * e * f + - 2 * a * b * e^2 * f + - 16 * b * c * e^2 * f + - 57 * c * d * e^2 * f + - 53 * a^2 * b * f^2 + - 50 * a^2 * d * f^2 + - 83 * a * b * d * f^2 + - 16 * a * c * d * f^2 + - 59 * d^3 * f^2 + - 13 * a^2 * e * f^2 + - 16 * b * c * e * f^2 + - 26 * b * d * e * f^2 + - 27 * b * c * f^3 + - 67 * d^2 * f^3 + - 23 * a * f^4, - 71 + - 41 * e + - 42 * b * d + - 42 * c * d + - 12 * b * e + - 32 * c * f + - 5 * b^3 + - 43 * a^2 * c + - 71 * a^2 * d + - 72 * a * b * d + - 76 * a * b * e + - 54 * a * d * e + - 61 * d^2 * e + - 32 * e^3 + - 89 * b^2 * f + - 82 * c * d * f + - 82 * b * f^2 + - 56 * f^3 + - 47 * a^2 * b^2 + - 43 * c^4 + - 32 * a^3 * d + - 80 * a^2 * b * d + - 8 * b^3 * d + - 49 * a^2 * c * d + - 57 * a * c^2 * d + - 42 * b * c^2 * d + - 58 * a^2 * d^2 + - 89 * a * b * d^2 + - 52 * a^3 * e + - 49 * a^2 * b * e + - 15 * a * b * c * e + - 29 * a * c^2 * e + - 83 * a * b * d * e + - 24 * c^2 * d * e + - 55 * c * d^2 * e + - 16 * b * d * e^2 + - 68 * d^2 * e^2 + - 12 * b * e^3 + - 83 * b^3 * f + - 14 * a^2 * c * f + - 3 * b^2 * c * f + - 65 * a^2 * d * f + - 79 * b^2 * d * f + - 70 * c^2 * d * f + - 29 * c * d * e * f + - 77 * a * e^2 * f + - 28 * e^3 * f + - 65 * a * b * f^2 + - 30 * b^2 * f^2 + - 76 * a * c * f^2 + - 83 * e^2 * f^2 + - 73 * f^4 + - 41 * a^2 * b * c^2 + - 40 * b^3 * c^2 + - 73 * a^3 * c * d + - 60 * a^2 * b * c * d + - 42 * b * c^3 * d + - 11 * a^2 * c * d^2 + - 75 * b^2 * d^3 + - 54 * a * d^4 + - 29 * c * d^4 + - 25 * d^5 + - 15 * a^4 * e + - 5 * a^2 * b * c * e + - 46 * a * b^2 * c * e + - 66 * a * b * c^2 * e + - 75 * b^2 * c^2 * e + - 67 * a * c^3 * e + - 4 * a^2 * d^2 * e + - 50 * a * b * d^2 * e + - 30 * a * d^3 * e + - 75 * a^3 * e^2 + - 82 * b^3 * e^2 + - 46 * a * c * d * e^2 + - 72 * b * d^2 * e^2 + - 64 * a * b * e^3 + - b^2 * e^3 + - 61 * d^2 * e^3 + - 67 * a^3 * c * f + - 71 * a * b^2 * c * f + - 85 * a * b * c^2 * f + - 42 * a * b^2 * d * f + - 25 * a^2 * c * d * f + - 62 * c^2 * d^2 * f + - 51 * a^3 * e * f + - 70 * a * b * c * e * f + - 2 * b * c * d * e * f + - 11 * b^2 * e^2 * f + - 69 * c * d * e^2 * f + - 77 * c * e^3 * f + - 2 * a * b^2 * f^2 + - 51 * a^2 * d * f^2 + - 8 * b * c * d * f^2 + - 87 * c * d^2 * f^2 + - 47 * d^3 * f^2 + - 21 * a * b * e * f^2 + - 71 * b * d * e * f^2 + - 2 * e^2 * f^3 + - 48 * b * f^4 + - 68 * e * f^4, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(2*10),90)", i, S) - runb2("sparseid(3,0,5,100-(2*10),90)", i, S) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 40 + - 45 * b + - 43 * f + - 53 * a^2 + - 16 * c^2 + - 46 * a * d + - 63 * d^2 + - 26 * d * e + - 75 * e^2 + - 70 * a * f + - 45 * c * f + - 76 * d * f + - 43 * f^2 + - 43 * a^2 * b + - 7 * a * b^2 + - 20 * a^2 * c + - 51 * b^2 * c + - 84 * a * c^2 + - 24 * b * c^2 + - 75 * a * b * d + - 71 * a * c * e + - 10 * c^2 * e + - 80 * c * d * e + - 32 * a * b * f + - b * c * f + - 25 * c^2 * f + - 61 * a * d * f + - 55 * d * e * f + - 29 * f^3 + - 37 * a^2 * b^2 + - 43 * a * b^3 + - 10 * a^3 * c + - 11 * a^2 * b * c + - 27 * a * b^2 * c + - 19 * b * c^3 + - 41 * a^2 * b * d + - 61 * b^2 * c * d + - 68 * b^2 * d^2 + - 44 * b * d^3 + - 42 * a^3 * e + - 11 * a^2 * b * e + - 70 * a * b^2 * e + - 32 * a * b * d * e + - 66 * b^2 * d * e + - 79 * b * c * d * e + - 36 * d^3 * e + - 73 * b * c * e^2 + - 71 * c^2 * e^2 + - 5 * d^2 * e^2 + - 46 * a * e^3 + - 14 * b * e^3 + - 38 * c * e^3 + - 32 * d * e^3 + - 88 * a^2 * b * f + - 66 * a * b^2 * f + - 24 * b^3 * f + - 35 * b^2 * d * f + - 68 * a * c * d * f + - 34 * d^3 * f + - 66 * a^2 * e * f + - a * b * e * f + - 23 * a * c * e * f + - 86 * c * d * e * f + - 86 * d * e^2 * f + - 16 * a^2 * f^2 + - 65 * b^2 * f^2 + - 37 * a^5 + - 51 * a * b^4 + - 87 * a^4 * c + - 57 * a^3 * b * c + - 87 * a * b^3 * c + - 54 * a^3 * c^2 + - 67 * a^2 * b * c^2 + - 85 * b^3 * c^2 + - 23 * a^2 * c^3 + - 36 * a * b * c^3 + - 22 * a^4 * d + - 44 * a * b^3 * d + - 43 * a^2 * b * d^2 + - 39 * b^3 * d^2 + - 85 * a * c^2 * d^2 + - 81 * a * c * d^3 + - 89 * b * c * d^3 + - 27 * c^2 * d^3 + - 80 * a * d^4 + - 6 * a^2 * b^2 * e + - 88 * a * b^3 * e + - 85 * a^3 * c * e + - 46 * b^3 * c * e + - 71 * a^3 * d * e + - 88 * a * b^2 * d * e + - 67 * a * b * d^2 * e + - 43 * b^2 * d^2 * e + - 76 * c^2 * d^2 * e + - 85 * a * d^3 * e + - 8 * c * d^3 * e + - 8 * d^4 * e + - 14 * a * c^2 * e^2 + - 33 * b^2 * d * e^2 + - 14 * b * c * d * e^2 + - a * c * e^3 + - b * c * e^3 + - 80 * a * d * e^3 + - 2 * b * e^4 + - 79 * d * e^4 + - 7 * a^3 * b * f + - 2 * a * b^2 * c * f + - 30 * b^3 * c * f + - 56 * a * b * c^2 * f + - 53 * b^2 * c^2 * f + - 38 * b^3 * d * f + - 64 * b^2 * c * d * f + - 47 * a * b * d^2 * f + - 39 * c^2 * d^2 * f + - 9 * c * d^3 * f + - 72 * b^3 * e * f + - 44 * b^2 * c * e * f + - 79 * b^2 * d * e * f + - 60 * a * d^2 * e * f + - 18 * a^2 * e^2 * f + - 26 * a * b * e^2 * f + - 27 * a * c * e^2 * f + - 26 * b * c * e^2 * f + - 25 * a^3 * f^2 + - 53 * b^3 * f^2 + - 77 * a * c^2 * f^2 + - 36 * c^2 * d * f^2 + - 32 * b * d^2 * f^2 + - 57 * c * d^2 * f^2 + - 4 * d^3 * f^2 + - 22 * a * b * e * f^2 + - 47 * a * d * e * f^2 + - 72 * d^2 * e * f^2 + - 56 * a * e^2 * f^2 + - 35 * e^3 * f^2 + - 30 * b^2 * f^3 + - 34 * b * c * f^3 + - 50 * c^2 * f^3 + - 74 * c * d * f^3 + - 40 * d^2 * f^3 + - 12 * b * e * f^3 + - 23 * e * f^4, - 85 * c + - 58 * f + - 2 * a * d + - 76 * c * d + - 89 * e^2 + - 69 * a * b^2 + - 64 * b^3 + - 4 * a^2 * c + - 5 * a * c^2 + - 26 * c^3 + - a * b * d + - 48 * b^2 * d + - 86 * a * c * d + - 11 * c^2 * d + - 37 * c^2 * e + - 4 * a * d * e + - 7 * b * e^2 + - c * e^2 + - 84 * d * e^2 + - 59 * e^3 + - 63 * a * e * f + - 19 * e^2 * f + - 88 * b * f^2 + - 65 * c * f^2 + - 51 * d * f^2 + - 60 * a^2 * b^2 + - 47 * a^3 * c + - 36 * a^2 * b * c + - 2 * b^3 * c + - 33 * a^2 * c^2 + - 79 * a * c^3 + - 49 * a^3 * d + - 21 * c^3 * d + - 89 * a^2 * d^2 + - 54 * a * b * d^2 + - 64 * c^2 * d^2 + - 75 * d^4 + - 42 * a^3 * e + - 35 * a^2 * b * e + - 54 * b^3 * e + - 13 * a^2 * c * e + - 7 * b^2 * c * e + - 77 * c^3 * e + - 72 * a^2 * d * e + - 31 * a * b * d * e + - 20 * d^3 * e + - 17 * a^2 * e^2 + - 86 * a * c * e^2 + - 42 * b * d * e^2 + - 65 * c * d * e^2 + - 16 * b * e^3 + - 6 * d * e^3 + - 37 * a^2 * b * f + - 84 * b^2 * c * f + - 25 * c^3 * f + - 42 * d^3 * f + - 5 * c^2 * e * f + - 73 * d^2 * e * f + - 30 * a^2 * f^2 + - 37 * a * c * f^2 + - 29 * b * d * f^2 + - 60 * d^2 * f^2 + - 31 * b * e * f^2 + - 63 * a * f^3 + - 81 * a^5 + - 24 * a^3 * b^2 + - 85 * a^2 * b^3 + - 58 * a * b^4 + - 72 * b^5 + - 75 * b^4 * c + - 38 * a^3 * c^2 + - 87 * a^2 * b * c^2 + - 25 * a^2 * c^3 + - 50 * a * b * c^3 + - 36 * b^2 * c^3 + - 29 * a^4 * d + - 21 * a^2 * b^2 * d + - 70 * a^3 * c * d + - 70 * a^2 * c^2 * d + - 65 * c^4 * d + - 90 * a * b^2 * d^2 + - 3 * b^3 * d^2 + - 76 * a * b * c * d^2 + - 87 * a * c^2 * d^2 + - 5 * c^3 * d^2 + - 29 * a^2 * d^3 + - 11 * a * b * d^3 + - 21 * b * d^4 + - 70 * d^5 + - 4 * a * b^3 * e + - 45 * a^3 * c * e + - 89 * a * c^3 * e + - 19 * a * c * d^2 * e + - 8 * c^2 * d^2 * e + - 2 * c * d^3 * e + - 61 * a^3 * e^2 + - 53 * b^2 * d * e^2 + - 69 * a * b * e^3 + - 55 * c * d * e^3 + - 46 * d^2 * e^3 + - 61 * e^5 + - 83 * a * b^3 * f + - 4 * b^3 * c * f + - 60 * c^4 * f + - 4 * a^3 * d * f + - 30 * b^2 * c * d * f + - 55 * b * c^2 * d * f + - 7 * b * c * d^2 * f + - 29 * b * d^3 * f + - 36 * c * d^3 * f + - 81 * d^4 * f + - 39 * a^3 * e * f + - 73 * a^2 * b * e * f + - 81 * a * b * c * e * f + - 19 * b^2 * c * e * f + - 87 * a^2 * d * e * f + - 37 * b * c * d * e * f + - 45 * a * d^2 * e * f + - 37 * d^3 * e * f + - 83 * a^2 * e^2 * f + - 19 * a * e^3 * f + - 89 * b * e^3 * f + - 28 * a^3 * f^2 + - 66 * a * b * c * f^2 + - 73 * b^2 * c * f^2 + - 27 * a * c^2 * f^2 + - 47 * a * d^2 * f^2 + - 76 * c * d^2 * f^2 + - 24 * d^3 * f^2 + - 53 * a^2 * e * f^2 + - 84 * a * c * e * f^2 + - 25 * c^2 * e * f^2 + - 39 * b * e^2 * f^2 + - 9 * a * b * f^3 + - 49 * b * c * f^3 + - 66 * a * d * f^3 + - 73 * a * e * f^3 + - 25 * b * f^4 + - 45 * c * f^4 + - 27 * e * f^4, - 31 * d + - 56 * f + - 22 * a^2 + - 62 * b * e + - 29 * c * e + - 76 * d * f + - 43 * e * f + - 84 * f^2 + - 74 * a * b^2 + - 90 * b^3 + - 43 * b * d^2 + - 13 * a * b * e + - 82 * a * d * e + - 83 * b * d * e + - 53 * d^2 * e + - 70 * d * e^2 + - 84 * b^2 * f + - 70 * b * c * f + - 4 * c^2 * f + - 19 * c * d * f + - 51 * d^2 * f + - 6 * a * f^2 + - 54 * b * f^2 + - 50 * a^4 + - 75 * a^2 * b * c + - 30 * b^2 * c^2 + - 55 * c^4 + - 82 * a^3 * d + - 74 * a^2 * b * d + - 87 * a * b^2 * d + - 74 * b^3 * d + - 55 * a * b * c * d + - 2 * a * c^2 * d + - 28 * a^2 * d^2 + - 57 * a^3 * e + - 10 * a^2 * b * e + - 64 * a^2 * c * e + - 81 * a * b * c * e + - 79 * b * c^2 * e + - 32 * d^3 * e + - 59 * a * b * e^2 + - 43 * a * c * e^2 + - 15 * b * d * e^2 + - 4 * a * e^3 + - 7 * a^2 * c * f + - 21 * a * c^2 * f + - 57 * b * c^2 * f + - 80 * a^2 * d * f + - 17 * b^2 * d * f + - 58 * a * c * d * f + - 72 * c^2 * d * f + - 13 * d^3 * f + - 79 * b^2 * e * f + - 8 * a * e^2 * f + - 71 * b * e^2 * f + - 18 * b * c * f^2 + - 3 * b * d * f^2 + - 88 * d^2 * f^2 + - 77 * a * e * f^2 + - 34 * b * e * f^2 + - 54 * f^4 + - 27 * a^3 * b^2 + - 5 * a^2 * b^3 + - 63 * a^4 * c + - 51 * a^3 * b * c + - 26 * b^3 * c^2 + - 19 * a^4 * d + - 75 * a^3 * b * d + - 14 * a^2 * b^2 * d + - 34 * a * b^3 * d + - 69 * b^2 * c^2 * d + - 61 * a * c^3 * d + - 18 * b * c^3 * d + - 35 * a^3 * d^2 + - 61 * b^3 * d^2 + - 16 * a * b * c * d^2 + - 58 * c^2 * d^3 + - 58 * b * d^4 + - 44 * d^5 + - 15 * a^3 * b * e + - 44 * a^3 * c * e + - 14 * a^2 * c^2 * e + - 50 * b^2 * c^2 * e + - 31 * b * c^3 * e + - 77 * b^3 * d * e + - 2 * b^2 * c * d * e + - 34 * a * c^2 * d * e + - 62 * b^2 * d^2 * e + - 74 * b * c * d^2 * e + - 89 * a * d^3 * e + - 8 * c * d^3 * e + - 64 * a * b^2 * e^2 + - 15 * a * b * d * e^2 + - 70 * b^2 * d * e^2 + - 79 * a * c * d * e^2 + - 19 * b * c * d * e^2 + - 65 * c^2 * d * e^2 + - 30 * b * d^2 * e^2 + - 81 * d^3 * e^2 + - 75 * b * d * e^3 + - 85 * d^2 * e^3 + - 59 * a^4 * f + - 3 * a * b^3 * f + - 54 * a^2 * b * c * f + - 78 * a^2 * c^2 * f + - 63 * a^3 * d * f + - 79 * a * b^2 * d * f + - 21 * b^3 * d * f + - a * b * c * d * f + - 21 * b^2 * d^2 * f + - 18 * a * d^3 * f + - 42 * b * d^3 * f + - 56 * d^4 * f + - 2 * b^3 * e * f + - 21 * c^3 * e * f + - 13 * a * b * d * e * f + - 90 * b^2 * d * e * f + - 2 * c^2 * d * e * f + - 75 * a^2 * e^2 * f + - 82 * a * c * e^2 * f + - 9 * c^2 * e^2 * f + - 74 * d^2 * e^2 * f + - 56 * a * e^3 * f + - 7 * d * e^3 * f + - 24 * a^2 * b * f^2 + - 36 * a * b^2 * f^2 + - 4 * a * d^2 * f^2 + - 76 * b * d^2 * f^2 + - 42 * c * d^2 * f^2 + - 48 * a * b * e * f^2 + - 38 * b^2 * e * f^2 + - 23 * a * c * e * f^2 + - 17 * b * c * e * f^2 + - 28 * a^2 * f^3 + - 11 * b * c * f^3 + - 21 * e * f^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 65 * a + - 60 * c + - 5 * f + - 48 * b * c + - 15 * c^2 + - 46 * a * d + - 40 * e^2 + - 78 * a * f + - 89 * d * f + - 13 * e * f + - 41 * a * b^2 + - 79 * a^2 * c + - 47 * b^2 * c + - 17 * c^3 + - 9 * b^2 * d + - 85 * a * c * d + - 28 * b * c * d + - 40 * c^2 * d + - 30 * a * c * e + - 43 * a * d * e + - 52 * d^2 * e + - 62 * a * e^2 + - 61 * d * e^2 + - 15 * e^3 + - a^2 * f + - 30 * b^2 * f + - 76 * c * d * f + - 49 * e^2 * f + - 57 * a * f^2 + - 31 * a^4 + - 31 * b^4 + - 25 * a * b * c^2 + - 58 * c^4 + - 85 * a^2 * c * d + - 75 * a * c^2 * d + - 86 * b * c^2 * d + - 63 * b * c * d^2 + - 72 * a * d^3 + - 33 * b * d^3 + - 6 * b^2 * c * e + - 86 * a^2 * d * e + - 40 * a * b * d * e + - 80 * b * c * d * e + - 79 * c * d^2 * e + - 62 * b^2 * e^2 + - 56 * b * d * e^2 + - 72 * d^2 * e^2 + - 85 * b * e^3 + - 62 * c * e^3 + - 18 * e^4 + - 13 * a * b * c * f + - 3 * b * c^2 * f + - 33 * b^2 * d * f + - 83 * a * c * d * f + - 85 * b * c * d * f + - 61 * a * d^2 * f + - 52 * d^3 * f + - 75 * b^2 * e * f + - 53 * a * c * e * f + - 17 * b * e^2 * f + - 3 * b^2 * f^2 + - 61 * d^2 * f^2 + - 52 * a * e * f^2 + - 68 * e * f^3 + - 75 * a^5 + - 79 * a^4 * b + - 15 * a^3 * b * c + - 88 * a * b^3 * c + - 55 * a^3 * c * d + - 63 * a * b^2 * c * d + - 85 * b^3 * c * d + - 54 * a^2 * c^2 * d + - 39 * a * b * c^2 * d + - 75 * b^2 * c^2 * d + - 54 * a * c^3 * d + - 75 * a^2 * b * d^2 + - 19 * a^2 * d^3 + - 42 * c^2 * d^3 + - 89 * c * d^4 + - 50 * a^4 * e + - 6 * a * b^2 * c * e + - 62 * b * c^3 * e + - 40 * c^4 * e + - 14 * a^3 * d * e + - 77 * a^2 * b * d * e + - 76 * b^2 * d^2 * e + - 18 * a * c * d^2 * e + - 55 * a^2 * c * e^2 + - 13 * b^2 * c * e^2 + - 24 * b * c * d * e^2 + - 33 * a * d^2 * e^2 + - 12 * b * d^2 * e^2 + - 76 * a * c * e^3 + - 13 * c * e^4 + - 89 * e^5 + - 22 * a^3 * c * f + - 54 * a^2 * b * c * f + - 90 * a^2 * c^2 * f + - 60 * a * c^3 * f + - 39 * b * c^3 * f + - 23 * b^3 * d * f + - 62 * a^2 * c * d * f + - 11 * c^3 * d * f + - 85 * a^3 * e * f + - 46 * a^2 * b * e * f + - 76 * b^3 * e * f + - 75 * a * c^2 * e * f + - 76 * b * c^2 * e * f + - 43 * c^3 * e * f + - 4 * a * b * d * e * f + - 65 * b^2 * d * e * f + - 22 * c^2 * d * e * f + - 77 * b * d^2 * e * f + - 22 * d^3 * e * f + - 79 * a * c * e^2 * f + - 74 * a * d * e^2 * f + - 33 * e^4 * f + - 76 * a^3 * f^2 + - 68 * a^2 * d * f^2 + - 73 * a * b * e * f^2 + - 72 * c^2 * e * f^2 + - 9 * d^2 * e * f^2 + - 31 * a * e^2 * f^2 + - 90 * d * e^2 * f^2 + - 67 * a * d * f^3 + - 32 * a * e * f^3 + - 19 * e^2 * f^3 + - 45 * b * f^4, - 22 * d + - 72 * f + - 59 * a^2 + - 25 * a * b + - 40 * b^2 + - 25 * b * c + - 13 * c^2 + - 37 * d^2 + - 73 * b * e + - 11 * c * e + - 37 * a^2 * b + - 83 * a * b * d + - 44 * b^2 * d + - 24 * c * d^2 + - 59 * a * c * e + - 87 * b * c * e + - 31 * c^2 * e + - 25 * a * e^2 + - 13 * b * e^2 + - 71 * c * e^2 + - 74 * d * e^2 + - 79 * b * c * f + - 12 * c * d * f + - 23 * c * e * f + - 16 * e^2 * f + - 6 * c * f^2 + - 4 * a^4 + - 88 * a^3 * b + - a^2 * b^2 + - 57 * a * b * c^2 + - 83 * b^3 * d + - 33 * a^2 * c * d + - 56 * b * c^2 * d + - 18 * a^2 * d^2 + - 77 * c^2 * d^2 + - 83 * b * d^3 + - 24 * c * d^3 + - 57 * a * b^2 * e + - 28 * a * b * c * e + - 4 * b^2 * c * e + - 47 * c^3 * e + - 84 * b^2 * d * e + - 21 * a * c * d * e + - 33 * d^3 * e + - 59 * a^2 * e^2 + - 47 * a * c * e^2 + - 90 * b * c * e^2 + - 74 * a * e^3 + - 68 * d * e^3 + - 22 * a^3 * f + - 42 * a^2 * b * f + - 53 * a * b^2 * f + - 47 * a * c^2 * f + - 77 * b^2 * d * f + - 77 * c^2 * d * f + - 22 * a^2 * e * f + - 15 * a * b * e * f + - 15 * b^2 * e * f + - 44 * c^2 * e * f + - 75 * a * e^2 * f + - 4 * a * c * f^2 + - 56 * b * c * f^2 + - 60 * a * d * f^2 + - 37 * b * d * f^2 + - 5 * b * e * f^2 + - 58 * c * e * f^2 + - 56 * d * e * f^2 + - 19 * a^4 * b + - 7 * a^2 * b^3 + - 50 * a^4 * c + - 18 * a^3 * b * c + - 51 * a^2 * c^3 + - 23 * a * c^4 + - 10 * a^4 * d + - 86 * a * b^2 * c * d + - 33 * a^2 * c^2 * d + - 34 * a^3 * d^2 + - 21 * b^3 * d^2 + - 82 * b^2 * c * d^2 + - 38 * b * c^2 * d^2 + - 6 * a * c * d^3 + - 88 * b * d^4 + - 14 * c * d^4 + - 20 * a^4 * e + - 63 * b^4 * e + - 3 * a^2 * b * c * e + - 47 * b * c^3 * e + - 56 * c^4 * e + - 60 * a * b^2 * d * e + - 15 * b^2 * c * d * e + - 38 * a^2 * d^2 * e + - 22 * b^2 * d^2 * e + - 31 * a * c * d^2 * e + - 50 * c^2 * d^2 * e + - 90 * a * d^3 * e + - 50 * a * b^2 * e^2 + - 87 * a^2 * d * e^2 + - 18 * b^2 * d * e^2 + - 73 * b * c * d * e^2 + - 27 * c * d^2 * e^2 + - 53 * a * b * e^3 + - 45 * a * c * e^3 + - 28 * c^2 * e^3 + - 4 * b * d * e^3 + - 85 * d^2 * e^3 + - 75 * c * e^4 + - 30 * a * b^3 * f + - 70 * a^3 * c * f + - 57 * a^2 * b * c * f + - 89 * a * b^2 * c * f + - 79 * a^2 * c^2 * f + - 3 * c^4 * f + - 40 * a^3 * d * f + - 30 * a^2 * c * d * f + - 77 * b * c^2 * d * f + - 76 * a * c * d^2 * f + - 61 * b * c * d^2 * f + - 65 * a^3 * e * f + - 64 * b^3 * e * f + - 11 * a^2 * c * e * f + - 16 * a * b * c * e * f + - 79 * b^2 * c * e * f + - 89 * b * c^2 * e * f + - 61 * c^3 * e * f + - 47 * b^2 * d * e * f + - 39 * a * d^2 * e * f + - 21 * b * d^2 * e * f + - 71 * b^2 * e^2 * f + - 76 * a * c * e^2 * f + - 20 * a * d * e^2 * f + - 13 * c * d * e^2 * f + - 50 * e^4 * f + - 46 * a * b^2 * f^2 + - 22 * b^2 * c * f^2 + - 54 * b * c^2 * f^2 + - 68 * a * b * d * f^2 + - 66 * b * c * d * f^2 + - 6 * b * d^2 * f^2 + - 55 * a * c * e * f^2 + - 23 * b * c * f^3 + - 9 * c^2 * f^3 + - 40 * d * f^4 + - 65 * e * f^4, - 41 + - 61 * d + - 44 * c^2 + - 41 * a * e + - 45 * b * e + - 45 * c * f + - 59 * a * b * c + - 21 * c^3 + - 31 * a * d^2 + - 13 * a * c * e + - 14 * b * d * e + - 27 * d^2 * e + - 10 * a * e^2 + - 57 * d * e^2 + - 5 * e^3 + - 67 * a^2 * f + - 78 * a * b * f + - 78 * a * c * f + - 60 * c^2 * f + - b * d * f + - 55 * c * e * f + - d * f^2 + - 79 * a^2 * b^2 + - 63 * a^3 * c + - 39 * a * b^2 * c + - 41 * a^2 * c^2 + - 65 * a^3 * d + - 55 * a^2 * b * d + - 87 * a^2 * c * d + - 62 * a * b * c * d + - 21 * c^2 * d^2 + - 53 * a * d^3 + - 27 * b * d^3 + - 43 * d^4 + - 28 * a^3 * e + - 44 * a^2 * c * e + - 81 * b * c^2 * e + - 26 * b * c * d * e + - 52 * b * d^2 * e + - 30 * a * d * e^2 + - 53 * c * d * e^2 + - 5 * d^2 * e^2 + - 56 * a^2 * c * f + - 10 * b * c^2 * f + - 5 * c^3 * f + - 13 * a^2 * d * f + - 82 * b^2 * d * f + - 70 * b * c * d * f + - 56 * b * d^2 * f + - 23 * a * d * e * f + - 3 * c * d * e * f + - 22 * a * e^2 * f + - 32 * d * e^2 * f + - 55 * a^2 * f^2 + - 63 * b^2 * f^2 + - 39 * c^2 * f^2 + - 43 * a * d * f^2 + - 34 * b * e * f^2 + - 28 * d * e * f^2 + - b * f^3 + - 25 * a^4 * b + - 51 * a * b^4 + - 10 * b^5 + - 48 * a^4 * c + - 13 * b^3 * c^2 + - 57 * a^2 * c^3 + - 85 * a * b * c^3 + - 14 * c^5 + - 68 * a^2 * b^2 * d + - 41 * a^3 * c * d + - 32 * a * b * c^2 * d + - 51 * b^2 * c^2 * d + - 71 * a * c^3 * d + - 62 * b * c^3 * d + - 45 * c^4 * d + - 55 * b^3 * d^2 + - 58 * b * c^2 * d^2 + - 69 * c^3 * d^2 + - 45 * a * d^4 + - 40 * a^2 * b^2 * e + - 76 * a * b^3 * e + - 61 * b^3 * c * e + - 73 * a^2 * b * d * e + - 47 * a * b^2 * d * e + - 9 * a^2 * c * d * e + - 7 * a * b * c * d * e + - 52 * a * c^2 * d * e + - 80 * a^2 * d^2 * e + - 34 * a * c * d^2 * e + - 53 * c^2 * d^2 * e + - 18 * c * d^3 * e + - 84 * a^3 * e^2 + - 42 * a^2 * b * e^2 + - 22 * a * b * c * e^2 + - 78 * b^2 * c * e^2 + - 86 * a * c^2 * e^2 + - 28 * b * c^2 * e^2 + - 65 * a * c * d * e^2 + - 2 * a * d^2 * e^2 + - 47 * d^3 * e^2 + - 41 * a * b * e^3 + - 61 * b^2 * e^3 + - 72 * a * d * e^3 + - 56 * c * d * e^3 + - 69 * d^2 * e^3 + - 49 * a * e^4 + - 41 * c * e^4 + - 75 * e^5 + - 8 * a^3 * b * f + - 62 * a * b^3 * f + - 83 * b^4 * f + - 45 * a^3 * c * f + - 46 * a * b * c^2 * f + - 7 * b^2 * c^2 * f + - 28 * a^3 * d * f + - 59 * b^3 * d * f + - 56 * b * c^2 * d * f + - 57 * c^3 * d * f + - 23 * a^2 * d^2 * f + - 52 * a * b * d^2 * f + - 33 * b^2 * d^2 * f + - 65 * a^2 * c * e * f + - 6 * a * c^2 * e * f + - 51 * c^3 * e * f + - 17 * a * c * d * e * f + - 40 * b * c * d * e * f + - 61 * c * d^2 * e * f + - 66 * d^3 * e * f + - 72 * b^2 * e^2 * f + - 64 * b * c * e^2 * f + - 26 * b * d * e^2 * f + - 48 * c * d * e^2 * f + - 68 * b * e^3 * f + - 6 * a^3 * f^2 + - 16 * b * c^2 * f^2 + - 63 * c^2 * d * f^2 + - 67 * b * d^2 * f^2 + - 11 * a^2 * e * f^2 + - 66 * c * d * e * f^2 + - 50 * a * b * f^3 + - 80 * b * c * f^3 + - 44 * a * d * f^3 + - 40 * c * d * f^3 + - 4 * d^2 * f^3 + - 63 * a * f^4 + - 22 * b * f^4 + - 81 * e * f^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 21 * d + - 19 * e + - 19 * f + - 30 * a * c + - 22 * b * c + - 28 * c^2 + - 54 * a * d + - 6 * d^2 + - 18 * b * e + - 28 * e^2 + - 59 * d * f + - 76 * a * b * d + - 73 * a * d^2 + - 65 * a^2 * e + - 41 * a * b * e + - 28 * a * c * e + - 73 * b * c * e + - 32 * a * e^2 + - 53 * b * e^2 + - 86 * d * e^2 + - 73 * a^2 * f + - 12 * b * c * f + - 3 * a * d * f + - 64 * c * e * f + - 89 * e^2 * f + - 37 * b * f^2 + - 85 * c * f^2 + - 20 * d * f^2 + - 75 * a * b^3 + - 84 * a^2 * b * d + - 89 * b * c^2 * d + - 21 * a^2 * d^2 + - 23 * c^2 * d^2 + - 64 * c * d^3 + - 18 * d^4 + - 47 * a^3 * e + - 70 * a * b * c * e + - 27 * c^3 * e + - 75 * b^2 * d * e + - 37 * a * d^2 * e + - 20 * b * d^2 * e + - 16 * b * d * e^2 + - 86 * c * d * e^2 + - 83 * a * e^3 + - 85 * b * e^3 + - 3 * d * e^3 + - 44 * b^3 * f + - 47 * b * c^2 * f + - 33 * a * b * d * f + - 9 * b^2 * d * f + - 64 * b * c * d * f + - 5 * c * d^2 * f + - 19 * a * c * e * f + - 6 * b * c * e * f + - 83 * b * d * e * f + - 28 * a * e^2 * f + - 29 * a^2 * f^2 + - 53 * a * c * f^2 + - 90 * a * d * f^2 + - 60 * d * e * f^2 + - 90 * e^2 * f^2 + - 55 * a^2 * b^3 + - 66 * a * b^4 + - 21 * b^5 + - 60 * a^4 * c + - 3 * a^2 * b^2 * c + - 77 * a * b^2 * c^2 + - 26 * a^2 * c^3 + - 19 * b^2 * c^3 + - 2 * a * c^4 + - 25 * a^4 * d + - 72 * a^2 * b^2 * d + - 67 * a^2 * b * c * d + - 14 * a * b * d^3 + - 16 * b^2 * d^3 + - 32 * c * d^4 + - 16 * d^5 + - 90 * a^4 * e + - 55 * a^2 * b^2 * e + - 52 * a * b^3 * e + - 4 * a * b^2 * c * e + - 18 * a * b * c^2 * e + - 29 * b^2 * c^2 * e + - 19 * b * c^3 * e + - 75 * a^3 * d * e + - 49 * a^2 * b * d * e + - 62 * a^2 * c * d * e + - 30 * b^2 * c * d * e + - 77 * a * c^2 * d * e + - 50 * b * c^2 * d * e + - 5 * c^3 * d * e + - 21 * a * c * d^2 * e + - 59 * b * c * d^2 * e + - b * d^3 * e + - 69 * d^4 * e + - 44 * a * b * c * e^2 + - 56 * c^3 * e^2 + - 61 * a^2 * d * e^2 + - 4 * a * b * d * e^2 + - 39 * b * c * d * e^2 + - 75 * b * d^2 * e^2 + - 57 * b^2 * e^3 + - 10 * c * d * e^3 + - 65 * e^5 + - 19 * a * b^3 * f + - 72 * b^2 * c^2 * f + - 76 * a^2 * b * d * f + - 52 * a * b * c * d * f + - 80 * a^2 * d^2 * f + - 47 * b^2 * d^2 * f + - 80 * b * d^3 * f + - 67 * a^2 * b * e * f + - b^2 * c * e * f + - 5 * b * c^2 * e * f + - 20 * a * c * d * e * f + - 59 * c^2 * d * e * f + - 60 * c^2 * e^2 * f + - 79 * b * e^3 * f + - 22 * c * e^3 * f + - 48 * a^2 * c * f^2 + - 23 * a * c^2 * f^2 + - 78 * b^2 * d * f^2 + - 85 * a * c * d * f^2 + - 55 * c^2 * d * f^2 + - 77 * d^3 * f^2 + - 40 * a * c * e * f^2 + - 83 * b * c * e * f^2 + - 55 * b * d * e * f^2 + - 26 * c * d * e * f^2 + - 35 * a^2 * f^3 + - 10 * b * c * f^3 + - 61 * c^2 * f^3 + - 86 * d^2 * f^3 + - 4 * a * e * f^3 + - 58 * b * f^4 + - 84 * f^5, - 51 * b + - 3 * e + - 14 * b^2 + - 66 * c^2 + - 80 * b * d + - 77 * c * d + - 83 * b * e + - 34 * a * b^2 + - 82 * a^2 * c + - 7 * a * c^2 + - 61 * a * c * d + - 81 * b * c * d + - 5 * c^2 * d + - 33 * d^3 + - 87 * a * d * e + - 23 * b * d * e + - 84 * b * e^2 + - 78 * c * e^2 + - 41 * e^3 + - 9 * a * d * f + - 13 * c * d * f + - 60 * b * e * f + - 78 * d * e * f + - 65 * a * f^2 + - 52 * b * f^2 + - 10 * a^3 * b + - 9 * a^2 * b^2 + - 63 * a * b^3 + - 54 * b^4 + - 75 * a^2 * b * c + - 40 * a^2 * c^2 + - 35 * b * c^3 + - 14 * c^4 + - 80 * a^3 * d + - 69 * b^3 * d + - 4 * a * b * c * d + - 75 * a * c^2 * d + - 64 * a * b * d^2 + - 31 * a^3 * e + - 17 * a^2 * b * e + - 56 * c^2 * d * e + - 55 * b * d^2 * e + - 72 * c * d^2 * e + - 89 * a^2 * e^2 + - 2 * b * c * e^2 + - 60 * b * d * e^2 + - 90 * b * e^3 + - 70 * c * e^3 + - 71 * a^2 * c * f + - 48 * b * c^2 * f + - 7 * a^2 * d * f + - 60 * a * c * d * f + - 61 * c^2 * d * f + - 23 * c * d^2 * f + - 40 * b^2 * e * f + - 8 * a * c * e * f + - 18 * a * d * e * f + - 18 * b * d * e * f + - 48 * c * d * e * f + - 26 * c * e^2 * f + - 34 * a * c * f^2 + - 26 * c^2 * f^2 + - 87 * b * d * f^2 + - 64 * c * d * f^2 + - 67 * a * e * f^2 + - 71 * a * f^3 + - 32 * e * f^3 + - 53 * a^5 + - 80 * b^5 + - 53 * a^3 * b * c + - 39 * a^2 * b^2 * c + - 27 * a * b^3 * c + - 44 * a * b^2 * c^2 + - 51 * b * c^4 + - 8 * c^5 + - 6 * b^4 * d + - 5 * a^2 * c^2 * d + - 22 * b * c^3 * d + - 39 * a^3 * d^2 + - 75 * b^2 * c * d^2 + - 28 * c^3 * d^2 + - 64 * b^2 * d^3 + - 60 * d^5 + - 63 * a^2 * b * c * e + - 30 * b * c^3 * e + - 53 * c^4 * e + - 20 * b^3 * d * e + - 60 * a * b * c * d * e + - 18 * a * c^2 * d * e + - 17 * a * c * d^2 * e + - 58 * a * d^3 * e + - 19 * a^2 * b * e^2 + - 86 * b^3 * e^2 + - 56 * a * b * c * e^2 + - 23 * a * d^2 * e^2 + - 50 * d^3 * e^2 + - 18 * a * c * e^3 + - 70 * b * c * e^3 + - 52 * b * e^4 + - 72 * c * e^4 + - 56 * d * e^4 + - 77 * a^4 * f + - 17 * a * b * c^2 * f + - 63 * a^2 * b * d * f + - 12 * a^2 * c * d * f + - 53 * a * b * d^2 * f + - 25 * b^2 * d^2 * f + - 26 * b * d^3 * f + - 70 * c * d^3 * f + - 33 * d^4 * f + - 42 * a * b * c * e * f + - 74 * b * c^2 * e * f + - 60 * a^2 * d * e * f + - 40 * b * d^2 * e * f + - 3 * c * d^2 * e * f + - 79 * a * c * e^2 * f + - 50 * b * c * e^2 * f + - 30 * a * d * e^2 * f + - 88 * d^2 * e^2 * f + - 88 * b * e^3 * f + - 28 * c * e^3 * f + - 17 * e^4 * f + - 20 * a^3 * f^2 + - 18 * a^2 * b * f^2 + - 35 * b^2 * c * f^2 + - 2 * c^2 * d * f^2 + - 68 * b * d^2 * f^2 + - 50 * c * d^2 * f^2 + - 13 * d^3 * f^2 + - 74 * a^2 * e * f^2 + - 69 * b^2 * e * f^2 + - 81 * b * c * e * f^2 + - 82 * c^2 * e * f^2 + - 27 * d^2 * e * f^2 + - 6 * e^3 * f^2 + - 47 * a * b * f^3 + - 25 * c * d * f^3 + - 89 * b * e * f^3 + - 56 * c * e * f^3 + - 23 * e^2 * f^3 + - 90 * b * f^4 + - 80 * e * f^4 + - 15 * f^5, - 51 + - 52 * e + - 11 * a^2 + - 36 * b * c + - b * d + - 73 * c * d + - 38 * a * e + - 9 * b * e + - 46 * a * b^2 + - 30 * b^3 + - 85 * a^2 * c + - 77 * a * b * c + - 4 * b^2 * c + - 33 * b^2 * d + - 82 * a * d^2 + - 32 * c * d^2 + - 35 * b^2 * e + - 44 * a * c * e + - 50 * b * c * e + - 28 * c * d * e + - 72 * a * b * f + - 61 * b^2 * f + - 24 * c^2 * f + - 19 * b * e * f + - 52 * a * b^2 * c + - 88 * b^3 * c + - 79 * a^2 * c^2 + - 70 * a * c^3 + - 70 * b * c^3 + - 10 * a * b^2 * d + - b^3 * d + - 18 * b^2 * c * d + - 36 * b * c^2 * d + - a^2 * d^2 + - 5 * b^2 * d^2 + - 71 * c^2 * d^2 + - 49 * c * d^3 + - 82 * d^4 + - 40 * c^3 * e + - 6 * b^2 * d * e + - 66 * a * c * d * e + - 42 * b * d^2 * e + - 90 * d^3 * e + - 21 * a^2 * e^2 + - 25 * b * d * e^2 + - 84 * d^2 * e^2 + - 69 * b * e^3 + - 36 * e^4 + - 86 * a^3 * f + - 63 * b^3 * f + - 56 * b^2 * c * f + - 79 * a * c * d * f + - 49 * a * b * e * f + - 56 * b^2 * e * f + - c^2 * e * f + - 15 * d^2 * e * f + - 82 * e^3 * f + - 17 * a * c * f^2 + - 24 * b * c * f^2 + - 87 * c^2 * f^2 + - 31 * a * d * f^2 + - 77 * b * e * f^2 + - 11 * d * e * f^2 + - 67 * a^4 * b + - 52 * a^3 * b^2 + - 90 * b^4 * c + - 32 * a^2 * b * c^2 + - 86 * a * b^2 * c^2 + - 70 * a^2 * c^3 + - 26 * a * c^4 + - 64 * b * c^4 + - 43 * c^5 + - 25 * a^2 * c^2 * d + - 53 * a * c^3 * d + - 50 * a^3 * d^2 + - 54 * a * b^2 * d^2 + - 71 * a^2 * c * d^2 + - 78 * a * b * c * d^2 + - 47 * a * c^2 * d^2 + - 15 * c^3 * d^2 + - 45 * b * d^4 + - 43 * c * d^4 + - 76 * a^3 * b * e + - 82 * a^3 * c * e + - 18 * a^2 * c^2 * e + - 9 * b^2 * c^2 * e + - 78 * a^3 * d * e + - 71 * a^2 * b * d * e + - 11 * a * b * c * d * e + - 13 * b * c^2 * d * e + - 16 * c^3 * d * e + - 52 * a^2 * d^2 * e + - 6 * b * d^3 * e + - 90 * b^3 * e^2 + - 65 * c^3 * e^2 + - 10 * a^2 * d * e^2 + - 77 * b^2 * d * e^2 + - c * d^2 * e^2 + - 90 * c^2 * e^3 + - 61 * b * e^4 + - 35 * e^5 + - 70 * a^4 * f + - 49 * a^3 * b * f + - 53 * a^2 * b^2 * f + - 67 * a^3 * c * f + - 58 * a^2 * b * c * f + - 29 * a^2 * c^2 * f + - 65 * b * c^3 * f + - 88 * a * c^2 * d * f + - 39 * a^2 * d^2 * f + - 64 * a * c * d^2 * f + - 82 * b * c * d^2 * f + - 52 * a^2 * c * e * f + - 22 * a * c^2 * e * f + - 41 * a * b * d * e * f + - 64 * b * c * d * e * f + - 87 * c^2 * d * e * f + - 74 * b * d^2 * e * f + - 53 * c * d^2 * e * f + - 83 * a * b * e^2 * f + - 49 * c^2 * e^2 * f + - 44 * b * d * e^2 * f + - 89 * c * d * e^2 * f + - 20 * a * e^3 * f + - 72 * c * e^3 * f + - 64 * a * b * c * f^2 + - 34 * a * b * d * f^2 + - 79 * b^2 * d * f^2 + - 36 * c * d^2 * f^2 + - 15 * b * c * e * f^2 + - 64 * a * d * e * f^2 + - 58 * d^2 * e * f^2 + - 89 * d * e^2 * f^2 + - 22 * a * d * f^3 + - a * e * f^3 + - 57 * d * e * f^3 + - 3 * c * f^4 + - 84 * d * f^4 + - 40 * e * f^4, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(3*10),90)", i, S) - runb2("sparseid(3,0,5,100-(3*10),90)", i, S) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 60 + - 62 * b + - 28 * c + - 70 * d + - 17 * a * d + - 21 * b * d + - 53 * c * d + - d * e + - 23 * e^2 + - 51 * a * f + - 40 * b * f + - 87 * e * f + - 56 * a^3 + - 80 * a * b^2 + - 11 * b^3 + - 5 * a * b * c + - 7 * b^2 * c + - 17 * c^3 + - 89 * a^2 * d + - 18 * a * b * d + - 39 * b^2 * d + - 6 * b * d^2 + - 40 * c * d^2 + - 53 * d^3 + - 24 * a^2 * e + - 14 * a * c * e + - 68 * d^2 * e + - 26 * a * e^2 + - 69 * a * b * f + - 39 * b^2 * f + - 69 * c^2 * f + - 23 * a * d * f + - 58 * d^2 * f + - 3 * a * e * f + - 12 * b * e * f + - 73 * d * e * f + - 51 * e^2 * f + - 90 * a * f^2 + - 61 * b * f^2 + - 74 * c * f^2 + - 44 * f^3 + - 56 * a^3 * b + - 74 * a^2 * b * c + - 25 * a^2 * c^2 + - 39 * b^2 * c^2 + - 86 * a^3 * d + - 84 * a^2 * b * d + - 55 * b^3 * d + - 24 * a^2 * c * d + - 5 * a * b * c * d + - 33 * b * c^2 * d + - 63 * c^3 * d + - 67 * b * d^3 + - 32 * d^4 + - 79 * a * b * c * e + - 42 * b^2 * c * e + - 47 * a * b * d * e + - 78 * b^2 * d * e + - 48 * c^2 * d * e + - 84 * d^3 * e + - 30 * a^2 * e^2 + - 90 * a * b * e^2 + - 55 * b^2 * e^2 + - 33 * b * c * e^2 + - 53 * b * d * e^2 + - 32 * c * d * e^2 + - 75 * a * e^3 + - 71 * b * e^3 + - 46 * c * e^3 + - 16 * d * e^3 + - 28 * e^4 + - 39 * a * c^2 * f + - 24 * c^3 * f + - 54 * a^2 * d * f + - 80 * a * d^2 * f + - 60 * c * d^2 * f + - 72 * a * c * e * f + - 2 * a * d * e * f + - 4 * b * d * e * f + - 52 * c * d * e * f + - 29 * d^2 * e * f + - 84 * b * e^2 * f + - 88 * d * e^2 * f + - 48 * a * b * f^2 + - 39 * b * c * f^2 + - 20 * c^2 * f^2 + - 72 * a * d * f^2 + - 28 * b * d * f^2 + - 56 * c * d * f^2 + - 53 * c * e * f^2 + - 62 * e^2 * f^2 + - 76 * a * f^3 + - 33 * b * f^3 + - 4 * d * f^3 + - 88 * a^3 * b^2 + - 36 * b^5 + - 48 * a^3 * b * c + - 11 * b^4 * c + - 82 * a^3 * c^2 + - 24 * a^2 * b * c^2 + - 54 * a * b * c^3 + - 4 * b^2 * c^3 + - 23 * b * c^4 + - 48 * a^3 * b * d + - 36 * a * b^3 * d + - 48 * a^3 * c * d + - 60 * a^2 * b * c * d + - 47 * a * b^2 * c * d + - 85 * a^2 * c^2 * d + - 64 * a^3 * d^2 + - 88 * a * b * c * d^2 + - 70 * a * c^2 * d^2 + - 36 * b * c^2 * d^2 + - 21 * a^2 * d^3 + - 65 * a * b * d^3 + - 54 * b^2 * d^3 + - 53 * a * c * d^3 + - 49 * a^3 * b * e + - 35 * b^4 * e + - 62 * a * b^2 * c * e + - 17 * a * b * c^2 * e + - 76 * c^4 * e + - 58 * a^3 * d * e + - 83 * a * b^2 * d * e + - 83 * b^3 * d * e + - 55 * a^2 * c * d * e + - 14 * a * c^2 * d * e + - 45 * c^3 * d * e + - 57 * a * b * d^2 * e + - 6 * a * c * d^2 * e + - 42 * c^2 * d^2 * e + - 61 * b * d^3 * e + - 32 * c * d^3 * e + - 15 * a^3 * e^2 + - 34 * a^2 * b * e^2 + - 74 * a * b^2 * e^2 + - 22 * b^3 * e^2 + - 90 * a^2 * c * e^2 + - 4 * c^3 * e^2 + - 36 * a * b * d * e^2 + - 36 * a * c * d * e^2 + - 20 * c^2 * d * e^2 + - 15 * a * d^2 * e^2 + - 24 * c * d^2 * e^2 + - 72 * d^3 * e^2 + - 41 * a * c * e^3 + - 61 * a * e^4 + - 6 * c * e^4 + - 51 * e^5 + - 50 * a^4 * f + - 54 * a^2 * b^2 * f + - 83 * a * b^3 * f + - 87 * a^3 * c * f + - 39 * a^2 * b * c * f + - 53 * b^3 * c * f + - 53 * b^2 * c^2 * f + - 13 * a * c^3 * f + - 46 * a * b^2 * d * f + - 77 * b * c^2 * d * f + - 36 * a^2 * d^2 * f + - 12 * a * c * d^2 * f + - 2 * b * c * d^2 * f + - 19 * c^2 * d^2 * f + - 15 * a^3 * e * f + - 69 * a^2 * c * e * f + - 90 * a * b * c * e * f + - 4 * a * c^2 * e * f + - 28 * a * b * d * e * f + - 15 * b^2 * d * e * f + - 14 * a * c * d * e * f + - 38 * b * c * d * e * f + - 13 * a * d^2 * e * f + - 32 * c * d^2 * e * f + - 89 * b * c * e^2 * f + - 7 * c^2 * e^2 * f + - 8 * b * d * e^2 * f + - 78 * c * d * e^2 * f + - 56 * c * e^3 * f + - 63 * d * e^3 * f + - 59 * e^4 * f + - 89 * a^2 * b * f^2 + - 20 * a * b^2 * f^2 + - 74 * b^3 * f^2 + - 26 * a * b * c * f^2 + - 87 * a * c^2 * f^2 + - 65 * b * c^2 * f^2 + - 50 * a^2 * d * f^2 + - 75 * a * c * d * f^2 + - 30 * a * d^2 * f^2 + - 5 * a^2 * e * f^2 + - 63 * b^2 * e * f^2 + - 22 * c^2 * e * f^2 + - 39 * a * d * e * f^2 + - 51 * c * d * e * f^2 + - 77 * b * e^2 * f^2 + - 24 * e^3 * f^2 + - 55 * a^2 * f^3 + - 31 * b * c * f^3 + - 38 * c * d * f^3 + - 63 * d^2 * f^3 + - 53 * a * e * f^3 + - 70 * d * e * f^3 + - 2 * e^2 * f^3 + - 87 * b * f^4 + - 59 * c * f^4 + - 61 * e * f^4 + - 53 * f^5, - 12 * b + - 88 * f + - 7 * a^2 + - 26 * b^2 + - 81 * b * c + - 18 * a * d + - 29 * b * e + - 36 * c * e + - 21 * e^2 + - 21 * a * f + - 29 * d * f + - 8 * e * f + - 4 * f^2 + - 24 * b^3 + - 86 * a * c^2 + - 68 * b * c^2 + - 57 * a^2 * d + - 8 * a * c * d + - 24 * b * c * d + - 63 * a * b * e + - 68 * c^2 * e + - 81 * b^2 * f + - 16 * b * c * f + - 66 * c * d * f + - 89 * b * e * f + - 86 * c * e * f + - 49 * d * e * f + - 55 * d * f^2 + - 4 * e * f^2 + - 27 * f^3 + - 72 * a^2 * b * c + - 51 * a * b^2 * c + - 52 * b^3 * c + - 23 * a^2 * c * d + - 16 * b^2 * c * d + - 81 * b * c^2 * d + - 41 * a^2 * d^2 + - 59 * b * c * d^2 + - a * d^3 + - 52 * c * d^3 + - 70 * d^4 + - 30 * a^2 * b * e + - 51 * b^3 * e + - 26 * a * b * c * e + - 82 * a * c^2 * e + - 20 * b * c^2 * e + - 42 * c^3 * e + - 10 * b^2 * d * e + - 26 * a * c * d * e + - 74 * b * c * d * e + - 65 * b * d^2 * e + - 47 * d^3 * e + - 65 * a^2 * e^2 + - 4 * b^2 * e^2 + - 61 * a * c * e^2 + - 48 * c^2 * e^2 + - 48 * a * d * e^2 + - 24 * b * d * e^2 + - 79 * b * e^3 + - 3 * c * e^3 + - 45 * a^2 * b * f + - 73 * a * b * c * f + - 33 * a * c^2 * f + - 39 * a^2 * d * f + - 26 * a * b * d * f + - 23 * c^2 * d * f + - 13 * b * d^2 * f + - 53 * a^2 * e * f + - 85 * b^2 * e * f + - 31 * a * c * e * f + - 49 * b * c * e * f + - 7 * a * e^2 * f + - 86 * c * e^2 * f + - 15 * e^3 * f + - 38 * a^2 * f^2 + - 70 * a * c * f^2 + - 37 * c^2 * f^2 + - 16 * a * d * f^2 + - 51 * b * d * f^2 + - 88 * c * e * f^2 + - 68 * e^2 * f^2 + - 75 * b * f^3 + - 37 * c * f^3 + - 38 * a^4 * b + - 84 * a * b^4 + - 88 * b^5 + - 49 * a^3 * b * c + - 8 * a^2 * b^2 * c + - 39 * b^4 * c + - 11 * a^2 * c^3 + - 29 * a * b * c^3 + - 72 * b^2 * c^3 + - 39 * a * c^4 + - 54 * b * c^4 + - 77 * a^4 * d + - 89 * a^3 * b * d + - 65 * a^3 * c * d + - 66 * a * b^2 * c * d + - 20 * a^2 * c^2 * d + - 79 * a * b * c^2 * d + - 68 * b^2 * c^2 * d + - 76 * c^4 * d + - 90 * b^3 * d^2 + - 46 * a * b * c * d^2 + - 82 * a * c^2 * d^2 + - 68 * b * c^2 * d^2 + - 60 * a^2 * d^3 + - 20 * a * b * d^3 + - 52 * a^3 * b * e + - 12 * a * b^3 * e + - 15 * b^4 * e + - 63 * a * b * c^2 * e + - 26 * b^2 * c^2 * e + - 63 * a * c^3 * e + - 31 * b^3 * d * e + - 65 * a * c^2 * d * e + - 45 * b * c * d^2 * e + - 31 * a * d^3 * e + - 33 * c * d^3 * e + - 38 * d^4 * e + - 53 * a^3 * e^2 + - 30 * a^2 * b * e^2 + - 31 * a * b^2 * e^2 + - 26 * a^2 * c * e^2 + - 33 * b^2 * c * e^2 + - 25 * a * c^2 * e^2 + - 61 * b * c^2 * e^2 + - 82 * c^3 * e^2 + - 71 * b^2 * d * e^2 + - 79 * a * d^2 * e^2 + - 47 * b * d^2 * e^2 + - 82 * c * d^2 * e^2 + - 84 * a * b * e^3 + - 25 * b * c * e^3 + - 52 * d^2 * e^3 + - 17 * b * e^4 + - 48 * c * e^4 + - 25 * a^4 * f + - 82 * a^3 * b * f + - 7 * a^3 * c * f + - 20 * a * b^2 * c * f + - 16 * a * b * c^2 * f + - 3 * a * c^3 * f + - 60 * c^4 * f + - 65 * a^3 * d * f + - 54 * a * b^2 * d * f + - 44 * a * b * c * d * f + - 32 * b * c^2 * d * f + - 15 * b^2 * d^2 * f + - 72 * c^2 * d^2 * f + - 79 * d^4 * f + - 81 * a^2 * b * e * f + - 49 * a * b^2 * e * f + - 64 * a * b * c * e * f + - 87 * b^2 * d * e * f + - 47 * c^2 * d * e * f + - 30 * a * d^2 * e * f + - 64 * b * d^2 * e * f + - 86 * a^2 * e^2 * f + - 14 * b * c * e^2 * f + - 81 * c^2 * e^2 * f + - 61 * d^2 * e^2 * f + - 54 * d * e^3 * f + - 75 * a^3 * f^2 + - 32 * a^2 * b * f^2 + - 62 * a * c^2 * f^2 + - 23 * c^2 * d * f^2 + - 11 * a * d^2 * f^2 + - 12 * b * d^2 * f^2 + - 74 * c * d^2 * f^2 + - 75 * b * c * e * f^2 + - 52 * c^2 * e * f^2 + - 7 * d^2 * e * f^2 + - 6 * a * e^2 * f^2 + - 73 * d * e^2 * f^2 + - 56 * e^3 * f^2 + - 51 * a^2 * f^3 + - 24 * c^2 * f^3 + - 90 * b * d * f^3 + - 76 * b * e * f^3 + - 59 * c * e * f^3 + - 24 * e * f^4 + - 57 * f^5, - 6 + - 36 * c + - 85 * e + - 12 * f + - 2 * c^2 + - 40 * c * d + - 84 * a * e + - 63 * b * e + - 72 * e^2 + - 76 * b * f + - 8 * e * f + - 81 * a^3 + - 86 * b^3 + - 30 * b * c^2 + - 68 * a * c * d + - 43 * c^2 * d + - 32 * a * d^2 + - 67 * c * d^2 + - 13 * a^2 * e + - 2 * a * b * e + - 60 * b^2 * e + - 80 * b * c * e + - 67 * a * d * e + - 38 * b * d * e + - 71 * a * e^2 + - 23 * c * e^2 + - 89 * b * c * f + - 74 * c^2 * f + - 76 * b * d * f + - 46 * a * e * f + - 12 * c * e * f + - 70 * d * e * f + - 22 * f^3 + - 60 * a^4 + - 18 * a^2 * b^2 + - 71 * b^4 + - 41 * a^2 * c^2 + - 62 * a * b * c^2 + - 84 * a * c^3 + - 72 * c^4 + - 76 * b^3 * d + - 41 * a * c * d^2 + - 47 * b * c * d^2 + - 44 * a^3 * e + - 74 * a^2 * b * e + - 21 * a^2 * c * e + - 37 * a * b * c * e + - 74 * a * c^2 * e + - 9 * b * c^2 * e + - 61 * a^2 * d * e + - 54 * b^2 * d * e + - 57 * b * c * d * e + - 52 * b^2 * e^2 + - 80 * c^2 * e^2 + - 80 * c * d * e^2 + - 15 * a^3 * f + - 11 * b^3 * f + - 45 * a^2 * c * f + - 14 * a * c^2 * f + - 77 * a^2 * d * f + - 89 * b * c * d * f + - 37 * b * d^2 * f + - 55 * d^3 * f + - 31 * a * b * e * f + - b * c * e * f + - 43 * a * d * e * f + - 84 * c * d * e * f + - 78 * d^2 * e * f + - 40 * d * e^2 * f + - 88 * b * c * f^2 + - 50 * b * d * f^2 + - 86 * c * d * f^2 + - 15 * d^2 * f^2 + - 78 * b * e * f^2 + - 46 * a * f^3 + - 56 * b * f^3 + - 76 * c * f^3 + - 89 * d * f^3 + - 83 * f^4 + - 86 * a^2 * b^3 + - 74 * a * b^4 + - 63 * b^5 + - 89 * a * b^3 * c + - 54 * a^2 * b * c^2 + - 50 * b^3 * c^2 + - 27 * a^2 * c^3 + - 54 * a * b * c^3 + - 46 * a^4 * d + - 2 * b^4 * d + - 80 * a * b * c^2 * d + - 16 * a * c^3 * d + - 68 * b * c^3 * d + - 4 * a * b^2 * d^2 + - 15 * b * c^2 * d^2 + - 66 * b * d^4 + - 8 * a^2 * b^2 * e + - 72 * b^4 * e + - 67 * a^2 * b * c * e + - 59 * b^3 * c * e + - 57 * b^2 * c^2 * e + - 60 * a^2 * b * d * e + - 82 * a * b^2 * d * e + - a * b * c * d * e + - 65 * b^2 * c * d * e + - 35 * b * c^2 * d * e + - 37 * a^2 * d^2 * e + - 80 * b^2 * d^2 * e + - 47 * c^2 * d^2 * e + - 9 * c * d^3 * e + - 33 * a * b^2 * e^2 + - 27 * a^2 * c * e^2 + - 46 * b^2 * c * e^2 + - 64 * b * c^2 * e^2 + - 58 * c^3 * e^2 + - 20 * a * b * d * e^2 + - 87 * b * c * d * e^2 + - 39 * c * d^2 * e^2 + - 4 * a^2 * e^3 + - 68 * b^2 * e^3 + - a * d * e^3 + - 41 * c * d * e^3 + - 72 * d^2 * e^3 + - 14 * a * e^4 + - 74 * b^4 * f + - 16 * a^3 * c * f + - 39 * a^2 * b * c * f + - 17 * b^2 * c^2 * f + - 58 * a * c^3 * f + - 82 * a^2 * b * d * f + - 87 * b^3 * d * f + - 12 * a * d^3 * f + - 86 * b * d^3 * f + - 2 * c * d^3 * f + - 67 * a * b^2 * e * f + - 50 * b^3 * e * f + - 67 * b * c^2 * e * f + - 51 * c^3 * e * f + - 15 * a * b * d * e * f + - 61 * b^2 * d * e * f + - 11 * b * d^2 * e * f + - 13 * a * b * e^2 * f + - 41 * b^2 * e^2 * f + - 17 * c^2 * e^2 * f + - 3 * b * d * e^2 * f + - 28 * a * e^3 * f + - 13 * b * e^3 * f + - 26 * c * e^3 * f + - 45 * e^4 * f + - 5 * a^3 * f^2 + - 49 * b^3 * f^2 + - 74 * a^2 * c * f^2 + - 61 * a * b * c * f^2 + - 49 * c^3 * f^2 + - 66 * a * c * d * f^2 + - 81 * b * c * d * f^2 + - 90 * c^2 * d * f^2 + - 28 * a * d^2 * f^2 + - 15 * c * d^2 * f^2 + - 17 * d^3 * f^2 + - 30 * a * b * e * f^2 + - 75 * a * e^2 * f^2 + - 48 * b * e^2 * f^2 + - 66 * c * e^2 * f^2 + - 46 * b^2 * f^3 + - 56 * b * c * f^3 + - 82 * c * d * f^3 + - 25 * a * e * f^3 + - 41 * d * e * f^3 + - 86 * c * f^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 69 * a + - 66 * b + - 40 * a * b + - 20 * b^2 + - 57 * c^2 + - 76 * c * d + - 46 * d^2 + - 7 * a * e + - 5 * b * e + - 59 * d * e + - 41 * a^3 + - 33 * a^2 * b + - 86 * a^2 * c + - 80 * a * b * c + - 80 * b^2 * c + - 55 * b * c^2 + - 2 * c^3 + - 82 * a^2 * d + - 59 * a * c * d + - 28 * a * d^2 + - 76 * d^3 + - 45 * a^2 * e + - 65 * b^2 * e + - 58 * a * c * e + - 23 * c^2 * e + - 9 * d^2 * e + - 17 * b * e^2 + - 5 * c * e^2 + - 19 * a * b * f + - 21 * b^2 * f + - 35 * b * c * f + - 63 * b * d * f + - 49 * e * f^2 + - 76 * f^3 + - 19 * a^3 * c + - 35 * a^2 * b * c + - 17 * b^3 * c + - 66 * a * c^3 + - 6 * c^4 + - 52 * a^2 * b * d + - 36 * a * b^2 * d + - 9 * b^2 * c * d + - 27 * b * c^2 * d + - 48 * a^2 * d^2 + - 38 * a * c * d^2 + - 11 * a * d^3 + - 8 * c * d^3 + - d^4 + - 39 * a^3 * e + - 59 * a * b^2 * e + - 68 * b^3 * e + - 62 * b^2 * c * e + - 4 * b * c^2 * e + - 8 * a * b * d * e + - 78 * b^2 * d * e + - 34 * a * c * d * e + - 10 * b * c * d * e + - 77 * b * d^2 * e + - 57 * c * d^2 * e + - 88 * a * b * e^2 + - 29 * a * c * e^2 + - 72 * a * d * e^2 + - 80 * b * d * e^2 + - 32 * d^2 * e^2 + - 67 * b * e^3 + - 15 * c * e^3 + - 26 * e^4 + - 78 * a * b^2 * f + - 20 * b^3 * f + - 29 * a^2 * c * f + - 12 * b * c^2 * f + - 22 * c^3 * f + - 10 * a * c * d * f + - 24 * b * c * d * f + - 77 * a * d^2 * f + - 86 * c * d^2 * f + - 74 * a^2 * e * f + - 6 * a * b * e * f + - 54 * b^2 * e * f + - 8 * a * d * e * f + - 30 * d^2 * e * f + - 89 * b * e^2 * f + - 88 * c * e^2 * f + - 40 * e^3 * f + - 63 * a^2 * f^2 + - 76 * a * b * f^2 + - 21 * c * d * f^2 + - 43 * d^2 * f^2 + - 60 * d * e * f^2 + - 50 * e^2 * f^2 + - 70 * b * f^3 + - 82 * c * f^3 + - 24 * d * f^3 + - 37 * f^4 + - 50 * a^5 + - 64 * a^4 * b + - 52 * a^3 * b^2 + - 19 * b^5 + - 60 * a * b^3 * c + - 43 * a^2 * b * c^2 + - 49 * a * b^2 * c^2 + - 64 * b^3 * c^2 + - 36 * a * b * c^3 + - 54 * b * c^4 + - 36 * c^5 + - 31 * a^4 * d + - 46 * a^3 * b * d + - 35 * b^4 * d + - 87 * a^2 * b * c * d + - 41 * b^3 * c * d + - 24 * a^2 * c^2 * d + - 79 * b^2 * c^2 * d + - 66 * b * c^3 * d + - 33 * a * b^2 * d^2 + - 24 * b^3 * d^2 + - 21 * a * b * c * d^2 + - 80 * b^2 * c * d^2 + - 73 * a * c^2 * d^2 + - 7 * b^2 * d^3 + - 21 * c * d^4 + - 31 * a^4 * e + - 22 * a^3 * b * e + - 49 * b^3 * c * e + - 17 * a * c^3 * e + - 65 * b^3 * d * e + - 67 * a * b * c * d * e + - 36 * c^3 * d * e + - 13 * a * b * d^2 * e + - 3 * b^2 * d^2 * e + - 87 * c * d^3 * e + - 25 * d^4 * e + - 47 * a^3 * e^2 + - 54 * a^2 * b * e^2 + - 66 * b^3 * e^2 + - 38 * a^2 * d * e^2 + - 18 * b * c * d * e^2 + - 10 * a * d^2 * e^2 + - 22 * b * d^2 * e^2 + - 74 * a * b * e^3 + - 68 * b^2 * e^3 + - 23 * a * c * e^3 + - 84 * b * c * e^3 + - 55 * a * d * e^3 + - 27 * d^2 * e^3 + - 54 * c * e^4 + - 4 * e^5 + - 4 * a * b^3 * f + - 57 * a^3 * c * f + - 8 * a^2 * b * c * f + - 3 * a * b * c^2 * f + - 71 * b * c^3 * f + - 46 * a^3 * d * f + - 62 * b^3 * d * f + - 63 * a^2 * c * d * f + - 85 * b^2 * c * d * f + - 74 * c^3 * d * f + - 25 * a * b * d^2 * f + - 62 * c^2 * d^2 * f + - 70 * b^2 * c * e * f + - 2 * c^3 * e * f + - 45 * b * c * d * e * f + - 88 * c^2 * d * e * f + - 8 * a * d^2 * e * f + - 37 * c * d^2 * e * f + - 28 * d^3 * e * f + - 39 * a^2 * e^2 * f + - 27 * b^2 * e^2 * f + - 25 * b * c * e^2 * f + - 62 * c^2 * e^2 * f + - 53 * c * d * e^2 * f + - 73 * e^4 * f + - 89 * a^3 * f^2 + - 3 * b^3 * f^2 + - 70 * b^2 * c * f^2 + - 16 * c^3 * f^2 + - 11 * a^2 * d * f^2 + - 20 * b * c * d * f^2 + - 68 * b^2 * e * f^2 + - 5 * a * e^2 * f^2 + - 88 * b^2 * f^3 + - 47 * b * c * f^3 + - 3 * c^2 * f^3 + - 74 * a * d * f^3 + - 24 * c * d * f^3 + - 86 * d * e * f^3 + - 3 * b * f^4 + - 72 * c * f^4, - 43 + - 89 * b + - 74 * c + - 72 * d + - 9 * a^2 + - 12 * b^2 + - 12 * a * c + - c^2 + - 28 * c * e + - 49 * c * f + - 77 * a * b^2 + - 16 * a * b * c + - 12 * a * c^2 + - 65 * a^2 * d + - 51 * b * c * d + - 45 * c^2 * d + - 21 * c * d^2 + - 15 * a^2 * e + - 51 * b * d * e + - 40 * c * d * e + - 9 * a * e^2 + - 25 * b * e^2 + - 9 * c * e^2 + - 62 * e^3 + - 76 * b^2 * f + - 77 * c^2 * f + - 61 * b * d * f + - 56 * c * d * f + - 51 * d^2 * f + - 86 * e^2 * f + - 41 * c * f^2 + - 43 * d * f^2 + - 19 * f^3 + - 66 * a * b^3 + - 60 * a^2 * c^2 + - 49 * b * c^3 + - 41 * b * c^2 * d + - 31 * c^3 * d + - 32 * a^2 * d^2 + - 63 * b^2 * d^2 + - 59 * c^2 * d^2 + - 37 * a * d^3 + - 33 * c * d^3 + - 35 * d^4 + - 9 * a^3 * e + - 15 * a^2 * b * e + - 33 * a^2 * c * e + - 19 * a * b * c * e + - 33 * b^2 * c * e + - 13 * a^2 * d * e + - 50 * a * b * d * e + - 90 * b * c * d * e + - 85 * c^2 * d * e + - 79 * d^3 * e + - 55 * a * c * e^2 + - 75 * b * c * e^2 + - 11 * c^2 * e^2 + - 40 * d^2 * e^2 + - 74 * c * e^3 + - 79 * a * b^2 * f + - 16 * a * b * c * f + - 84 * b * c^2 * f + - 10 * b * c * d * f + - 47 * a * d^2 * f + - 39 * d^3 * f + - 56 * a^2 * e * f + - 60 * a * b * e * f + - 70 * b^2 * e * f + - 63 * c^2 * e * f + - 53 * b * e^2 * f + - 31 * c * e^2 * f + - 43 * e^3 * f + - 16 * a * b * f^2 + - 79 * b * c * f^2 + - 74 * b * d * f^2 + - 15 * b * e * f^2 + - 18 * c * e * f^2 + - 33 * b * f^3 + - 44 * c * f^3 + - 89 * a^4 * b + - 42 * a^3 * b^2 + - 39 * a * b^4 + - 43 * a * b^3 * c + - 36 * a^3 * c^2 + - 57 * a * b^2 * c^2 + - 10 * b^3 * c^2 + - 69 * a * c^4 + - 32 * b * c^4 + - 90 * c^5 + - 85 * a^4 * d + - 12 * a^3 * b * d + - 42 * a * b^3 * d + - 74 * a^3 * c * d + - 23 * a * b^2 * c * d + - 29 * a^2 * c * d^2 + - 57 * a * b * c * d^2 + - 62 * b^2 * c * d^2 + - 20 * b^2 * d^3 + - 14 * b * c * d^3 + - 62 * c^2 * d^3 + - 76 * a * d^4 + - b * d^4 + - 89 * a^2 * b^2 * e + - 79 * a * b^3 * e + - 2 * b^4 * e + - 27 * a^2 * b * c * e + - 4 * a * b * c^2 * e + - 17 * a * c^3 * e + - 55 * b * c^3 * e + - 35 * c^4 * e + - 21 * a * b^2 * d * e + - 43 * b^3 * d * e + - 60 * a * b * c * d * e + - 5 * b * c^2 * d * e + - 62 * a * b * d^2 * e + - 72 * b^2 * d^2 * e + - 60 * a * c * d^2 * e + - 90 * c^2 * d^2 * e + - 14 * a * d^3 * e + - 19 * d^4 * e + - 69 * a^3 * e^2 + - 42 * a^2 * b * e^2 + - 10 * a * b^2 * e^2 + - 69 * a * c^2 * e^2 + - 72 * b^2 * d * e^2 + - 58 * a * c * d * e^2 + - 29 * a^2 * e^3 + - 41 * a * b * e^3 + - 83 * a * c * e^3 + - 32 * b * c * e^3 + - 34 * a * d * e^3 + - 74 * d * e^4 + - 35 * e^5 + - 87 * a^2 * b^2 * f + - 86 * a^2 * b * c * f + - 14 * a * c^3 * f + - 8 * c^4 * f + - 87 * a^2 * b * d * f + - 81 * b^3 * d * f + - 69 * a * b * c * d * f + - 34 * c^3 * d * f + - 48 * a * b * d^2 * f + - 15 * b^2 * d^2 * f + - 47 * c^2 * d^2 * f + - 77 * b * d^3 * f + - 87 * a^3 * e * f + - 8 * a^2 * b * e * f + - 5 * a^2 * c * e * f + - 14 * a * b * c * e * f + - 42 * a * c * d * e * f + - 82 * b * c * d * e * f + - 11 * c^2 * d * e * f + - 55 * a * b * e^2 * f + - 74 * b * c * e^2 * f + - 28 * c^2 * e^2 * f + - 74 * b * d * e^2 * f + - 10 * a * e^3 * f + - 58 * d * e^3 * f + - 50 * a^2 * b * f^2 + - 61 * a * b * c * f^2 + - 25 * b * c^2 * f^2 + - 87 * c^3 * f^2 + - 70 * a^2 * d * f^2 + - 59 * a * b * d * f^2 + - 75 * a * c * d * f^2 + - 20 * c * d^2 * f^2 + - 51 * a * b * e * f^2 + - 4 * a * c * e * f^2 + - 51 * a * d * e * f^2 + - 14 * b * d * e * f^2 + - 83 * a * e^2 * f^2 + - 79 * b * e^2 * f^2 + - 80 * a^2 * f^3 + - 72 * a * c * f^3 + - 30 * b * c * f^3 + - 25 * c^2 * f^3 + - 33 * d^2 * f^3 + - 71 * a * e * f^3 + - 54 * c * e * f^3 + - 35 * e^2 * f^3, - 34 + - 72 * b + - 33 * e + - 45 * f + - 26 * a * c + - 58 * b * c + - 90 * c^2 + - 25 * a * d + - 29 * c * d + - 7 * b * e + - 78 * c * e + - 22 * e^2 + - 76 * a * f + - 12 * c * f + - 79 * d * f + - 70 * e * f + - 46 * b^2 * c + - 48 * b * c * d + - 51 * c^2 * d + - 54 * a * d^2 + - 55 * b * d^2 + - 28 * a^2 * e + - 21 * a * b * e + - 60 * a * c * e + - 40 * b * c * e + - 31 * c * d * e + - 25 * d^2 * e + - 10 * a * e^2 + - 30 * a^2 * f + - 76 * b * c * f + - 29 * c * d * f + - 35 * d^2 * f + - 8 * a * e * f + - 17 * b * e * f + - 2 * d * e * f + - 30 * e * f^2 + - 68 * f^3 + - 34 * a^3 * c + - 28 * a^2 * b * c + - 53 * b^3 * c + - 81 * b^2 * c^2 + - 4 * a * c^3 + - 58 * b * c^3 + - 82 * a * b^2 * d + - 87 * a^2 * c * d + - 26 * b^2 * c * d + - 17 * b * c^2 * d + - 56 * a * b * d^2 + - 79 * a * c * d^2 + - 84 * a^2 * c * e + - 77 * b^2 * c * e + - 66 * b * c^2 * e + - 89 * c^3 * e + - 73 * a * d^2 * e + - 73 * b * d^2 * e + - 23 * a * c * e^2 + - 47 * b * c * e^2 + - 27 * c^2 * e^2 + - 2 * a * d * e^2 + - 80 * d^2 * e^2 + - 9 * b * e^3 + - 78 * c * e^3 + - 86 * a * b^2 * f + - 38 * b * c^2 * f + - 53 * c^3 * f + - 30 * a * c * d * f + - 81 * d^3 * f + - 6 * a * b * e * f + - 59 * b^2 * e * f + - 75 * a * c * e * f + - 4 * c^2 * e * f + - 71 * d^2 * e * f + - 52 * b * e^2 * f + - 42 * a^2 * f^2 + - 33 * b^2 * f^2 + - 74 * a * d * f^2 + - 87 * b * d * f^2 + - 72 * d^2 * f^2 + - 56 * a * e * f^2 + - 75 * c * e * f^2 + - 59 * e^2 * f^2 + - 22 * a * f^3 + - 54 * c * f^3 + - 52 * a^2 * b^3 + - 40 * a^2 * b^2 * c + - 27 * a * b^3 * c + - 27 * b^4 * c + - 23 * a^3 * c^2 + - 5 * a^2 * b * c^2 + - 77 * a^2 * c^3 + - 54 * c^5 + - 3 * a^3 * b * d + - 2 * a * b^3 * d + - 55 * a^3 * c * d + - 25 * a^2 * c^2 * d + - 9 * b^2 * c^2 * d + - 52 * a * c^3 * d + - 32 * a^2 * b * d^2 + - 75 * a * b^2 * d^2 + - 64 * a^2 * c * d^2 + - 27 * b^2 * c * d^2 + - 12 * a^2 * d^3 + - 72 * b^2 * d^3 + - 89 * a * d^4 + - 42 * b * d^4 + - 63 * c * d^4 + - 32 * a^3 * c * e + - 12 * b^2 * c^2 * e + - 38 * b * c^3 * e + - 41 * b * c^2 * d * e + - 79 * a^2 * d^2 * e + - 24 * a * b * d^2 * e + - 88 * a * d^3 * e + - 13 * a * b * c * e^2 + - 3 * b^2 * c * e^2 + - 55 * a * c^2 * e^2 + - 68 * a * b * d * e^2 + - 88 * b^2 * d * e^2 + - 51 * a * c * d * e^2 + - 42 * b * c * d * e^2 + - 37 * c^2 * d * e^2 + - 78 * a * d^2 * e^2 + - 4 * c * d^2 * e^2 + - 68 * b * c * e^3 + - 34 * d^2 * e^3 + - 72 * a * e^4 + - 21 * c * e^4 + - 76 * d * e^4 + - 79 * e^5 + - 16 * a^4 * f + - 57 * a^3 * c * f + - 23 * b^3 * c * f + - 68 * a^2 * c^2 * f + - 78 * b^2 * c^2 * f + - 56 * a^2 * b * d * f + - 28 * a * b^2 * d * f + - 36 * b^3 * d * f + - 71 * a^2 * c * d * f + - 9 * a * b * c * d * f + - 49 * b^2 * c * d * f + - 20 * a * c^2 * d * f + - 71 * b * c^2 * d * f + - 74 * a^2 * d^2 * f + - 32 * a * b * d^2 * f + - 37 * b^2 * d^2 * f + - 2 * a * d^3 * f + - 39 * d^4 * f + - 20 * b^3 * e * f + - 9 * a * b * c * e * f + - 53 * b^2 * c * e * f + - 68 * a * c^2 * e * f + - 52 * c^3 * e * f + - 24 * a * b * d * e * f + - 9 * c^2 * d * e * f + - 49 * a * d^2 * e * f + - 81 * b * d^2 * e * f + - 72 * a^2 * e^2 * f + - 31 * a * b * e^2 * f + - 76 * b^2 * e^2 * f + - 36 * a * c * e^2 * f + - 32 * c^2 * e^2 * f + - 50 * c * d * e^2 * f + - 76 * c * e^3 * f + - 82 * e^4 * f + - 71 * a * b * c * f^2 + - 63 * a^2 * d * f^2 + - 3 * a * b * d * f^2 + - 17 * b^2 * d * f^2 + - 5 * b * c * d * f^2 + - 37 * b * d^2 * f^2 + - 79 * a * c * e * f^2 + - 27 * c^2 * e * f^2 + - 43 * a * d * e * f^2 + - 49 * b * d * e * f^2 + - 54 * c * d * e * f^2 + - 29 * a * e^2 * f^2 + - 4 * c * e^2 * f^2 + - e^3 * f^2 + - 82 * a^2 * f^3 + - a * b * f^3 + - 61 * b^2 * f^3 + - 67 * a * c * f^3 + - 9 * c^2 * f^3 + - 84 * a * d * f^3 + - 9 * a * e * f^3 + - 47 * b * e * f^3 + - 44 * d * e * f^3 + - 30 * e^2 * f^3 + - 50 * c * f^4 + - 76 * d * f^4 + - 8 * e * f^4 + - 24 * f^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 40 * b + - 36 * c + - 81 * b^2 + - 25 * b * c + - 19 * a * d + - 42 * b * d + - 24 * c * d + - 10 * c * e + - 43 * d * e + - 61 * e^2 + - 12 * c * f + - 3 * a^3 + - 16 * a^2 * c + - 60 * a * b * c + - 40 * c^3 + - 30 * a^2 * d + - 86 * a * c * d + - 23 * c^2 * d + - 71 * a * d^2 + - 19 * a * b * e + - 21 * a * c * e + - 43 * b * c * e + - 64 * a * d * e + - 8 * c * d * e + - 23 * c * e^2 + - 39 * d * e^2 + - 70 * b^2 * f + - 3 * a * c * f + - 40 * c * d * f + - 88 * a * e * f + - 63 * e^2 * f + - 80 * a * f^2 + - a * b^3 + - 37 * a * b^2 * c + - 6 * b^3 * c + - 71 * a^2 * c^2 + - 3 * a * b * c^2 + - 76 * b^2 * c^2 + - 90 * a * c^3 + - 79 * b * c^3 + - 3 * c^4 + - 86 * a * b^2 * d + - 76 * b^3 * d + - 34 * a^2 * c * d + - 64 * a * b * c * d + - 72 * a * c^2 * d + - 47 * a^2 * d^2 + - 27 * b^2 * d^2 + - 84 * a^3 * e + - 52 * b^2 * c * e + - 8 * a * c^2 * e + - 44 * b * c^2 * e + - 62 * c^3 * e + - 88 * c^2 * d * e + - 75 * a * d^2 * e + - 14 * c * d^2 * e + - 78 * a^2 * e^2 + - 70 * a * b * e^2 + - 71 * a * c * e^2 + - 80 * c^2 * e^2 + - 32 * d^2 * e^2 + - 83 * a * e^3 + - 45 * c * e^3 + - 77 * d * e^3 + - 76 * a^2 * b * f + - 82 * b^3 * f + - 22 * a * b * c * f + - 10 * a * c^2 * f + - 26 * b * c^2 * f + - 45 * a^2 * d * f + - 10 * a * b * d * f + - 59 * b^2 * d * f + - 34 * c^2 * d * f + - 42 * a^2 * e * f + - 59 * b^2 * e * f + - 50 * a * c * e * f + - 30 * a * b * f^2 + - 36 * b * d * f^2 + - 38 * b * f^3 + - 6 * e * f^3 + - 82 * a^4 * c + - 71 * a * b^3 * c + - a^3 * c^2 + - 36 * a^2 * b * c^2 + - 87 * a * b^2 * c^2 + - 6 * a^2 * c^3 + - 89 * a * b * c^3 + - 8 * a * c^4 + - 59 * b * c^4 + - 81 * a^4 * d + - 6 * a^3 * b * d + - 45 * a^3 * c * d + - 73 * a^2 * b * c * d + - 41 * b^3 * c * d + - 3 * a * b * c^2 * d + - 26 * b^2 * c^2 * d + - 42 * a * c^3 * d + - 37 * b * c^3 * d + - 44 * a^2 * b * d^2 + - 6 * a * b^2 * d^2 + - 87 * a^2 * c * d^2 + - 35 * a * c^2 * d^2 + - 71 * b * c^2 * d^2 + - 27 * c^3 * d^2 + - 67 * a * b * d^3 + - 76 * a * c * d^3 + - 57 * c^2 * d^3 + - 15 * a * d^4 + - 82 * b * d^4 + - 23 * a^3 * b * e + - 36 * a * b^3 * e + - 72 * a^2 * c^2 * e + - 53 * a * b * c^2 * e + - 20 * b * c^3 * e + - 9 * a^3 * d * e + - 86 * a * b^2 * d * e + - 81 * b^3 * d * e + - 29 * b^2 * c * d * e + - 56 * b * c^2 * d * e + - 74 * c^3 * d * e + - 79 * b^2 * d^2 * e + - 86 * b * c * d^2 * e + - 49 * c^2 * d^2 * e + - 2 * a * d^3 * e + - 13 * b * d^3 * e + - 73 * c * d^3 * e + - 17 * a^3 * e^2 + - 47 * a^2 * b * e^2 + - 33 * a * b^2 * e^2 + - 15 * a^2 * c * e^2 + - 17 * a * b * c * e^2 + - 25 * b^2 * c * e^2 + - 46 * a^2 * d * e^2 + - 31 * b^2 * d * e^2 + - 36 * a * c * d * e^2 + - 39 * c^2 * d * e^2 + - 23 * b * d^2 * e^2 + - 86 * c * d^2 * e^2 + - 68 * a^2 * e^3 + - 31 * a * c * e^3 + - 20 * c^2 * e^3 + - 5 * a * d * e^3 + - 28 * c * d * e^3 + - 59 * b^2 * c^2 * f + - 68 * a * c^3 * f + - 75 * b * c^3 * f + - 5 * c^4 * f + - 56 * a^2 * c * d * f + - 28 * b^2 * c * d * f + - 44 * a * c^2 * d * f + - 44 * b^2 * d^2 * f + - 15 * a * d^3 * f + - 83 * b * d^3 * f + - 58 * a^3 * e * f + - 77 * a * b^2 * e * f + - 37 * a * c^2 * e * f + - 6 * b * c^2 * e * f + - 25 * c^3 * e * f + - 54 * a^2 * d * e * f + - 33 * a * b * e^2 * f + - 40 * b^2 * e^2 * f + - 87 * a * c * e^2 * f + - 10 * c^2 * e^2 * f + - 90 * a * d * e^2 * f + - 87 * b * d * e^2 * f + - 57 * d^2 * e^2 * f + - 82 * d * e^3 * f + - 65 * e^4 * f + - 60 * b^2 * c * f^2 + - 48 * a^2 * d * f^2 + - 39 * a * c * d * f^2 + - 48 * a^2 * e * f^2 + - 30 * a * b * e * f^2 + - 7 * a * c * e * f^2 + - 27 * c * d * e * f^2 + - 25 * a * e^2 * f^2 + - 41 * d * e^2 * f^2 + - 80 * e^3 * f^2 + - 71 * b^2 * f^3 + - 9 * c^2 * f^3 + - 64 * a * d * f^3 + - 47 * c * d * f^3 + - 40 * a * e * f^3 + - 20 * c * e * f^3 + - 14 * d * e * f^3 + - 20 * a * f^4 + - 47 * e * f^4, - 65 + - 43 * a + - 13 * c + - 66 * e + - 26 * a * b + - 8 * c * d + - 83 * d * e + - 85 * d * f + - 79 * e * f + - 19 * a^2 * b + - 39 * c^3 + - 14 * a * c * d + - 43 * c^2 * d + - 79 * a * d^2 + - 41 * c * d^2 + - 80 * d^3 + - 4 * a * b * e + - 72 * b^2 * e + - 5 * b * c * e + - 84 * c * d * e + - 21 * b * e^2 + - 5 * e^3 + - 61 * b^2 * f + - 30 * a * c * f + - 80 * c^2 * f + - 22 * b * d * f + - 15 * d * e * f + - 8 * a * f^2 + - 19 * b * f^2 + - 39 * d * f^2 + - 43 * a^4 + - 16 * a * b^3 + - 15 * a^3 * c + - 34 * a^2 * b * c + - 81 * a^2 * c^2 + - 10 * a * b * c^2 + - 30 * b^2 * c^2 + - 83 * a * c^3 + - 82 * a^3 * d + - 14 * a^2 * b * d + - 10 * a * b^2 * d + - 2 * b^3 * d + - 88 * a^2 * c * d + - 60 * c^3 * d + - 9 * a * b * d^2 + - 60 * b^2 * d^2 + - 34 * a * c * d^2 + - 36 * b * c * d^2 + - 59 * b * d^3 + - 38 * b^3 * e + - 59 * a^2 * c * e + - 81 * a * c^2 * e + - 56 * b * c^2 * e + - 87 * c^3 * e + - 6 * a^2 * d * e + - 40 * b * d^2 * e + - 35 * a^2 * e^2 + - 56 * a * b * e^2 + - 17 * b^2 * e^2 + - 75 * a * d * e^2 + - 3 * b * e^3 + - 17 * e^4 + - 33 * a^3 * f + - 68 * b^3 * f + - 65 * a^2 * c * f + - 53 * b^2 * c * f + - 45 * a * c^2 * f + - 36 * b * c^2 * f + - 5 * b^2 * d * f + - 7 * b * c * d * f + - 55 * c^2 * d * f + - 41 * a * d^2 * f + - 79 * d^3 * f + - 11 * a * b * e * f + - 84 * b^2 * e * f + - 78 * b * c * e * f + - 46 * b * d * e * f + - 10 * a * e^2 * f + - 39 * c * e^2 * f + - 74 * b^2 * f^2 + - 27 * b * d * f^2 + - 77 * c * d * f^2 + - c * e * f^2 + - 9 * e^2 * f^2 + - 59 * b * f^3 + - 18 * c * f^3 + - 20 * e * f^3 + - 62 * f^4 + - 22 * a^5 + - 24 * a^4 * b + - 73 * a^2 * b^2 * c + - 62 * b^4 * c + - 34 * a^3 * c^2 + - 71 * a^2 * b * c^2 + - 10 * a^2 * c^3 + - 53 * a * b * c^3 + - 2 * b * c^4 + - 29 * a^4 * d + - 54 * a^3 * c * d + - 40 * b^3 * c * d + - 65 * a^2 * c^2 * d + - 72 * a * b * c^2 * d + - 80 * b^2 * c^2 * d + - 64 * a * c^3 * d + - 59 * b * c^3 * d + - 13 * a^2 * b * d^2 + - 26 * a * b^2 * d^2 + - 20 * b * c^2 * d^2 + - 9 * a * c * d^3 + - 18 * c^2 * d^3 + - 59 * a * d^4 + - 50 * a^4 * e + - 67 * a^2 * b^2 * e + - 68 * a * b^3 * e + - 38 * b^4 * e + - 19 * a^2 * b * c * e + - 7 * a * b^2 * c * e + - 15 * b^3 * c * e + - 23 * a * b * c^2 * e + - 49 * b^2 * c^2 * e + - 63 * c^4 * e + - 25 * b^3 * d * e + - 10 * a^2 * c * d * e + - 8 * c^3 * d * e + - 14 * a * b * d^2 * e + - 27 * b * c * d^2 * e + - 80 * d^4 * e + - 60 * b^3 * e^2 + - 11 * a * b * d * e^2 + - 37 * b^2 * d * e^2 + - 71 * b * c * d * e^2 + - 86 * c^2 * d * e^2 + - 86 * b * d^2 * e^2 + - 12 * c * d^2 * e^2 + - 83 * b^2 * e^3 + - 19 * a * c * e^3 + - 32 * b * c * e^3 + - 63 * b * d * e^3 + - 59 * c * d * e^3 + - 82 * c * e^4 + - 74 * e^5 + - 68 * a^3 * b * f + - 30 * b^4 * f + - 85 * a^3 * c * f + - 45 * a^2 * c^2 * f + - 39 * b^2 * c^2 * f + - 71 * b * c^3 * f + - 73 * c^4 * f + - 4 * b^3 * d * f + - 78 * a^2 * c * d * f + - 83 * b^2 * c * d * f + - 7 * a * c^2 * d * f + - 6 * c^3 * d * f + - 3 * a^2 * d^2 * f + - 88 * b^2 * d^2 * f + - 35 * a * c * d^2 * f + - 40 * b * c * d^2 * f + - 52 * c^2 * d^2 * f + - 58 * d^4 * f + - 35 * a^3 * e * f + - 54 * a^2 * c * e * f + - 90 * b * c^2 * e * f + - 66 * a * b * d * e * f + - 40 * a * c * d * e * f + - 2 * b * c * d * e * f + - 81 * c * d^2 * e * f + - 53 * d^3 * e * f + - 9 * a^2 * e^2 * f + - 23 * b * d * e^2 * f + - 42 * a * e^3 * f + - 21 * c * e^3 * f + - 18 * b^3 * f^2 + - 49 * a^2 * c * f^2 + - 68 * a * c^2 * f^2 + - 90 * b * c^2 * f^2 + - 36 * c^3 * f^2 + - 59 * a * b * d * f^2 + - 34 * b^2 * d * f^2 + - 56 * b * c * d * f^2 + - 4 * b * d^2 * f^2 + - 28 * a^2 * e * f^2 + - 54 * b^2 * e * f^2 + - 80 * a * c * e * f^2 + - 56 * d^2 * e * f^2 + - 68 * b * e^2 * f^2 + - 21 * c * e^2 * f^2 + - 78 * b^2 * f^3 + - 5 * b * c * f^3, - 35 + - 32 * a + - 8 * b + - 27 * f + - 35 * a^2 + - 11 * a * b + - 67 * b^2 + - 51 * a * c + - 78 * b * c + - 65 * c^2 + - 7 * a * d + - 22 * a * e + - 15 * b * e + - 19 * c * f + - 43 * e * f + - 67 * f^2 + - 23 * a^3 + - 36 * a * b * c + - 62 * b^2 * c + - 74 * a * b * d + - 90 * b^2 * d + - 62 * a * c * d + - 14 * b * c * d + - 12 * a * d^2 + - 76 * c * d^2 + - 79 * d^3 + - 34 * a * b * e + - 23 * b^2 * e + - 3 * a * c * e + - 89 * b * c * e + - 85 * a * d * e + - 78 * b * d * e + - 78 * c * d * e + - 28 * d^2 * e + - 75 * a * e^2 + - 7 * d * e^2 + - 39 * b * c * f + - 50 * d^2 * f + - 79 * c * e * f + - 80 * e^2 * f + - 60 * b * f^2 + - 27 * f^3 + - 2 * a^3 * b + - 59 * a^3 * c + - 31 * a^2 * b * c + - 53 * a * b^2 * c + - 19 * b^3 * c + - 58 * a^2 * c^2 + - 16 * b * c^3 + - 38 * c^4 + - 31 * a^3 * d + - 39 * a^2 * b * d + - 38 * a^2 * c * d + - 32 * b * c * d^2 + - 5 * a * d^3 + - 58 * a * b^2 * e + - 4 * a^2 * c * e + - 3 * b^2 * c * e + - 3 * b * c * d * e + - 11 * c^2 * d * e + - 88 * c * d^2 * e + - 46 * a * b * e^2 + - 75 * a * d * e^2 + - 15 * b * e^3 + - 58 * c * e^3 + - 57 * d * e^3 + - 28 * a * b^2 * f + - 14 * b^3 * f + - 26 * a^2 * c * f + - 53 * a * b * d * f + - 6 * b * c * d * f + - 78 * c * d^2 * f + - 37 * d^3 * f + - 34 * a^2 * e * f + - 63 * a * b * e * f + - 5 * c * d * e * f + - 42 * d^2 * e * f + - 37 * a * e^2 * f + - 23 * c * e^2 * f + - 33 * a * b * f^2 + - 77 * b^2 * f^2 + - 70 * b * c * f^2 + - 9 * a * d * f^2 + - 66 * d^2 * f^2 + - 14 * a * e * f^2 + - 63 * e^2 * f^2 + - 2 * b * f^3 + - 82 * c * f^3 + - 9 * a^5 + - 4 * a * b^4 + - 30 * b^5 + - 31 * a^3 * b * c + - 30 * a^2 * b^2 * c + - 39 * a * b * c^3 + - 82 * b * c^4 + - 8 * a^4 * d + - 44 * b^4 * d + - 8 * a^2 * b * c * d + - 28 * b^2 * c^2 * d + - 9 * a * c^3 * d + - 32 * a^2 * b * d^2 + - 16 * a * b^2 * d^2 + - 21 * b^3 * d^2 + - 25 * a * b * c * d^2 + - 42 * a * d^4 + - 41 * b * d^4 + - 79 * d^5 + - 4 * b^3 * c * e + - 2 * a * c^3 * e + - 26 * a^2 * b * d * e + - 82 * b^2 * c * d * e + - 88 * a * c^2 * d * e + - 73 * a * b * d^2 * e + - 56 * b * c * d^2 * e + - 19 * c^2 * d^2 * e + - 70 * b * d^3 * e + - 88 * d^4 * e + - 78 * a * b^2 * e^2 + - 62 * b * c^2 * e^2 + - 79 * c^3 * e^2 + - 65 * a * b * d * e^2 + - 53 * b^2 * d * e^2 + - 60 * a * c * d * e^2 + - 60 * c^2 * d * e^2 + - 18 * b * d^2 * e^2 + - 12 * a^2 * e^3 + - 12 * b^2 * e^3 + - 37 * b * c * e^3 + - 54 * d^2 * e^3 + - 69 * b * e^4 + - 89 * c * e^4 + - 6 * d * e^4 + - 79 * e^5 + - 40 * a^4 * f + - 25 * a^3 * b * f + - 71 * a * b^3 * f + - 74 * b^4 * f + - 76 * a^3 * c * f + - 64 * a * b^2 * c * f + - 21 * a^2 * c^2 * f + - 26 * b^2 * c^2 * f + - 12 * a * c^3 * f + - 28 * a^2 * b * d * f + - 65 * a * b^2 * d * f + - 44 * b^3 * d * f + - 4 * a * c^2 * d * f + - 68 * b * c * d^2 * f + - 12 * b * d^3 * f + - 76 * d^4 * f + - 34 * a^2 * b * e * f + - 50 * a * b^2 * e * f + - 55 * b^3 * e * f + - 34 * a * b * c * e * f + - 38 * c^3 * e * f + - 50 * a^2 * d * e * f + - 62 * a * b * d * e * f + - 68 * a * c * d * e * f + - 47 * a^2 * e^2 * f + - 11 * c^2 * e^2 * f + - 10 * b * d * e^2 * f + - 68 * c * d * e^2 * f + - 65 * d * e^3 * f + - 83 * a^2 * b * f^2 + - 39 * b * c^2 * f^2 + - 21 * c^3 * f^2 + - 9 * a * b * d * f^2 + - 64 * b * c * d * f^2 + - 85 * a^2 * e * f^2 + - 51 * a * b * e * f^2 + - 51 * b^2 * e * f^2 + - 28 * c^2 * e * f^2 + - 43 * b * d * e * f^2 + - 29 * c * d * e * f^2 + - 84 * d * e^2 * f^2 + - 59 * e^3 * f^2 + - 2 * a * c * f^3 + - b * d * f^3 + - 90 * d * e * f^3 + - 16 * e^2 * f^3 + - 8 * a * f^4 + - 7 * b * f^4 + - 46 * c * f^4 + - 49 * d * f^4 + - 31 * e * f^4, - ], - ), - ) - for i in ideals - runb("sparseid(3,0,5,100-(4*10),90)", i, S) - runb2("sparseid(3,0,5,100-(4*10),90)", i, S) - end - ideals = [] - - prinln("Completed examples.") -end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl index 40a31c745..ac107ed14 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -658,7 +658,7 @@ function fractal_walk( ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println(PertVecs) - println("FacrtalWalk_standard results") + println("FractalWalk_standard results") println("Crossed Cones in: ") Gb = fractal_recursiv(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) @@ -695,10 +695,10 @@ function fractal_recursiv( return G else i2 = - @ballocated [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 i = - @belapsed [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -861,10 +861,10 @@ function fractal_walk_recursiv_startorder( return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -1012,9 +1012,9 @@ function fractal_walk_recursive_lex( return G else i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] println(PertVecs) @@ -1170,9 +1170,9 @@ function fractal_walk_look_ahead_recursiv( return G else i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue @@ -1239,7 +1239,7 @@ function fractal_walk_look_ahead_recursiv( j2 = p G = Singular.std(H, complete_reduction = true) - df = DataFrame( + df2 = DataFrame( a2 = [a2], b2 = [b2], z2 = [z2], @@ -1253,9 +1253,22 @@ function fractal_walk_look_ahead_recursiv( j2 = [j2], k2 = [k2], ) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + ) savea(df, "fractalWalklookahead") savea(df2, "allocsFractalWalklookahead") - cleardf2() cleardf() R = Rn @@ -1320,10 +1333,10 @@ function fractal_walk_combined( return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl index f6b537ee5..aa58b489a 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl @@ -130,7 +130,6 @@ function runb( prepareExampleElapsed(v) println("Computing deglex-Basis") - stime =@belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 I = Singular.std(ideal, complete_reduction = true) println("Benchmarking GroebnerWalk") @@ -147,14 +146,7 @@ function runb( push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) - println("Computing lex-Basis") - ttime = @belapsed Singular.std( - Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), - complete_reduction = true, - ) evals=1 samples =1 - df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) - savea(df, "SingularComputationTimings") s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), complete_reduction = true, diff --git a/src/GroebnerWalkFinal/Benchmarking/parser.jl b/src/GroebnerWalkFinal/Benchmarking/parser.jl index 96062daef..f1daafe13 100644 --- a/src/GroebnerWalkFinal/Benchmarking/parser.jl +++ b/src/GroebnerWalkFinal/Benchmarking/parser.jl @@ -3,17 +3,19 @@ include("readWriteHelper.jl") using CSV using DataFrames -function parseideal() - csv_reader = CSV.File("Beispiele3Variablen.txt") +function parseideal(k::String) + csv_reader = CSV.File("Beispiele"*"$k"*"Variablen.txt") for row in csv_reader poly = collect(split("$(row.generator)", "")) result = "" println("from", poly) d = length(poly) + for i = 1:d a = poly[i] if i == d result = result * a + result = result* "," println("to", result) break end @@ -41,8 +43,8 @@ function parseideal() end end end - df = DataFrame(generator = result) - savea(df, "cBeispiele3Variablen.txt") + df = DataFrame(generator = Symbol(result)) + savea(df, "cBeispiele"*"$k"*"Variablen") cd("/Users/JordiWelp/Results/1ideals") end diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 1b052aa60..e86ceb239 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -61,15 +61,15 @@ Performs a lifting step in the Groebner Walk. See Fukuda et. al. """=# function lift_fractal_walk( G::Singular.sideal, - Gw::Singular.sideal, R::Singular.PolyRing, + H::Singular.sideal, Rn::Singular.PolyRing, ) G.isGB = true rest = [ change_ring(gen, Rn) - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in Singular.gens(Gw) + gen in Singular.gens(H) ] G = Singular.Ideal(Rn, [Rn(x) for x in rest]) G.isGB = true diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index cd0b24b23..309417372 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -659,7 +659,7 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) - if tryparse(string(w), Int32) == nothing + if tryparse(Int32,string(w)) == nothing println("w bigger than int32") return G end From 92659185f60423c32378ffa3197833b186164985 Mon Sep 17 00:00:00 2001 From: welpj Date: Fri, 31 Dec 2021 16:11:03 +0100 Subject: [PATCH 45/85] feat: Testsets --- .../Benchmarking/BenchmarkHelper | 10 +- .../Benchmarking/BspEinzeln.jl | 546 +++-------------- .../GroebnerWalkFinalBenchmarkProcedures.jl | 7 +- src/GroebnerWalkFinal/Examples | 562 ++++++++++++++++++ src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 3 +- src/GroebnerWalkFinal/tests | 140 +++++ 6 files changed, 782 insertions(+), 486 deletions(-) create mode 100644 src/GroebnerWalkFinal/Examples create mode 100644 src/GroebnerWalkFinal/tests diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper index 03808e91b..402c6db18 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper @@ -279,7 +279,7 @@ function prepareExampleElapsed(v::String) example = [v], ) for i in 2:10 - savew(df, "pertubedWalk",i) + savea(df, "pertubedWalk",i) end df = DataFrame( @@ -299,7 +299,7 @@ function prepareExampleElapsed(v::String) nGens = ["-"], initials = ["-"], stdh = ["-"], - liftGW2 = ["liftGW2"], + liftGW2 = ["-"], lift = ["-"], interred = ["-"], inCone = ["-"], @@ -314,7 +314,7 @@ function prepareExampleElapsed(v::String) nGens = ["-"], initials = ["-"], stdh = ["-"], - liftGW2 = ["liftGW2"], + liftGW2 = ["-"], lift = ["-"], interred = ["-"], inCone = ["-"], @@ -329,7 +329,7 @@ function prepareExampleElapsed(v::String) nGens = ["-"], initials = ["-"], stdh = ["-"], - liftGW2 = ["liftGW2"], + liftGW2 = ["-"], lift = ["-"], interred = ["-"], inCone = ["-"], @@ -344,7 +344,7 @@ function prepareExampleElapsed(v::String) nGens = ["-"], initials = ["-"], stdh = ["-"], - liftGW2 = ["liftGW2"], + liftGW2 = ["-"], lift = ["-"], interred = ["-"], inCone = ["-"], diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 04d23dbc4..976d918d4 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -4,6 +4,7 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") include("readWriteHelper.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples") @@ -15,568 +16,159 @@ function runAllSingleExample() prepare2() prepareAlloc() - #Katsura 5 - dim = 5 - ve = [1, 1, 1, 1, 1] + id = katsura5() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (v, u, t, z, y) = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2 * z * y + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t - f4 = 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 - I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) runAll("Katsura5", I, S, StartOrd, TarOrd) #Katsura6 - dim = 6 - ve = [1, 1, 1, 1, 1, 1] + id = katsura6() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (v, u, t, z, y, x) = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y", "x"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2 * x * y + 2 * y * z + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * x * z + 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t - f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y - f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) runAll("Katsura6", I, S, StartOrd, TarOrd) - dim = 7 - ve = [1, 1, 1, 1, 1, 1, 1] + example = "Cyclic7" + id = cyclic7() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - f1 = x1 + x2 + x3 + x4 + x5 + x6 + x7 - f2 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 * x7 + x6 * x7 - f3 = - x1 * x2 * x3 + - x2 * x3 * x4 + - x3 * x4 * x5 + - x4 * x5 * x6 + - x1 * x2 * x7 + - x1 * x6 * x7 + - x5 * x6 * x7 - f4 = - x1 * x2 * x3 * x4 + - x2 * x3 * x4 * x5 + - x3 * x4 * x5 * x6 + - x1 * x2 * x3 * x7 + - x1 * x2 * x6 * x7 + - x1 * x5 * x6 * x7 + - x4 * x5 * x6 * x7 - f5 = - x1 * x2 * x3 * x4 * x5 + - x2 * x3 * x4 * x5 * x6 + - x1 * x2 * x3 * x4 * x7 + - x1 * x2 * x3 * x6 * x7 + - x1 * x2 * x5 * x6 * x7 + - x1 * x4 * x5 * x6 * x7 + - x3 * x4 * x5 * x6 * x7 - f6 = - x1 * x2 * x3 * x4 * x5 * x6 + - x1 * x2 * x3 * x4 * x5 * x7 + - x1 * x2 * x3 * x4 * x6 * x7 + - x1 * x2 * x3 * x5 * x6 * x7 + - x1 * x2 * x4 * x5 * x6 * x7 + - x1 * x3 * x4 * x5 * x6 * x7 + - x2 * x3 * x4 * x5 * x6 * x7 - f7 = x1 * x2 * x3 * x4 * x5 * x6 * x7 - 1 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) runAll(example, I, S, StartOrd, TarOrd) - dim = 6 - ve = [1, 1, 1, 1, 1, 1] example = "Cyclic6" + id = cyclic6() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - - f1 = x1 + x2 + x3 + x4 + x5 + x6 - f2 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x1 * x6 + x5 * x6 - f3 = - x1 * x2 * x3 + - x2 * x3 * x4 + - x3 * x4 * x5 + - x1 * x2 * x6 + - x1 * x5 * x6 + - x4 * x5 * x6 - f4 = - x1 * x2 * x3 * x4 + - x2 * x3 * x4 * x5 + - x1 * x2 * x3 * x6 + - x1 * x2 * x5 * x6 + - x1 * x4 * x5 * x6 + - x3 * x4 * x5 * x6 - f5 = - x1 * x2 * x3 * x4 * x5 + - x1 * x2 * x3 * x4 * x6 + - x1 * x2 * x3 * x5 * x6 + - x1 * x2 * x4 * x5 * x6 + - x1 * x3 * x4 * x5 * x6 + - x2 * x3 * x4 * x5 * x6 - f6 = x1 * x2 * x3 * x4 * x5 * x6 - 1 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) runAll(example, I, S, StartOrd, TarOrd) - dim = 5 - ve = [1, 1, 1, 1, 1] + example = "Cyclic5" + id = cyclic5() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (v, w, x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["v", "w", "x", "y", "z"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = v + w + x + y + z - f2 = v * w + w * x + x * y + v * z + y * z - f3 = v * w * x + w * x * y + v * w * z + v * y * z + x * y * z - f4 = - v * w * x * y + - v * w * x * z + - v * w * y * z + - v * x * y * z + - w * x * y * z - f5 = v * w * x * y * z - 1 - - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) runAll(example, I, S, StartOrd, TarOrd) - dim = 6 - ve = [1, 1, 1, 1, 1, 1] example = "eco6" + id = eco6() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - - f1 = x1 + x2 + x3 + x4 + x5 + 1 - f2 = x5 * x6 - 5 - f3 = x1 * x5 * x6 + x4 * x6 - 4 - f4 = x1 * x4 * x6 + x2 * x5 * x6 + x3 * x6 - 3 - f5 = x1 * x3 * x6 + x2 * x4 * x6 + x3 * x5 * x6 + x2 * x6 - 2 - f6 = x1 * x2 * x6 + x2 * x3 * x6 + x3 * x4 * x6 + x4 * x5 * x6 + x1 * x6 - 1 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) runAll(example, I, S, StartOrd, TarOrd) - - dim = 6 - ve = [1, 1, 1, 1, 1, 1] example = "eco7" + id = eco7() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = x1 + x2 + x3 + x4 + x5 + x6 + 1 - f2 = x6 * x7 - 6 - f3 = x1 * x6 * x7 + x5 * x7 - 5 - f4 = x1 * x5 * x7 + x2 * x6 * x7 + x4 * x7 - 4 - f5 = x1 * x4 * x7 + x2 * x5 * x7 + x3 * x6 * x7 + x3 * x7 - 3 - f6 = x1 * x3 * x7 + x2 * x4 * x7 + x3 * x5 * x7 + x4 * x6 * x7 + x2 * x7 - 2 - f7 = - x1 * x2 * x7 + - x2 * x3 * x7 + - x3 * x4 * x7 + - x4 * x5 * x7 + - x5 * x6 * x7 + - x1 * x7 - 1 - - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) runAll(example, I, S, StartOrd, TarOrd) - - - dim = 5 - ve = [1, 1, 1, 1, 1] example = "noon5" + id = noon5() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = - 10 * x1^2 * x5 + 10 * x2^2 * x5 + 10 * x3^2 * x5 + 10 * x4^2 * x5 - - 11 * x5 + 10 - f2 = - 10 * x1^2 * x4 + 10 * x2^2 * x4 + 10 * x3^2 * x4 + 10 * x4 * x5^2 - - 11 * x4 + 10 - f3 = - 10 * x1^2 * x3 + 10 * x2^2 * x3 + 10 * x3 * x4^2 + 10 * x3 * x5^2 - - 11 * x3 + 10 - f4 = - 10 * x1 * x2^2 + 10 * x1 * x3^2 + 10 * x1 * x4^2 + 10 * x1 * x5^2 - - 11 * x1 + 10 - f5 = - 10 * x1^2 * x2 + 10 * x2 * x3^2 + 10 * x2 * x4^2 + 10 * x2 * x5^2 - - 11 * x2 + 10 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) runAll(example, I, S, StartOrd, TarOrd) - dim = 6 - ve = [1, 1, 1, 1, 1, 1] + example = "noon6" + id = noon6() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = - 10 * x1^2 * x6 + - 10 * x2^2 * x6 + - 10 * x3^2 * x6 + - 10 * x4^2 * x6 + - 10 * x5^2 * x6 - 11 * x6 + 10 - f2 = - 10 * x1^2 * x5 + - 10 * x2^2 * x5 + - 10 * x3^2 * x5 + - 10 * x4^2 * x5 + - 10 * x5 * x6^2 - 11 * x5 + 10 - f3 = - 10 * x1^2 * x4 + - 10 * x2^2 * x4 + - 10 * x3^2 * x4 + - 10 * x4 * x5^2 + - 10 * x4 * x6^2 - 11 * x4 + 10 - f4 = - 10 * x1^2 * x3 + - 10 * x2^2 * x3 + - 10 * x3 * x4^2 + - 10 * x3 * x5^2 + - 10 * x3 * x6^2 - 11 * x3 + 10 - f5 = - 10 * x1 * x2^2 + - 10 * x1 * x3^2 + - 10 * x1 * x4^2 + - 10 * x1 * x5^2 + - 10 * x1 * x6^2 - 11 * x1 + 10 - f6 = - 10 * x1^2 * x2 + - 10 * x2 * x3^2 + - 10 * x2 * x4^2 + - 10 * x2 * x5^2 + - 10 * x2 * x6^2 - 11 * x2 + 10 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) runAll(example, I, S, StartOrd, TarOrd) - - dim = 7 - ve = [1, 1, 1, 1, 1, 1, 1] example = "noon7" + id = noon7() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = - 10 * x1^2 * x7 + - 10 * x2^2 * x7 + - 10 * x3^2 * x7 + - 10 * x4^2 * x7 + - 10 * x5^2 * x7 + - 10 * x6^2 * x7 - 11 * x7 + 10 - f2 = - 10 * x1^2 * x6 + - 10 * x2^2 * x6 + - 10 * x3^2 * x6 + - 10 * x4^2 * x6 + - 10 * x5^2 * x6 + - 10 * x6 * x7^2 - 11 * x6 + 10 - f3 = - 10 * x1^2 * x5 + - 10 * x2^2 * x5 + - 10 * x3^2 * x5 + - 10 * x4^2 * x5 + - 10 * x5 * x6^2 + - 10 * x5 * x7^2 - 11 * x5 + 10 - f4 = - 10 * x1^2 * x4 + - 10 * x2^2 * x4 + - 10 * x3^2 * x4 + - 10 * x4 * x5^2 + - 10 * x4 * x6^2 + - 10 * x4 * x7^2 - 11 * x4 + 10 - f5 = - 10 * x1^2 * x3 + - 10 * x2^2 * x3 + - 10 * x3 * x4^2 + - 10 * x3 * x5^2 + - 10 * x3 * x6^2 + - 10 * x3 * x7^2 - 11 * x3 + 10 - f6 = - 10 * x1 * x2^2 + - 10 * x1 * x3^2 + - 10 * x1 * x4^2 + - 10 * x1 * x5^2 + - 10 * x1 * x6^2 + - 10 * x1 * x7^2 - 11 * x1 + 10 - f7 = - 10 * x1^2 * x2 + - 10 * x2 * x3^2 + - 10 * x2 * x4^2 + - 10 * x2 * x5^2 + - 10 * x2 * x6^2 + - 10 * x2 * x7^2 - 11 * x2 + 10 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) runAll(example, I, S, StartOrd, TarOrd) - - - dim = 8 - ve = [1, 1, 1, 1, 1, 1, 1, 1] example = "noon8" + id = noon8() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) - - f1 = - 10 * x1^2 * x8 + - 10 * x2^2 * x8 + - 10 * x3^2 * x8 + - 10 * x4^2 * x8 + - 10 * x5^2 * x8 + - 10 * x6^2 * x8 + - 10 * x7^2 * x8 - 11 * x8 + 10 - f2 = - 10 * x1^2 * x7 + - 10 * x2^2 * x7 + - 10 * x3^2 * x7 + - 10 * x4^2 * x7 + - 10 * x5^2 * x7 + - 10 * x6^2 * x7 + - 10 * x7 * x8^2 - 11 * x7 + 10 - f3 = - 10 * x1^2 * x6 + - 10 * x2^2 * x6 + - 10 * x3^2 * x6 + - 10 * x4^2 * x6 + - 10 * x5^2 * x6 + - 10 * x6 * x7^2 + - 10 * x6 * x8^2 - 11 * x6 + 10 - f4 = - 10 * x1^2 * x5 + - 10 * x2^2 * x5 + - 10 * x3^2 * x5 + - 10 * x4^2 * x5 + - 10 * x5 * x6^2 + - 10 * x5 * x7^2 + - 10 * x5 * x8^2 - 11 * x5 + 10 - f5 = - 10 * x1^2 * x4 + - 10 * x2^2 * x4 + - 10 * x3^2 * x4 + - 10 * x4 * x5^2 + - 10 * x4 * x6^2 + - 10 * x4 * x7^2 + - 10 * x4 * x8^2 - 11 * x4 + 10 - f6 = - 10 * x1^2 * x3 + - 10 * x2^2 * x3 + - 10 * x3 * x4^2 + - 10 * x3 * x5^2 + - 10 * x3 * x6^2 + - 10 * x3 * x7^2 + - 10 * x3 * x8^2 - 11 * x3 + 10 - f7 = - 10 * x1 * x2^2 + - 10 * x1 * x3^2 + - 10 * x1 * x4^2 + - 10 * x1 * x5^2 + - 10 * x1 * x6^2 + - 10 * x1 * x7^2 + - 10 * x1 * x8^2 - 11 * x1 + 10 - f8 = - 10 * x1^2 * x2 + - 10 * x2 * x3^2 + - 10 * x2 * x4^2 + - 10 * x2 * x5^2 + - 10 * x2 * x6^2 + - 10 * x2 * x7^2 + - 10 * x2 * x8^2 - 11 * x2 + 10 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) runAll(example, I, S, StartOrd, TarOrd) - - dim = 7 - ve = [1, 1, 1, 1, 1, 1, 1] example = "redeco7" + id = redeco7() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1, x2, x3, x4, u7, x5, x6) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "u7", "x5", "x6"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) - f1 = -6 * u7 + x6 - f2 = x1 + x2 + x3 + x4 + x5 + x6 + 1 - f3 = x1 * x6 - 5 * u7 + x5 - f4 = x1 * x5 + x2 * x6 + x4 - 4 * u7 - f5 = x1 * x4 + x2 * x5 + x3 * x6 + x3 - 3 * u7 - f6 = x1 * x3 + x2 * x4 + x3 * x5 + x4 * x6 + x2 - 2 * u7 - f7 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 - u7 + example = "redeco8" + id = redeco8() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) + example = "wang91" + id = wang91() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) runAll(example, I, S, StartOrd, TarOrd) - dim = 8 - ve = [1, 1, 1, 1, 1,1,1,1] - example ="redeco8" + example = "cohn4" + id = cohn4() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) - R, (x1,x2,x3,x4,u8,x5,x6,x7) = Singular.PolynomialRing( - Singular.QQ, - ["x1","x2","x3","x4","u8","x5","x6","x7"], - ordering = Singular.ordering_M(StartOrd), - ) S = change_order(R, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) - f1 =-7*u8+x7 - f2 =x1+x2+x3+x4+x5+x6+x7+1 - f3 =x1*x7-6*u8+x6 - f4 =x1*x6+x2*x7+x5-5*u8 - f5 =x1*x5+x2*x6+x3*x7+x4-4*u8 - f6 =x1*x4+x2*x5+x3*x6+x4*x7+x3-3*u8 - f7 =x1*x3+x2*x4+x3*x5+x4*x6+x5*x7+x2-2*u8 - f8 =x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x6*x7+x1-u8 - - I = Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7, f8]) - runAll(example, I, S, StartOrd, TarOrd) - - - dim = 6 - ve = [1, 1, 1, 1, 1,1] - example ="Wang-91" - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (x3,x2,x1,x0,b,a) = Singular.PolynomialRing( - Singular.QQ, - ["x3","x2","x1","x0","b","a"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - - f1 =3*x2*x1*a+3*x0^2 - f2 =3*x2*x1*b+3*x3^2 - f3 =3*x3*x1*b+3*x1*x0*a+3*x2^2 - f4 =3*x3*x2*b+3*x2*x0*a+3*x1^2 - - I = Singular.Ideal(R, [f1, f2,f3,f4]) - runAll(example, I, S, StartOrd, TarOrd) - - - - dim = 4 - ve = [1, 1, 1, 1] - example ="cohn4" - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (x,y,z,t) = Singular.PolynomialRing( - Singular.QQ, - ["x","y","z","t"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - - f1 =-x^3*y^2+2*x^2*y^2*z-x^2*y*z^2-144*x^2*y^2-207*x^2*y*z+288*x*y^2*z+78*x*y*z^2+x*z^3-3456*x^2*y-5184*x*y^2-9504*x*y*z-432*x*z^2-248832*x*y+62208*x*z-2985984*x - f2 =y^3*t^3-y^2*z*t^3+4*y^3*t^2-2*y^2*z*t^2+72*y^2*t^3+71*y*z*t^3+288*y^2*t^2+360*y*z*t^2+6*z^2*t^2+1728*y*t^3-464*z*t^3+432*y*z*t+8*z^2*t+6912*y*t^2-4320*z*t^2+13824*t^3+z^2-13824*z*t+55296*t^2-13824*z - f3 =x^2*y*t^3-2*x*y^2*t^3+y^3*t^3+8*x^2*y*t^2-12*x*y^2*t^2+4*y^3*t^2-24*x*y*t^3+24*y^2*t^3+20*x^2*y*t-20*x*y^2*t-160*x*y*t^2+96*y^2*t^2+128*x*t^3+16*x^2*y+96*x*y*t+2304*x*t^2+1152*x*y+13824*x*t+27648*x - f4 =-x^3*z*t^2+x^2*z^2*t^2-6*x^3*z*t+4*x^2*z^2*t+32*x^3*t^2-72*x^2*z*t^2-87*x*z^2*t^2-z^3*t^2-8*x^3*z-432*x^2*z*t-414*x*z^2*t+2592*x*z*t^2+864*z^2*t^2-1728*x^2*z-20736*x*z*t+3456*z^2*t-186624*z*t^2-124416*x*z-1492992*z*t-2985984*z - I = Singular.Ideal(R, [f1, f2,f3,f4]) - runAll(example, I, S, StartOrd, TarOrd) - - - - dim = 3 - ve = [9, 9, 8] - example ="Oberfranz" - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (x1,x2,x3) = Singular.PolynomialRing( - Singular.QQ, - ["x1","x2","x3"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - f1=x2^3+x1*x2*x3+x2^2*x3+x1*x3^3 - f2=3+x1*x2+x1^2*x2+x2^2*x3 - - I = Singular.Ideal(R, [f1, f2]) - runAll(example, I, S, StartOrd, TarOrd) + example = "of" + id = oberfr() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + runAll(example, I, S, StartOrd, TarOrd) end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl index ac107ed14..6935ef904 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl @@ -700,6 +700,7 @@ function fractal_recursiv( i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println(PertVecs) continue end end @@ -857,7 +858,6 @@ function fractal_walk_recursiv_startorder( @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 - println(PertVecs[p], " in depth", p) return G else i2 = @@ -866,6 +866,8 @@ function fractal_walk_recursiv_startorder( i = @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println(PertVecs) + continue end end @@ -1022,6 +1024,7 @@ function fractal_walk_recursive_lex( end end if t == 1 && p == 1 + println("up in: ", p, " with: ", w) return fractal_walk_recursive_lex(G, S, T, PertVecs, p + 1) else w = w + t * (PertVecs[p] - w) @@ -1286,7 +1289,7 @@ function fractal_walk_combined( ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println("fractal_walk_withStartorder results") + println("fractal_walk_combined results") println("Crossed Cones in: ") Gb = fractal_walk_combined(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) diff --git a/src/GroebnerWalkFinal/Examples b/src/GroebnerWalkFinal/Examples new file mode 100644 index 000000000..2066d283a --- /dev/null +++ b/src/GroebnerWalkFinal/Examples @@ -0,0 +1,562 @@ +function katsura5() + dim = 5 + ve = [1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + R, (v, u, t, z, y) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v + f2 = 2 * z * y + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t + f4 = 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + return Singular.Ideal(R, [f1, f2, f3, f4, f5]) +end + + +#Katsura6 +function katsura6() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(ve, :lex) + R, (v, u, t, z, y, x) = Singular.PolynomialRing( + Singular.QQ, + ["v", "u", "t", "z", "y", "x"], + ordering = Singular.ordering_M(StartOrd), + ) + f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v + f2 = 2 * x * y + 2 * y * z + 2 * z * t + 2 * t * u + 2 * u * v - u + f3 = 2 * x * z + 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t + f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z + f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y + f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) +end + +function cyclic7() + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example = "Cyclic7" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], + ordering = Singular.ordering_M(StartOrd), + ) + f1 = x1 + x2 + x3 + x4 + x5 + x6 + x7 + f2 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 * x7 + x6 * x7 + f3 = + x1 * x2 * x3 + + x2 * x3 * x4 + + x3 * x4 * x5 + + x4 * x5 * x6 + + x1 * x2 * x7 + + x1 * x6 * x7 + + x5 * x6 * x7 + f4 = + x1 * x2 * x3 * x4 + + x2 * x3 * x4 * x5 + + x3 * x4 * x5 * x6 + + x1 * x2 * x3 * x7 + + x1 * x2 * x6 * x7 + + x1 * x5 * x6 * x7 + + x4 * x5 * x6 * x7 + f5 = + x1 * x2 * x3 * x4 * x5 + + x2 * x3 * x4 * x5 * x6 + + x1 * x2 * x3 * x4 * x7 + + x1 * x2 * x3 * x6 * x7 + + x1 * x2 * x5 * x6 * x7 + + x1 * x4 * x5 * x6 * x7 + + x3 * x4 * x5 * x6 * x7 + f6 = + x1 * x2 * x3 * x4 * x5 * x6 + + x1 * x2 * x3 * x4 * x5 * x7 + + x1 * x2 * x3 * x4 * x6 * x7 + + x1 * x2 * x3 * x5 * x6 * x7 + + x1 * x2 * x4 * x5 * x6 * x7 + + x1 * x3 * x4 * x5 * x6 * x7 + + x2 * x3 * x4 * x5 * x6 * x7 + f7 = x1 * x2 * x3 * x4 * x5 * x6 * x7 - 1 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) +end + + +function cyclic6() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "Cyclic6" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = x1 + x2 + x3 + x4 + x5 + x6 + f2 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x1 * x6 + x5 * x6 + f3 = + x1 * x2 * x3 + + x2 * x3 * x4 + + x3 * x4 * x5 + + x1 * x2 * x6 + + x1 * x5 * x6 + + x4 * x5 * x6 + f4 = + x1 * x2 * x3 * x4 + + x2 * x3 * x4 * x5 + + x1 * x2 * x3 * x6 + + x1 * x2 * x5 * x6 + + x1 * x4 * x5 * x6 + + x3 * x4 * x5 * x6 + f5 = + x1 * x2 * x3 * x4 * x5 + + x1 * x2 * x3 * x4 * x6 + + x1 * x2 * x3 * x5 * x6 + + x1 * x2 * x4 * x5 * x6 + + x1 * x3 * x4 * x5 * x6 + + x2 * x3 * x4 * x5 * x6 + f6 = x1 * x2 * x3 * x4 * x5 * x6 - 1 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) +end + +function cyclic5() + dim = 5 + ve = [1, 1, 1, 1, 1] + example = "Cyclic5" + StartOrd = ordering_as_matrix(ve, :lex) + R, (v, w, x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["v", "w", "x", "y", "z"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = v + w + x + y + z + f2 = v * w + w * x + x * y + v * z + y * z + f3 = v * w * x + w * x * y + v * w * z + v * y * z + x * y * z + f4 = + v * w * x * y + + v * w * x * z + + v * w * y * z + + v * x * y * z + + w * x * y * z + f5 = v * w * x * y * z - 1 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5]) +end + +function eco6() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "eco6" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + + + f1 = x1 + x2 + x3 + x4 + x5 + 1 + f2 = x5 * x6 - 5 + f3 = x1 * x5 * x6 + x4 * x6 - 4 + f4 = x1 * x4 * x6 + x2 * x5 * x6 + x3 * x6 - 3 + f5 = x1 * x3 * x6 + x2 * x4 * x6 + x3 * x5 * x6 + x2 * x6 - 2 + f6 = x1 * x2 * x6 + x2 * x3 * x6 + x3 * x4 * x6 + x4 * x5 * x6 + x1 * x6 - 1 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) +end + +function eco7() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "eco7" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = x1 + x2 + x3 + x4 + x5 + x6 + 1 + f2 = x6 * x7 - 6 + f3 = x1 * x6 * x7 + x5 * x7 - 5 + f4 = x1 * x5 * x7 + x2 * x6 * x7 + x4 * x7 - 4 + f5 = x1 * x4 * x7 + x2 * x5 * x7 + x3 * x6 * x7 + x3 * x7 - 3 + f6 = x1 * x3 * x7 + x2 * x4 * x7 + x3 * x5 * x7 + x4 * x6 * x7 + x2 * x7 - 2 + f7 = + x1 * x2 * x7 + + x2 * x3 * x7 + + x3 * x4 * x7 + + x4 * x5 * x7 + + x5 * x6 * x7 + + x1 * x7 - 1 + + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) +end + +function noon5() + dim = 5 + ve = [1, 1, 1, 1, 1] + example = "noon5" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = + 10 * x1^2 * x5 + 10 * x2^2 * x5 + 10 * x3^2 * x5 + 10 * x4^2 * x5 - + 11 * x5 + 10 + f2 = + 10 * x1^2 * x4 + 10 * x2^2 * x4 + 10 * x3^2 * x4 + 10 * x4 * x5^2 - + 11 * x4 + 10 + f3 = + 10 * x1^2 * x3 + 10 * x2^2 * x3 + 10 * x3 * x4^2 + 10 * x3 * x5^2 - + 11 * x3 + 10 + f4 = + 10 * x1 * x2^2 + 10 * x1 * x3^2 + 10 * x1 * x4^2 + 10 * x1 * x5^2 - + 11 * x1 + 10 + f5 = + 10 * x1^2 * x2 + 10 * x2 * x3^2 + 10 * x2 * x4^2 + 10 * x2 * x5^2 - + 11 * x2 + 10 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5]) +end + +function noon6() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "noon6" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = + 10 * x1^2 * x6 + + 10 * x2^2 * x6 + + 10 * x3^2 * x6 + + 10 * x4^2 * x6 + + 10 * x5^2 * x6 - 11 * x6 + 10 + f2 = + 10 * x1^2 * x5 + + 10 * x2^2 * x5 + + 10 * x3^2 * x5 + + 10 * x4^2 * x5 + + 10 * x5 * x6^2 - 11 * x5 + 10 + f3 = + 10 * x1^2 * x4 + + 10 * x2^2 * x4 + + 10 * x3^2 * x4 + + 10 * x4 * x5^2 + + 10 * x4 * x6^2 - 11 * x4 + 10 + f4 = + 10 * x1^2 * x3 + + 10 * x2^2 * x3 + + 10 * x3 * x4^2 + + 10 * x3 * x5^2 + + 10 * x3 * x6^2 - 11 * x3 + 10 + f5 = + 10 * x1 * x2^2 + + 10 * x1 * x3^2 + + 10 * x1 * x4^2 + + 10 * x1 * x5^2 + + 10 * x1 * x6^2 - 11 * x1 + 10 + f6 = + 10 * x1^2 * x2 + + 10 * x2 * x3^2 + + 10 * x2 * x4^2 + + 10 * x2 * x5^2 + + 10 * x2 * x6^2 - 11 * x2 + 10 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) +end + +function noon7() + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example = "noon7" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = + 10 * x1^2 * x7 + + 10 * x2^2 * x7 + + 10 * x3^2 * x7 + + 10 * x4^2 * x7 + + 10 * x5^2 * x7 + + 10 * x6^2 * x7 - 11 * x7 + 10 + f2 = + 10 * x1^2 * x6 + + 10 * x2^2 * x6 + + 10 * x3^2 * x6 + + 10 * x4^2 * x6 + + 10 * x5^2 * x6 + + 10 * x6 * x7^2 - 11 * x6 + 10 + f3 = + 10 * x1^2 * x5 + + 10 * x2^2 * x5 + + 10 * x3^2 * x5 + + 10 * x4^2 * x5 + + 10 * x5 * x6^2 + + 10 * x5 * x7^2 - 11 * x5 + 10 + f4 = + 10 * x1^2 * x4 + + 10 * x2^2 * x4 + + 10 * x3^2 * x4 + + 10 * x4 * x5^2 + + 10 * x4 * x6^2 + + 10 * x4 * x7^2 - 11 * x4 + 10 + f5 = + 10 * x1^2 * x3 + + 10 * x2^2 * x3 + + 10 * x3 * x4^2 + + 10 * x3 * x5^2 + + 10 * x3 * x6^2 + + 10 * x3 * x7^2 - 11 * x3 + 10 + f6 = + 10 * x1 * x2^2 + + 10 * x1 * x3^2 + + 10 * x1 * x4^2 + + 10 * x1 * x5^2 + + 10 * x1 * x6^2 + + 10 * x1 * x7^2 - 11 * x1 + 10 + f7 = + 10 * x1^2 * x2 + + 10 * x2 * x3^2 + + 10 * x2 * x4^2 + + 10 * x2 * x5^2 + + 10 * x2 * x6^2 + + 10 * x2 * x7^2 - 11 * x2 + 10 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) +end + +function noon8() + dim = 8 + ve = [1, 1, 1, 1, 1, 1, 1, 1] + example = "noon8" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = + 10 * x1^2 * x8 + + 10 * x2^2 * x8 + + 10 * x3^2 * x8 + + 10 * x4^2 * x8 + + 10 * x5^2 * x8 + + 10 * x6^2 * x8 + + 10 * x7^2 * x8 - 11 * x8 + 10 + f2 = + 10 * x1^2 * x7 + + 10 * x2^2 * x7 + + 10 * x3^2 * x7 + + 10 * x4^2 * x7 + + 10 * x5^2 * x7 + + 10 * x6^2 * x7 + + 10 * x7 * x8^2 - 11 * x7 + 10 + f3 = + 10 * x1^2 * x6 + + 10 * x2^2 * x6 + + 10 * x3^2 * x6 + + 10 * x4^2 * x6 + + 10 * x5^2 * x6 + + 10 * x6 * x7^2 + + 10 * x6 * x8^2 - 11 * x6 + 10 + f4 = + 10 * x1^2 * x5 + + 10 * x2^2 * x5 + + 10 * x3^2 * x5 + + 10 * x4^2 * x5 + + 10 * x5 * x6^2 + + 10 * x5 * x7^2 + + 10 * x5 * x8^2 - 11 * x5 + 10 + f5 = + 10 * x1^2 * x4 + + 10 * x2^2 * x4 + + 10 * x3^2 * x4 + + 10 * x4 * x5^2 + + 10 * x4 * x6^2 + + 10 * x4 * x7^2 + + 10 * x4 * x8^2 - 11 * x4 + 10 + f6 = + 10 * x1^2 * x3 + + 10 * x2^2 * x3 + + 10 * x3 * x4^2 + + 10 * x3 * x5^2 + + 10 * x3 * x6^2 + + 10 * x3 * x7^2 + + 10 * x3 * x8^2 - 11 * x3 + 10 + f7 = + 10 * x1 * x2^2 + + 10 * x1 * x3^2 + + 10 * x1 * x4^2 + + 10 * x1 * x5^2 + + 10 * x1 * x6^2 + + 10 * x1 * x7^2 + + 10 * x1 * x8^2 - 11 * x1 + 10 + f8 = + 10 * x1^2 * x2 + + 10 * x2 * x3^2 + + 10 * x2 * x4^2 + + 10 * x2 * x5^2 + + 10 * x2 * x6^2 + + 10 * x2 * x7^2 + + 10 * x2 * x8^2 - 11 * x2 + 10 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) +end + +function redeco7() + dim = 7 + ve = [1, 1, 1, 1, 1, 1, 1] + example = "redeco7" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, u7, x5, x6) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "u7", "x5", "x6"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = -6 * u7 + x6 + f2 = x1 + x2 + x3 + x4 + x5 + x6 + 1 + f3 = x1 * x6 - 5 * u7 + x5 + f4 = x1 * x5 + x2 * x6 + x4 - 4 * u7 + f5 = x1 * x4 + x2 * x5 + x3 * x6 + x3 - 3 * u7 + f6 = x1 * x3 + x2 * x4 + x3 * x5 + x4 * x6 + x2 - 2 * u7 + f7 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x1 - u7 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) +end + +function redeco8() + dim = 8 + ve = [1, 1, 1, 1, 1, 1, 1, 1] + example = "redeco8" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3, x4, u8, x5, x6, x7) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3", "x4", "u8", "x5", "x6", "x7"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = -7 * u8 + x7 + f2 = x1 + x2 + x3 + x4 + x5 + x6 + x7 + 1 + f3 = x1 * x7 - 6 * u8 + x6 + f4 = x1 * x6 + x2 * x7 + x5 - 5 * u8 + f5 = x1 * x5 + x2 * x6 + x3 * x7 + x4 - 4 * u8 + f6 = x1 * x4 + x2 * x5 + x3 * x6 + x4 * x7 + x3 - 3 * u8 + f7 = x1 * x3 + x2 * x4 + x3 * x5 + x4 * x6 + x5 * x7 + x2 - 2 * u8 + f8 = x1 * x2 + x2 * x3 + x3 * x4 + x4 * x5 + x5 * x6 + x6 * x7 + x1 - u8 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) +end + +function wang91() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "Wang-91" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x3, x2, x1, x0, b, a) = Singular.PolynomialRing( + Singular.QQ, + ["x3", "x2", "x1", "x0", "b", "a"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = 3 * x2 * x1 * a + 3 * x0^2 + f2 = 3 * x2 * x1 * b + 3 * x3^2 + f3 = 3 * x3 * x1 * b + 3 * x1 * x0 * a + 3 * x2^2 + f4 = 3 * x3 * x2 * b + 3 * x2 * x0 * a + 3 * x1^2 + + return Singular.Ideal(R, [f1, f2, f3, f4]) +end + +function cohn4() + dim = 4 + ve = [1, 1, 1, 1] + example = "cohn4" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x, y, z, t) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "t"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = + -x^3 * y^2 + 2 * x^2 * y^2 * z - x^2 * y * z^2 - 144 * x^2 * y^2 - + 207 * x^2 * y * z + + 288 * x * y^2 * z + + 78 * x * y * z^2 + + x * z^3 - 3456 * x^2 * y - 5184 * x * y^2 - 9504 * x * y * z - + 432 * x * z^2 - 248832 * x * y + 62208 * x * z - 2985984 * x + f2 = + y^3 * t^3 - y^2 * z * t^3 + 4 * y^3 * t^2 - 2 * y^2 * z * t^2 + + 72 * y^2 * t^3 + + 71 * y * z * t^3 + + 288 * y^2 * t^2 + + 360 * y * z * t^2 + + 6 * z^2 * t^2 + + 1728 * y * t^3 - 464 * z * t^3 + + 432 * y * z * t + + 8 * z^2 * t + + 6912 * y * t^2 - 4320 * z * t^2 + + 13824 * t^3 + + z^2 - 13824 * z * t + 55296 * t^2 - 13824 * z + f3 = + x^2 * y * t^3 - 2 * x * y^2 * t^3 + y^3 * t^3 + 8 * x^2 * y * t^2 - + 12 * x * y^2 * t^2 + 4 * y^3 * t^2 - 24 * x * y * t^3 + + 24 * y^2 * t^3 + + 20 * x^2 * y * t - 20 * x * y^2 * t - 160 * x * y * t^2 + + 96 * y^2 * t^2 + + 128 * x * t^3 + + 16 * x^2 * y + + 96 * x * y * t + + 2304 * x * t^2 + + 1152 * x * y + + 13824 * x * t + + 27648 * x + f4 = + -x^3 * z * t^2 + x^2 * z^2 * t^2 - 6 * x^3 * z * t + + 4 * x^2 * z^2 * t + + 32 * x^3 * t^2 - 72 * x^2 * z * t^2 - 87 * x * z^2 * t^2 - z^3 * t^2 - + 8 * x^3 * z - 432 * x^2 * z * t - 414 * x * z^2 * t + + 2592 * x * z * t^2 + + 864 * z^2 * t^2 - 1728 * x^2 * z - 20736 * x * z * t + 3456 * z^2 * t - + 186624 * z * t^2 - 124416 * x * z - 1492992 * z * t - 2985984 * z + return Singular.Ideal(R, [f1, f2, f3, f4]) +end + +function oberfr() + dim = 3 + ve = [9, 9, 8] + example = "Oberfranz" + StartOrd = ordering_as_matrix(ve, :lex) + R, (x1, x2, x3) = Singular.PolynomialRing( + Singular.QQ, + ["x1", "x2", "x3"], + ordering = Singular.ordering_M(StartOrd), + ) + f1 = x2^3 + x1 * x2 * x3 + x2^2 * x3 + x1 * x3^3 + f2 = 3 + x1 * x2 + x1^2 * x2 + x2^2 * x3 + + return Singular.Ideal(R, [f1, f2]) +end diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 309417372..98b0bfb72 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -372,7 +372,6 @@ function fractal_walk_recursiv_startorder( t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - println(PertVecs[p], " in depth", p) return G else global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] @@ -562,7 +561,7 @@ function fractal_walk_combined( ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println("fractal_walk_withStartorder results") + println("fractal_walk_combined results") println("Crossed Cones in: ") Gb = fractal_walk_combined(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) diff --git a/src/GroebnerWalkFinal/tests b/src/GroebnerWalkFinal/tests new file mode 100644 index 000000000..78273c38e --- /dev/null +++ b/src/GroebnerWalkFinal/tests @@ -0,0 +1,140 @@ +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkFinal.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples.jl") + +@testset "Groebnerwalks" begin + @testset "Testing Groebnerwalks" begin + let id = cyclic5() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + I = Singular.std(ideal, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + for id in ideals + @test Singular.equal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + let id = katsura5() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + + I = Singular.std(ideal, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + for id in ideals + @test Singular.equal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + let id = cohn4() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + + I = Singular.std(ideal, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + for id in ideals + @test Singular.equal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + let id = noon5() + dim = nvars(base_ring(id)) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(ve, :lex) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + + I = Singular.std(ideal, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + end + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) + push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + complete_reduction = true, + ) + + for id in ideals + @test Singular.equal( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + end From 069aeb89a9865d63ab51fa5dbb85d83d84cd4cc0 Mon Sep 17 00:00:00 2001 From: welpj Date: Sat, 1 Jan 2022 20:39:07 +0100 Subject: [PATCH 46/85] Refactoring --- .../Benchmarking/BenchmarkHelper | 252 ++--- .../GroebnerWalkFinalBenchmarkProcedures.jl | 949 ------------------ .../bechmarkingEveryProcedure/runbenchmark.jl | 292 ------ .../Benchmarking/BspEinzeln.jl | 93 +- src/GroebnerWalkFinal/Benchmarking/BspVar3.jl | 15 +- src/GroebnerWalkFinal/Benchmarking/BspVar4.jl | 11 +- src/GroebnerWalkFinal/Benchmarking/BspVar5.jl | 11 +- .../GroebnerWalkFinalBenchmark.jl | 0 .../GroebnerWalkFinalBenchmarkProcedures.jl | 329 +++--- .../runbenchmark.jl | 78 +- .../{BenchmarkingAlg => }/runbenchmark2.jl | 4 +- 11 files changed, 406 insertions(+), 1628 deletions(-) delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl rename src/GroebnerWalkFinal/Benchmarking/{BenchmarkingAlg => }/GroebnerWalkFinalBenchmark.jl (100%) rename src/GroebnerWalkFinal/Benchmarking/{bechmarkingEveryProcedure => }/GroebnerWalkFinalBenchmarkProcedures.jl (84%) rename src/GroebnerWalkFinal/Benchmarking/{bechmarkingEveryProcedure => }/runbenchmark.jl (71%) rename src/GroebnerWalkFinal/Benchmarking/{BenchmarkingAlg => }/runbenchmark2.jl (98%) diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper index 402c6db18..5b6613b07 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper @@ -11,26 +11,26 @@ end function prepareAlloc() df = DataFrame( - weights = ["weights"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], + lift = ["lift"], + interreduce = ["interreduce"], example = ["example"], ) savew(df, "allocsStandardWalk") df = DataFrame( - weights = ["weights"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], + lift = ["lift"], + interreduce = ["interreduce"], pert = ["pert"], inCone = ["inCone"], laststd = ["laststd"], @@ -42,25 +42,25 @@ savew(df, "allocsPertubedWalk",i) end df = DataFrame( - weights = ["weights"], + nextW = ["nextW"], facetnormal = ["-"], initials = ["initials"], - stdh = ["stdh"], + stdH = ["stdH"], liftgeneric = ["liftgeneric"], - interred = ["interred"], + interreduce = ["interreduce"], example = ["example"], ) savew(df, "allocsGenericWalk") df = DataFrame( - weights = ["weights"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -68,14 +68,14 @@ df = DataFrame( ) savew(df, "allocsFractalWalk") df = DataFrame( - weights = ["weights"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -83,14 +83,14 @@ df = DataFrame( ) savew(df, "allocsFractalWalklex") df = DataFrame( - weights = ["weights"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], + stdH = ["stdH"], +liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -99,14 +99,14 @@ df = DataFrame( savew(df, "allocsFractalWalklookahead") df = DataFrame( - weights = ["weights"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], + stdH = ["stdH"], +liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -114,17 +114,17 @@ df = DataFrame( ) savew(df, "allocsFractalWalkcombined") df = DataFrame( - weights = "weights", - weight = "weight", + nextW = "nextW", + currrentWeight = "currrentWeight", nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - rep = ["rep"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], + lift = ["lift"], + interreduce = ["interreduce"], + reprVec = ["reprVec"], inCone = ["inCone"], - inseveral = ["inseveral"], + inSeveralCones = ["inSeveralCones"], example = ["example"], ) savew(df, "allocsTranWalk") @@ -132,26 +132,26 @@ end function prepareExampleAlloc(v::String) df = DataFrame( - weights = ["-"], - weight = ["-"], + nextW = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], example = [v], ) savea(df, "allocsStandardWalk") df = DataFrame( - weights = ["-"], - weight = ["-"], + nextW = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], pert = ["-"], inCone = ["-"], laststd = ["-"], @@ -163,25 +163,25 @@ savea(df, "allocsPertubedWalk",i) end df = DataFrame( - weights = ["-"], + nextW = ["-"], facetnormal = ["-"], initials = ["-"], - stdh = ["-"], + stdH = ["-"], liftgeneric = ["-"], - interred = ["-"], + interreduce = ["-"], example = [v], ) savea(df, "allocsGenericWalk") df = DataFrame( - weights = ["-"], - weight = ["-"], + nextW = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - lift2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -189,14 +189,14 @@ df = DataFrame( ) savea(df, "allocsFractalWalk") df = DataFrame( - weights = ["-"], - weight = ["-"], + nextW = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - lift2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -204,14 +204,14 @@ df = DataFrame( ) savea(df, "allocsFractalWalklex") df = DataFrame( - weights = ["-"], - weight = ["-"], + nextW = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - lift2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -219,14 +219,14 @@ df = DataFrame( ) savea(df, "allocsFractalWalklookahead") df = DataFrame( - weights = ["-"], - weight = ["-"], + nextW = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - lift2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -234,17 +234,17 @@ df = DataFrame( ) savea(df, "allocsFractalWalkcombined") df = DataFrame( - weights = "-", - weight = "-", + nextW = "-", + currrentWeight = "-", nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - rep = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + reprVec = ["-"], inCone = ["-"], - inseveral = ["-"], + inSeveralCone = ["-"], example = [v], ) savea(df, "allocsTranWalk") @@ -252,26 +252,26 @@ end function prepareExampleElapsed(v::String) df = DataFrame( - NextWeight = ["-"], - weight = ["-"], + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], example = [v], ) savea(df, "standardWalk") df = DataFrame( - NextWeight = ["-"], - weight = ["-"], + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], pert = ["-"], inCone = ["-"], laststd = ["-"], @@ -283,25 +283,25 @@ function prepareExampleElapsed(v::String) end df = DataFrame( - NextWeight = ["-"], + NextcurrrentWeight = ["-"], facetnormal = ["-"], initials = ["-"], - stdh = ["-"], + stdH = ["-"], liftgeneric = ["-"], - interred = ["-"], + interreduce = ["-"], example = [v], ) savea(df, "genericWalk") df = DataFrame( - NextWeight = ["-"], - weight = ["-"], + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -309,14 +309,14 @@ function prepareExampleElapsed(v::String) ) savea(df, "fractalWalk") df = DataFrame( - NextWeight = ["-"], - weight = ["-"], + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -324,14 +324,14 @@ function prepareExampleElapsed(v::String) ) savea(df, "fractalWalklex") df = DataFrame( - NextWeight = ["-"], - weight = ["-"], + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -339,14 +339,14 @@ function prepareExampleElapsed(v::String) ) savea(df, "fractalWalklookahead") df = DataFrame( - NextWeight = ["-"], - weight = ["-"], + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], + interreduce = ["-"], inCone = ["-"], pertvec = ["-"], depth = ["-"], @@ -354,17 +354,17 @@ function prepareExampleElapsed(v::String) ) savea(df, "fractalWalkcombined") df = DataFrame( - NextWeight = "-", - weight = "-", + NextcurrrentWeight = "-", + currrentWeight = "-", nGens = ["-"], initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], + stdH = ["-"], + liftAlternative = ["-"], lift = ["-"], - interred = ["-"], - rep = ["-"], + interreduce = ["-"], + reprVec = ["-"], inCone = ["-"], - inseveral = ["-"], + inSeveralCone = ["-"], example = [v], ) savea(df, "tranWalk") diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl deleted file mode 100644 index b5da84a11..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ /dev/null @@ -1,949 +0,0 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl") -using BenchmarkTools -BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 -BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 -a="-" -b="-" -z ="-" -c="-" -d="-" -e="-" -f="-" -g="-" -h="-" -i="-" -j="-" -k="-" -l="-" -function cleardf() - global a="-" - global b="-" - global c="-" - global d="-" - global e="-" - global f="-" - global g="-" - global h="-" - global i="-" - global j="-" - global k="-" - global l="-" - global z ="-" -end - -############################################################### -#Implementation of the gröbner walk. -############################################################### - -#for counting the steps of the groebnerwalk. -counter = 0 -function getCounter() - global counter - temp = counter - counter = 0 - return temp -end -#= -@doc Markdown.doc""" -function groebnerwalk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - p::Int64 = 0, -) -Given an Ideal G generated by a reduced Groebner Basis w.r.t. the monomial ordering S this function -returns a reduced Groebner Basis w.r.t. the monomial ordering T by converting it using the Groebner Walk. -The Groebner Walk is proposed by Collart et al. (1993) -One can choose a strategy of: -Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). -Pertubed Walk (:pertubed, with p = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). -Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. -Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that T represents the lex ordering. Pertubes only the target vector. -Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. -"""=# -function groebnerwalk3( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - p::Int64 = 0, -) - if grwalktype == :standard - walk = (x, y, z) -> standard_walk3(x, y, z) - elseif grwalktype == :generic - walk = (x, y, z) -> generic_walk3(x, y, z) - elseif grwalktype == :pertubed - walk = (x, y, z) -> pertubed_walk3(x, y, z, p) - elseif grwalktype == :fractal - walk = - (x, y, z) -> fractal_walk3( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_start_order - walk = - (x, y, z) -> fractal_walk3_start_order( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_lex - walk = - (x, y, z) -> fractal_walk3_lex( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_look_ahead - walk = - (x, y, z) -> fractal_walk3_look_ahead( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :tran - walk = (x, y, z) -> tran_walk3(x, y, z) - elseif grwalktype == :fractal_combined - walk = - (x, y, z) -> fractal_walk3_combined( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - end - - ######TODO:Check the parameter##### - R = base_ring(G) - I = Singular.Ideal(R, [R(x) for x in gens(G)]) - - Gb = walk(I, S, T) - println("Cones crossed: ", getCounter()) - - S = change_order(Gb.base_ring, T) - return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) -end - - -function standard_walk3(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - println("standard_walk3 results") - println("Crossed Cones in: ") - standard_walk3(G, S, T, S[1, :], T[1, :]) -end - -function standard_walk3( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, -) - R = base_ring(G) - Rn = change_order(R, cweight, T) - terminate = false - while !terminate - global counter = getCounter() + 1 - println(cweight) - global b = cweight - G = standard_step3(G, R, cweight, Rn) - if cweight == tweight - terminate = true - else - global a = @ballocated next_weight($G, $cweight, $tweight) evals =1 samples=1 - cweight = next_weight(G, cweight, tweight) - R = Rn - Rn = change_order(Rn, cweight, T) - end - end - return G -end - -function standard_step3( - G::Singular.sideal, - R::Singular.PolyRing, - cw::Vector{Int64}, - Rn::Singular.PolyRing -) -global z = length(Singular.gens(G)) - - -global c = @ballocated initials($Rn, gens($G), $cw) evals =1 samples=1 - - Gw = initials(Rn, gens(G), cw) - global d= @ballocated Singular.std( - Singular.Ideal($Rn, $Gw), - complete_reduction = true, - ) evals =1 samples=1 - - H = Singular.std( - Singular.Ideal(Rn, Gw), - complete_reduction = true, - ) - - - global e=@ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - global f= @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - global g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f],g=[g], h=[counter]) - cleardf() - savea(df,"allocsStandardWalk") - return Singular.std(H, complete_reduction = true) -end -############################## -#just for benchmark###### -############################# -function standard_walk32(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - println("standard_walk3 results") - println("Crossed Cones in: ") - standard_walk32(G, S, T, S[1, :], T[1, :]) -end - -function standard_walk32( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, - k::Int64, -) -R = base_ring(G) -Rn = change_order(R, cweight, T) -terminate = false -while !terminate - global counter = getCounter() + 1 - println(cweight) - global b = cweight - G = standard_step32(G, R, cweight, Rn) - df = DataFrame(a=[a], b = [b], z=[z], c = [c], d = [d], e = [e], f=[f],g=[g],h=[h], i=[i], j =[j], k=[k],l=[l]) - cleardf() - savea(df,"allocsPertubedWalk",k) - if cweight == tweight - terminate = true - else - global a = @ballocated next_weight($G, $cweight, $tweight) evals =1 samples=1 - cweight = next_weight(G, cweight, tweight) - R = Rn - Rn = change_order(Rn, cweight, T) - end -end -return G -end - -function standard_step32( - G::Singular.sideal, - R::Singular.PolyRing, - cw::Vector{Int64}, - Rn::Singular.PolyRing -) -global z = length(Singular.gens(G)) - - -global c = @ballocated initials($Rn, gens($G), $cw) evals =1 samples=1 - Gw = initials(Rn, gens(G), cw) - - global d= @ballocated Singular.std( - Singular.Ideal($Rn, $Gw), - complete_reduction = true, - ) evals =1 samples=1 - - H = Singular.std( - Singular.Ideal(Rn, Gw), - complete_reduction = true, - ) - - - global e=@ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - global f= @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - global g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - - return Singular.std(H, complete_reduction = true) -end -############################################################### -#Generic-version of the groebner walk by Fukuda et al. (2007) -############################################################### - -function generic_walk3(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R = base_ring(G) - Rn = change_order(G.base_ring, T) - global a =@ballocated next_gamma($G, $[0], $S, $T) evals =1 samples=1 - v = next_gamma(G, [0], S, T) - Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] - G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) - - println("generic_walk3 results") - println("Crossed Cones with facetNormal: ") - while !isempty(v) - global counter = getCounter() + 1 - global b = v - println(v) - G, Lm = generic_step3(G, Lm, v, T,R) - df = DataFrame(a = [a], b = [b],z=[z], c = [c], d=[d], e=[e],f=[f],g=[g]) - savea(df, "allocsGenericWalk") - cleardf() - global a = @ballocated next_gamma($G, $Lm, $v, $S, $T) evals =1 samples=1 - v =next_gamma(G, Lm, v, S, T) - end - return Singular.interreduce(G) -end - -function generic_step3( - G::Singular.sideal, - Lm::Vector{Singular.spoly{L}}, - v::Vector{Int64}, - T::Matrix{Int64}, - R::Singular.PolyRing -) where {L<:Nemo.RingElem} -global z = length(Singular.gens(G)) - - - Rn = Singular.base_ring(G) - global c =@ballocated facet_initials($G,$Lm, $v) evals =1 samples=1 - facet_Generators = facet_initials(G,Lm, v) - global d= @ballocated Singular.std( - Singular.Ideal($Rn, $facet_Generators), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, facet_Generators), - complete_reduction = true, - ) - global e = @ballocated lift_generic($G, $Lm, $H) evals =1 samples=1 - H, Lm = lift_generic(G, Lm, H) - global f= @ballocated interreduce($H, $Lm) evals =1 samples=1 - G = interreduce(H, Lm) - G = Singular.Ideal(Rn, G) - G.isGB = true - return G, Lm -end - - -############################################################### -#Pertubed-version of the groebner walk Amrhein et al. -############################################################### -function pertubed_walk3( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - p::Int64, -) -k=p -df = DataFrame(a=["-"], b = ["-"],z=["-"], c = ["-"], d = ["-"], e = ["-"], f = ["-"], g=["-"], h=["-"], i=[(p,p)], j=["-"]) -savea(df, "allocsPertubedWalk",k) - #cweight = pertubed_vector(G, S, p) - cweight = S[1, :] - terminate = false - println("pertubed_walk3 results") - println("Crossed Cones in: ") - - while !terminate - global h = @ballocated pertubed_vector($G, $T, $p) evals =1 samples=1 - tweight = pertubed_vector(G, T, p) - G = standard_walk32(G, S, T, cweight, tweight,k) - - if inCone(G, T, tweight) - global i = @ballocated inCone($G, $T, $tweight) evals =1 samples=1 - terminate = true - else - if p == 1 - R = change_order(G.base_ring, T) - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - global j= @ballocated Singular.std($G, complete_reduction = true) evals =1 samples=1 - G = Singular.std(G, complete_reduction = true) - terminate = true - end - p = p - 1 - cweight = tweight - end - df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k],l=[l]) - savea(df, "allocsPertubedWalk",k) - cleardf() - end - return G -end - -############################################################### -#fractal-walk by Amrhein et al. -#Inlcuding: -#fractal_walk3 -> standard-version -#fractal_walk32 -> checks if the starting weight is in the inner of a cone. -#fractal_walk33 -> fractal walk expecially for conversion to the lexikographic orderig. -# checks if the starting weight is in the inner of a cone. -############################################################### - -######################################## -#Counter for the steps in the fractal_walk3 -######################################## -counterFr = 0 -function deleteCounterFr() - global counterFr - temp = counterFr - counterFr = 0 - return temp -end -function getCounterFr() - global counterFr - return counterFr -end -function raiseCounterFr() - global counterFr = getCounterFr() + 1 -end -PertVecs = [] -sigma = [] - -function fractal_walk3( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println(PertVecs) - println("FacrtalWalk_standard results") - println("Crossed Cones in: ") - Gb = fractal_recursiv3(G, S,T, PertVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv3( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = base_ring(G) - terminate = false - G.isGB = true - w = S.w - h= "-" - i="-" - while !terminate - a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 - t = nextT(G, w, PertVecs[p]) - if (t == [0]) - if inCone(G, T,PertVecs[p]) - h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 - return G - else - i = @ballocated [pertubed_vector($G, $T, $i) for i = 1:nvars(R)] evals =1 samples=1 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - b = w - T.w = w - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, Singular.gens(G), w) - if p == nvars(R) - d = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - H = fractal_recursiv3( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - end - e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - G = Singular.std(H, complete_reduction = true) - R = Rn - j = p - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"allocsFractalWalk") - cleardf() - - end - return G -end - -cwPert = [] -firstStepMode = false -function cwpert(p::Int64) - cwPert[p] -end - -function fractal_walk3_start_order( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - global sigma = S.w - println("fractal_walk3_withStartorder results") - println("Crossed Cones in: ") - Gb = fractal_walk3_recursiv_startorder(G, S, T, PertVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk3_recursiv_startorder( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = cwPert[p] - else - w = S.w - end - h= "-" - i="-" - while !terminate - a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 - println(PertVecs[p], " in depth", p) - return G - else - i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, gens(G), w) - if p == Singular.nvars(R) - d = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - - H = fractal_walk3_recursiv_startorder( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - j = p - - G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"allocsFractalWalkstartorder") - cleardf() - - R = Rn - end - return G -end -function fractal_walk3_lex( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println("fractal_walk3_lex results") - println("Crossed Cones in: ") - Gb = fractal_walk3_recursive_lex(G, S, T, PertVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk3_recursive_lex( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - w = S.w - h= "-" - i="-" - while !terminate - a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 - return G - else - i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - println(PertVecs) - continue - end - end - if t == 1 && p==1 - return fractal_walk3_recursive_lex( - G, - S, - T, - PertVecs, - p + 1, - ) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - d = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - - H = fractal_walk3_recursive_lex( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - end - e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - j = p - - G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"allocsFractalWalklex") - cleardf() - - R = Rn - end - return G -end -function fractal_walk3_look_ahead( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - println("fractal_walk3_look_ahead results") - println("Crossed Cones in: ") - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk3_look_ahead_recursiv(G, S, T, PertVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk3_look_ahead_recursiv( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - w = S.w - h= "-" - i="-" - while !terminate - a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 - return G - else - i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, Singular.gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - d = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - - H = fractal_walk3_look_ahead_recursiv( - Singular.Ideal(R, Gw), - S, - T, - PertVecs, - p + 1, - ) - end - e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R H, Rn) - g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - j = p - - G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b], z=[z],c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"allocsFractalWalklookahead") - cleardf() - - R = Rn - end - return G -end - -function fractal_walk3_combined( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println("fractal_walk3_withStartorder results") - println("Crossed Cones in: ") - Gb = fractal_walk3_combined(G, S, T, PertVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk3_combined( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = cwPert[p] - else - w = S.w - end - h= "-" - i="-" - while !terminate - a = @ballocated nextT($G, $w, PertVecs[$p]) evals =1 samples=1 - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @ballocated inCone($G, $T,PertVecs[$p]) evals =1 samples=1 - println(PertVecs[p], " in depth", p) - return G - else - i = @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars(R)] evals =1 samples=1 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - if t == 1 && p==1 - return fractal_walk3_combined( - G, - S, - T, - PertVecs, - p + 1, - ) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - - Rn = change_order(R, T) - global z = length(Singular.gens(G)) - - c = @ballocated initials($R, Singular.gens($G), $w) evals =1 samples=1 - Gw = initials(R, gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - d = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals =1 samples=1 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - - H = fractal_walk3_combined( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - end - e = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals =1 samples=1 - f = @ballocated lift($G, $R, $H, $Rn) evals =1 samples=1 - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - g = @ballocated Singular.std($H, complete_reduction = true) evals =1 samples=1 - j = p - - G = Singular.std(H, complete_reduction = true) - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"allocsFractalWalkcombined") - cleardf() - - R = Rn - end - return G -end - -############################################################### -#Tran-version of the groebner walk by Tran (2002) -############################################################### - -function tran_walk3(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - cweight = S[1, :] - tweight = T[1, :] - println("tran_walk3 results") - println("Crossed Cones in: ") - R = base_ring(G) - if !isMonomial(initials(R, Singular.gens(G), cweight)) - cweight = pertubed_vector(G, S, nvars(R)) - end - - terminate = false - while !terminate - global a = @ballocated next_weight($G, $cweight, $tweight) evals =1 samples=1 - w = next_weight(G, cweight, tweight) - if tryparse(Int32, string(w)) == nothing - println("w bigger than int32") - return G - end - Rn= change_order(R, w, T) - if w == tweight - if inCone(G, T, cweight) - global i = @ballocated inCone($G, $T, $cweight) evals =1 samples=1 - return G - else - if inSeveralCones(initials(base_ring(G), gens(G), w)) - global j = @ballocated inSeveralCones(initials(base_ring($G), gens($G), $w)) evals =1 samples=1 - global h = @ballocated representation_vector($G, $T) evals =1 samples=1 - tweight = representation_vector(G, T) - continue - end - end - end - G = standard_step32(G, R, w, Rn) - global counter = getCounter() + 1 - println(w) - global b=w - R = Rn - cweight = w - df = DataFrame(a=[a], b = [b],z=[z], c = [c], d = [d], e = [e], f = [f], g=[g], h=[h], i=[i],j=[j],k=[k]) - savea(df,"allocsTranWalk") - cleardf() - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl deleted file mode 100644 index e0a24dc47..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAllocs/bechmarkingEveryProcedure/runbenchmark.jl +++ /dev/null @@ -1,292 +0,0 @@ -using BenchmarkTools - -function prepare3() -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - example = ["example"], -) -savew(df, "allocsStandardWalk") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -for i in 2:10 -savew(df, "allocsPertubedWalk",i) -end - -df = DataFrame( - weights = ["weights"], - facetnormal = ["-"], - initials = ["initials"], - stdh = ["stdh"], - liftgeneric = ["liftgeneric"], - interred = ["interred"], - example = ["example"], -) -savew(df, "allocsGenericWalk") - -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalk") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalklex") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalklookahead") -df = DataFrame( - weights = ["weights"], - weight = ["weight"], - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - lift2 = ["lift2"], - lift = ["lift"], - interred = ["interred"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalkcombined") -df = DataFrame( - weights = "weights", - weight = "weight", - nGens = ["nGens"], - initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], - lift2 = ["lift2"], - interred = ["interred"], - rep = ["rep"], - inCone = ["inCone"], - inseveral = ["inseveral"], - example = ["example"], -) -savew(df, "allocsTranWalk") -end -function runb3( - v::String, - ideal::Singular.sideal, - S::Singular.PolyRing, - StartOrd::Matrix{Int64}, - TarOrd::Matrix{Int64}, -) - println("starting Benchmark") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - example = [v], - ) - savea(df, "allocsStandardWalk") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - for i in 2:10 - savea(df, "allocsPertubedWalk",i) -end - - df = DataFrame( - weights = ["-"], - facetnormal = ["-"], - initials = ["-"], - stdh = ["-"], - liftgeneric = ["-"], - interred = ["-"], - example = [v], - ) - savea(df, "allocsGenericWalk") - - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "allocsFractalWalk") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "allocsFractalWalklex") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "allocsFractalWalklookahead") - df = DataFrame( - weights = ["-"], - weight = ["-"], - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - lift2 = ["-"], - lift = ["-"], - interred = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "allocsFractalWalkcombined") - df = DataFrame( - weights = "-", - weight = "-", - nGens = ["-"], - initials = ["-"], - stdh = ["-"], - liftGW2 = ["-"], - lift2 = ["-"], - interred = ["-"], - rep = ["-"], - inCone = ["-"], - inseveral = ["-"], - example = [v], - ) - savea(df, "allocsTranWalk") - - println("Computing deglex-Basis") - stime =@belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 - I = Singular.std(ideal, complete_reduction = true) - - println("Benchmarking GroebnerWalk") - ideals = [] - for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) - end - - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) - - println("Computing lex-Basis") - ttime = @belapsed Singular.std( - Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), - complete_reduction = true, - ) evals=1 samples =1 - - df = DataFrame(startTime = [stime], targetTime =[ttime], example=[v]) - savea(df, "SingularComputationTimings") - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), - complete_reduction = true, - ) - - df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) - savea(df, "correct") - - println("Benchmarking ideals") - for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b],c=[v]) - savea(df, "correct") - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 976d918d4..925354c80 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -1,8 +1,8 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") +include("GroebnerWalkFinalBenchmarkProcedures.jl") +include("runbenchmark.jl") +include("GroebnerWalkFinalBenchmark.jl") +include("runbenchmark2.jl") +include("BenchmarkHelper") include("readWriteHelper.jl") include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples") @@ -17,158 +17,173 @@ function runAllSingleExample() prepareAlloc() id = katsura5() - dim = nvars(base_ring(id)) + R= base_ring(id) + dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll("Katsura5", I, S, StartOrd, TarOrd) + runAll("Katsura5", id, S, StartOrd, TarOrd) - #Katsura6 id = katsura6() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll("Katsura6", I, S, StartOrd, TarOrd) + runAll("Katsura6", id, S, StartOrd, TarOrd) example = "Cyclic7" id = cyclic7() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "Cyclic6" id = cyclic6() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "Cyclic5" id = cyclic5() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "eco6" id = eco6() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "eco7" id = eco7() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "noon5" id = noon5() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "noon6" id = noon6() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "noon7" id = noon7() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "noon8" id = noon8() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "redeco7" id = redeco7() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "redeco8" id = redeco8() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "wang91" id = wang91() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "cohn4" id = cohn4() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) example = "of" id = oberfr() - dim = nvars(base_ring(id)) +R= base_ring(id) +dim = nvars(R) ve=ones(Int64,dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - runAll(example, I, S, StartOrd, TarOrd) + runAll(example, id, S, StartOrd, TarOrd) end @@ -195,7 +210,7 @@ S = change_order(R, TarOrd) f7 =x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x1-u7 I = Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7]) -runb(example, I, S, StartOrd, TarOrd) +runb(example, id, S, StartOrd, TarOrd) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl index 381f9539d..c7b99cfa5 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl @@ -1,9 +1,10 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") +include("GroebnerWalkFinalBenchmarkProcedures.jl") +include("runbenchmark.jl") +include("GroebnerWalkFinalBenchmark.jl") +include("runbenchmark2.jl") +include("BenchmarkHelper") include("readWriteHelper.jl") +include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples") using DataFrames using CSV @@ -24,7 +25,7 @@ function benchmarkVar3() S = change_order(R, TarOrd) ideals = [] - push!( + #=push!( ideals, Singular.Ideal( R,[48*b+23*a*c+47*a^5+69*a*b^4, @@ -45,7 +46,7 @@ push!( for i in ideals runAll("sparseid(3,0,5,100-(1*2),90)", i, S, StartOrd, TarOrd) end -ideals =[] +ideals =[]=# push!( ideals, Singular.Ideal( diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl index 0f48d2d35..d21c70588 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl @@ -1,9 +1,10 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") +include("GroebnerWalkFinalBenchmarkProcedures.jl") +include("runbenchmark.jl") +include("GroebnerWalkFinalBenchmark.jl") +include("runbenchmark2.jl") +include("BenchmarkHelper") include("readWriteHelper.jl") +include("Examples") using DataFrames using CSV diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl index 578bef97b..d8ce973e7 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl @@ -1,9 +1,10 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper") +include("GroebnerWalkFinalBenchmarkProcedures.jl") +include("runbenchmark.jl") +include("GroebnerWalkFinalBenchmark.jl") +include("runbenchmark2.jl") +include("BenchmarkHelper") include("readWriteHelper.jl") +include("Examples") using DataFrames using CSV diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl similarity index 100% rename from src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/GroebnerWalkFinalBenchmark.jl rename to src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl similarity index 84% rename from src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl rename to src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl index 6935ef904..2831a4fd9 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl @@ -15,7 +15,7 @@ include( ) using BenchmarkTools BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 -BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 +BenchmarkTools.DEFAULT_PARAMETERS.evals= 5 a = "-" b = "-" z = "-" @@ -200,11 +200,11 @@ function standard_walk( terminate = true else global a = - @belapsed next_weight($G, $cweight, $tweight) evals = 1 samples = - 1 + @belapsed next_weight($G, $cweight, $tweight) evals= 5 samples = + 2 global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals = 1 samples = - 1 + @ballocated next_weight($G, $cweight, $tweight) evals= 5 samples = + 2 cweight = next_weight(G, cweight, tweight) R = Rn @@ -224,37 +224,37 @@ function standard_step( global z2 = length(Singular.gens(G)) - global c = @belapsed initials($Rn, gens($G), $cw) evals = 1 samples = 1 - global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 1 samples = 1 + global c = @belapsed initials($Rn, gens($G), $cw) evals= 5 samples = 2 + global c2 = @ballocated initials($Rn, gens($G), $cw) evals= 5 samples = 2 Gw = initials(Rn, gens(G), cw) global d = @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - global f = @belapsed lift($G, $R, $H, $Rn) evals = 1 samples = 1 - global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 1 samples = 1 + global f = @belapsed lift($G, $R, $H, $Rn) evals= 5 samples = 2 + global f2 = @ballocated lift($G, $R, $H, $Rn) evals= 5 samples = 2 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) global g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 global g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 df = DataFrame( a = [a], @@ -349,11 +349,11 @@ function standard_walk2( terminate = true else global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals = 1 samples = - 1 + @ballocated next_weight($G, $cweight, $tweight) evals= 5 samples = + 2 global a = - @belapsed next_weight($G, $cweight, $tweight) evals = 1 samples = - 1 + @belapsed next_weight($G, $cweight, $tweight) evals= 5 samples = + 2 cweight = next_weight(G, cweight, tweight) R = Rn Rn = change_order(Rn, cweight, T) @@ -372,37 +372,37 @@ function standard_step2( global z2 = length(Singular.gens(G)) - global c = @belapsed initials($Rn, gens($G), $cw) evals = 1 samples = 1 - global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 1 samples = 1 + global c = @belapsed initials($Rn, gens($G), $cw) evals= 5 samples = 2 + global c2 = @ballocated initials($Rn, gens($G), $cw) evals= 5 samples = 2 Gw = initials(Rn, gens(G), cw) global d = @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 1 samples = 1 - global f = @belapsed lift($G, $R, $H, $Rn) evals = 1 samples = 1 + global f2 = @ballocated lift($G, $R, $H, $Rn) evals= 5 samples = 2 + global f = @belapsed lift($G, $R, $H, $Rn) evals= 5 samples = 2 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) global g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 global g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 return Singular.std(H, complete_reduction = true) end @@ -413,8 +413,8 @@ end function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R = base_ring(G) Rn = change_order(G.base_ring, T) - global a = @belapsed next_gamma($G, $[0], $S, $T) evals = 1 samples = 1 - global a2 = @ballocated next_gamma($G, $[0], $S, $T) evals = 1 samples = 1 + global a = @belapsed next_gamma($G, $[0], $S, $T) evals= 5 samples = 2 + global a2 = @ballocated next_gamma($G, $[0], $S, $T) evals= 5 samples = 2 v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] @@ -453,10 +453,10 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) savea(df, "genericWalk") cleardf() global a2 = - @ballocated next_gamma($G, $Lm, $v, $S, $T) evals = 1 samples = 1 + @ballocated next_gamma($G, $Lm, $v, $S, $T) evals= 5 samples = 2 global a = - @belapsed next_gamma($G, $Lm, $v, $S, $T) evals = 1 samples = 1 + @belapsed next_gamma($G, $Lm, $v, $S, $T) evals= 5 samples = 2 v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) @@ -473,29 +473,29 @@ function generic_step( Rn = Singular.base_ring(G) - global c = @belapsed facet_initials($G, $Lm, $v) evals = 1 samples = 1 - global c2 = @ballocated facet_initials($G, $Lm, $v) evals = 1 samples = 1 + global c = @belapsed facet_initials($G, $Lm, $v) evals= 5 samples = 2 + global c2 = @ballocated facet_initials($G, $Lm, $v) evals= 5 samples = 2 facet_Generators = facet_initials(G, Lm, v) global d = @belapsed Singular.std( Singular.Ideal($Rn, $facet_Generators), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $facet_Generators), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, facet_Generators), complete_reduction = true, ) - global e2 = @ballocated lift_generic($G, $Lm, $H) evals = 1 samples = 1 + global e2 = @ballocated lift_generic($G, $Lm, $H) evals= 5 samples = 2 - global e = @belapsed lift_generic($G, $Lm, $H) evals = 1 samples = 1 + global e = @belapsed lift_generic($G, $Lm, $H) evals= 5 samples = 2 H, Lm = lift_generic(G, Lm, H) - global f = @belapsed interreduce($H, $Lm) evals = 1 samples = 1 - global f2 = @ballocated interreduce($H, $Lm) evals = 1 samples = 1 + global f = @belapsed interreduce($H, $Lm) evals= 5 samples = 2 + global f2 = @ballocated interreduce($H, $Lm) evals= 5 samples = 2 G = interreduce(H, Lm) G = Singular.Ideal(Rn, G) @@ -554,17 +554,17 @@ function pertubed_walk( println("Crossed Cones in: ") while !terminate - global h = @belapsed pertubed_vector($G, $T, $p) evals = 1 samples = 1 + global h = @belapsed pertubed_vector($G, $T, $p) evals= 5 samples = 2 global h2 = - @ballocated pertubed_vector($G, $T, $p) evals = 1 samples = 1 + @ballocated pertubed_vector($G, $T, $p) evals= 5 samples = 2 tweight = pertubed_vector(G, T, p) G = standard_walk2(G, S, T, cweight, tweight, k) if inCone(G, T, tweight) - global i = @belapsed inCone($G, $T, $tweight) evals = 1 samples = 1 + global i = @belapsed inCone($G, $T, $tweight) evals= 5 samples = 2 global i2 = - @ballocated inCone($G, $T, $tweight) evals = 1 samples = 1 + @ballocated inCone($G, $T, $tweight) evals= 5 samples = 2 terminate = true else @@ -573,10 +573,10 @@ function pertubed_walk( G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) global j = @belapsed Singular.std($G, complete_reduction = true) evals = - 1 samples = 1 + 2 samples = 1 global j2 = @ballocated Singular.std($G, complete_reduction = true) evals = - 1 samples = 1 + 2 samples = 1 G = Singular.std(G, complete_reduction = true) terminate = true @@ -681,24 +681,24 @@ function fractal_recursiv( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 t = nextT(G, w, PertVecs[p]) if (t == [0]) if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = - 1 + @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + 2 return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println(PertVecs) continue @@ -713,20 +713,20 @@ function fractal_recursiv( z = length(Singular.gens(G)) z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + c2 = @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 - c = @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = 1 + c = @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = 2 Gw = initials(R, Singular.gens(G), w) if p == nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -746,20 +746,20 @@ function fractal_recursiv( p + 1, ) end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 G = Singular.std(H, complete_reduction = true) R = Rn j = p @@ -847,24 +847,24 @@ function fractal_walk_recursiv_startorder( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = - 1 + @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + 2 return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println(PertVecs) @@ -881,20 +881,20 @@ function fractal_walk_recursiv_startorder( z = length(Singular.gens(G)) z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + c2 = @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 - c = @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = 1 + c = @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = 2 Gw = initials(R, gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -916,21 +916,21 @@ function fractal_walk_recursiv_startorder( ) global firstStepMode = false end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R, H, Rn) g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 j = p j2 = p @@ -1000,23 +1000,23 @@ function fractal_walk_recursive_lex( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = - 1 + @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + 2 return G else i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] println(PertVecs) @@ -1038,22 +1038,22 @@ function fractal_walk_recursive_lex( z2 = length(Singular.gens(G)) c2 = - @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 c = - @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -1077,19 +1077,19 @@ function fractal_walk_recursive_lex( global firstStepMode = false end end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R, H, Rn) g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 j = p j2 = p @@ -1159,23 +1159,23 @@ function fractal_walk_look_ahead_recursiv( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = - 1 + @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + 2 return G else i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue @@ -1190,20 +1190,20 @@ function fractal_walk_look_ahead_recursiv( Rn = change_order(R, T) z = length(Singular.gens(G)) z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + c2 = @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 - c = @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = 1 + c = @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = 2 Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -1223,20 +1223,20 @@ function fractal_walk_look_ahead_recursiv( p + 1, ) end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R H, Rn) g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 j = p j2 = p @@ -1322,24 +1322,24 @@ function fractal_walk_combined( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 1 samples = 1 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 1 samples = 1 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 1 samples = - 1 + @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + 2 println(PertVecs[p], " in depth", p) return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 1 samples = 1 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -1358,22 +1358,22 @@ function fractal_walk_combined( z2 = length(Singular.gens(G)) c2 = - @ballocated initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 c = - @belapsed initials($R, Singular.gens($G), $w) evals = 1 samples = - 1 + @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = + 2 Gw = initials(R, gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -1396,18 +1396,18 @@ function fractal_walk_combined( global firstStepMode = false end end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 1 samples = 1 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 1 samples = 1 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R, H, Rn) g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 g = - @belapsed Singular.std($H, complete_reduction = true) evals = 1 samples = - 1 + @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + 2 j = p j2 = p @@ -1466,12 +1466,13 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals = 1 samples = - 1 + @ballocated next_weight($G, $cweight, $tweight) evals= 5 samples = + 2 global a = - @belapsed next_weight($G, $cweight, $tweight) evals = 1 samples = 1 + @belapsed next_weight($G, $cweight, $tweight) evals= 5 samples = 2 w = next_weight(G, cweight, tweight) + println(w) if tryparse(Int32, string(w)) == nothing println("w bigger than int32") return G @@ -1480,25 +1481,25 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) if w == tweight if inCone(G, T, cweight) global i2 = - @ballocated inCone($G, $T, $cweight) evals = 1 samples = 1 + @ballocated inCone($G, $T, $cweight) evals= 5 samples = 2 global i = - @belapsed inCone($G, $T, $cweight) evals = 1 samples = 1 + @belapsed inCone($G, $T, $cweight) evals= 5 samples = 2 return G else if inSeveralCones(initials(base_ring(G), gens(G), w)) global j = @belapsed inSeveralCones( initials(base_ring($G), gens($G), $w), - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 global j2 = @ballocated inSeveralCones( initials(base_ring($G), gens($G), $w), - ) evals = 1 samples = 1 + ) evals= 5 samples = 2 global h2 = - @ballocated representation_vector($G, $T) evals = 1 samples = - 1 + @ballocated representation_vector($G, $T) evals= 5 samples = + 2 global h = - @belapsed representation_vector($G, $T) evals = 1 samples = - 1 + @belapsed representation_vector($G, $T) evals= 5 samples = + 2 tweight = representation_vector(G, T) continue end diff --git a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl similarity index 71% rename from src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl rename to src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl index aa58b489a..c78dbe750 100644 --- a/src/GroebnerWalkFinal/Benchmarking/bechmarkingEveryProcedure/runbenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl @@ -2,26 +2,26 @@ using BenchmarkTools function prepare() df = DataFrame( - NextWeight = ["NextWeight"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], stdH = ["stdH"], - liftGW2 = ["liftGW2"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], example = ["example"], ) savew(df, "standardWalk") df = DataFrame( - NextWeight = ["NextWeight"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], pert = ["pert"], inCone = ["inCone"], laststd = ["laststd"], @@ -32,25 +32,25 @@ for i in 2:10 savew(df, "pertubedWalk",i) end df = DataFrame( - NextWeight = ["NextWeight"], + nextW = ["nextW"], facetnormal = ["-"], initials = ["initials"], - stdh = ["stdh"], + stdH = ["stdH"], liftgeneric = ["liftgeneric"], - interred = ["interred"], + interreduce = ["interreduce"], example = ["example"], ) savew(df, "genericWalk") df = DataFrame( - NextWeight = ["NextWeight"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -58,14 +58,14 @@ df = DataFrame( ) savew(df, "fractalWalk") df = DataFrame( - NextWeight = ["NextWeight"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -73,14 +73,14 @@ df = DataFrame( ) savew(df, "fractalWalklex") df = DataFrame( - NextWeight = ["NextWeight"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -88,14 +88,14 @@ df = DataFrame( ) savew(df, "fractalWalklookahead") df = DataFrame( - NextWeight = ["NextWeight"], - weight = ["weight"], + nextW = ["nextW"], + currrentWeight = ["currrentWeight"], nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], inCone = ["inCone"], pertvec = ["pertvec"], depth = ["depth"], @@ -103,14 +103,14 @@ df = DataFrame( ) savew(df, "fractalWalkcombined") df = DataFrame( - NextWeight = "NextWeight", - weight = "weight", + nextW = "nextW", + currrentWeight = "currrentWeight", nGens = ["nGens"], initials = ["initials"], - stdh = ["stdh"], - liftGW2 = ["liftGW2"], + stdH = ["stdH"], + liftAlternative = ["liftAlternative"], lift = ["lift"], - interred = ["interred"], + interreduce = ["interreduce"], rep = ["rep"], inCone = ["inCone"], inseveral = ["inseveral"], @@ -157,11 +157,11 @@ function runb( println("Benchmarking ideals") for id in ideals - a = isequal( + a = Singular.isequal( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), s, ) - b = equalitytest(s, id) + b = "-" df = DataFrame(a = [a], b = [b],c=[v]) savea(df, "correct") end diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl similarity index 98% rename from src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl rename to src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl index 727eaa4b3..03e73f66f 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkingAlg/runbenchmark2.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl @@ -36,7 +36,7 @@ function runb2( println("Computing deglex-Basis") - stime = @belapsed Singular.std($ideal, complete_reduction = true) evals = 1 samples = 1 + stime = @belapsed Singular.std($ideal, complete_reduction = true) evals = 5 samples = 1 I = Singular.std(ideal, complete_reduction = true) ideals = [] println("Benchmarking groebnerwalk2") @@ -82,7 +82,7 @@ function runb2( ttime = @belapsed Singular.std( Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), complete_reduction = true, - ) evals=1 samples =1 + ) evals=5 samples =1 df = DataFrame( example=[v], From 6ff3a56a83be2e22eff5e3bc304ebc39786da953 Mon Sep 17 00:00:00 2001 From: welpj Date: Sun, 2 Jan 2022 11:07:50 +0100 Subject: [PATCH 47/85] Refactoring --- .../Benchmarking/BenchmarkHelper | 695 +++++------ .../Benchmarking/BspEinzeln.jl | 94 +- src/GroebnerWalkFinal/Benchmarking/BspVar3.jl | 1052 +++++++++++++---- .../GroebnerWalkFinalBenchmark.jl | 169 +-- .../GroebnerWalkFinalBenchmarkProcedures.jl | 291 ++--- src/GroebnerWalkFinal/Benchmarking/parser.jl | 6 +- .../Benchmarking/readWriteHelper.jl | 16 +- .../Benchmarking/runbenchmark.jl | 233 ++-- .../Benchmarking/runbenchmark2.jl | 184 +-- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 143 +-- 10 files changed, 1774 insertions(+), 1109 deletions(-) diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper index 5b6613b07..174c94dbc 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper @@ -5,367 +5,368 @@ function runAll( StartOrd::Matrix{Int64}, TarOrd::Matrix{Int64}, ) -runb(v,ideal,S,StartOrd,TarOrd) -runb2(v,ideal,S,StartOrd,TarOrd) + runb(v, ideal, S, StartOrd, TarOrd) + runb2(v, ideal, S, StartOrd, TarOrd) end function prepareAlloc() -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - example = ["example"], -) -savew(df, "allocsStandardWalk") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -for i in 2:10 -savew(df, "allocsPertubedWalk",i) -end + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + example = ["-"], + ) + savew(df, "allocsStandardWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = ["-"], + ) + for i = 2:10 + savew(df, "allocsPertubedWalk", i) + end -df = DataFrame( - nextW = ["nextW"], - facetnormal = ["-"], - initials = ["initials"], - stdH = ["stdH"], - liftgeneric = ["liftgeneric"], - interreduce = ["interreduce"], - example = ["example"], -) -savew(df, "allocsGenericWalk") + df = DataFrame( + nextW = ["-"], + facetnormal = ["-"], + initials = ["-"], + stdH = ["-"], + liftgeneric = ["-"], + interreduce = ["-"], + example = ["-"], + ) + savew(df, "allocsGenericWalk") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalk") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalklex") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], -liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalklookahead") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = [""], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "allocsFractalWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "allocsFractalWalklex") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "allocsFractalWalklookahead") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], -liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "allocsFractalWalkcombined") -df = DataFrame( - nextW = "nextW", - currrentWeight = "currrentWeight", - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - reprVec = ["reprVec"], - inCone = ["inCone"], - inSeveralCones = ["inSeveralCones"], - example = ["example"], -) -savew(df, "allocsTranWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "allocsFractalWalkcombined") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + reprVec = ["-"], + inCone = ["-"], + inSeveralCones = ["-"], + example = ["-"], + ) + savew(df, "allocsTranWalk") end function prepareExampleAlloc(v::String) -df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - example = [v], -) -savea(df, "allocsStandardWalk") -df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], -) -for i in 2:10 -savea(df, "allocsPertubedWalk",i) -end + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + example = [v], + ) + savea(df, "allocsStandardWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + for i = 2:10 + savea(df, "allocsPertubedWalk", i) + end -df = DataFrame( - nextW = ["-"], - facetnormal = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], - example = [v], -) -savea(df, "allocsGenericWalk") + df = DataFrame( + nextW = ["-"], + facetnormal = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftgeneric = ["-"], + interreduce = ["-"], + example = [v], + ) + savea(df, "allocsGenericWalk") -df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], -) -savea(df, "allocsFractalWalk") -df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], -) -savea(df, "allocsFractalWalklex") -df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], -) -savea(df, "allocsFractalWalklookahead") -df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], -) -savea(df, "allocsFractalWalkcombined") -df = DataFrame( - nextW = "-", - currrentWeight = "-", - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - reprVec = ["-"], - inCone = ["-"], - inSeveralCone = ["-"], - example = [v], -) -savea(df, "allocsTranWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalklex") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalklookahead") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "allocsFractalWalkcombined") + df = DataFrame( + nextW = "-", + currrentWeight = "-", + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + reprVec = ["-"], + inCone = ["-"], + inSeveralCone = ["-"], + example = [v], + ) + savea(df, "allocsTranWalk") end function prepareExampleElapsed(v::String) - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - example = [v], - ) - savea(df, "standardWalk") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = [v], - ) - for i in 2:10 - savea(df, "pertubedWalk",i) - end + df = DataFrame( + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + example = [v], + ) + savea(df, "standardWalk") + df = DataFrame( + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = [v], + ) + for i = 2:10 + savea(df, "pertubedWalk", i) + end - df = DataFrame( - NextcurrrentWeight = ["-"], - facetnormal = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], - example = [v], - ) - savea(df, "genericWalk") + df = DataFrame( + NextcurrrentWeight = ["-"], + facetnormal = ["-"], + initials = ["-"], + stdH = ["-"], + liftgeneric = ["-"], + interreduce = ["-"], + example = [v], + ) + savea(df, "genericWalk") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalk") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalklex") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalklookahead") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = [v], - ) - savea(df, "fractalWalkcombined") - df = DataFrame( - NextcurrrentWeight = "-", - currrentWeight = "-", - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - reprVec = ["-"], - inCone = ["-"], - inSeveralCone = ["-"], - example = [v], - ) - savea(df, "tranWalk") + df = DataFrame( + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalk") + df = DataFrame( + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalklex") + df = DataFrame( + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalklookahead") + df = DataFrame( + NextcurrrentWeight = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = [v], + ) + savea(df, "fractalWalkcombined") + df = DataFrame( + NextcurrrentWeight = "-", + currrentWeight = "-", + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + reprVec = ["-"], + inCone = ["-"], + inSeveralCone = ["-"], + example = [v], + ) + savea(df, "tranWalk") end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl index 925354c80..fb65e4cc4 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl @@ -17,9 +17,9 @@ function runAllSingleExample() prepareAlloc() id = katsura5() - R= base_ring(id) + R = base_ring(id) dim = nvars(R) - ve=ones(Int64,dim) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -28,9 +28,9 @@ function runAllSingleExample() id = katsura6() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -40,9 +40,9 @@ dim = nvars(R) example = "Cyclic7" id = cyclic7() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -53,9 +53,9 @@ dim = nvars(R) example = "Cyclic6" id = cyclic6() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -64,9 +64,9 @@ dim = nvars(R) example = "Cyclic5" id = cyclic5() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -75,9 +75,9 @@ dim = nvars(R) example = "eco6" id = eco6() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -85,9 +85,9 @@ dim = nvars(R) example = "eco7" id = eco7() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -95,9 +95,9 @@ dim = nvars(R) example = "noon5" id = noon5() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -107,9 +107,9 @@ dim = nvars(R) example = "noon6" id = noon6() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -117,9 +117,9 @@ dim = nvars(R) example = "noon7" id = noon7() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -127,9 +127,9 @@ dim = nvars(R) example = "noon8" id = noon8() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -137,9 +137,9 @@ dim = nvars(R) example = "redeco7" id = redeco7() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -147,9 +147,9 @@ dim = nvars(R) example = "redeco8" id = redeco8() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -157,9 +157,9 @@ dim = nvars(R) example = "wang91" id = wang91() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -167,9 +167,9 @@ dim = nvars(R) example = "cohn4" id = cohn4() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -177,9 +177,9 @@ dim = nvars(R) example = "of" id = oberfr() -R= base_ring(id) -dim = nvars(R) - ve=ones(Int64,dim) + R = base_ring(id) + dim = nvars(R) + ve = ones(Int64, dim) StartOrd = ordering_as_matrix(ve, :lex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl index c7b99cfa5..61dcb4dbe 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl +++ b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl @@ -29,221 +29,855 @@ function benchmarkVar3() ideals, Singular.Ideal( R,[48*b+23*a*c+47*a^5+69*a*b^4, -53*b*c^2, -65+21*a*b*c^2])) -push!( + 53*b*c^2, + 65+21*a*b*c^2])) + push!( ideals, Singular.Ideal( R,[R(47), -4*a*b^3+64*a^3*b^2, -40*a+90*b^2+59*a*b^2+74*b^4*c])) -push!( + 4*a*b^3+64*a^3*b^2, + 40*a+90*b^2+59*a*b^2+74*b^4*c])) + push!( ideals, Singular.Ideal( R,[89*c+78*a*c^3, -26*a*c^2, -26+4*c^2+89*a^4*b+73*a^2*b^2*c])) -for i in ideals + 26*a*c^2, + 26+4*c^2+89*a^4*b+73*a^2*b^2*c])) + for i in ideals runAll("sparseid(3,0,5,100-(1*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[]=# -push!( - ideals, - Singular.Ideal( - R,[65+a^3+37*a^4+60*a^3*c^2, -47*a*b+4*a^2*b+35*b*c^4, -a+23*a^3*b+84*a*b^2*c^2])) -push!( - ideals, - Singular.Ideal( - R,[86+77*a+13*a^3+23*a^2*b+21*c^4+4*a*b^4+7*c^5, -82*c^2, -23*c^4+4*a^3*b*c])) -push!( - ideals, - Singular.Ideal( - R,[71*c^3+67*a^4+14*b*c^4, -64+87*b^2+40*a^2*b+21*b^2*c^2+73*a^4*b, -50*b+21*a^2*b^3])) -for i in ideals - runAll("sparseid(3,0,5,100-(2*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[22+38*b*c^2+60*a*c^4, -14*a+67*a^2+58*b^2*c^2+87*b^5+88*a^2*b*c^2, -67*a*c+83*a^2*c+87*b^4+18*a*c^3+74*b^3*c^2])) -push!( - ideals, - Singular.Ideal( - R,[49*a+88*a*b*c^2+55*a*b*c^3, -5*c^2+83*a^3*b+10*a^4*c+28*a*c^4, -54+19*b^2+8*b*c^2+54*c^3+10*a*b^2*c+40*c^5])) -push!( - ideals, - Singular.Ideal( - R,[44*c+60*b*c+3*a^2*c+43*c^4, -85*a^2+36*b^3*c^2+19*c^5, -5+64*a*b^2+55*a^2*b^2+18*b^4+26*b*c^4+5*c^5])) -for i in ideals - runAll("sparseid(3,0,5,100-(3*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[74*a*c+48*b*c+26*a*b^2*c+9*c^4+83*a*b^4+45*b^5+49*a^3*c^2, -85+42*a*b^2*c+68*a*c^3+50*b^2*c^3+45*c^5, -26*a+59*a^2*b+49*a^2*c+75*c^3+40*a^2*c^3])) -push!( - ideals, - Singular.Ideal( - R,[48*a*c+19*a*c^2+23*a^3*b^2+42*a*b^2*c^2, -18*b^2+32*a^2*b+64*b*c^2+44*a*b^3+2*b^4+23*a^3*b^2+2*a^2*b^3+13*b^3*c^2, -41+19*c+51*a*b^3+9*b*c^3+50*a*b*c^3])) -push!( - ideals, - Singular.Ideal( - R,[49*c^3+78*c^5, -12*a+22*b^4+40*a^3*b*c+44*a*b*c^3, -75+87*a*b+86*c^2+16*a^2*b+53*c^3+87*a^3*c+87*a*c^3+28*b*c^3+23*a^2*b^2*c+15*b^4*c+65*b^2*c^3])) -for i in ideals - runAll("sparseid(3,0,5,100-(4*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[36*b*c+80*b^3+29*c^3+70*a*b^2*c+23*a^2*c^2+86*a^3*b^2+29*b^4*c+55*b*c^4, -65+75*a*c+58*b^3+69*a^3*b+64*a*b^2*c+82*a*b^4+24*c^5, -53*b+39*a^2*b*c+42*a^3*b*c+42*a^2*b*c^2])) -push!( - ideals, - Singular.Ideal( - R,[78+7*a*c+21*a^2*b+20*b^2*c+85*b^3*c+34*b*c^3+9*b^2*c^3, -37*a^2*b^2+89*a^3*b^2+45*a*b^4+76*a^3*c^2+21*a*c^4+22*b*c^4, -37*c+24*b^2+49*b^2*c+15*a^2*b*c+55*a*c^3+5*a^2*c^3])) -push!( - ideals, - Singular.Ideal( - R,[18+89*b^2+80*a^3+22*a^2*c^2+75*b^2*c^2+58*b*c^3+64*a*b^3*c+85*a^3*c^2+4*a^2*b*c^2+46*a^2*c^3, -16*a*b+31*a^3+10*b^3+9*a*b^2*c+67*a^2*c^2+46*a^2*b*c^2, -86*a+19*a^5+8*b^4*c])) -for i in ideals - runAll("sparseid(3,0,5,100-(5*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[48*a+18*a^2+90*a*c+7*b*c+81*a*b*c+2*b^2*c+69*b^4+57*a*b*c^2, -20+35*b+24*b^4+11*b^3*c+49*a*c^3+22*a^3*b^2+76*a*b^4+3*a^2*b^2*c+47*b^2*c^3, -89*a^2*b+9*a*b^2+62*a*b^3+74*a^4*b+32*a^3*b^2+87*a^2*b^3+62*b*c^4])) -push!( - ideals, - Singular.Ideal( - R,[48+15*a+42*a^2+35*c^2+72*b^4, -37*c^2+17*a*b^2+46*a*b*c+78*a^2*b*c+33*a*b*c^2+34*b^2*c^2+63*a*c^3+71*a^3*b^2+22*a^4*c+29*a^2*b^2*c+12*a^3*c^2+66*a*c^4+86*b*c^4, -73*c+52*a*b^2+69*a*b*c+18*a*b*c^2+49*a^4*b+77*b^3*c^2])) -push!( - ideals, - Singular.Ideal( - R,[50*b+63*c^2+51*a^3+26*b^4*c+77*a^3*c^2+67*b^3*c^2, -11*b+48*a*b+57*a^4+10*b^4+23*a^5+14*a*b^4, -19+79*a*c+3*a*b^2+27*a*b*c+74*b^2*c+62*a^3*c+31*a^2*b*c+30*a*b^2*c+43*b^3*c+8*a*b^3*c+31*a^2*b*c^2+86*b^3*c^2])) -for i in ideals - runAll("sparseid(3,0,5,100-(6*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[42+23*a*b+8*a^2*b+20*a^2*c+76*a^3*b*c+78*b^3*c^2+2*a*b*c^3+6*b^2*c^3+25*b*c^4, -31*c+50*b*c+80*a^2*b+79*a^3*b+85*a*b*c^2+58*a*b^4+2*a^3*c^2+16*c^5, -88*a+52*a*b+17*b^3+78*b*c^2+40*a^2*b^2+14*b^3*c+85*a^2*c^2+85*b^2*c^2+80*c^4+19*a^2*b^2*c])) -push!( - ideals, - Singular.Ideal( - R,[61*a*b+35*b*c^2+13*a*b*c^2+69*b^2*c^2+20*b*c^3+21*a*b^4+21*a*b^3*c+53*b^3*c^2, -90+39*a+62*a^3*c+61*b*c^3+55*c^4+22*b^4*c+35*a^3*c^2+41*a*c^4+75*c^5, -56*c+a*c+13*b*c+33*a*b^2+65*b^3+45*a^2*c+71*b*c^2+4*a*b*c^2+82*a*b^3*c+70*b^2*c^3])) -push!( - ideals, - Singular.Ideal( - R,[87*a*c+73*a*b^2+62*a*c^2+55*a^2*b^2+78*b^4+77*c^4+2*a^3*b^2+40*b^2*c^3+49*b*c^4, -58+42*c+85*a*b+58*a^2*b*c, -70*c+11*b^2+20*a^2*b+47*b^2*c+69*b*c^2+4*a^3*b+72*a*b*c^2+72*a*c^3+43*a^2*b^3+76*a*b^4+22*a^3*b*c+36*a^2*b*c^2+64*b^2*c^3+28*c^5])) -for i in ideals - runAll("sparseid(3,0,5,100-(7*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[29+47*c+89*b^2+76*b*c+26*a^3+5*b^2*c^2+66*c^4+21*a^4*b+31*a^3*b^2+33*a*b^3*c+18*a*b^2*c^2+51*b^2*c^3, -22*a+57*a*c^2+56*c^3+62*a^4+10*a^3*c+22*a*c^3+68*a^3*b*c+10*a^2*c^3+34*a*b*c^3, -21*b^2+15*a*b*c+42*b^2*c+83*a^3*b+81*a*b^2*c+80*b^2*c^2+33*a*b*c^3+42*a*c^4+82*b*c^4])) -push!( - ideals, - Singular.Ideal( - R,[17+21*c+67*a^2*c+70*b^2*c+84*a^2*b^2+14*a*b^2*c+66*a*b*c^2+23*a*b^4+6*b^5+22*a^2*c^3, -b+56*a^2+7*b^2+42*a^2*c+36*a*b*c+28*c^3+53*a^4+49*a^3*c+12*a^2*b^3+53*a*b^4+6*b^4*c+30*a^2*c^3+88*a*b*c^3+54*b^2*c^3, -28*b*c+16*a^3*b+65*a^2*c^2+23*a*c^3+54*b^3*c^2+38*a*b*c^3])) -push!( - ideals, - Singular.Ideal( - R,[64*b^2+4*a^2*b+78*c^3+17*a*b^3+48*b^4+28*a*b^4+16*a^3*c^2, -49*c+25*a^2+13*c^2+87*a^2*c+34*c^3+88*a^2*b*c+8*a^3*b^2+6*a^2*b*c^2+31*a*c^4, -64+30*b+14*a*b*c+47*a^2*b^2+38*a*b^3+23*a^3*c+10*a^2*b*c+21*b^3*c+46*a^4*c+38*a^3*b*c+34*b^4*c+17*a^3*c^2+89*a^2*b*c^2+71*b^3*c^2])) -for i in ideals - runAll("sparseid(3,0,5,100-(8*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[88*b+63*c^2+49*a*b*c+78*b*c^2+31*a^3*b+77*a*b^2*c+12*b^3*c+44*a^2*c^2+49*b^2*c^2+36*a*c^3+42*a^3*b*c+21*a^2*b^2*c+44*a*b^2*c^2, -2+55*a*b+75*a*c+75*b*c+51*a*b*c+59*a^3*b*c+39*a^2*c^3+89*c^5, -36*c+35*a^2*b+68*b^2*c+2*c^3+55*a^3*c+20*a*b^2*c+77*a^2*c^2+30*a^5+61*a^4*b+42*a^4*c+29*a*b^3*c+77*a^3*c^2+69*c^5])) -push!( - ideals, - Singular.Ideal( - R,[44+4*a+60*c^2+35*a^3+15*a^2*c+47*b^2*c+68*b*c^2+2*a*b^3+4*a^5+7*a^3*b*c+70*a^2*b^2*c+56*a*b^3*c+70*b^2*c^3+2*a*c^4+40*c^5, -31*c+34*b*c+52*a*c^2+33*a^3*b+45*a^3*c+82*a*b*c^2+77*b*c^3+30*a^2*b^2*c+31*a^2*b*c^2+83*c^5, -33*a*c+40*b*c+25*b^2*c+78*a^4+68*a^2*b^2+65*a*b*c^2+c^4+40*a^2*c^3+49*a*c^4])) -push!( - ideals, - Singular.Ideal( - R,[21*c^2+42*a^2*b+12*a*b^2+15*a*c^2+43*b*c^2+34*a*b^3+10*a^3*c+57*a^2*b*c+36*b^2*c^2+64*b^5+86*a^3*b*c+7*b^4*c+78*a*b*c^3+52*b^2*c^3+82*c^5, -45*a*c+63*a^3+8*a^4+80*b^2*c^2+76*a^4*b+46*a*b^2*c^2+9*b^3*c^2+11*a*c^4, -54+73*a+24*c+70*a^2+7*a*b+15*a^2*c+89*a^4+57*b^4+26*b*c^3+38*a^2*b^2*c+81*b^4*c])) -for i in ideals - runAll("sparseid(3,0,5,100-(9*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] -push!( - ideals, - Singular.Ideal( - R,[8*c+50*b^2+29*b*c+55*a^3+8*a^2*c+27*b^2*c+67*a*c^2+55*b^3*c+26*a^4*b+85*a^2*b^3+10*b^5+15*a*b^2*c^2+64*a^2*c^3, -76*a+64*a*b+20*b^2+24*a^3*b+79*b^4+11*b^2*c^2+5*a*c^3+88*b*c^3+3*c^4+67*a^3*b^2+37*a^2*b^3+47*a*b^3*c+51*a^2*c^3, -46+35*a*b^2+26*a*c^2+27*a^4+54*a*c^3+31*a^5+42*a^2*b^3+74*b^2*c^3+33*b*c^4])) -push!( - ideals, - Singular.Ideal( - R,[62+85*b+37*c+9*a*c+56*a*c^2+76*b*c^2+55*c^3+70*a^4+20*a*b^3+21*a*c^3+73*a*b^2*c^2+69*a*c^4, -36*b^3+30*b^2*c+61*a^3*b+54*a^2*b^2+10*a*b^3+87*b^5+49*a^3*c^2+49*a*b^2*c^2+76*a^2*c^3+11*a*b*c^3+49*b^2*c^3, -74*b^2+12*a*c+11*b*c+40*a^2*c+63*a^4+86*b^4+17*a^2*c^2+86*a^3*b^2+88*b^5+56*a^2*b^2*c+13*a*b^2*c^2+22*c^5])) -push!( - ideals, - Singular.Ideal( - R,[30*a+86*a*b*c+74*b^2*c+9*c^3+57*a^4+65*a^3*b+46*a*b^3+23*b^3*c+13*a*c^3+65*b*c^3+3*b^4*c+15*a^3*c^2+69*b^3*c^2+86*b*c^4, -1+57*a^2+7*a*b+37*a^3+15*a^2*c+79*a*b^3+80*b*c^3+42*a^3*b^2+38*a^2*b*c^2+15*b^2*c^3+32*a*c^4, -77*b+76*b^2+2*c^2+15*a*c^2+9*a^4+40*a^3*b^2+8*a^2*b^2*c+16*a^3*c^2+76*a^2*c^3+24*a*b*c^3])) -for i in ideals - runAll("sparseid(3,0,5,100-(10*2),90)", i, S, StartOrd, TarOrd) -end -ideals =[] + end + ideals =[]=# + push!( + ideals, + Singular.Ideal( + R, + [ + 65 + a^3 + 37 * a^4 + 60 * a^3 * c^2, + 47 * a * b + 4 * a^2 * b + 35 * b * c^4, + a + 23 * a^3 * b + 84 * a * b^2 * c^2, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 86 + + 77 * a + + 13 * a^3 + + 23 * a^2 * b + + 21 * c^4 + + 4 * a * b^4 + + 7 * c^5, + 82 * c^2, + 23 * c^4 + 4 * a^3 * b * c, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 71 * c^3 + 67 * a^4 + 14 * b * c^4, + 64 + 87 * b^2 + 40 * a^2 * b + 21 * b^2 * c^2 + 73 * a^4 * b, + 50 * b + 21 * a^2 * b^3, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(2*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 22 + 38 * b * c^2 + 60 * a * c^4, + 14 * a + + 67 * a^2 + + 58 * b^2 * c^2 + + 87 * b^5 + + 88 * a^2 * b * c^2, + 67 * a * c + + 83 * a^2 * c + + 87 * b^4 + + 18 * a * c^3 + + 74 * b^3 * c^2, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 49 * a + 88 * a * b * c^2 + 55 * a * b * c^3, + 5 * c^2 + 83 * a^3 * b + 10 * a^4 * c + 28 * a * c^4, + 54 + + 19 * b^2 + + 8 * b * c^2 + + 54 * c^3 + + 10 * a * b^2 * c + + 40 * c^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 44 * c + 60 * b * c + 3 * a^2 * c + 43 * c^4, + 85 * a^2 + 36 * b^3 * c^2 + 19 * c^5, + 5 + + 64 * a * b^2 + + 55 * a^2 * b^2 + + 18 * b^4 + + 26 * b * c^4 + + 5 * c^5, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(3*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 74 * a * c + + 48 * b * c + + 26 * a * b^2 * c + + 9 * c^4 + + 83 * a * b^4 + + 45 * b^5 + + 49 * a^3 * c^2, + 85 + + 42 * a * b^2 * c + + 68 * a * c^3 + + 50 * b^2 * c^3 + + 45 * c^5, + 26 * a + + 59 * a^2 * b + + 49 * a^2 * c + + 75 * c^3 + + 40 * a^2 * c^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 48 * a * c + 19 * a * c^2 + 23 * a^3 * b^2 + 42 * a * b^2 * c^2, + 18 * b^2 + + 32 * a^2 * b + + 64 * b * c^2 + + 44 * a * b^3 + + 2 * b^4 + + 23 * a^3 * b^2 + + 2 * a^2 * b^3 + + 13 * b^3 * c^2, + 41 + 19 * c + 51 * a * b^3 + 9 * b * c^3 + 50 * a * b * c^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 49 * c^3 + 78 * c^5, + 12 * a + 22 * b^4 + 40 * a^3 * b * c + 44 * a * b * c^3, + 75 + + 87 * a * b + + 86 * c^2 + + 16 * a^2 * b + + 53 * c^3 + + 87 * a^3 * c + + 87 * a * c^3 + + 28 * b * c^3 + + 23 * a^2 * b^2 * c + + 15 * b^4 * c + + 65 * b^2 * c^3, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(4*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 36 * b * c + + 80 * b^3 + + 29 * c^3 + + 70 * a * b^2 * c + + 23 * a^2 * c^2 + + 86 * a^3 * b^2 + + 29 * b^4 * c + + 55 * b * c^4, + 65 + + 75 * a * c + + 58 * b^3 + + 69 * a^3 * b + + 64 * a * b^2 * c + + 82 * a * b^4 + + 24 * c^5, + 53 * b + + 39 * a^2 * b * c + + 42 * a^3 * b * c + + 42 * a^2 * b * c^2, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 78 + + 7 * a * c + + 21 * a^2 * b + + 20 * b^2 * c + + 85 * b^3 * c + + 34 * b * c^3 + + 9 * b^2 * c^3, + 37 * a^2 * b^2 + + 89 * a^3 * b^2 + + 45 * a * b^4 + + 76 * a^3 * c^2 + + 21 * a * c^4 + + 22 * b * c^4, + 37 * c + + 24 * b^2 + + 49 * b^2 * c + + 15 * a^2 * b * c + + 55 * a * c^3 + + 5 * a^2 * c^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 18 + + 89 * b^2 + + 80 * a^3 + + 22 * a^2 * c^2 + + 75 * b^2 * c^2 + + 58 * b * c^3 + + 64 * a * b^3 * c + + 85 * a^3 * c^2 + + 4 * a^2 * b * c^2 + + 46 * a^2 * c^3, + 16 * a * b + + 31 * a^3 + + 10 * b^3 + + 9 * a * b^2 * c + + 67 * a^2 * c^2 + + 46 * a^2 * b * c^2, + 86 * a + 19 * a^5 + 8 * b^4 * c, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(5*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 48 * a + + 18 * a^2 + + 90 * a * c + + 7 * b * c + + 81 * a * b * c + + 2 * b^2 * c + + 69 * b^4 + + 57 * a * b * c^2, + 20 + + 35 * b + + 24 * b^4 + + 11 * b^3 * c + + 49 * a * c^3 + + 22 * a^3 * b^2 + + 76 * a * b^4 + + 3 * a^2 * b^2 * c + + 47 * b^2 * c^3, + 89 * a^2 * b + + 9 * a * b^2 + + 62 * a * b^3 + + 74 * a^4 * b + + 32 * a^3 * b^2 + + 87 * a^2 * b^3 + + 62 * b * c^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 48 + 15 * a + 42 * a^2 + 35 * c^2 + 72 * b^4, + 37 * c^2 + + 17 * a * b^2 + + 46 * a * b * c + + 78 * a^2 * b * c + + 33 * a * b * c^2 + + 34 * b^2 * c^2 + + 63 * a * c^3 + + 71 * a^3 * b^2 + + 22 * a^4 * c + + 29 * a^2 * b^2 * c + + 12 * a^3 * c^2 + + 66 * a * c^4 + + 86 * b * c^4, + 73 * c + + 52 * a * b^2 + + 69 * a * b * c + + 18 * a * b * c^2 + + 49 * a^4 * b + + 77 * b^3 * c^2, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 50 * b + + 63 * c^2 + + 51 * a^3 + + 26 * b^4 * c + + 77 * a^3 * c^2 + + 67 * b^3 * c^2, + 11 * b + + 48 * a * b + + 57 * a^4 + + 10 * b^4 + + 23 * a^5 + + 14 * a * b^4, + 19 + + 79 * a * c + + 3 * a * b^2 + + 27 * a * b * c + + 74 * b^2 * c + + 62 * a^3 * c + + 31 * a^2 * b * c + + 30 * a * b^2 * c + + 43 * b^3 * c + + 8 * a * b^3 * c + + 31 * a^2 * b * c^2 + + 86 * b^3 * c^2, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(6*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 42 + + 23 * a * b + + 8 * a^2 * b + + 20 * a^2 * c + + 76 * a^3 * b * c + + 78 * b^3 * c^2 + + 2 * a * b * c^3 + + 6 * b^2 * c^3 + + 25 * b * c^4, + 31 * c + + 50 * b * c + + 80 * a^2 * b + + 79 * a^3 * b + + 85 * a * b * c^2 + + 58 * a * b^4 + + 2 * a^3 * c^2 + + 16 * c^5, + 88 * a + + 52 * a * b + + 17 * b^3 + + 78 * b * c^2 + + 40 * a^2 * b^2 + + 14 * b^3 * c + + 85 * a^2 * c^2 + + 85 * b^2 * c^2 + + 80 * c^4 + + 19 * a^2 * b^2 * c, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 61 * a * b + + 35 * b * c^2 + + 13 * a * b * c^2 + + 69 * b^2 * c^2 + + 20 * b * c^3 + + 21 * a * b^4 + + 21 * a * b^3 * c + + 53 * b^3 * c^2, + 90 + + 39 * a + + 62 * a^3 * c + + 61 * b * c^3 + + 55 * c^4 + + 22 * b^4 * c + + 35 * a^3 * c^2 + + 41 * a * c^4 + + 75 * c^5, + 56 * c + + a * c + + 13 * b * c + + 33 * a * b^2 + + 65 * b^3 + + 45 * a^2 * c + + 71 * b * c^2 + + 4 * a * b * c^2 + + 82 * a * b^3 * c + + 70 * b^2 * c^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 87 * a * c + + 73 * a * b^2 + + 62 * a * c^2 + + 55 * a^2 * b^2 + + 78 * b^4 + + 77 * c^4 + + 2 * a^3 * b^2 + + 40 * b^2 * c^3 + + 49 * b * c^4, + 58 + 42 * c + 85 * a * b + 58 * a^2 * b * c, + 70 * c + + 11 * b^2 + + 20 * a^2 * b + + 47 * b^2 * c + + 69 * b * c^2 + + 4 * a^3 * b + + 72 * a * b * c^2 + + 72 * a * c^3 + + 43 * a^2 * b^3 + + 76 * a * b^4 + + 22 * a^3 * b * c + + 36 * a^2 * b * c^2 + + 64 * b^2 * c^3 + + 28 * c^5, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(7*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 29 + + 47 * c + + 89 * b^2 + + 76 * b * c + + 26 * a^3 + + 5 * b^2 * c^2 + + 66 * c^4 + + 21 * a^4 * b + + 31 * a^3 * b^2 + + 33 * a * b^3 * c + + 18 * a * b^2 * c^2 + + 51 * b^2 * c^3, + 22 * a + + 57 * a * c^2 + + 56 * c^3 + + 62 * a^4 + + 10 * a^3 * c + + 22 * a * c^3 + + 68 * a^3 * b * c + + 10 * a^2 * c^3 + + 34 * a * b * c^3, + 21 * b^2 + + 15 * a * b * c + + 42 * b^2 * c + + 83 * a^3 * b + + 81 * a * b^2 * c + + 80 * b^2 * c^2 + + 33 * a * b * c^3 + + 42 * a * c^4 + + 82 * b * c^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 17 + + 21 * c + + 67 * a^2 * c + + 70 * b^2 * c + + 84 * a^2 * b^2 + + 14 * a * b^2 * c + + 66 * a * b * c^2 + + 23 * a * b^4 + + 6 * b^5 + + 22 * a^2 * c^3, + b + + 56 * a^2 + + 7 * b^2 + + 42 * a^2 * c + + 36 * a * b * c + + 28 * c^3 + + 53 * a^4 + + 49 * a^3 * c + + 12 * a^2 * b^3 + + 53 * a * b^4 + + 6 * b^4 * c + + 30 * a^2 * c^3 + + 88 * a * b * c^3 + + 54 * b^2 * c^3, + 28 * b * c + + 16 * a^3 * b + + 65 * a^2 * c^2 + + 23 * a * c^3 + + 54 * b^3 * c^2 + + 38 * a * b * c^3, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 64 * b^2 + + 4 * a^2 * b + + 78 * c^3 + + 17 * a * b^3 + + 48 * b^4 + + 28 * a * b^4 + + 16 * a^3 * c^2, + 49 * c + + 25 * a^2 + + 13 * c^2 + + 87 * a^2 * c + + 34 * c^3 + + 88 * a^2 * b * c + + 8 * a^3 * b^2 + + 6 * a^2 * b * c^2 + + 31 * a * c^4, + 64 + + 30 * b + + 14 * a * b * c + + 47 * a^2 * b^2 + + 38 * a * b^3 + + 23 * a^3 * c + + 10 * a^2 * b * c + + 21 * b^3 * c + + 46 * a^4 * c + + 38 * a^3 * b * c + + 34 * b^4 * c + + 17 * a^3 * c^2 + + 89 * a^2 * b * c^2 + + 71 * b^3 * c^2, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(8*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 88 * b + + 63 * c^2 + + 49 * a * b * c + + 78 * b * c^2 + + 31 * a^3 * b + + 77 * a * b^2 * c + + 12 * b^3 * c + + 44 * a^2 * c^2 + + 49 * b^2 * c^2 + + 36 * a * c^3 + + 42 * a^3 * b * c + + 21 * a^2 * b^2 * c + + 44 * a * b^2 * c^2, + 2 + + 55 * a * b + + 75 * a * c + + 75 * b * c + + 51 * a * b * c + + 59 * a^3 * b * c + + 39 * a^2 * c^3 + + 89 * c^5, + 36 * c + + 35 * a^2 * b + + 68 * b^2 * c + + 2 * c^3 + + 55 * a^3 * c + + 20 * a * b^2 * c + + 77 * a^2 * c^2 + + 30 * a^5 + + 61 * a^4 * b + + 42 * a^4 * c + + 29 * a * b^3 * c + + 77 * a^3 * c^2 + + 69 * c^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 44 + + 4 * a + + 60 * c^2 + + 35 * a^3 + + 15 * a^2 * c + + 47 * b^2 * c + + 68 * b * c^2 + + 2 * a * b^3 + + 4 * a^5 + + 7 * a^3 * b * c + + 70 * a^2 * b^2 * c + + 56 * a * b^3 * c + + 70 * b^2 * c^3 + + 2 * a * c^4 + + 40 * c^5, + 31 * c + + 34 * b * c + + 52 * a * c^2 + + 33 * a^3 * b + + 45 * a^3 * c + + 82 * a * b * c^2 + + 77 * b * c^3 + + 30 * a^2 * b^2 * c + + 31 * a^2 * b * c^2 + + 83 * c^5, + 33 * a * c + + 40 * b * c + + 25 * b^2 * c + + 78 * a^4 + + 68 * a^2 * b^2 + + 65 * a * b * c^2 + + c^4 + + 40 * a^2 * c^3 + + 49 * a * c^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 21 * c^2 + + 42 * a^2 * b + + 12 * a * b^2 + + 15 * a * c^2 + + 43 * b * c^2 + + 34 * a * b^3 + + 10 * a^3 * c + + 57 * a^2 * b * c + + 36 * b^2 * c^2 + + 64 * b^5 + + 86 * a^3 * b * c + + 7 * b^4 * c + + 78 * a * b * c^3 + + 52 * b^2 * c^3 + + 82 * c^5, + 45 * a * c + + 63 * a^3 + + 8 * a^4 + + 80 * b^2 * c^2 + + 76 * a^4 * b + + 46 * a * b^2 * c^2 + + 9 * b^3 * c^2 + + 11 * a * c^4, + 54 + + 73 * a + + 24 * c + + 70 * a^2 + + 7 * a * b + + 15 * a^2 * c + + 89 * a^4 + + 57 * b^4 + + 26 * b * c^3 + + 38 * a^2 * b^2 * c + + 81 * b^4 * c, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(9*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] + push!( + ideals, + Singular.Ideal( + R, + [ + 8 * c + + 50 * b^2 + + 29 * b * c + + 55 * a^3 + + 8 * a^2 * c + + 27 * b^2 * c + + 67 * a * c^2 + + 55 * b^3 * c + + 26 * a^4 * b + + 85 * a^2 * b^3 + + 10 * b^5 + + 15 * a * b^2 * c^2 + + 64 * a^2 * c^3, + 76 * a + + 64 * a * b + + 20 * b^2 + + 24 * a^3 * b + + 79 * b^4 + + 11 * b^2 * c^2 + + 5 * a * c^3 + + 88 * b * c^3 + + 3 * c^4 + + 67 * a^3 * b^2 + + 37 * a^2 * b^3 + + 47 * a * b^3 * c + + 51 * a^2 * c^3, + 46 + + 35 * a * b^2 + + 26 * a * c^2 + + 27 * a^4 + + 54 * a * c^3 + + 31 * a^5 + + 42 * a^2 * b^3 + + 74 * b^2 * c^3 + + 33 * b * c^4, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 62 + + 85 * b + + 37 * c + + 9 * a * c + + 56 * a * c^2 + + 76 * b * c^2 + + 55 * c^3 + + 70 * a^4 + + 20 * a * b^3 + + 21 * a * c^3 + + 73 * a * b^2 * c^2 + + 69 * a * c^4, + 36 * b^3 + + 30 * b^2 * c + + 61 * a^3 * b + + 54 * a^2 * b^2 + + 10 * a * b^3 + + 87 * b^5 + + 49 * a^3 * c^2 + + 49 * a * b^2 * c^2 + + 76 * a^2 * c^3 + + 11 * a * b * c^3 + + 49 * b^2 * c^3, + 74 * b^2 + + 12 * a * c + + 11 * b * c + + 40 * a^2 * c + + 63 * a^4 + + 86 * b^4 + + 17 * a^2 * c^2 + + 86 * a^3 * b^2 + + 88 * b^5 + + 56 * a^2 * b^2 * c + + 13 * a * b^2 * c^2 + + 22 * c^5, + ], + ), + ) + push!( + ideals, + Singular.Ideal( + R, + [ + 30 * a + + 86 * a * b * c + + 74 * b^2 * c + + 9 * c^3 + + 57 * a^4 + + 65 * a^3 * b + + 46 * a * b^3 + + 23 * b^3 * c + + 13 * a * c^3 + + 65 * b * c^3 + + 3 * b^4 * c + + 15 * a^3 * c^2 + + 69 * b^3 * c^2 + + 86 * b * c^4, + 1 + + 57 * a^2 + + 7 * a * b + + 37 * a^3 + + 15 * a^2 * c + + 79 * a * b^3 + + 80 * b * c^3 + + 42 * a^3 * b^2 + + 38 * a^2 * b * c^2 + + 15 * b^2 * c^3 + + 32 * a * c^4, + 77 * b + + 76 * b^2 + + 2 * c^2 + + 15 * a * c^2 + + 9 * a^4 + + 40 * a^3 * b^2 + + 8 * a^2 * b^2 * c + + 16 * a^3 * c^2 + + 76 * a^2 * c^3 + + 24 * a * b * c^3, + ], + ), + ) + for i in ideals + runAll("sparseid(3,0,5,100-(10*2),90)", i, S, StartOrd, TarOrd) + end + ideals = [] end diff --git a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl index e8cc3b96f..bd09c2959 100644 --- a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl @@ -1,8 +1,18 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl") +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl", +) +include( + "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl", +) using BenchmarkTools ############################################################### @@ -103,7 +113,11 @@ function groebnerwalk2( end -function standard_walkAlloc(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function standard_walkAlloc( + G::Singular.sideal, + S::Matrix{Int64}, + T::Matrix{Int64}, +) #println("standard_walkAlloc results") #println("Crossed Cones in: ") standard_walkAlloc(G, S, T, S[1, :], T[1, :]) @@ -138,13 +152,10 @@ function standard_stepAlloc( G::Singular.sideal, R::Singular.PolyRing, cw::Vector{Int64}, - Rn::Singular.PolyRing + Rn::Singular.PolyRing, ) Gw = initials(Rn, gens(G), cw) - H = Singular.std( - Singular.Ideal(Rn, Gw), - complete_reduction = true, - ) + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) return Singular.std(H, complete_reduction = true) @@ -166,7 +177,7 @@ function generic_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while !isempty(v) #global counter = getCounter() + 1 #println(v) - G, Lm = generic_stepAlloc(G, Lm, v, T,R) + G, Lm = generic_stepAlloc(G, Lm, v, T, R) v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) @@ -177,12 +188,12 @@ function generic_stepAlloc( Lm::Vector{Singular.spoly{L}}, v::Vector{Int64}, T::Matrix{Int64}, - R::Singular.PolyRing + R::Singular.PolyRing, ) where {L<:Nemo.RingElem} Rn = Singular.base_ring(G) - facet_Generators = facet_initials(G,Lm, v) + facet_Generators = facet_initials(G, Lm, v) H = Singular.std( Singular.Ideal(Rn, facet_Generators), complete_reduction = true, @@ -267,7 +278,7 @@ function fractal_walk2( #println(PertVecs) #println("FacrtalWalk_standard results") #println("Crossed Cones in: ") - Gb = fractal_recursiv2(G, S,T, PertVecs, 1) + Gb = fractal_recursiv2(G, S, T, PertVecs, 1) #println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -287,7 +298,7 @@ function fractal_recursiv2( while !terminate t = nextT(G, w, PertVecs[p]) if (t == [0]) - if inCone(G, T,PertVecs[p]) + if inCone(G, T, PertVecs[p]) return G else global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] @@ -441,43 +452,37 @@ function fractal_walk2_recursive_lex2( else global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - #println(PertVecs) + #println(PertVecs) continue end end - if t == 1 && p==1 - return fractal_walk2_recursive_lex2( - G, - S, - T, - PertVecs, - p + 1, - ) + if t == 1 && p == 1 + return fractal_walk2_recursive_lex2(G, S, T, PertVecs, p + 1) else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - Rn = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - H = fractal_walk2_recursive_lex2( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + Rn = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + H = fractal_walk2_recursive_lex2( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end end - end H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) @@ -600,40 +605,34 @@ function fractal_walk2_combined( continue end end - if t == 1 && p==1 - return fractal_walk2_combined( - G, - S, - T, - PertVecs, - p + 1, - ) + if t == 1 && p == 1 + return fractal_walk2_combined(G, S, T, PertVecs, p + 1) else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - Rn = change_order(R, T) - Gw = initials(R, gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - H = fractal_walk2_combined( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + Rn = change_order(R, T) + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + #println(w, " in depth", p) + #raiseCounterFr() + else + #println("up in: ", p, " with: ", w) + H = fractal_walk2_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end end - end H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) @@ -658,11 +657,13 @@ function tran_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) - if tryparse(Int32,string(w)) == nothing - #println("w bigger than int32") - return G + for i = 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + println("w bigger than int32") + return G + end end - Rn= change_order(R, w, T) + Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) return G diff --git a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl index 2831a4fd9..710e0ac23 100644 --- a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl @@ -15,7 +15,7 @@ include( ) using BenchmarkTools BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 -BenchmarkTools.DEFAULT_PARAMETERS.evals= 5 +BenchmarkTools.DEFAULT_PARAMETERS.evals = 5 a = "-" b = "-" z = "-" @@ -200,10 +200,10 @@ function standard_walk( terminate = true else global a = - @belapsed next_weight($G, $cweight, $tweight) evals= 5 samples = + @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = 2 global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals= 5 samples = + @ballocated next_weight($G, $cweight, $tweight) evals = 5 samples = 2 cweight = next_weight(G, cweight, tweight) @@ -224,36 +224,36 @@ function standard_step( global z2 = length(Singular.gens(G)) - global c = @belapsed initials($Rn, gens($G), $cw) evals= 5 samples = 2 - global c2 = @ballocated initials($Rn, gens($G), $cw) evals= 5 samples = 2 + global c = @belapsed initials($Rn, gens($G), $cw) evals = 5 samples = 2 + global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 5 samples = 2 Gw = initials(Rn, gens(G), cw) global d = @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - global f = @belapsed lift($G, $R, $H, $Rn) evals= 5 samples = 2 - global f2 = @ballocated lift($G, $R, $H, $Rn) evals= 5 samples = 2 + global f = @belapsed lift($G, $R, $H, $Rn) evals = 5 samples = 2 + global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 5 samples = 2 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) global g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 global g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 df = DataFrame( @@ -349,10 +349,10 @@ function standard_walk2( terminate = true else global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals= 5 samples = + @ballocated next_weight($G, $cweight, $tweight) evals = 5 samples = 2 global a = - @belapsed next_weight($G, $cweight, $tweight) evals= 5 samples = + @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = 2 cweight = next_weight(G, cweight, tweight) R = Rn @@ -372,36 +372,36 @@ function standard_step2( global z2 = length(Singular.gens(G)) - global c = @belapsed initials($Rn, gens($G), $cw) evals= 5 samples = 2 - global c2 = @ballocated initials($Rn, gens($G), $cw) evals= 5 samples = 2 + global c = @belapsed initials($Rn, gens($G), $cw) evals = 5 samples = 2 + global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 5 samples = 2 Gw = initials(Rn, gens(G), cw) global d = @belapsed Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $Gw), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - global f2 = @ballocated lift($G, $R, $H, $Rn) evals= 5 samples = 2 - global f = @belapsed lift($G, $R, $H, $Rn) evals= 5 samples = 2 + global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 5 samples = 2 + global f = @belapsed lift($G, $R, $H, $Rn) evals = 5 samples = 2 #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) global g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 global g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 return Singular.std(H, complete_reduction = true) @@ -413,8 +413,8 @@ end function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) R = base_ring(G) Rn = change_order(G.base_ring, T) - global a = @belapsed next_gamma($G, $[0], $S, $T) evals= 5 samples = 2 - global a2 = @ballocated next_gamma($G, $[0], $S, $T) evals= 5 samples = 2 + global a = @belapsed next_gamma($G, $[0], $S, $T) evals = 5 samples = 2 + global a2 = @ballocated next_gamma($G, $[0], $S, $T) evals = 5 samples = 2 v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] @@ -428,6 +428,8 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) global b2 = v println(v) + global z = Singular.ngens(G) + global z2 = z G, Lm = generic_step(G, Lm, v, T, R) df = DataFrame( a = [a], @@ -453,10 +455,10 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) savea(df, "genericWalk") cleardf() global a2 = - @ballocated next_gamma($G, $Lm, $v, $S, $T) evals= 5 samples = 2 + @ballocated next_gamma($G, $Lm, $v, $S, $T) evals = 5 samples = 2 global a = - @belapsed next_gamma($G, $Lm, $v, $S, $T) evals= 5 samples = 2 + @belapsed next_gamma($G, $Lm, $v, $S, $T) evals = 5 samples = 2 v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) @@ -469,33 +471,32 @@ function generic_step( T::Matrix{Int64}, R::Singular.PolyRing, ) where {L<:Nemo.RingElem} - global z = length(Singular.gens(G)) Rn = Singular.base_ring(G) - global c = @belapsed facet_initials($G, $Lm, $v) evals= 5 samples = 2 - global c2 = @ballocated facet_initials($G, $Lm, $v) evals= 5 samples = 2 + global c = @belapsed facet_initials($G, $Lm, $v) evals = 5 samples = 2 + global c2 = @ballocated facet_initials($G, $Lm, $v) evals = 5 samples = 2 facet_Generators = facet_initials(G, Lm, v) global d = @belapsed Singular.std( Singular.Ideal($Rn, $facet_Generators), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 global d2 = @ballocated Singular.std( Singular.Ideal($Rn, $facet_Generators), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, facet_Generators), complete_reduction = true, ) - global e2 = @ballocated lift_generic($G, $Lm, $H) evals= 5 samples = 2 + global e2 = @ballocated lift_generic($G, $Lm, $H) evals = 5 samples = 2 - global e = @belapsed lift_generic($G, $Lm, $H) evals= 5 samples = 2 + global e = @belapsed lift_generic($G, $Lm, $H) evals = 5 samples = 2 H, Lm = lift_generic(G, Lm, H) - global f = @belapsed interreduce($H, $Lm) evals= 5 samples = 2 - global f2 = @ballocated interreduce($H, $Lm) evals= 5 samples = 2 + global f = @belapsed interreduce($H, $Lm) evals = 5 samples = 2 + global f2 = @ballocated interreduce($H, $Lm) evals = 5 samples = 2 G = interreduce(H, Lm) G = Singular.Ideal(Rn, G) @@ -554,17 +555,17 @@ function pertubed_walk( println("Crossed Cones in: ") while !terminate - global h = @belapsed pertubed_vector($G, $T, $p) evals= 5 samples = 2 + global h = @belapsed pertubed_vector($G, $T, $p) evals = 5 samples = 2 global h2 = - @ballocated pertubed_vector($G, $T, $p) evals= 5 samples = 2 + @ballocated pertubed_vector($G, $T, $p) evals = 5 samples = 2 tweight = pertubed_vector(G, T, p) G = standard_walk2(G, S, T, cweight, tweight, k) if inCone(G, T, tweight) - global i = @belapsed inCone($G, $T, $tweight) evals= 5 samples = 2 + global i = @belapsed inCone($G, $T, $tweight) evals = 5 samples = 2 global i2 = - @ballocated inCone($G, $T, $tweight) evals= 5 samples = 2 + @ballocated inCone($G, $T, $tweight) evals = 5 samples = 2 terminate = true else @@ -681,24 +682,24 @@ function fractal_recursiv( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 t = nextT(G, w, PertVecs[p]) if (t == [0]) if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println(PertVecs) continue @@ -710,23 +711,23 @@ function fractal_recursiv( b2 = w T.w = w Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = 2 - c = @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = 2 + c = @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 Gw = initials(R, Singular.gens(G), w) if p == nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -746,19 +747,20 @@ function fractal_recursiv( p + 1, ) end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 + f2 = + @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 G = Singular.std(H, complete_reduction = true) R = Rn @@ -847,24 +849,24 @@ function fractal_walk_recursiv_startorder( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println(PertVecs) @@ -878,23 +880,23 @@ function fractal_walk_recursiv_startorder( b2 = w Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = 2 - c = @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = 2 + c = @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 Gw = initials(R, gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -916,20 +918,21 @@ function fractal_walk_recursiv_startorder( ) global firstStepMode = false end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 + f2 = + @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R, H, Rn) g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 j = p j2 = p @@ -1000,23 +1003,23 @@ function fractal_walk_recursive_lex( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 return G else i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] println(PertVecs) @@ -1038,22 +1041,22 @@ function fractal_walk_recursive_lex( z2 = length(Singular.gens(G)) c2 = - @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = 2 c = - @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = + @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -1077,18 +1080,19 @@ function fractal_walk_recursive_lex( global firstStepMode = false end end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 + f2 = + @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R, H, Rn) g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 j = p @@ -1159,23 +1163,23 @@ function fractal_walk_look_ahead_recursiv( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 return G else i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue @@ -1184,26 +1188,26 @@ function fractal_walk_look_ahead_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w - b = w - b2 = w + b = w + b2 = w Rn = change_order(R, T) z = length(Singular.gens(G)) z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = 2 - c = @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = 2 + c = @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -1223,19 +1227,20 @@ function fractal_walk_look_ahead_recursiv( p + 1, ) end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 + f2 = + @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R H, Rn) g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 j = p @@ -1322,24 +1327,24 @@ function fractal_walk_combined( h2 = "-" i2 = "-" while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals= 5 samples = 2 + a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 + a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 t = nextT(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals= 5 samples = 2 + h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals= 5 samples = + @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 println(PertVecs[p], " in depth", p) return G else i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals= 5 samples = 2 + @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] continue end @@ -1354,26 +1359,26 @@ function fractal_walk_combined( b2 = w Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) + z = length(Singular.gens(G)) + z2 = length(Singular.gens(G)) c2 = - @ballocated initials($R, Singular.gens($G), $w) evals= 5 samples = + @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = 2 c = - @belapsed initials($R, Singular.gens($G), $w) evals= 5 samples = + @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 Gw = initials(R, gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) d = @belapsed Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 d2 = @ballocated Singular.std( Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), complete_reduction = true, - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -1396,17 +1401,18 @@ function fractal_walk_combined( global firstStepMode = false end end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals= 5 samples = 2 - f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals= 5 samples = 2 + e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 + f2 = + @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 + f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 H = liftGW2(G, R, Gw, H, Rn) #H = lift_fractal_walk(G, R, H, Rn) g2 = - @ballocated Singular.std($H, complete_reduction = true) evals= 5 samples = + @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = 2 g = - @belapsed Singular.std($H, complete_reduction = true) evals= 5 samples = + @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 j = p j2 = p @@ -1466,39 +1472,40 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals= 5 samples = + @ballocated next_weight($G, $cweight, $tweight) evals = 5 samples = 2 global a = - @belapsed next_weight($G, $cweight, $tweight) evals= 5 samples = 2 + @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = 2 w = next_weight(G, cweight, tweight) - println(w) - if tryparse(Int32, string(w)) == nothing - println("w bigger than int32") - return G + for i = 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + println("w bigger than int32") + return G + end end Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) global i2 = - @ballocated inCone($G, $T, $cweight) evals= 5 samples = 2 + @ballocated inCone($G, $T, $cweight) evals = 5 samples = 2 global i = - @belapsed inCone($G, $T, $cweight) evals= 5 samples = 2 + @belapsed inCone($G, $T, $cweight) evals = 5 samples = 2 return G else if inSeveralCones(initials(base_ring(G), gens(G), w)) global j = @belapsed inSeveralCones( initials(base_ring($G), gens($G), $w), - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 global j2 = @ballocated inSeveralCones( initials(base_ring($G), gens($G), $w), - ) evals= 5 samples = 2 + ) evals = 5 samples = 2 global h2 = - @ballocated representation_vector($G, $T) evals= 5 samples = + @ballocated representation_vector($G, $T) evals = 5 samples = 2 global h = - @belapsed representation_vector($G, $T) evals= 5 samples = + @belapsed representation_vector($G, $T) evals = 5 samples = 2 tweight = representation_vector(G, T) continue diff --git a/src/GroebnerWalkFinal/Benchmarking/parser.jl b/src/GroebnerWalkFinal/Benchmarking/parser.jl index f1daafe13..e835f5485 100644 --- a/src/GroebnerWalkFinal/Benchmarking/parser.jl +++ b/src/GroebnerWalkFinal/Benchmarking/parser.jl @@ -4,7 +4,7 @@ using CSV using DataFrames function parseideal(k::String) - csv_reader = CSV.File("Beispiele"*"$k"*"Variablen.txt") + csv_reader = CSV.File("Beispiele" * "$k" * "Variablen.txt") for row in csv_reader poly = collect(split("$(row.generator)", "")) result = "" @@ -15,7 +15,7 @@ function parseideal(k::String) a = poly[i] if i == d result = result * a - result = result* "," + result = result * "," println("to", result) break end @@ -44,7 +44,7 @@ function parseideal(k::String) end end df = DataFrame(generator = Symbol(result)) - savea(df, "cBeispiele"*"$k"*"Variablen") + savea(df, "cBeispiele" * "$k" * "Variablen") cd("/Users/JordiWelp/Results/1ideals") end diff --git a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl index 3206c9bba..14dfcda8e 100644 --- a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl +++ b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl @@ -2,26 +2,26 @@ using DataFrames using CSV function savew(df::DataFrame, file::String) - open(file*".txt", "w") do io # create a file and write with header as the file does not exist + open(file * ".txt", "w") do io # create a file and write with header as the file does not exist foreach(row -> print(io, row), CSV.RowWriter(df)) end end function savea(df::DataFrame, file::String) - open(file*".txt", "a") do io # append to file and write without header + open(file * ".txt", "a") do io # append to file and write without header foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) end end function savea(df::DataFrame, file::String, p::Int64) - open(file * "$p.txt","a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) -end + open(file * "$p.txt", "a") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end end function savew(df::DataFrame, file::String, p::Int64) - open(file * "$p.txt","w") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) -end + open(file * "$p.txt", "w") do io # append to file and write without header + foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) + end end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl index c78dbe750..5a17a2b72 100644 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl @@ -1,122 +1,123 @@ using BenchmarkTools function prepare() -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - example = ["example"], -) -savew(df, "standardWalk") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - pert = ["pert"], - inCone = ["inCone"], - laststd = ["laststd"], - degree = ["degree"], - example = ["example"], -) -for i in 2:10 -savew(df, "pertubedWalk",i) -end -df = DataFrame( - nextW = ["nextW"], - facetnormal = ["-"], - initials = ["initials"], - stdH = ["stdH"], - liftgeneric = ["liftgeneric"], - interreduce = ["interreduce"], - example = ["example"], -) -savew(df, "genericWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + example = ["-"], + ) + savew(df, "standardWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = ["-"], + ) + for i = 2:10 + savew(df, "pertubedWalk", i) + end + df = DataFrame( + nextW = ["-"], + facetnormal = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftgeneric = ["-"], + interreduce = ["-"], + example = ["-"], + ) + savew(df, "genericWalk") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalk") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalklex") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalklookahead") -df = DataFrame( - nextW = ["nextW"], - currrentWeight = ["currrentWeight"], - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - inCone = ["inCone"], - pertvec = ["pertvec"], - depth = ["depth"], - example = ["example"], -) -savew(df, "fractalWalkcombined") -df = DataFrame( - nextW = "nextW", - currrentWeight = "currrentWeight", - nGens = ["nGens"], - initials = ["initials"], - stdH = ["stdH"], - liftAlternative = ["liftAlternative"], - lift = ["lift"], - interreduce = ["interreduce"], - rep = ["rep"], - inCone = ["inCone"], - inseveral = ["inseveral"], - example = ["example"], -) -savew(df, "tranWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "fractalWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "fractalWalklex") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "fractalWalklookahead") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], + ) + savew(df, "fractalWalkcombined") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + rep = ["-"], + inCone = ["-"], + inseveral = ["-"], + example = ["-"], + ) + savew(df, "tranWalk") end function runb( v::String, @@ -162,7 +163,7 @@ function runb( s, ) b = "-" - df = DataFrame(a = [a], b = [b],c=[v]) + df = DataFrame(a = [a], b = [b], c = [v]) savea(df, "correct") end end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl index 03e73f66f..25a1d326f 100644 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl @@ -2,25 +2,25 @@ using BenchmarkTools function prepare2() df = DataFrame( - example=["-"], - standard=["-"], - pertubed2=["-"], - pertubed3=["-"], - pertubed4=["-"], - pertubed5=["-"], - pertubed6=["-"], - pertubed7=["-"], - pertubed8=["-"], - pertubed9=["-"], - pertubed10=["-"], - fractal=["-"], - fractallex=["-"], - fractallookahead=["-"], - fractalcombined=["-"], - generic=["-"], - tran=["-"], - stime=["-"], - ttime=["-"] + example = ["-"], + standard = ["-"], + pertubed2 = ["-"], + pertubed3 = ["-"], + pertubed4 = ["-"], + pertubed5 = ["-"], + pertubed6 = ["-"], + pertubed7 = ["-"], + pertubed8 = ["-"], + pertubed9 = ["-"], + pertubed10 = ["-"], + fractal = ["-"], + fractallex = ["-"], + fractallookahead = ["-"], + fractalcombined = ["-"], + generic = ["-"], + tran = ["-"], + stime = ["-"], + ttime = ["-"], ) savew(df, "CompareAlg") end @@ -36,74 +36,108 @@ function runb2( println("Computing deglex-Basis") - stime = @belapsed Singular.std($ideal, complete_reduction = true) evals = 5 samples = 1 + stime = + @belapsed Singular.std($ideal, complete_reduction = true) evals = 5 samples = + 1 I = Singular.std(ideal, complete_reduction = true) ideals = [] println("Benchmarking groebnerwalk2") - pertubed2= "-" - pertubed3= "-" - pertubed4= "-" - pertubed5= "-" - pertubed6= "-" - pertubed7= "-" - pertubed8= "-" - pertubed9= "-" - pertubed10= "-" + pertubed2 = "-" + pertubed3 = "-" + pertubed4 = "-" + pertubed5 = "-" + pertubed6 = "-" + pertubed7 = "-" + pertubed8 = "-" + pertubed9 = "-" + pertubed10 = "-" for i = 2:nvars(S) - if i ==2 - pertubed2 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==3 - pertubed3 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==4 - pertubed4 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==5 - pertubed5 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==6 - pertubed6 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==7 - pertubed7 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==8 - pertubed8 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==9 - pertubed9 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 - elseif i==10 - pertubed10 = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals =1 samples =1 + if i == 2 + pertubed2 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 3 + pertubed3 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 4 + pertubed4 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 5 + pertubed5 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 6 + pertubed6 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 7 + pertubed7 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 8 + pertubed8 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 9 + pertubed9 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + elseif i == 10 + pertubed10 = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = + 1 samples = 1 + end end - end - standard = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:standard) evals =1 samples =1 - generic = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:generic) evals =1 samples =1 - fractal = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal) evals =1 samples =1 - fractallex = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_lex) evals =1 samples =1 - fractallookahead = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_look_ahead) evals =1 samples =1 - fractalcombined = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_combined) evals =1 samples =1 - tran = @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:tran) evals =1 samples =1 + standard = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:standard) evals = 1 samples = + 1 + generic = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:generic) evals = 1 samples = + 1 + fractal = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal) evals = 1 samples = + 1 + fractallex = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_lex) evals = 1 samples = + 1 + fractallookahead = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_look_ahead) evals = + 1 samples = 1 + fractalcombined = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_combined) evals = + 1 samples = 1 + tran = + @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:tran) evals = 1 samples = + 1 println("Computing lex-Basis") ttime = @belapsed Singular.std( Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), complete_reduction = true, - ) evals=5 samples =1 + ) evals = 5 samples = 1 df = DataFrame( - example=[v], - standard=[standard], - pertubed2=[pertubed2], - pertubed3=[pertubed3], - pertubed4=[pertubed4], - pertubed5=[pertubed5], - pertubed6=[pertubed6], - pertubed7=[pertubed7], - pertubed8=[pertubed8], - pertubed9=[pertubed9], - pertubed10=[pertubed10], - fractal=[fractal], - fractallex=[fractallex], - fractallookahead=[fractallookahead], - fractalcombined=[fractalcombined], - generic=[generic], - tran=[tran], - stime=[stime], - ttime=[ttime] + example = [v], + standard = [standard], + pertubed2 = [pertubed2], + pertubed3 = [pertubed3], + pertubed4 = [pertubed4], + pertubed5 = [pertubed5], + pertubed6 = [pertubed6], + pertubed7 = [pertubed7], + pertubed8 = [pertubed8], + pertubed9 = [pertubed9], + pertubed10 = [pertubed10], + fractal = [fractal], + fractallex = [fractallex], + fractallookahead = [fractallookahead], + fractalcombined = [fractalcombined], + generic = [generic], + tran = [tran], + stime = [stime], + ttime = [ttime], ) savea(df, "CompareAlg") diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 98b0bfb72..b21d716af 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -139,13 +139,10 @@ function standard_step( G::Singular.sideal, R::Singular.PolyRing, cw::Vector{Int64}, - Rn::Singular.PolyRing + Rn::Singular.PolyRing, ) Gw = initials(Rn, gens(G), cw) - H = Singular.std( - Singular.Ideal(Rn, Gw), - complete_reduction = true, - ) + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) return Singular.std(H, complete_reduction = true) @@ -167,7 +164,7 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) while !isempty(v) global counter = getCounter() + 1 println(v) - G, Lm = generic_step(G, Lm, v, T,R) + G, Lm = generic_step(G, Lm, v, T, R) v = next_gamma(G, Lm, v, S, T) end return Singular.interreduce(G) @@ -178,12 +175,12 @@ function generic_step( Lm::Vector{Singular.spoly{L}}, v::Vector{Int64}, T::Matrix{Int64}, - R::Singular.PolyRing + R::Singular.PolyRing, ) where {L<:Nemo.RingElem} Rn = Singular.base_ring(G) - facet_Generators = facet_initials(G,Lm, v) + facet_Generators = facet_initials(G, Lm, v) H = Singular.std( Singular.Ideal(Rn, facet_Generators), complete_reduction = true, @@ -268,7 +265,7 @@ function fractal_walk( println(PertVecs) println("FractalWalk_standard results") println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S,T, PertVecs, 1) + Gb = fractal_recursiv(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -288,7 +285,7 @@ function fractal_recursiv( while !terminate t = nextT(G, w, PertVecs[p]) if (t == [0]) - if inCone(G, T,PertVecs[p]) + if inCone(G, T, PertVecs[p]) return G else global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] @@ -441,43 +438,37 @@ function fractal_walk_recursive_lex( else global PertVecs = [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - println(PertVecs) + println(PertVecs) continue end end - if t == 1 && p==1 - return fractal_walk_recursive_lex( - G, - S, - T, - PertVecs, - p + 1, - ) + if t == 1 && p == 1 + return fractal_walk_recursive_lex(G, S, T, PertVecs, p + 1) else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - Rn = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - H = fractal_walk_recursive_lex( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + Rn = change_order(R, T) + Gw = initials(R, Singular.gens(G), w) + if p == Singular.nvars(R) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + H = fractal_walk_recursive_lex( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end end - end H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) @@ -600,40 +591,34 @@ function fractal_walk_combined( continue end end - if t == 1 && p==1 - return fractal_walk_combined( - G, - S, - T, - PertVecs, - p + 1, - ) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - T.w = w - b = w - Rn = change_order(R, T) - Gw = initials(R, gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() + if t == 1 && p == 1 + return fractal_walk_combined(G, S, T, PertVecs, p + 1) else - println("up in: ", p, " with: ", w) - H = fractal_walk_combined( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false + w = w + t * (PertVecs[p] - w) + w = convert_bounding_vector(w) + T.w = w + b = w + Rn = change_order(R, T) + Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + println(w, " in depth", p) + raiseCounterFr() + else + println("up in: ", p, " with: ", w) + H = fractal_walk_combined( + Singular.Ideal(R, [x for x in Gw]), + S, + T, + PertVecs, + p + 1, + ) + global firstStepMode = false + end end - end H = liftGW2(G, R, Gw, H, Rn) #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) @@ -658,11 +643,13 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) - if tryparse(Int32,string(w)) == nothing - println("w bigger than int32") - return G + for i = 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + println("w bigger than int32") + return G + end end - Rn= change_order(R, w, T) + Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) return G From a2aa40f284e2e3cf3c89a2489ef8ad545e6f00cb Mon Sep 17 00:00:00 2001 From: welpj Date: Tue, 18 Jan 2022 21:02:54 +0100 Subject: [PATCH 48/85] Refactoring feat: checking for weights > int32 fix: fix the counter of the standard and pertubed walk. --- .../Benchmarking/BenchmarkHelper | 193 ++++++++++++-- .../GroebnerWalkFinalBenchmark.jl | 37 ++- .../GroebnerWalkFinalBenchmarkProcedures.jl | 244 +++++++++++++++++- .../Benchmarking/runbenchmark.jl | 118 --------- .../Benchmarking/runbenchmark2.jl | 24 -- .../FractalWalkUtilitysFinal.jl | 55 +++- .../GenericWalkUtilitysFinal.jl | 66 ++++- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 37 ++- .../GroebnerWalkUtilitysFinal.jl | 10 + 9 files changed, 588 insertions(+), 196 deletions(-) diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper index 174c94dbc..6f850e211 100644 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper +++ b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper @@ -9,6 +9,31 @@ function runAll( runb2(v, ideal, S, StartOrd, TarOrd) end +function prepare2() + + df = DataFrame( + example = ["-"], + standard = ["-"], + pertubed2 = ["-"], + pertubed3 = ["-"], + pertubed4 = ["-"], + pertubed5 = ["-"], + pertubed6 = ["-"], + pertubed7 = ["-"], + pertubed8 = ["-"], + pertubed9 = ["-"], + pertubed10 = ["-"], + fractal = ["-"], + fractallex = ["-"], + fractallookahead = ["-"], + fractalcombined = ["-"], + generic = ["-"], + tran = ["-"], + stime = ["-"], + ttime = ["-"], + ) + savew(df, "CompareAlg") +end function prepareAlloc() df = DataFrame( nextW = ["-"], @@ -140,7 +165,8 @@ function prepareExampleAlloc(v::String) liftAlternative = ["-"], lift = ["-"], interreduce = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsStandardWalk") df = DataFrame( @@ -156,7 +182,8 @@ function prepareExampleAlloc(v::String) inCone = ["-"], laststd = ["-"], degree = ["-"], - example = [v], +example = [v], +counter = ["-"] ) for i = 2:10 savea(df, "allocsPertubedWalk", i) @@ -170,7 +197,8 @@ function prepareExampleAlloc(v::String) stdH = ["-"], liftgeneric = ["-"], interreduce = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsGenericWalk") @@ -186,7 +214,8 @@ function prepareExampleAlloc(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsFractalWalk") df = DataFrame( @@ -201,7 +230,8 @@ function prepareExampleAlloc(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsFractalWalklex") df = DataFrame( @@ -216,7 +246,8 @@ function prepareExampleAlloc(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsFractalWalklookahead") df = DataFrame( @@ -231,7 +262,8 @@ function prepareExampleAlloc(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsFractalWalkcombined") df = DataFrame( @@ -246,7 +278,8 @@ function prepareExampleAlloc(v::String) reprVec = ["-"], inCone = ["-"], inSeveralCone = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "allocsTranWalk") end @@ -261,7 +294,8 @@ function prepareExampleElapsed(v::String) liftAlternative = ["-"], lift = ["-"], interreduce = ["-"], - example = [v], +example = [v], + counter = ["-"] ) savea(df, "standardWalk") df = DataFrame( @@ -277,7 +311,8 @@ function prepareExampleElapsed(v::String) inCone = ["-"], laststd = ["-"], degree = ["-"], - example = [v], +example = [v], +counter = ["-"] ) for i = 2:10 savea(df, "pertubedWalk", i) @@ -290,7 +325,8 @@ function prepareExampleElapsed(v::String) stdH = ["-"], liftgeneric = ["-"], interreduce = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "genericWalk") @@ -306,7 +342,8 @@ function prepareExampleElapsed(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "fractalWalk") df = DataFrame( @@ -321,7 +358,8 @@ function prepareExampleElapsed(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "fractalWalklex") df = DataFrame( @@ -336,7 +374,8 @@ function prepareExampleElapsed(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "fractalWalklookahead") df = DataFrame( @@ -351,7 +390,8 @@ function prepareExampleElapsed(v::String) inCone = ["-"], pertvec = ["-"], depth = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "fractalWalkcombined") df = DataFrame( @@ -366,7 +406,128 @@ function prepareExampleElapsed(v::String) reprVec = ["-"], inCone = ["-"], inSeveralCone = ["-"], - example = [v], +example = [v], +counter = ["-"] ) savea(df, "tranWalk") end + +function prepare() + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "standardWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + pert = ["-"], + inCone = ["-"], + laststd = ["-"], + degree = ["-"], + example = ["-"], +counter = ["-"] ) + for i = 2:10 + savew(df, "pertubedWalk", i) + end + df = DataFrame( + nextW = ["-"], + facetnormal = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftgeneric = ["-"], + interreduce = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "genericWalk") + + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "fractalWalk") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "fractalWalklex") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "fractalWalklookahead") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + inCone = ["-"], + pertvec = ["-"], + depth = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "fractalWalkcombined") + df = DataFrame( + nextW = ["-"], + currrentWeight = ["-"], + nGens = ["-"], + initials = ["-"], + stdH = ["-"], + liftAlternative = ["-"], + lift = ["-"], + interreduce = ["-"], + rep = ["-"], + inCone = ["-"], + inseveral = ["-"], + example = ["-"], +counter = ["-"] ) + savew(df, "tranWalk") +end diff --git a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl index bd09c2959..1556467c3 100644 --- a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl @@ -141,6 +141,9 @@ function standard_walkAlloc( terminate = true else cweight = next_weight(G, cweight, tweight) + if !checkInt32(cweight) + return G + end R = Rn Rn = change_order(Rn, cweight, T) end @@ -215,8 +218,8 @@ function pertubed_walk2( T::Matrix{Int64}, p::Int64, ) - #cweight = pertubed_vector(G, S, p) - cweight = S[1, :] + cweight = pertubed_vector(G, S, p) + #cweight = S[1, :] terminate = false #println("pertubed_walk2 results") #println("Crossed Cones in: ") @@ -307,6 +310,9 @@ function fractal_recursiv2( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -391,6 +397,9 @@ function fractal_walk2_recursiv_startorder2( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(cweight) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, gens(G), w) @@ -413,8 +422,8 @@ function fractal_walk2_recursiv_startorder2( ) global firstStepMode = false end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn end @@ -461,6 +470,9 @@ function fractal_walk2_recursive_lex2( else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -527,6 +539,9 @@ function fractal_walk2_look_ahead_recursiv2( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -548,8 +563,8 @@ function fractal_walk2_look_ahead_recursiv2( ) end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn end @@ -610,6 +625,9 @@ function fractal_walk2_combined( else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w b = w Rn = change_order(R, T) @@ -657,11 +675,8 @@ function tran_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) - for i = 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - println("w bigger than int32") - return G - end + if !checkInt32(w) + return G end Rn = change_order(R, w, T) if w == tweight diff --git a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl index 710e0ac23..a553cf6de 100644 --- a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl +++ b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl @@ -191,11 +191,15 @@ function standard_walk( Rn = change_order(R, cweight, T) terminate = false while !terminate - global counter = getCounter() + 1 println(cweight) global b = cweight global b2 = cweight + Gtemp = G G = standard_step(G, R, cweight, Rn) + if !isequal(Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(Gtemp)]), G) + global counter = getCounter() + 1 + println(true) + end if cweight == tweight terminate = true else @@ -207,10 +211,27 @@ function standard_walk( 2 cweight = next_weight(G, cweight, tweight) + if !checkInt32(cweight) + return G + end R = Rn Rn = change_order(Rn, cweight, T) end end + global z = Singular.ngens(G) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = ["-"], + counter = [getCounter()], + ) + savea(df, "standardWalk") return G end @@ -265,7 +286,8 @@ function standard_step( e = [e], f = [f], g = [g], - h = [counter], + h = ["-"], + counter = ["-"] ) df2 = DataFrame( a2 = [a2], @@ -276,7 +298,8 @@ function standard_step( e2 = [e2], f2 = [f2], g2 = [g2], - h2 = [counter], + h2 = ["-"], + counter = ["-"] ) savea(df, "standardWalk") @@ -305,12 +328,17 @@ function standard_walk2( Rn = change_order(R, cweight, T) terminate = false while !terminate - global counter = getCounter() + 1 println(cweight) global b = cweight global b2 = cweight + Gtemp = G G = standard_step2(G, R, cweight, Rn) + + if !isequal(Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(Gtemp)]), G) + global counter = getCounter() + 1 + println(true) + end df = DataFrame( a = [a], b = [b], @@ -325,6 +353,8 @@ function standard_walk2( j = [j], k = [k], l = [l], + counter = ["-"] + ) df2 = DataFrame( a2 = [a2], @@ -340,6 +370,8 @@ function standard_walk2( j2 = [j2], k2 = [k2], l2 = [l2], + counter = ["-"] + ) cleardf() savea(df, "pertubedWalk", k) @@ -355,6 +387,9 @@ function standard_walk2( @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = 2 cweight = next_weight(G, cweight, tweight) + if !checkInt32(cweight) + return G + end R = Rn Rn = change_order(Rn, cweight, T) end @@ -440,6 +475,8 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) e = [e], f = [f], g = [g], + counter = ["-"] + ) df2 = DataFrame( a2 = [a2], @@ -450,6 +487,8 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) e2 = [e2], f2 = [f2], g2 = [g2], + counter = ["-"] + ) savea(df2, "allocsGenericWalk") savea(df, "genericWalk") @@ -461,6 +500,19 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) @belapsed next_gamma($G, $Lm, $v, $S, $T) evals = 5 samples = 2 v = next_gamma(G, Lm, v, S, T) end + global z = Singular.ngens(G) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + counter = [getCounter()], + ) + savea(df, "genericWalk") return Singular.interreduce(G) end @@ -530,6 +582,8 @@ function pertubed_walk( j = ["-"], k = [(p, p)], l = ["-"], + counter = ["-"] + ) df2 = DataFrame( a2 = ["-"], @@ -545,11 +599,13 @@ function pertubed_walk( j2 = ["-"], k2 = [(p, p)], l2 = ["-"], + counter = ["-"] + ) savea(df2, "allocsPertubedWalk", k) savea(df, "pertubedWalk", k) - #cweight = pertubed_vector(G, S, p) - cweight = S[1, :] + cweight = pertubed_vector(G, S, p) + #cweight = S[1, :] terminate = false println("pertubed_walk results") println("Crossed Cones in: ") @@ -599,6 +655,8 @@ function pertubed_walk( j = [j], k = [k], l = [l], + counter = ["-"] + ) df2 = DataFrame( a2 = [a2], @@ -614,12 +672,33 @@ function pertubed_walk( j2 = [j2], k2 = [k2], l2 = [l2], + counter = ["-"] + ) savea(df, "pertubedWalk", k) savea(df2, "allocsPertubedWalk", k) cleardf() end + global z = Singular.ngens(G) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + l = [l], + counter = [getCounter()], + ) + savea(df, "pertubedWalk", k) + return G end @@ -662,6 +741,23 @@ function fractal_walk( println("FractalWalk_standard results") println("Crossed Cones in: ") Gb = fractal_recursiv(G, S, T, PertVecs, 1) + z = length(Singular.gens(Gb)) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + counter = [deleteCounterFr()], + ) + savea(df, "fractalWalk") println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -707,6 +803,9 @@ function fractal_recursiv( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end b = w b2 = w T.w = w @@ -779,6 +878,8 @@ function fractal_recursiv( i2 = [i2], j2 = [j2], k2 = [k2], + counter = ["-"] + ) df = DataFrame( @@ -794,6 +895,8 @@ function fractal_recursiv( i = [i], j = [j], k = [k], + counter = ["-"] + ) savea(df, "fractalWalk") savea(df2, "allocsFractalWalk") @@ -819,6 +922,23 @@ function fractal_walk_start_order( println("fractal_walk_withStartorder results") println("Crossed Cones in: ") Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) + z = length(Singular.gens(Gb)) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + counter = [deleteCounterFr()], + ) + savea(df, "fractalWalk") println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -875,6 +995,9 @@ function fractal_walk_recursiv_startorder( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w b = w b2 = w @@ -951,6 +1074,8 @@ function fractal_walk_recursiv_startorder( i = [i], j = [j], k = [k], + counter = ["-"] + ) df2 = DataFrame( a2 = [a2], @@ -965,6 +1090,8 @@ function fractal_walk_recursiv_startorder( i2 = [i2], j2 = [j2], k2 = [k2], + counter = ["-"] + ) savea(df2, "allocsFractalWalkstartorder") savea(df, "fractalWalkstartorder") @@ -983,6 +1110,23 @@ function fractal_walk_lex( println("fractal_walk_lex results") println("Crossed Cones in: ") Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) + z = length(Singular.gens(Gb)) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + counter = [deleteCounterFr()], + ) + savea(df, "fractalWalklex") println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -1032,6 +1176,9 @@ function fractal_walk_recursive_lex( else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w b = w b2 = w @@ -1112,6 +1259,8 @@ function fractal_walk_recursive_lex( i2 = [i2], j2 = [j2], k2 = [k2], + counter = ["-"] + ) df = DataFrame( a = [a], @@ -1126,6 +1275,8 @@ function fractal_walk_recursive_lex( i = [i], j = [j], k = [k], + counter = ["-"] + ) savea(df, "fractalWalklex") savea(df2, "allocsFractalWalklex") @@ -1143,6 +1294,23 @@ function fractal_walk_look_ahead( println("Crossed Cones in: ") global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) + z = length(Singular.gens(Gb)) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + counter = [deleteCounterFr()], + ) + savea(df, "fractalWalklookahead") println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -1187,6 +1355,9 @@ function fractal_walk_look_ahead_recursiv( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w b = w b2 = w @@ -1234,8 +1405,8 @@ function fractal_walk_look_ahead_recursiv( f2 = @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - H = liftGW2(G, R, Gw, H, Rn) - #H = lift_fractal_walk(G, R H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) g = @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = 2 @@ -1260,6 +1431,8 @@ function fractal_walk_look_ahead_recursiv( i2 = [i2], j2 = [j2], k2 = [k2], + counter = ["-"] + ) df = DataFrame( a = [a], @@ -1274,6 +1447,8 @@ function fractal_walk_look_ahead_recursiv( i = [i], j = [j], k = [k], + counter = ["-"] + ) savea(df, "fractalWalklookahead") savea(df2, "allocsFractalWalklookahead") @@ -1297,6 +1472,23 @@ function fractal_walk_combined( println("fractal_walk_combined results") println("Crossed Cones in: ") Gb = fractal_walk_combined(G, S, T, PertVecs, 1) + z = length(Singular.gens(Gb)) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + counter = [deleteCounterFr()], + ) + savea(df, "fractalWalkcombined") println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -1354,6 +1546,9 @@ function fractal_walk_combined( else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w b = w b2 = w @@ -1431,6 +1626,8 @@ function fractal_walk_combined( i = [i], j = [j], k = [k], + counter = ["-"] + ) df2 = DataFrame( a2 = [a2], @@ -1445,6 +1642,8 @@ function fractal_walk_combined( i2 = [i2], j2 = [j2], k2 = [k2], + counter = ["-"] + ) savea(df, "fractalWalkcombined") savea(df2, "allocsFractalWalkcombined") @@ -1478,11 +1677,8 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) global a = @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = 2 w = next_weight(G, cweight, tweight) - for i = 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - println("w bigger than int32") - return G - end + if !checkInt32(w) + return G end Rn = change_order(R, w, T) if w == tweight @@ -1492,6 +1688,24 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) global i = @belapsed inCone($G, $T, $cweight) evals = 5 samples = 2 + global z = Singular.nGens(G) + df = DataFrame( + a = [a], + b = [b], + z = [z], + c = [c], + d = [d], + e = [e], + f = [f], + g = [g], + h = [h], + i = [i], + j = [j], + k = [k], + counter = [getCounter()], + ) + savea(df, "tranWalk") + return G else if inSeveralCones(initials(base_ring(G), gens(G), w)) @@ -1533,6 +1747,8 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) i = [i], j = [j], k = [k], + counter = ["-"] + ) df2 = DataFrame( a2 = [a2], @@ -1547,6 +1763,8 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) i2 = [i2], j2 = [j2], k2 = [k2], + counter = ["-"] + ) savea(df, "tranWalk") savea(df2, "allocsTranWalk") diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl index 5a17a2b72..b476d7d13 100644 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl @@ -1,124 +1,6 @@ using BenchmarkTools -function prepare() - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - example = ["-"], - ) - savew(df, "standardWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = ["-"], - ) - for i = 2:10 - savew(df, "pertubedWalk", i) - end - df = DataFrame( - nextW = ["-"], - facetnormal = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], - example = ["-"], - ) - savew(df, "genericWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "fractalWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "fractalWalklex") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "fractalWalklookahead") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "fractalWalkcombined") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - rep = ["-"], - inCone = ["-"], - inseveral = ["-"], - example = ["-"], - ) - savew(df, "tranWalk") -end function runb( v::String, ideal::Singular.sideal, diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl index 25a1d326f..6c79b4f69 100644 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl +++ b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl @@ -1,29 +1,5 @@ using BenchmarkTools -function prepare2() - df = DataFrame( - example = ["-"], - standard = ["-"], - pertubed2 = ["-"], - pertubed3 = ["-"], - pertubed4 = ["-"], - pertubed5 = ["-"], - pertubed6 = ["-"], - pertubed7 = ["-"], - pertubed8 = ["-"], - pertubed9 = ["-"], - pertubed10 = ["-"], - fractal = ["-"], - fractallex = ["-"], - fractallookahead = ["-"], - fractalcombined = ["-"], - generic = ["-"], - tran = ["-"], - stime = ["-"], - ttime = ["-"], - ) - savew(df, "CompareAlg") -end function runb2( v::String, diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index e86ceb239..3f90ab77c 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -57,7 +57,7 @@ function lift_fractal_walk( R::Singular.PolyRing, S::Singular.PolyRing, ) -Performs a lifting step in the Groebner Walk. See Fukuda et. al. +Performs a lifting step in the Groebner Walk proposed by Amrhein et. al. """=# function lift_fractal_walk( G::Singular.sideal, @@ -76,7 +76,13 @@ function lift_fractal_walk( return G end -#returns ´true´ if all polynomials of the array are monomials. +#= +@doc Markdown.doc""" +function isMonomial( +Gw::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} +Returns ´true´ if all polynomials of the given array are monomials. +"""=# function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if size(collect(Singular.coefficients(g)))[1] > 1 @@ -86,7 +92,13 @@ function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} return true end -#returns ´true´ if all polynomials of the array are binomial or less. +#= +@doc Markdown.doc""" +function isbinomial( +Gw::Vector{spoly{L}}, +) +Returns ´true´ if all polynomials of the given array are binomials or less. +"""=# function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if size(collect(Singular.coefficients(g)))[1] > 2 @@ -97,6 +109,15 @@ function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} end +#= +@doc Markdown.doc""" +function nextT( + G::Singular.sideal, + w::Array{T,1}, + tw::Array{K,1}, +) where {T<:Number,K<:Number} +Returns the next t to compute the next weight vector w(t) = w + t * (tw - w). +"""=# function nextT( G::Singular.sideal, w::Array{T,1}, @@ -127,6 +148,14 @@ function nextT( end end +#= +@doc Markdown.doc""" +function change_order( + R::Singular.PolyRing, + T::MonomialOrder{Matrix{Int64},Vector{Int64}}, +) where {L<:Number,K<:Number} +Returns a new PolynomialRing w.r.t. the monomial ordering T. +"""=# function change_order( R::Singular.PolyRing, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, @@ -141,6 +170,16 @@ function change_order( return S end +#= +@doc Markdown.doc""" +function pertubed_vector( +G::Singular.sideal, +Mo::MonomialOrder{Matrix{Int64}}, +t::Vector{Int64}, +p::Integer, +) +Computes a p-pertubed weight vector of the current weight vector t by using the monomial ordering Mo. +"""=# function pertubed_vector( G::Singular.sideal, Mo::MonomialOrder{Matrix{Int64}}, @@ -183,6 +222,16 @@ function pertubed_vector( return w end +#= +@doc Markdown.doc""" +function pertubed_vector( +G::Singular.sideal, +Mo::MonomialOrder{Matrix{Int64}}, +t::Vector{Int64}, +p::Integer, +) +Computes a p-pertubed weight vector of the current weight vector given by the first row of the matrix corresponding the the monomial ordering T. +"""=# function pertubed_vector( G::Singular.sideal, T::MonomialOrder{Matrix{Int64},Vector{Int64}}, diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 67cbcc5e9..9511e3e0a 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -4,7 +4,15 @@ include("GroebnerWalkUtilitysFinal.jl") #Utilitys for generic_walk ############################################################### -#Return the facet_facet_facet_initials of polynomials w.r.t. a weight vector. +#= +@doc Markdown.doc""" +function facet_initials( + G::Singular.sideal, + lm::Vector{spoly{L}}, + v::Vector{Int64}, +) where {L<:Nemo.RingElem} +Returns the facet initials of the polynomials w.r.t. the vector v. +"""=# function facet_initials( G::Singular.sideal, lm::Vector{spoly{L}}, @@ -29,8 +37,14 @@ function facet_initials( return initials end -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. +#= +@doc Markdown.doc""" +function difference_lead_tail( + I::Singular.sideal, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} +Returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. +"""=# function difference_lead_tail( I::Singular.sideal, Lm::Vector{spoly{L}}, @@ -47,7 +61,11 @@ function difference_lead_tail( return unique!(v) end -# +#= +@doc Markdown.doc""" +function isParallel(u::Vector{Int64}, v::Vector{Int64}) +Returns true if the vector u is parallel to the vector v. +"""=# function isParallel(u::Vector{Int64}, v::Vector{Int64}) count = 1 x = 0 @@ -75,7 +93,15 @@ function isParallel(u::Vector{Int64}, v::Vector{Int64}) return true end -#lifting step of the generic_walk +#= +@doc Markdown.doc""" +function lift_generic( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + H::Singular.sideal, +) where {L<:Nemo.RingElem} +Performs a lifting step in the Groebner Walk proposed by Fukuda et. al. +"""=# function lift_generic( G::Singular.sideal, Lm::Vector{Singular.spoly{L}}, @@ -129,7 +155,6 @@ function filter_lf( return btz end -#return the next facet_normal. function next_gamma( G::Singular.sideal, Lm::Vector{spoly{L}}, @@ -154,7 +179,6 @@ function next_gamma( return minV end -#return the next facet_normal. function next_gamma( G::Singular.sideal, w::Vector{Int64}, @@ -220,8 +244,12 @@ function less_facet( return false end -#returns divrem() -function divremGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) +#= +@doc Markdown.doc""" +function dividesGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) +Returns the multiple m for all terms q in p with lm * m = q. +"""=# +function dividesGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) div = false newpoly = Singular.MPolyBuildCtx(S) for term in Singular.terms(p) @@ -238,6 +266,16 @@ function divremGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) return (finish(newpoly), div) end +#= +@doc Markdown.doc""" +function modulo( + p::Singular.spoly, + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, + c::Bool = false, +) where {L<:Nemo.RingElem} +Returns p modulo G w.r.t. the leading terms Lm and true if a division occured. +"""=# function modulo( p::Singular.spoly, G::Vector{spoly{L}}, @@ -248,7 +286,7 @@ function modulo( R = parent(p) Q = zero(R) for i = 1:length(G) - (q, b) = divremGW(p, Lm[i], R) + (q, b) = dividesGW(p, Lm[i], R) if b I = i Q = q @@ -263,6 +301,14 @@ function modulo( end end +#= +@doc Markdown.doc""" +function interreduce( + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} +G represents a Gröbnerbasis. This function interreduces G w.r.t. the leading terms Lm with tail-reduction. +"""=# function interreduce( G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index b21d716af..d75c1ffeb 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -39,13 +39,27 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that $T$ represents the lex ordering. Pertubes only the target vector. Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. + +#Arguments +*`I::Singular.sideal`: Gröbnerbasis to compute the Gröbnerbasis w.r.t. the traget-ordering. +*`S::Matrix{Int64}`: The ordering w.r.t. the Gröbnerbasis I. Note that S has to be a nxn-matrix with rank(S)=n. +*`T::Matrix{Int64}`: The ordering we want to compute a Gröbnerbasis for. Note that T has to be a nxn-matrix with rank(T)=n. +*`grwalktype::Symbol`: Strategy of the Gröbnerwalk to be used. There are the strategies: + - `standard`: Standard Walk (default), + - `pertubed`: Pertubed Walk, + - `tran`: Tran´s Walk, + - `generic`: Generic Walk, + - `fractal`: Standard-Version of the Fractal Walk, + - `fractalcombined`: Combined Fractal Walk with handling of start-ordering and look-ahead computation for lexicographic target-ordering, + - `fractal_look_ahead`:Fractal Walk with look-ahead computation. +*`p::Int64`: Pertubationdegree (p,p) for the pertubed Walk. Default is 2. """=# function groebnerwalk( G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}, grwalktype::Symbol = :standard, - p::Int64 = 0, + p::Int64 = 2, ) if grwalktype == :standard walk = (x, y, z) -> standard_walk(x, y, z) @@ -128,6 +142,9 @@ function standard_walk( terminate = true else cweight = next_weight(G, cweight, tweight) + if !checkInt32(cweight) + return G + end R = Rn Rn = change_order(Rn, cweight, T) end @@ -295,6 +312,9 @@ function fractal_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) T.w = w + if !checkInt32(w) + return G + end Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) if p == nvars(R) @@ -377,6 +397,9 @@ function fractal_walk_recursiv_startorder( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, gens(G), w) @@ -447,6 +470,9 @@ function fractal_walk_recursive_lex( else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -513,6 +539,9 @@ function fractal_walk_look_ahead_recursiv( end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -596,6 +625,9 @@ function fractal_walk_combined( else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + if !checkInt32(w) + return G + end T.w = w b = w Rn = change_order(R, T) @@ -643,6 +675,9 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) + if !checkInt32(w) + return G + end for i = 1:length(w) if tryparse(Int32, string(w[i])) == nothing println("w bigger than int32") diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 88e78b12a..35fd04048 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -23,6 +23,16 @@ function next_weight( return convert_bounding_vector(w) end +function checkInt32(w::Vector{Int64}) +for i = 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + println("w bigger than int32") + return false + end +end +return true +end + #Return the initials of polynomials w.r.t. a weight vector. function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) inits = spoly{elem_type(base_ring(R))}[] From d86884b7bbc8d02c3dc83beb2907c5febabc0b1a Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 10 Feb 2022 16:11:41 +0100 Subject: [PATCH 49/85] fixes --- src/GroebnerWalkFinal/Examples | 80 ++- .../FractalWalkUtilitysFinal.jl | 62 ++- src/GroebnerWalkFinal/GWtestFinal.jl | 186 ++++--- .../GenericWalkUtilitysFinal.jl | 74 +-- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 148 +++--- .../GroebnerWalkUtilitysFinal.jl | 187 +++++-- .../TranWalkUtilitysFinal.jl | 3 +- src/GroebnerWalkFinal/examplesFinal.jl | 471 ++---------------- src/GroebnerWalkFinal/tests | 111 +++-- 9 files changed, 546 insertions(+), 776 deletions(-) diff --git a/src/GroebnerWalkFinal/Examples b/src/GroebnerWalkFinal/Examples index 2066d283a..41977bb0b 100644 --- a/src/GroebnerWalkFinal/Examples +++ b/src/GroebnerWalkFinal/Examples @@ -1,7 +1,7 @@ function katsura5() dim = 5 ve = [1, 1, 1, 1, 1] - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, u, t, z, y) = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y"], @@ -21,7 +21,7 @@ end function katsura6() dim = 6 ve = [1, 1, 1, 1, 1, 1] - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, u, t, z, y, x) = Singular.PolynomialRing( Singular.QQ, ["v", "u", "t", "z", "y", "x"], @@ -41,7 +41,7 @@ function cyclic7() dim = 7 ve = [1, 1, 1, 1, 1, 1, 1] example = "Cyclic7" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], @@ -91,7 +91,7 @@ function cyclic6() dim = 6 ve = [1, 1, 1, 1, 1, 1] example = "Cyclic6" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6"], @@ -130,7 +130,7 @@ function cyclic5() dim = 5 ve = [1, 1, 1, 1, 1] example = "Cyclic5" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, w, x, y, z) = Singular.PolynomialRing( Singular.QQ, ["v", "w", "x", "y", "z"], @@ -155,7 +155,7 @@ function eco6() dim = 6 ve = [1, 1, 1, 1, 1, 1] example = "eco6" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6"], @@ -177,7 +177,7 @@ function eco7() dim = 6 ve = [1, 1, 1, 1, 1, 1] example = "eco7" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6"], @@ -206,7 +206,7 @@ function noon5() dim = 5 ve = [1, 1, 1, 1, 1] example = "noon5" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5"], @@ -236,7 +236,7 @@ function noon6() dim = 6 ve = [1, 1, 1, 1, 1, 1] example = "noon6" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6"], @@ -287,7 +287,7 @@ function noon7() dim = 7 ve = [1, 1, 1, 1, 1, 1, 1] example = "noon7" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], @@ -351,7 +351,7 @@ function noon8() dim = 8 ve = [1, 1, 1, 1, 1, 1, 1, 1] example = "noon8" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], @@ -430,7 +430,7 @@ function redeco7() dim = 7 ve = [1, 1, 1, 1, 1, 1, 1] example = "redeco7" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, u7, x5, x6) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "u7", "x5", "x6"], @@ -452,7 +452,7 @@ function redeco8() dim = 8 ve = [1, 1, 1, 1, 1, 1, 1, 1] example = "redeco8" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, u8, x5, x6, x7) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3", "x4", "u8", "x5", "x6", "x7"], @@ -475,7 +475,7 @@ function wang91() dim = 6 ve = [1, 1, 1, 1, 1, 1] example = "Wang-91" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x3, x2, x1, x0, b, a) = Singular.PolynomialRing( Singular.QQ, ["x3", "x2", "x1", "x0", "b", "a"], @@ -494,7 +494,7 @@ function cohn4() dim = 4 ve = [1, 1, 1, 1] example = "cohn4" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x, y, z, t) = Singular.PolynomialRing( Singular.QQ, ["x", "y", "z", "t"], @@ -549,7 +549,7 @@ function oberfr() dim = 3 ve = [9, 9, 8] example = "Oberfranz" - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3) = Singular.PolynomialRing( Singular.QQ, ["x1", "x2", "x3"], @@ -560,3 +560,51 @@ function oberfr() return Singular.Ideal(R, [f1, f2]) end + +function trinks1() + dim = 6 + ve = [1, 1, 1, 1, 1, 1] + example = "trinks1" + StartOrd = ordering_as_matrix(:degrevlex, dim) + R, (x, y, z, t, u, v) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "t", "u", "v"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = 45 * y + 35 * u - 165 * v - 36 + f2 = 36 * y + 25 * z + 40 * t - 27 * u + f3 = 25 * y * u - 165 * v^2 + 15 * x - 18 * z + 30t + f4 = 15 * y * z + 20 * t * u - 9 * x + f5 = -11 * v^3 + x * y + 2 * z * t + f6 = -11 * u * v + 3 * v^2 + 99 * x + + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) +end + +function ex1() + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + + return Singular.Ideal( + R, + [ + d^2 + + 3 * a^2 * d + + 3 * c * d^2 + + 5 * a^3 * c + + 5 * a^2 * c^2 + + 4 * a^2 * c * d, + 3 + 2 * b + 3 * a * b + 3 * c^2 * d + 5 * a^4 + a * b * c^2, + ], + ) +end diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 3f90ab77c..8527798c6 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -2,11 +2,7 @@ include("GroebnerWalkUtilitysFinal.jl") #Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) #Maybe not needed -mutable struct MonomialOrder{ - T<:Matrix{Int64}, - v<:Vector{Int64}, - tv<:Vector{Int64}, -} +mutable struct MonomialOrder{T<:Matrix{Int},v<:Vector{Int},tv<:Vector{Int}} m::T w::v t::tv @@ -14,10 +10,10 @@ end #= @doc Markdown.doc""" convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} -Given a Vector{Number} $v$ this function computes a Vector{Int64} w with w = v*gcd(v). +Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v*gcd(v). """=# function convert_bounding_vector(v::Vector{T}) where {T<:Number} - w = Vector{Int64}() + w = Vector{Int}() for i = 1:length(v) push!(w, float(divexact(v[i], gcd(v)))) end @@ -28,15 +24,15 @@ end @doc Markdown.doc""" function inCone( G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - t::Vector{Int64}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + t::Vector{Int}, ) Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. """=# function inCone( G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - t::Vector{Int64}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + t::Vector{Int}, ) R = change_order(G.base_ring, T.t, T.m) I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) @@ -152,13 +148,13 @@ end @doc Markdown.doc""" function change_order( R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) where {L<:Number,K<:Number} Returns a new PolynomialRing w.r.t. the monomial ordering T. """=# function change_order( R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) where {L<:Number,K<:Number} G = Singular.gens(R) Gstrich = string.(G) @@ -174,16 +170,16 @@ end @doc Markdown.doc""" function pertubed_vector( G::Singular.sideal, -Mo::MonomialOrder{Matrix{Int64}}, -t::Vector{Int64}, +Mo::MonomialOrder{Matrix{Int}}, +t::Vector{Int}, p::Integer, ) Computes a p-pertubed weight vector of the current weight vector t by using the monomial ordering Mo. """=# function pertubed_vector( G::Singular.sideal, - Mo::MonomialOrder{Matrix{Int64}}, - t::Vector{Int64}, + Mo::MonomialOrder{Matrix{Int}}, + t::Vector{Int}, p::Integer, ) if t == Mo.m[1, :] @@ -215,9 +211,9 @@ function pertubed_vector( end end e = maxdeg * msum + 1 - w = view(M,1, :) * e^(p - 1) + w = view(M, 1, :) * e^(p - 1) for i = 2:p - w += e^(p - i) * view(M,i, :) + w += e^(p - i) * view(M, i, :) end return w end @@ -226,15 +222,15 @@ end @doc Markdown.doc""" function pertubed_vector( G::Singular.sideal, -Mo::MonomialOrder{Matrix{Int64}}, -t::Vector{Int64}, +Mo::MonomialOrder{Matrix{Int}}, +t::Vector{Int}, p::Integer, ) Computes a p-pertubed weight vector of the current weight vector given by the first row of the matrix corresponding the the monomial ordering T. """=# function pertubed_vector( G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, p::Integer, ) m = [] @@ -272,3 +268,25 @@ function pertubed_vector( end return w end + +function next_weightfr( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} + if (cweight == tweight) + return [0] + end + tmin = 1 + for v in difference_lead_tail(G) + cw = dot(cweight, v) + tw = dot(tweight, v) + if tw < 0 + t = cw // (cw - tw) + if t < tmin + tmin = t + end + end + end + return tmin +end diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl index f1e9b0729..02ce27d3e 100644 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -1,65 +1,73 @@ include("GroebnerWalkFinal.jl") - +include("Examples") function test(case::Int) test_successfull = true if case == 1 || case == 99 - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + id = oberfr() + + R = base_ring(id) + dim = nvars(R) + ve = ones(Int, dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R2 = change_order(R, StartOrd) + S = change_order(R, TarOrd) + I = Singular.std( + Singular.Ideal(R2, [change_ring(x, R2) for x in gens(id)]), + complete_reduction = true, ) - - f1 = x^2 - y^3 - f2 = x^3 - y^2 - x - I = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) - + #I = Singular.std(id, complete_reduction = true) @time T = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :tran, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 2, ) + + @time F = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), :fractal, ) @time FA = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :fractal_look_ahead, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_combined, ) @time St = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :standard, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3, ) @time Pe = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), :pertubed, - 2, + 3, ) @time Ge = groebnerwalk( I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), :generic, ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) + + + + #@time T0 = Singular.std( + # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + # complete_reduction = true, + #) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) @@ -67,13 +75,15 @@ function test(case::Int) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) + + + println("test tran: ", equalitytest(T6, T1)) + println("test fractal: ", equalitytest(T6, T2)) + println("test fractal: ", equalitytest(T6, T3)) + println("test pertubed: ", equalitytest(T5, T6)) + println("test standard: ", equalitytest(T4, T6)) + println("test generic: ", equalitytest(T6, T6)) if !( equalitytest(T2, T1) && equalitytest(T3, T4) && @@ -87,77 +97,88 @@ function test(case::Int) R, (x, y, z) = Singular.PolynomialRing( Singular.QQ, ["x", "y", "z"], - ordering = Singular.ordering_M( - ordering_as_matrix([5, 4, 1], :deglex), - ), + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), ) - f1 = x^2 - y - f2 = y^2 - x * z - y * z + f1 = 16 + 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = 6 + y^3 * z + 17 * x^2 * z^2 + 7 * x * y^2 * z^2 + 13 * x^3 * z^2 I = Singular.Ideal(R, [f1, f2]) + I = Singular.std(I, complete_reduction = true) @time T = groebnerwalk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), :tran, ) @time F = groebnerwalk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), :fractal, ) + + @time FA = groebnerwalk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), :fractal_look_ahead, ) @time Pe = groebnerwalk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), :pertubed, - 3, + 2, ) @time St = groebnerwalk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), :standard, ) @time Ge = groebnerwalk( I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), :generic, ) + S, V = Singular.PolynomialRing( Singular.QQ, ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 3)), ) T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, ) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - + for gens in gens(T0) + println(leading_term(gens)) + end + for gens in gens(T5) + println(leading_term(gens)) + end println("test tran: ", equalitytest(T0, T1)) println("test fractal: ", equalitytest(T0, T2)) println("test fractal: ", equalitytest(T0, T3)) println("test pertubed: ", equalitytest(T5, T0)) println("test standard: ", equalitytest(T4, T0)) println("test generic: ", equalitytest(T6, T0)) + + + if !( equalitytest(T2, T1) && equalitytest(T3, T4) && @@ -184,7 +205,8 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :standard, + :pertubed, + 4, ) #= @time J = fractal_walk( I, @@ -255,7 +277,7 @@ function test(case::Int) equalitytest(T2, T0) && equalitytest(T3, T6) && equalitytest(T0, T5) && - Singular.equal(T0, T4) + equalitytest(T0, T4) ) test_successfull = false end @@ -267,7 +289,6 @@ function test(case::Int) ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), ) - f1 = 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + @@ -364,10 +385,11 @@ function test(case::Int) equalitytest(T2, T1) && equalitytest(T3, T6) && equalitytest(T0, T5) && - Singular.equal(T0, T4) + equalitytest(T0, T4) ) test_successfull = false end + end if case == 5 || case == 99 R, (x, y, z) = Singular.PolynomialRing( @@ -450,7 +472,7 @@ function test(case::Int) equalitytest(T2, T1) && equalitytest(T3, T6) && equalitytest(T0, T5) && - Singular.equal(T0, T4) + equalitytest(T0, T4) ) test_successfull = false end @@ -482,19 +504,22 @@ function test(case::Int) ordering_as_matrix(:lex, 6), :standard, ) - #= @time J = fractal_walk( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - ) =# + @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + ) + + + @time JJ = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), @@ -507,7 +532,7 @@ function test(case::Int) ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), :pertubed, - 6, + 4, ) @time L = groebnerwalk( I, @@ -526,6 +551,7 @@ function test(case::Int) ["x", "y", "z", "u", "v", "w"], ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), ) + @time T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, @@ -548,7 +574,7 @@ function test(case::Int) equalitytest(T2, T0) && equalitytest(T3, T6) && equalitytest(T0, T5) && - Singular.equal(T0, T4) + equalitytest(T0, T4) ) test_successfull = false end diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 9511e3e0a..c3d4ee8e2 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -9,14 +9,14 @@ include("GroebnerWalkUtilitysFinal.jl") function facet_initials( G::Singular.sideal, lm::Vector{spoly{L}}, - v::Vector{Int64}, + v::Vector{Int}, ) where {L<:Nemo.RingElem} Returns the facet initials of the polynomials w.r.t. the vector v. """=# function facet_initials( G::Singular.sideal, lm::Vector{spoly{L}}, - v::Vector{Int64}, + v::Vector{Int}, ) where {L<:Nemo.RingElem} Rn = base_ring(G) initials = Array{Singular.elem_type(Rn),1}(undef, 0) @@ -63,10 +63,10 @@ end #= @doc Markdown.doc""" -function isParallel(u::Vector{Int64}, v::Vector{Int64}) +function isParallel(u::Vector{Int}, v::Vector{Int}) Returns true if the vector u is parallel to the vector v. """=# -function isParallel(u::Vector{Int64}, v::Vector{Int64}) +function isParallel(u::Vector{Int}, v::Vector{Int}) count = 1 x = 0 for i = 1:length(u) @@ -121,8 +121,8 @@ function lift_generic( return liftPolys, Newlm end -function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) - btz = Set{Vector{Int64}}() +function filter_btz(S::Matrix{Int}, V::Vector{Vector{Int}}) + btz = Set{Vector{Int}}() for v in V if bigger_than_zero(S, v) push!(btz, v) @@ -131,8 +131,8 @@ function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) return btz end -function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) - btz = Set{Vector{Int64}}() +function filter_ltz(S::Matrix{Int}, V::Set{Vector{Int}}) + btz = Set{Vector{Int}}() for v in V if less_than_zero(S, v) push!(btz, v) @@ -141,12 +141,12 @@ function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) return btz end function filter_lf( - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, - V::Set{Vector{Int64}}, + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, + V::Set{Vector{Int}}, ) - btz = Set{Vector{Int64}}() + btz = Set{Vector{Int}}() for v in V if less_facet(w, v, S, T) push!(btz, v) @@ -158,9 +158,9 @@ end function next_gamma( G::Singular.sideal, Lm::Vector{spoly{L}}, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, ) where {L<:Nemo.RingElem} V = filter_btz(S, difference_lead_tail(G, Lm)) V = filter_ltz(T, V) @@ -181,9 +181,9 @@ end function next_gamma( G::Singular.sideal, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, ) V = filter_btz(S, difference_lead_tail(G)) V = filter_ltz(T, V) @@ -202,7 +202,7 @@ function next_gamma( return minV end -function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) +function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) for i = 1:size(M)[1] d = dot(M[i, :], v) if d != 0 @@ -212,7 +212,7 @@ function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) return false end -function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) +function less_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i = 1:nrows d = 0 @@ -227,10 +227,10 @@ function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) end function less_facet( - u::Vector{Int64}, - v::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, + u::Vector{Int}, + v::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, ) for i = 1:size(T)[1] for j = 1:size(S)[1] @@ -314,19 +314,19 @@ function interreduce( Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} Rn = parent(first(G)) - for i = 1:Singular.length(G) - gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) - Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) - for j = 1:length(G) - if i != j - push!(gensrest, G[j]) - push!(Lmrest, Lm[j]) - end - end - r, b = modulo(G[i], gensrest, Lmrest) - if b - G[i] = r + for i = 1:Singular.length(G) + gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) + Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) + for j = 1:length(G) + if i != j + push!(gensrest, G[j]) + push!(Lmrest, Lm[j]) end + end + r, b = modulo(G[i], gensrest, Lmrest) + if b + G[i] = r + end end return G end diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index d75c1ffeb..c8c7e6744 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -22,10 +22,10 @@ end @doc Markdown.doc""" function groebnerwalk( G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, + S::Matrix{Int}, + T::Matrix{Int}, grwalktype::Symbol = :standard, - p::Int64 = 0, + p::Int = 0, ) Given an Ideal $G$ generated by a reduced Groebner Basis w.r.t. the monomial ordering $S$ this function returns a reduced Groebner Basis w.r.t. the monomial ordering $T$ by converting it using the Groebner Walk. @@ -42,8 +42,8 @@ Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhe #Arguments *`I::Singular.sideal`: Gröbnerbasis to compute the Gröbnerbasis w.r.t. the traget-ordering. -*`S::Matrix{Int64}`: The ordering w.r.t. the Gröbnerbasis I. Note that S has to be a nxn-matrix with rank(S)=n. -*`T::Matrix{Int64}`: The ordering we want to compute a Gröbnerbasis for. Note that T has to be a nxn-matrix with rank(T)=n. +*`S::Matrix{Int}`: The ordering w.r.t. the Gröbnerbasis I. Note that S has to be a nxn-matrix with rank(S)=n. +*`T::Matrix{Int}`: The ordering we want to compute a Gröbnerbasis for. Note that T has to be a nxn-matrix with rank(T)=n. *`grwalktype::Symbol`: Strategy of the Gröbnerwalk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, @@ -52,14 +52,14 @@ Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhe - `fractal`: Standard-Version of the Fractal Walk, - `fractalcombined`: Combined Fractal Walk with handling of start-ordering and look-ahead computation for lexicographic target-ordering, - `fractal_look_ahead`:Fractal Walk with look-ahead computation. -*`p::Int64`: Pertubationdegree (p,p) for the pertubed Walk. Default is 2. +*`p::Int`: Pertubationdegree (p,p) for the pertubed Walk. Default is 2. """=# function groebnerwalk( G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, + S::Matrix{Int}, + T::Matrix{Int}, grwalktype::Symbol = :standard, - p::Int64 = 2, + p::Int = 2, ) if grwalktype == :standard walk = (x, y, z) -> standard_walk(x, y, z) @@ -99,7 +99,7 @@ function groebnerwalk( walk = (x, y, z) -> tran_walk(x, y, z) elseif grwalktype == :fractal_combined walk = - (x, y, z) -> fractal_combined( + (x, y, z) -> fractal_walk_combined( x, MonomialOrder(S, S[1, :], [0]), MonomialOrder(T, T[1, :], T[1, :]), @@ -118,7 +118,7 @@ function groebnerwalk( end -function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function standard_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) println("standard_walk results") println("Crossed Cones in: ") standard_walk(G, S, T, S[1, :], T[1, :]) @@ -126,10 +126,10 @@ end function standard_walk( G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, + S::Matrix{Int}, + T::Matrix{Int}, + cweight::Vector{Int}, + tweight::Vector{Int}, ) R = base_ring(G) Rn = change_order(R, cweight, T) @@ -155,7 +155,7 @@ end function standard_step( G::Singular.sideal, R::Singular.PolyRing, - cw::Vector{Int64}, + cw::Vector{Int}, Rn::Singular.PolyRing, ) Gw = initials(Rn, gens(G), cw) @@ -169,7 +169,7 @@ end #Generic-version of the groebner walk by Fukuda et al. (2007) ############################################################### -function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function generic_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) R = base_ring(G) Rn = change_order(G.base_ring, T) v = next_gamma(G, [0], S, T) @@ -190,8 +190,8 @@ end function generic_step( G::Singular.sideal, Lm::Vector{Singular.spoly{L}}, - v::Vector{Int64}, - T::Matrix{Int64}, + v::Vector{Int}, + T::Matrix{Int}, R::Singular.PolyRing, ) where {L<:Nemo.RingElem} @@ -215,30 +215,25 @@ end ############################################################### function pertubed_walk( G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - p::Int64, + S::Matrix{Int}, + T::Matrix{Int}, + p::Int, ) - #cweight = pertubed_vector(G, S, p) - cweight = S[1, :] + cweight = pertubed_vector(G, S, p) + #cweight = S[1, :] terminate = false println("pertubed_walk results") println("Crossed Cones in: ") - while !terminate tweight = pertubed_vector(G, T, p) - G = standard_walk(G, S, T, cweight, tweight) + Tn = add_weight_vector(tweight, T) + G = standard_walk(G, S, Tn, cweight, tweight) if inCone(G, T, tweight) terminate = true else - if p == 1 - R = change_order(G.base_ring, T) - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - G = Singular.std(G, complete_reduction = true) - terminate = true - end p = p - 1 cweight = tweight + S = Tn end end return G @@ -275,8 +270,8 @@ sigma = [] function fractal_walk( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println(PertVecs) @@ -289,10 +284,10 @@ end function fractal_recursiv( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + PertVecs::Vector{Vector{Int}}, + p::Int, ) R = base_ring(G) terminate = false @@ -300,7 +295,7 @@ function fractal_recursiv( w = S.w while !terminate - t = nextT(G, w, PertVecs[p]) + t = next_weightfr(G, w, PertVecs[p]) if (t == [0]) if inCone(G, T, PertVecs[p]) return G @@ -344,14 +339,14 @@ end cwPert = [] firstStepMode = false -function cwpert(p::Int64) +function cwpert(p::Int) cwPert[p] end function fractal_walk_start_order( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] @@ -365,10 +360,10 @@ end function fractal_walk_recursiv_startorder( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + PertVecs::Vector{Vector{Int}}, + p::Int, ) R = Singular.base_ring(G) terminate = false @@ -386,7 +381,7 @@ function fractal_walk_recursiv_startorder( end while !terminate - t = nextT(G, w, PertVecs[p]) + t = next_weightfr(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) return G @@ -415,8 +410,8 @@ function fractal_walk_recursiv_startorder( H = fractal_walk_recursiv_startorder( Singular.Ideal(R, [x for x in Gw]), - S, - T, + copy(S), + copy(T), PertVecs, p + 1, ) @@ -431,8 +426,8 @@ function fractal_walk_recursiv_startorder( end function fractal_walk_lex( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println("fractal_walk_lex results") @@ -444,17 +439,17 @@ end function fractal_walk_recursive_lex( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + PertVecs::Vector{Vector{Int}}, + p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true w = S.w while !terminate - t = nextT(G, w, PertVecs[p]) + t = next_weightfr(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) return G @@ -504,8 +499,8 @@ function fractal_walk_recursive_lex( end function fractal_walk_look_ahead( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) println("fractal_walk_look_ahead results") println("Crossed Cones in: ") @@ -517,10 +512,10 @@ end function fractal_walk_look_ahead_recursiv( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + PertVecs::Vector{Vector{Int}}, + p::Int, ) R = Singular.base_ring(G) terminate = false @@ -528,7 +523,7 @@ function fractal_walk_look_ahead_recursiv( w = S.w while !terminate - t = nextT(G, w, PertVecs[p]) + t = next_weightfr(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) return G @@ -576,8 +571,8 @@ end function fractal_walk_combined( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] @@ -590,10 +585,10 @@ end function fractal_walk_combined( G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, + S::MonomialOrder{Matrix{Int},Vector{Int}}, + T::MonomialOrder{Matrix{Int},Vector{Int}}, + PertVecs::Vector{Vector{Int}}, + p::Int, ) R = Singular.base_ring(G) terminate = false @@ -601,6 +596,7 @@ function fractal_walk_combined( if (p == 1) if !isMonomial(initials(R, Singular.gens(G), S.w)) global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + println(cwPert) global firstStepMode = true end end @@ -610,7 +606,7 @@ function fractal_walk_combined( w = S.w end while !terminate - t = nextT(G, w, PertVecs[p]) + t = next_weightfr(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) println(PertVecs[p], " in depth", p) @@ -662,7 +658,7 @@ end #Tran-version of the groebner walk by Tran (2002) ############################################################### -function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) +function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) cweight = S[1, :] tweight = T[1, :] println("tran_walk results") @@ -675,21 +671,16 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) terminate = false while !terminate w = next_weight(G, cweight, tweight) + println(w) if !checkInt32(w) return G end - for i = 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - println("w bigger than int32") - return G - end - end Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) return G else - if inSeveralCones(initials(base_ring(G), gens(G), w)) + if inSeveralCones(initials(base_ring(G), gens(G), tweight)) tweight = representation_vector(G, T) continue end @@ -697,7 +688,6 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) end G = standard_step(G, R, w, Rn) global counter = getCounter() + 1 - println(w) R = Rn cweight = w end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 35fd04048..5d99ff435 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -6,35 +6,55 @@ #This Version is used by the standard_walk, pertubed_walk and tran_walk. function next_weight( G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} - tv = [] + cweight::Vector{Int}, + tweight::Vector{Int}, +) where {K<:Number} + tmin = 1 for v in difference_lead_tail(G) cw = dot(cweight, v) tw = dot(tweight, v) + if tw < 0 - push!(tv, cw // (cw - tw)) + t = cw // (cw - tw) + if t < tmin + tmin = t + end end end - push!(tv, 1) - t = minimum(tv) - w = (1 - t) * cweight + t * tweight - return convert_bounding_vector(w) + w = convert_bounding_vector((1 - tmin) * cweight + tmin * tweight) + #= if !checkInt32(w) + println(w) + for i in 1:length(cweight) + cweight[i] = round(cweight[i] * 0.10) + if cweight[i]== 0 + cweight = 1 + end + end + if !inCone(G, T, cweight) + println("not", cweight) + return w + end + w= next_weight(G,T,cweight,tweight) + end=# + return w end -function checkInt32(w::Vector{Int64}) -for i = 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - println("w bigger than int32") - return false +function checkInt32(w::Vector{Int}) + for i = 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + println("w bigger than int32") + return false + end end -end -return true + return true end #Return the initials of polynomials w.r.t. a weight vector. -function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) +function initials( + R::Singular.PolyRing, + G::Vector{L}, + w::Vector{Int}, +) where {L<:Nemo.RingElem} inits = spoly{elem_type(base_ring(R))}[] indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] for g in G @@ -74,7 +94,7 @@ function difference_lead_tail(I::Singular.sideal) return unique!(v) end -function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) +function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) m = [] n = size(M)[1] for i = 1:p @@ -103,10 +123,49 @@ function pertubed_vector(G::Singular.sideal, M::Matrix{Int64}, p::Integer) for i = 2:p w += e^(p - i) * M[i, :] end - return w + #if !checkInt32(w) + # w = pertubed_vector(G, M, p, e - 1) + #end + + return convert_bounding_vector(w) end -function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) +#=function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer, e::Int) + m = [] + n = size(M)[1] + for i = 1:p + max = M[i, 1] + for j = 2:n + temp = abs(M[i, j]) + if temp > max + max = temp + end + end + push!(m, max) + end + msum = 0 + for i = 2:p + msum += m[i] + end + maxdeg = 0 + for g in gens(G) + td = deg(g, n) + if (td > maxdeg) + maxdeg = td + end + end + #e = maxdeg * msum + 1 + w = M[1, :] * e^(p - 1) + for i = 2:p + w += e^(p - i) * M[i, :] + end + if !checkInt32(w) + w = pertubed_vector(G, M, p, e - 1) + end + return w +end=# + +function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) R = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) @@ -122,7 +181,7 @@ function lift( G::Singular.sideal, R::Singular.PolyRing, H::Singular.sideal, - Rn::Singular.PolyRing + Rn::Singular.PolyRing, ) G.isGB = true rest = [ @@ -139,7 +198,7 @@ function liftGW2( R::Singular.PolyRing, inG::Vector{spoly{L}}, H::Singular.sideal, - Rn::Singular.PolyRing + Rn::Singular.PolyRing, ) where {L<:Nemo.RingElem} gH = collect(gens(H)) @@ -149,7 +208,9 @@ function liftGW2( q = divalg(change_ring(gH[i], R), [change_ring(x, R) for x in inG], R) gH[i] = Rn(0) for j = 1:s - gH[i] = change_ring(gH[i], Rn) + change_ring(q[j],Rn) * change_ring(gG[j],Rn) + gH[i] = + change_ring(gH[i], Rn) + + change_ring(q[j], Rn) * change_ring(gG[j], Rn) end end G = Singular.Ideal(Rn, [x for x in gH]) @@ -180,8 +241,8 @@ function divalg( i = i + 1 end end - if div == false - p = p - leading_term(p) + if div == false + p = p - leading_term(p) end end return q @@ -189,34 +250,49 @@ end #Solves problems with weight vectors of floats. function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int64}() + w = Vector{Int}() + g = gcd(wtemp) for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) + push!(w, float(divexact(wtemp[i], g))) end return w end + #return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) function change_order( R::Singular.PolyRing, cweight::Array{L,1}, - T::Matrix{Int64}, + T::Matrix{Int}, ) where {L<:Number,K<:Number} G = Singular.gens(R) Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), - cached = false, - ) + s = size(T) + if s[1] == s[2] + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), + cached = false, + ) + else + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(cweight) * + Singular.ordering_a(T[1, :]) * + Singular.ordering_M(T[2:end, :]), + cached = false, + ) + end return S + end #return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) function change_order( R::Singular.PolyRing, - M::Matrix{Int64}, + M::Matrix{Int}, ) where {T<:Number,K<:Number} G = Singular.gens(R) Gstrich = string.(G) @@ -252,16 +328,16 @@ end # unspecific help functions ############################################# -function ident_matrix(n::Int64) - M = zeros(Int64, n, n) +function ident_matrix(n::Int) + M = zeros(Int, n, n) for i = 1:n M[i, i] = 1 end return M end -function anti_diagonal_matrix(n::Int64) - M = zeros(Int64, n, n) +function anti_diagonal_matrix(n::Int) + M = zeros(Int, n, n) for i = 1:n M[i, n+1-i] = -1 end @@ -285,7 +361,7 @@ function equalitytest(G::Singular.sideal, K::Singular.sideal) return false end -function dot(v::Vector{Int64}, w::Vector{Int64}) +function dot(v::Vector{Int}, w::Vector{Int}) n = length(v) sum = 0 for i = 1:n @@ -294,7 +370,7 @@ function dot(v::Vector{Int64}, w::Vector{Int64}) return sum end -function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) +function ordering_as_matrix(w::Vector{Int}, ord::Symbol) if length(w) > 2 if ord == :lex return [ @@ -305,14 +381,14 @@ function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) if ord == :deglex return [ w' - ones(Int64, length(w))' + ones(Int, length(w))' ident_matrix(length(w))[1:length(w)-2, :] ] end if ord == :degrevlex return [ w' - ones(Int64, length(w))' + ones(Int, length(w))' anti_diagonal_matrix(length(w))[1:length(w)-2, :] ] end @@ -327,33 +403,38 @@ function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) end end -function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) +function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) return [ w' M[2:length(w), :] ] end -function insert_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) +function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) return [ w' M[1:length(w)-1, :] ] end +function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M + ] +end - -function ordering_as_matrix(ord::Symbol, nvars::Int64) +function ordering_as_matrix(ord::Symbol, nvars::Int) if ord == :lex return ident_matrix(nvars) end if ord == :deglex return [ - ones(Int64, nvars)' + ones(Int, nvars)' ident_matrix(nvars)[1:nvars-1, :] ] end if ord == :degrevlex return [ - ones(Int64, nvars)' + ones(Int, nvars)' anti_diagonal_matrix(nvars)[1:nvars-1, :] ] end @@ -368,7 +449,7 @@ function ordering_as_matrix(ord::Symbol, nvars::Int64) end -function deg(p::Singular.spoly, n::Int64) +function deg(p::Singular.spoly, n::Int) max = 0 for mon in Singular.monomials(p) ev = Singular.exponent_vectors(mon) @@ -377,9 +458,9 @@ function deg(p::Singular.spoly, n::Int64) for i = 1:n sum += e[i] end - end - if (max < sum) - max = sum + if (max < sum) + max = sum + end end end return max diff --git a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl index d85d13e0a..3a30a2aee 100644 --- a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl @@ -1,7 +1,7 @@ include("GroebnerWalkUtilitysFinal.jl") -function representation_vector(G::Singular.sideal, T::Matrix{Int64}) +function representation_vector(G::Singular.sideal, T::Matrix{Int}) n = size(T)[1] M = 0 for i = 1:n @@ -24,6 +24,7 @@ function representation_vector(G::Singular.sideal, T::Matrix{Int64}) for i = 2:n w = w + d^(n - i) * T[i, :] end + println(w) return w end diff --git a/src/GroebnerWalkFinal/examplesFinal.jl b/src/GroebnerWalkFinal/examplesFinal.jl index e73046f0e..1bb829d4c 100644 --- a/src/GroebnerWalkFinal/examplesFinal.jl +++ b/src/GroebnerWalkFinal/examplesFinal.jl @@ -1,438 +1,37 @@ include("GroebnerWalkFinal.jl") -function test(case::Int) - - test_successfull = true - - if case == 1 || case == 99 - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), - ) - f1 = x^2 - y^3 - f2 = x^3 - y^2 - x - I = Singular.Ideal(R, [f1, f2]) - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :tran, - ) - - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - println("test tran: ", equalitytest(T0, T6)) - - if !(equalitytest(T6, T0)) - test_successfull = false - end - end - - - if case == 2 || case == 99 - - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M( - ordering_as_matrix([5, 4, 1], :deglex), - ), - ) - - - - f1 = x^2 - y - f2 = y^2 - x * z - y * z - I = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(I, complete_reduction = true) - @time H = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :fractal, - 3, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), - ) - - T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - if !(equalitytest(T0, T6)) - test_successfull = false - end - end - - - if case == 3 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - - f1 = y^4 + y * z^2 - u^2 * w - f2 = 2 * x^2 * y + x^3 * w * u^2 + x - f3 = 2 - 3 * x^2 * v * z^4 * w - I = Singular.Ideal(R, [f1, f2, f3]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", Singular.equal(T0, T6)) - if !(Singular.equal(T0, T6)) - test_successfull = false - end - - end - if case == 4 || case == 99 - R, (q, c, p, d) = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), - ) - f1 = - 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + - c^2 * q^2 + - 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - - 8 * p + - c^2 + - 4 * d^2 - 2 * q + - 10 * p^2 + - 2 - f2 = - 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - - 3 * p * q * c + 4 * c - f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q - f4 = - 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + - 3 * c^2 + - 9 * p^2 * d^2 + - 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + - 12 * d^2 + - 4 * p^2 + - 12 * c * d * p + - 12 * c * d * q + - 12 * c * d * p * q - 12 * c * d - I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :generic, - 3 - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - if !(equalitytest(T6, T0)) - test_successfull = false - end - end - if case == 5 || case == 99 - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 - f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 - f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 - I = Singular.Ideal(R, [f1, f2, f3]) - - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = :lex, - ) - - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal, - 2, - ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - if !(Singular.equal(T0, T6)) - test_successfull = false - end - - end - - - - if case == 6 || case == 99 - R, (v, u, t, z, y, x) = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y", "x"], - ordering = Singular.ordering_M( - ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), - ), - ) - - f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2*x * y +2* y * z + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * x * z + 2 * y * t + 2 * z * u +2* u^2 + 2 * t * v - t - f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y - f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), - ordering_as_matrix(:lex, 6), - :pertubed, - 5, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1, 1], :lex), - ordering_as_matrix(:lex, 6), - :generic, - 5, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y", "x"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - if !(isequal(T6, T0)) - test_successfull = false - end - end - - -if case == 7 || case == 99 - #Katsura 5 - R, (v, u, t, z, y) = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y"], - ordering = Singular.ordering_M( - ordering_as_matrix([1, 1, 1, 1, 1], :lex), - ), - ) - - f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2*z*y + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * y * t + 2 * z * u + 2*u^2 + 2 * t * v - t - f4 = 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1], :lex), - ordering_as_matrix(:lex, 5), - :fractal_lex, - 5, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1], :lex), - ordering_as_matrix(:lex, 5), - :fractal_look_ahead, - 5, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 5)), - ) - T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - if !(isequal(T6, T0)) - test_successfull = false - end -end - -if case == 8 || case == 99 - - #Katsura 7 - R, (x1,x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], - ordering = Singular.ordering_M( - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), - ), - ) - - f1=-x1+2*x8^2+2*x7^2+2*x6^2+2*x5^2+2*x4^2+2*x3^2+2*x2^2+x1^2 - f2=-x2+2*x8*x7+2*x7*x6+2*x6*x5+2*x5*x4+2*x4*x3+2*x3*x2+2*x2*x1 - f3= -x3+2*x8*x6+2*x7*x5+2*x6*x4+2*x5*x3+2*x4*x2+2*x3*x1+x2^2 - f4= -x4+2*x8*x5+2*x7*x4+2*x6*x3+2*x5*x2+2*x4*x1+2*x3*x2 - f5= -x5+2*x8*x4+2*x7*x3+2*x6*x2+2*x5*x1+2*x4*x2+x3^2 - f6=-x6+2*x8*x3+2*x7*x2+2*x6*x1+2*x5*x2+2*x4*x3 - f7=-x7+2*x8*x2+2*x7*x1+2*x6*x2+2*x5*x3+x4^2 - f8=-1+2*x8+2*x7+2*x6+2*x5+2*x4+2*x3+2*x2+x1 - I = Singular.Ideal(R, [f1, f2, f3, f4, f5,f6,f7,f8]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), - ordering_as_matrix(:lex, 8), - :generic, - 5, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1], :lex), - ordering_as_matrix(:lex, 8), - :generic, - 5, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 8)), - ) - T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - if !(isequal(T6, T0)) - test_successfull = false - end -end - -if case == 9 || case == 99 - - #eco10 - R, (x0,x1,x2, x3, x4, x5, x6, x7, x8, x9) = Singular.PolynomialRing( - Singular.QQ, - ["x0","x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9"], - ordering = Singular.ordering_M( - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1,1], :lex), - ), - ) - - f1=x0*x1*x9+x1*x2*x9+x2*x3*x9+x3*x4*x9+x4*x5*x9+x5*x6*x9+x6*x7*x9+x7*x8*x9+x0*x9-1 - f2=x0*x2*x9+x1*x3*x9+x2*x4*x9+x3*x5*x9+x4*x6*x9+x5*x7*x9+x6*x8*x9+x1*x9-2 - f3=x0*x3*x9+x1*x4*x9+x2*x5*x9+x3*x6*x9+x4*x7*x9+x5*x8*x9+x2*x9-3 - f4=x0*x4*x9+x1*x5*x9+x2*x6*x9+x3*x7*x9+x4*x8*x9+x3*x9-4 - f5=x0*x5*x9+x1*x6*x9+x2*x7*x9+x3*x8*x9+x4*x9-5 - f6=x0*x6*x9+x1*x7*x9+x2*x8*x9+x5*x9-6 - f7=x0*x7*x9+x1*x8*x9+x6*x9-7 - f8=x0*x8*x9+x7*x9-8 - f9=x8*x9-9 - f10=x0+x1+x2+x3+x4+x5+x6+x7+x8+1 - I = Singular.Ideal(R, [f1, f2, f3, f4, f5,f6,f7,f8,f9,f10]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1,1], :lex), - ordering_as_matrix(:lex, 10), - :generic, - 5, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix([1, 1, 1, 1, 1,1,1,1,1,1], :lex), - ordering_as_matrix(:lex, 10), - :generic, - 5, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x0","x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 10)), - ) - T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - if !(isequal(T6, T0)) - test_successfull = false - end -end -println("All tests were: ", test_successfull) -end +#function test(case::Int) +test_successfull = true +#if case == 1 || case == 99 + +dim = 4 +ve = [1, 1, 1, 1] +StartOrd = ordering_as_matrix(:degrevlex, dim) +TarOrd = ordering_as_matrix(:lex, dim) +R, (a, b, c, d) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), +) +S = change_order(R, TarOrd) + +I = Singular.std( + Singular.Ideal( + R, + [ + 5 + a^2 * b + 2 * a * c^2 + a^4 + 3 * a^2 * b * c, + c + + 5 * a * b + + 4 * c^2 + + 2 * a * c * d + + 2 * b^4 + + 3 * c^4 + + 2 * a * d^3, + ], + ), + complete_reduction = true, +) +println(I) +println(groebnerwalk(I, StartOrd, TarOrd, :pertubed, 4)) +# end +#end diff --git a/src/GroebnerWalkFinal/tests b/src/GroebnerWalkFinal/tests index 78273c38e..322aa2fd8 100644 --- a/src/GroebnerWalkFinal/tests +++ b/src/GroebnerWalkFinal/tests @@ -1,30 +1,32 @@ -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkFinal.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples.jl") +include("GroebnerWalkFinal.jl") +include("Examples") +using Test @testset "Groebnerwalks" begin @testset "Testing Groebnerwalks" begin let id = cyclic5() - dim = nvars(base_ring(id)) + R = base_ring(id) + dim = nvars(R) ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - I = Singular.std(ideal, complete_reduction = true) + I = Singular.std(id, complete_reduction = true) ideals = [] for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) end - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), complete_reduction = true, ) @@ -37,28 +39,29 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples.jl") end let id = katsura5() - dim = nvars(base_ring(id)) + R = base_ring(id) + dim = nvars(R) ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - I = Singular.std(ideal, complete_reduction = true) + I = Singular.std(id, complete_reduction = true) ideals = [] - for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + for i = 1:nvars(S)-1 + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) end - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), complete_reduction = true, ) @@ -71,31 +74,33 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples.jl") end let id = cohn4() - dim = nvars(base_ring(id)) + R = base_ring(id) + dim = nvars(R) ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex, dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - I = Singular.std(ideal, complete_reduction = true) + I = Singular.std(id, complete_reduction = true) ideals = [] for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) end - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), complete_reduction = true, ) + for id in ideals @test Singular.equal( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), @@ -104,29 +109,30 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples.jl") end end - let id = noon5() - dim = nvars(base_ring(id)) + let id = ex1() + R = base_ring(id) + dim = nvars(R) ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(ve, :lex) + StartOrd = ordering_as_matrix(:degrevlex) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - I = Singular.std(ideal, complete_reduction = true) + I = Singular.std(id, complete_reduction = true) ideals = [] for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :pertubed, i)) end - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :generic)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), Taordering_as_matrix(:lex, dim)rOrd, :tran)) s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), complete_reduction = true, ) @@ -138,3 +144,4 @@ include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples.jl") end end end +end From 7701956470b8f9a500934c347397f9a21f548b7e Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 14 Feb 2022 17:00:55 +0100 Subject: [PATCH 50/85] Units tests Overflow Bug --- .../FractalWalkUtilitysFinal.jl | 114 +------------ src/GroebnerWalkFinal/GWtestFinal.jl | 115 +++++++++++-- .../GenericWalkUtilitysFinal.jl | 29 +++- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 110 +++++++------ .../GroebnerWalkUtilitysFinal.jl | 110 +++++++------ src/GroebnerWalkFinal/UnitTests | 152 ++++++++++++++++++ src/GroebnerWalkFinal/tests | 20 +-- 7 files changed, 422 insertions(+), 228 deletions(-) create mode 100644 src/GroebnerWalkFinal/UnitTests diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 8527798c6..3774119bc 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -8,9 +8,10 @@ mutable struct MonomialOrder{T<:Matrix{Int},v<:Vector{Int},tv<:Vector{Int}} t::tv end #= +#= @doc Markdown.doc""" convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} -Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v*gcd(v). +Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). """=# function convert_bounding_vector(v::Vector{T}) where {T<:Number} w = Vector{Int}() @@ -18,7 +19,7 @@ function convert_bounding_vector(v::Vector{T}) where {T<:Number} push!(w, float(divexact(v[i], gcd(v)))) end return w -end +end=# #= @doc Markdown.doc""" @@ -34,7 +35,7 @@ function inCone( T::MonomialOrder{Matrix{Int},Vector{Int}}, t::Vector{Int}, ) - R = change_order(G.base_ring, T.t, T.m) + R = change_order(G.base_ring, T.m) I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip @@ -53,7 +54,7 @@ function lift_fractal_walk( R::Singular.PolyRing, S::Singular.PolyRing, ) -Performs a lifting step in the Groebner Walk proposed by Amrhein et. al. +Performs a lifting step in the Groebner Walk proposed by Amrhein et. al. and Cox Little Oshea """=# function lift_fractal_walk( G::Singular.sideal, @@ -161,114 +162,11 @@ function change_order( S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Singular.ordering_a(T.w) * Singular.ordering_M(T.m), + ordering = Singular.ordering_a(T.w) * Singular.ordering_a(T.t) * Singular.ordering_M(T.m), ) return S end -#= -@doc Markdown.doc""" -function pertubed_vector( -G::Singular.sideal, -Mo::MonomialOrder{Matrix{Int}}, -t::Vector{Int}, -p::Integer, -) -Computes a p-pertubed weight vector of the current weight vector t by using the monomial ordering Mo. -"""=# -function pertubed_vector( - G::Singular.sideal, - Mo::MonomialOrder{Matrix{Int}}, - t::Vector{Int}, - p::Integer, -) - if t == Mo.m[1, :] - M = Mo.m - else - M = insert_weight_vector(t, Mo.m) - end - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = view(M, 1, :) * e^(p - 1) - for i = 2:p - w += e^(p - i) * view(M, i, :) - end - return w -end - -#= -@doc Markdown.doc""" -function pertubed_vector( -G::Singular.sideal, -Mo::MonomialOrder{Matrix{Int}}, -t::Vector{Int}, -p::Integer, -) -Computes a p-pertubed weight vector of the current weight vector given by the first row of the matrix corresponding the the monomial ordering T. -"""=# -function pertubed_vector( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int},Vector{Int}}, - p::Integer, -) - m = [] - if T.t == T.m[1, :] - M = T.m - else - M = insert_weight_vector(T.t, T.m) - end - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - e = maxdeg * msum + 1 - w = view(M, 1, :) * e^(p - 1) - for i = 2:p - w += e^(p - i) * view(M, i, :) - end - return w -end - function next_weightfr( G::Singular.sideal, cweight::Array{T,1}, diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl index 02ce27d3e..9ee9a29d0 100644 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -5,7 +5,7 @@ function test(case::Int) test_successfull = true if case == 1 || case == 99 - id = oberfr() + id = katsura5() R = base_ring(id) dim = nvars(R) @@ -18,16 +18,20 @@ function test(case::Int) Singular.Ideal(R2, [change_ring(x, R2) for x in gens(id)]), complete_reduction = true, ) + + + #I = Singular.std(id, complete_reduction = true) @time T = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, - 2, + 4, ) + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), @@ -38,7 +42,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :fractal_combined, + :fractal_look_ahead, ) @time St = groebnerwalk( I, @@ -47,6 +51,7 @@ function test(case::Int) :pertubed, 3, ) + @time Pe = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), @@ -112,6 +117,7 @@ function test(case::Int) ordering_as_matrix(:lex, 3), :tran, ) + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, 3), @@ -164,12 +170,6 @@ function test(case::Int) T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - for gens in gens(T0) - println(leading_term(gens)) - end - for gens in gens(T5) - println(leading_term(gens)) - end println("test tran: ", equalitytest(T0, T1)) println("test fractal: ", equalitytest(T0, T2)) println("test fractal: ", equalitytest(T0, T3)) @@ -316,6 +316,8 @@ function test(case::Int) I = Singular.Ideal(R, [f1, f2, f3, f4]) I = Singular.std(I, complete_reduction = true) + + @time T = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), @@ -326,7 +328,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal_lex, + :fractal, ) @time Fa = groebnerwalk( @@ -504,7 +506,7 @@ function test(case::Int) ordering_as_matrix(:lex, 6), :standard, ) - @time J = fractal_walk( + @time J = fractal_walk_combined( I, MonomialOrder( ordering_as_matrix(:degrevlex, 6), @@ -538,7 +540,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :fractal, + :fractal_look_ahead, ) @time M = groebnerwalk( I, @@ -580,5 +582,94 @@ function test(case::Int) end end + + if case ==7 || case == 99 + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex,dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + I = Singular.Ideal(R,[ 5+a^2*b+2*a*c^2+a^4+3*a^2*b*c,c+5*a*b+4*c^2+2*a*c*d+2*b^4+3*c^4+2*a*d^3]) + I = Singular.std(I, complete_reduction = true) + + + + @time T = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3, + ) + + @time F = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal, + ) + @time FA = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_look_ahead, + ) + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 2, + ) + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3, + ) + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :generic, + ) + + + + #@time T0 = Singular.std( + # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + # complete_reduction = true, + #) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + + + + println("test tran: ", equalitytest(T6, T1)) + println("test fractal: ", equalitytest(T6, T2)) + println("test fractal: ", equalitytest(T6, T3)) + println("test pertubed: ", equalitytest(T5, T6)) + println("test standard: ", equalitytest(T4, T6)) + println("test generic: ", equalitytest(T6, T6)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end + end println("All tests were: ", test_successfull) end diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index c3d4ee8e2..428c115f2 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -276,6 +276,7 @@ function modulo( ) where {L<:Nemo.RingElem} Returns p modulo G w.r.t. the leading terms Lm and true if a division occured. """=# + function modulo( p::Singular.spoly, G::Vector{spoly{L}}, @@ -300,7 +301,33 @@ function modulo( return p, false end end - +#= +function modulo( + p::Singular.spoly, + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, + c::Bool = false, +) where {L<:Nemo.RingElem} + I = 0 + R = parent(p) + Q = zero(R) + result = p + b = true + r = false + while b + b = false + for i = 1:length(G) + (q, b) = dividesGW(result, Lm[i], R) + if b + result = result - (q * G[i]) + b = true + r = true + break + end + end + end + return result, r +end=# #= @doc Markdown.doc""" function interreduce( diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index c8c7e6744..e0fc443fe 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -160,8 +160,8 @@ function standard_step( ) Gw = initials(Rn, gens(G), cw) H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) + H = liftGW2(G, R, Gw, H, Rn) + #H = lift(G, R, H, Rn) return Singular.std(H, complete_reduction = true) end @@ -273,7 +273,7 @@ function fractal_walk( S::MonomialOrder{Matrix{Int},Vector{Int}}, T::MonomialOrder{Matrix{Int},Vector{Int}}, ) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(base_ring(G))] println(PertVecs) println("FractalWalk_standard results") println("Crossed Cones in: ") @@ -294,22 +294,24 @@ function fractal_recursiv( G.isGB = true w = S.w + while !terminate t = next_weightfr(G, w, PertVecs[p]) if (t == [0]) if inCone(G, T, PertVecs[p]) + println(PertVecs[p], " in Cone", p) return G else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] + T.t = PertVecs[p] + println("not in Cone ", PertVecs) continue end end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) + checkInt32(w) T.w = w - if !checkInt32(w) - return G - end Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) if p == nvars(R) @@ -323,8 +325,8 @@ function fractal_recursiv( println("up in: ", p, " with: ", w) H = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), - S, - T, + MonomialOrder(S.m, S.w, PertVecs[p]), + MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1, ) @@ -333,6 +335,8 @@ function fractal_recursiv( #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn + S.w = T.w + end return G end @@ -370,7 +374,7 @@ function fractal_walk_recursiv_startorder( G.isGB = true if (p == 1) if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global cwPert = [pertubed_vector(G, S.m, i) for i = 1:nvars(R)] global firstStepMode = true end end @@ -384,17 +388,18 @@ function fractal_walk_recursiv_startorder( t = next_weightfr(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) + println(PertVecs[p], " in Cone", p) return G else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] + T.t = PertVecs[p] + println("not in Cone ", PertVecs) continue end end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end + checkInt32(w) T.w = w Rn = change_order(R, T) Gw = initials(R, gens(G), w) @@ -410,8 +415,8 @@ function fractal_walk_recursiv_startorder( H = fractal_walk_recursiv_startorder( Singular.Ideal(R, [x for x in Gw]), - copy(S), - copy(T), + MonomialOrder(S.m, S.w, PertVecs[p]), + MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1, ) @@ -421,6 +426,8 @@ function fractal_walk_recursiv_startorder( #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn + S.w = T.w + end return G end @@ -429,7 +436,7 @@ function fractal_walk_lex( S::MonomialOrder{Matrix{Int},Vector{Int}}, T::MonomialOrder{Matrix{Int},Vector{Int}}, ) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(base_ring(G))] println("fractal_walk_lex results") println("Crossed Cones in: ") Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) @@ -452,22 +459,22 @@ function fractal_walk_recursive_lex( t = next_weightfr(G, w, PertVecs[p]) if t == [0] if inCone(G, T, PertVecs[p]) + println(PertVecs[p], " in Cone", p) return G else global PertVecs = - [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - println(PertVecs) + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] + T.t = PertVecs[p] + println("not in Cone ", PertVecs) continue end end if t == 1 && p == 1 - return fractal_walk_recursive_lex(G, S, T, PertVecs, p + 1) + return fractal_walk_recursive_lex(G, S, MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1) else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end + checkInt32(w) T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -482,8 +489,8 @@ function fractal_walk_recursive_lex( println("up in: ", p, " with: ", w) H = fractal_walk_recursive_lex( Singular.Ideal(R, [x for x in Gw]), - S, - T, + MonomialOrder(S.m, S.w, PertVecs[p]), + MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1, ) @@ -494,6 +501,8 @@ function fractal_walk_recursive_lex( #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn + S.w = T.w + end return G end @@ -504,7 +513,7 @@ function fractal_walk_look_ahead( ) println("fractal_walk_look_ahead results") println("Crossed Cones in: ") - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(base_ring(G))] Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb @@ -525,18 +534,19 @@ function fractal_walk_look_ahead_recursiv( while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PertVecs[p]) + if inCone(G, T.m, PertVecs[p]) + println(PertVecs[p], " in Cone ",p) return G else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] + T.t = PertVecs[p] + println(PertVecs[p], " not in Cone") continue end end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end + checkInt32(w) T.w = w Rn = change_order(R, T) Gw = initials(R, Singular.gens(G), w) @@ -551,8 +561,8 @@ function fractal_walk_look_ahead_recursiv( println("up in: ", p, " with: ", w) H = fractal_walk_look_ahead_recursiv( Singular.Ideal(R, Gw), - S, - T, + MonomialOrder(S.m, S.w, PertVecs[p]), + MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1, ) @@ -562,6 +572,7 @@ function fractal_walk_look_ahead_recursiv( #H = lift(G, R H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn + S.w = T.w end return G end @@ -575,7 +586,8 @@ function fractal_walk_combined( T::MonomialOrder{Matrix{Int},Vector{Int}}, ) global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + [pertubed_vector(G, T.m, i) for i = 1:nvars(Singular.base_ring(G))] +println(PertVecs) println("fractal_walk_combined results") println("Crossed Cones in: ") Gb = fractal_walk_combined(G, S, T, PertVecs, 1) @@ -590,12 +602,12 @@ function fractal_walk_combined( PertVecs::Vector{Vector{Int}}, p::Int, ) - R = Singular.base_ring(G) +R = Singular.base_ring(G) terminate = false G.isGB = true if (p == 1) if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] + global cwPert = [pertubed_vector(G, S.m, i) for i = 1:nvars(R)] println(cwPert) global firstStepMode = true end @@ -605,27 +617,28 @@ function fractal_walk_combined( else w = S.w end + while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PertVecs[p]) - println(PertVecs[p], " in depth", p) + if inCone(G, T.m, PertVecs[p]) + println(PertVecs[p], " in Cone", p) return G else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] + T.t = PertVecs[p] + println("not in Cone ", PertVecs) continue end - end + end if t == 1 && p == 1 - return fractal_walk_combined(G, S, T, PertVecs, p + 1) + println("up in: ", p, " with: t = 1") + return fractal_walk_combined(G, S, MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1) else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end + checkInt32(w) T.w = w - b = w Rn = change_order(R, T) Gw = initials(R, gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) @@ -636,11 +649,11 @@ function fractal_walk_combined( println(w, " in depth", p) raiseCounterFr() else - println("up in: ", p, " with: ", w) + println("from $(S.w) to $(T.w)","up in: ", p, " with: ", w) H = fractal_walk_combined( Singular.Ideal(R, [x for x in Gw]), - S, - T, + MonomialOrder(S.m, S.w, PertVecs[p]), + MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1, ) @@ -651,6 +664,7 @@ function fractal_walk_combined( #H = lift(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn + S.w = T.w end return G end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 5d99ff435..43e678399 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -9,10 +9,11 @@ function next_weight( cweight::Vector{Int}, tweight::Vector{Int}, ) where {K<:Number} - tmin = 1 + + tmin = BigInt(1) for v in difference_lead_tail(G) - cw = dot(cweight, v) - tw = dot(tweight, v) + cw = BigInt(dot(cweight, v)) + tw = BigInt(dot(tweight, v)) if tw < 0 t = cw // (cw - tw) @@ -21,7 +22,8 @@ function next_weight( end end end - w = convert_bounding_vector((1 - tmin) * cweight + tmin * tweight) + + w = convert_bounding_vector(cweight + tmin * (tweight- cweight)) #= if !checkInt32(w) println(w) for i in 1:length(cweight) @@ -42,7 +44,7 @@ end function checkInt32(w::Vector{Int}) for i = 1:length(w) if tryparse(Int32, string(w[i])) == nothing - println("w bigger than int32") + println("int32") return false end end @@ -94,6 +96,15 @@ function difference_lead_tail(I::Singular.sideal) return unique!(v) end +#= +@doc Markdown.doc""" +function pertubed_vector( +G::Singular.sideal, +M::Matrix{Int}, +p::Integer +) +Computes a p-pertubed weight vector of M. +"""=# function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) m = [] n = size(M)[1] @@ -123,48 +134,18 @@ function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) for i = 2:p w += e^(p - i) * M[i, :] end - #if !checkInt32(w) - # w = pertubed_vector(G, M, p, e - 1) - #end - return convert_bounding_vector(w) end -#=function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer, e::Int) - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxdeg = 0 - for g in gens(G) - td = deg(g, n) - if (td > maxdeg) - maxdeg = td - end - end - #e = maxdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - if !checkInt32(w) - w = pertubed_vector(G, M, p, e - 1) - end - return w -end=# - +#= +@doc Markdown.doc""" +function inCone( + G::Singular.sideal, + T::Matrix{Int}, + t::Vector{Int}, +) +Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. +"""=# function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) R = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) @@ -192,7 +173,18 @@ function lift( G.isGB = true return G end -#Amrhein & Gloor + +#= +@doc Markdown.doc""" +function lift_fractal_walk( +G::Singular.sideal, +R::Singular.PolyRing, +inG::Vector{spoly{L}}, +H::Singular.sideal, +Rn::Singular.PolyRing, +) +Performs a lifting step in the Groebner Walk proposed by Amrhein et. al. and Cox Little Oshea +"""=# function liftGW2( G::Singular.sideal, R::Singular.PolyRing, @@ -204,8 +196,9 @@ function liftGW2( gH = collect(gens(H)) gG = collect(gens(G)) s = length(inG) + inGR = [change_ring(x, R) for x in inG] for i = 1:length(gH) - q = divalg(change_ring(gH[i], R), [change_ring(x, R) for x in inG], R) + q = divalg(change_ring(gH[i], R), inGR, R) gH[i] = Rn(0) for j = 1:s gH[i] = @@ -248,8 +241,23 @@ function divalg( return q end -#Solves problems with weight vectors of floats. -function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} +#= +@doc Markdown.doc""" + convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} +Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). +"""=#function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} + w = Vector{Int}() + g = gcd(wtemp) + for i = 1:length(wtemp) + push!(w, float(divexact(wtemp[i], g))) + end + return w +end +#= +@doc Markdown.doc""" + convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} +Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). +"""=#function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int}() g = gcd(wtemp) for i = 1:length(wtemp) @@ -346,12 +354,16 @@ end # Singular.isequal depends on order of generators function equalitytest(G::Singular.sideal, K::Singular.sideal) + if Singular.ngens(G) != Singular.ngens(K) + return false + end generators = Singular.gens(G) count = 0 for gen in generators for r in Singular.gens(K) - if gen - r == 0 + if gen*leading_coefficient(r) - r*leading_coefficient(gen) == 0 count += 1 + break end end end diff --git a/src/GroebnerWalkFinal/UnitTests b/src/GroebnerWalkFinal/UnitTests new file mode 100644 index 000000000..a1ef8ec8f --- /dev/null +++ b/src/GroebnerWalkFinal/UnitTests @@ -0,0 +1,152 @@ +using Test +include("GroebnerWalkFinal.jl") +include("Examples") + +@testset "UnitTests" begin + @testset "Testing GroebnerwalkUtilitys" begin + + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + + f1 = 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 + I = Singular.Ideal(R, [f1, f2]) + sol = [14 * x^2 * y^3, y^3 *z + 7*x^2*y^2*z^2] + @test initials(R, gens(I), [1,3,1]) == sol + + @test difference_lead_tail(I) == [[0, 3, -1],[0, 3, 0],[-1, 2, 0],[2, -1, 1],[0, 2, 0]] + + F = [13*x^3*z^2, 14*x^2*y^3, 98*x*y^5*z^2, y^7*z + x^2*z^3, 14*x*y^6*z] + g = y^7*z + x^2*z^3 + 28 *x^2 * y^4 + q = Array{Singular.elem_type(R),1}(undef, 5) + q[1] = R(0) + q[2] = R(2*y) + q[3] = R(0) + q[4] = R(1) + q[5] = R(0) + @test divalg(g,F,R) == q + + J = Singular.Ideal(R, [f2, f1]) + f1 = 4 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 + K = Singular.Ideal(R, [f1,f2]) + @test equalitytest(I,J) == true + @test equalitytest(I,K) == false + + @test deg(f1, 3) == 5 + + + id = trinks1() + R = base_ring(id) + dim = nvars(R) + ve = ones(Int, dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + I= Singular.std(id, complete_reduction = true) + @test pertubed_vector(I,StartOrd, 1) == [1,1,1,1,1,1] + @test pertubed_vector(I,StartOrd, 2) == [4,4,4,4,4,3] + @test pertubed_vector(I,StartOrd, 3) == [49,49,49,49,48,42] + @test pertubed_vector(I,StartOrd, 4) == [1000,1000,1000,999,990,900] + @test pertubed_vector(I,TarOrd, 1) == [1,0,0,0,0,0] + @test pertubed_vector(I,TarOrd, 2) == [4,1,0,0,0,0] + @test pertubed_vector(I,TarOrd, 3) == [49,7,1,0,0,0] + @test pertubed_vector(I,TarOrd, 4) == [1000,100,10,1,0,0] + + @test inCone(I, StartOrd, [1000,1000,1000,999,990,900]) == true + @test inCone(I, StartOrd, [100,1000,1000,999,990,900]) == false + + + @test dot([1,2,3,4], [2,2,2,2]) == 20 + +end + +@testset "Testing FraktalWalkUtilitys" begin + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = 3 * x^2 + f2 = y^3 * z + 17 * x^2 * z^2 + I = Singular.Ideal(R, [f1,f2]) + f1 = 3 * x^2 + f2 = y^3 * z + J = Singular.Ideal(R, [f1,f2]) + + @test isMonomial(gens(I)) == false + @test isMonomial(gens(J)) == true + @test isbinomial(gens(I)) == true + @test isbinomial(gens(J)) == true + +end + +@testset "Testing GenericWalkUtilitys" begin + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + ) + + + f1 = x^2-y^3 + f2 = x^3-y^2-x + I = Singular.Ideal(R, [f1,f2]) + G = Singular.std(I, complete_reduction = true) + + @test next_gamma(G,[0], ordering_as_matrix(:degrevlex, 2),ordering_as_matrix(:lex, 2)) == [-2,3] + + Rn, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 2)), + ) + g = [Rn(y^3 - x^2), Rn(x^3)] + @test facet_initials(Singular.Ideal(Rn,[change_ring(x, Rn) for x in gens(G)]), [change_ring(Singular.leading_term(g), Rn) for g in gens(G)], [-2,3]) == g + + @test difference_lead_tail(G,[Singular.leading_term(g) for g in gens(G)]) == [[-2,3],[3,-2],[2,0]] + + @test isParallel([1,2], [1,4]) == false + @test isParallel([1,2], [2,4]) == true + @test isParallel([-1, 0], [-2,1]) == false + @test isParallel([-1, 0], [2,0]) == true + + @test less_facet([-2,3],[-1,4], ordering_as_matrix(:degrevlex, 2),ordering_as_matrix(:lex, 2)) == true + @test less_facet([-1,7],[-1,4], ordering_as_matrix(:degrevlex, 2),ordering_as_matrix(:lex, 2)) == false + + dim = 5 + ve = [1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex,dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d, e) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d", "e"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) +J = Singular.Ideal(R,[ b+3*b^3+2*b*c*e+5*b*d*e, +4+b^2+4*b*c+5*b^3+c*d*e, +d*e+5*b^2*e]) + I= Singular.std(J, complete_reduction = true) + f1 = R(a^3 +a^2 + b^5*a^3*c^9 +e^3 +b^2*a^2*c^4 +d^3 +e^3 + b^8*d^10*e^18) + f2 = R(a^3 *b^3) + f3 = R(a^2*b^4 +c^2 +a^3*4 +a*e^3) + f4 = R(0) + t = @timed modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) + println(t.time) + + + @test (reduce(f1, I), true) == modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f2, I), true) == modulo(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f3, I), true) == modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f4, I), false) == modulo(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) + J= Singular.std(J) + @test equalitytest(Singular.std(J, complete_reduction = true),Singular.Ideal(R,interreduce(collect(gens(J)), [Singular.leading_term(g) for g in gens(J)]))) + + +end +end diff --git a/src/GroebnerWalkFinal/tests b/src/GroebnerWalkFinal/tests index 322aa2fd8..c7c8a70a1 100644 --- a/src/GroebnerWalkFinal/tests +++ b/src/GroebnerWalkFinal/tests @@ -19,11 +19,11 @@ using Test end push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), @@ -31,7 +31,7 @@ using Test ) for id in ideals - @test Singular.equal( + @test equalitytest( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), s, ) @@ -58,7 +58,7 @@ using Test push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), @@ -66,7 +66,7 @@ using Test ) for id in ideals - @test Singular.equal( + @test equalitytest( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), s, ) @@ -93,7 +93,7 @@ using Test push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), @@ -102,7 +102,7 @@ using Test for id in ideals - @test Singular.equal( + @test equalitytest( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), s, ) @@ -129,7 +129,7 @@ using Test push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), Taordering_as_matrix(:lex, dim)rOrd, :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :generic)) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), @@ -137,7 +137,7 @@ using Test ) for id in ideals - @test Singular.equal( + @test equalitytest( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), s, ) From ebfb94e46338c696ef3c6dce5993d660fc16c495 Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 14 Feb 2022 17:53:13 +0100 Subject: [PATCH 51/85] refactor --- .../Benchmarking/BenchmarkHelper | 533 ----- .../Benchmarking/BspEinzeln.jl | 230 --- src/GroebnerWalkFinal/Benchmarking/BspVar3.jl | 883 -------- src/GroebnerWalkFinal/Benchmarking/BspVar4.jl | 247 --- src/GroebnerWalkFinal/Benchmarking/BspVar5.jl | 250 --- .../GroebnerWalkFinalBenchmark.jl | 698 ------- .../GroebnerWalkFinalBenchmarkProcedures.jl | 1773 ----------------- src/GroebnerWalkFinal/Benchmarking/parser.jl | 51 - .../Benchmarking/readWriteHelper.jl | 27 - .../Benchmarking/runbenchmark.jl | 51 - .../Benchmarking/runbenchmark2.jl | 120 -- .../FractalWalkUtilitysFinal.jl | 4 +- src/GroebnerWalkFinal/GWtestFinal.jl | 189 +- src/GroebnerWalkFinal/UnitTests | 349 ++-- src/GroebnerWalkFinal/examplesFinal.jl | 37 - src/GroebnerWalkFinal/tests | 2 +- src/Groebnerwalk/AlternativeAlgorithm.jl | 168 -- src/Groebnerwalk/FractalWalkUtilitys.jl | 203 -- src/Groebnerwalk/GWtest.jl | 559 ------ src/Groebnerwalk/GenericWalkUtilitys.jl | 383 ---- src/Groebnerwalk/GroebnerWalk.jl | 669 ------- src/Groebnerwalk/GroebnerWalkUtilitys.jl | 539 ----- src/Groebnerwalk/StandardWalkUtilitys.jl | 40 - src/Groebnerwalk/TranWalkUtilitys.jl | 46 - src/Groebnerwalk/examples | 294 --- src/Groebnerwalk/testwiese | 149 -- 26 files changed, 308 insertions(+), 8186 deletions(-) delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar3.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar4.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/BspVar5.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/parser.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl delete mode 100644 src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl delete mode 100644 src/GroebnerWalkFinal/examplesFinal.jl delete mode 100644 src/Groebnerwalk/AlternativeAlgorithm.jl delete mode 100644 src/Groebnerwalk/FractalWalkUtilitys.jl delete mode 100644 src/Groebnerwalk/GWtest.jl delete mode 100644 src/Groebnerwalk/GenericWalkUtilitys.jl delete mode 100644 src/Groebnerwalk/GroebnerWalk.jl delete mode 100644 src/Groebnerwalk/GroebnerWalkUtilitys.jl delete mode 100644 src/Groebnerwalk/StandardWalkUtilitys.jl delete mode 100644 src/Groebnerwalk/TranWalkUtilitys.jl delete mode 100644 src/Groebnerwalk/examples delete mode 100644 src/Groebnerwalk/testwiese diff --git a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper b/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper deleted file mode 100644 index 6f850e211..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BenchmarkHelper +++ /dev/null @@ -1,533 +0,0 @@ -function runAll( - v::String, - ideal::Singular.sideal, - S::Singular.PolyRing, - StartOrd::Matrix{Int64}, - TarOrd::Matrix{Int64}, -) - runb(v, ideal, S, StartOrd, TarOrd) - runb2(v, ideal, S, StartOrd, TarOrd) -end - -function prepare2() - - df = DataFrame( - example = ["-"], - standard = ["-"], - pertubed2 = ["-"], - pertubed3 = ["-"], - pertubed4 = ["-"], - pertubed5 = ["-"], - pertubed6 = ["-"], - pertubed7 = ["-"], - pertubed8 = ["-"], - pertubed9 = ["-"], - pertubed10 = ["-"], - fractal = ["-"], - fractallex = ["-"], - fractallookahead = ["-"], - fractalcombined = ["-"], - generic = ["-"], - tran = ["-"], - stime = ["-"], - ttime = ["-"], - ) - savew(df, "CompareAlg") -end -function prepareAlloc() - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - example = ["-"], - ) - savew(df, "allocsStandardWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = ["-"], - ) - for i = 2:10 - savew(df, "allocsPertubedWalk", i) - end - - df = DataFrame( - nextW = ["-"], - facetnormal = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], - example = ["-"], - ) - savew(df, "allocsGenericWalk") - - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = [""], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "allocsFractalWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "allocsFractalWalklex") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "allocsFractalWalklookahead") - - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], - ) - savew(df, "allocsFractalWalkcombined") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - reprVec = ["-"], - inCone = ["-"], - inSeveralCones = ["-"], - example = ["-"], - ) - savew(df, "allocsTranWalk") -end - -function prepareExampleAlloc(v::String) - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsStandardWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], -example = [v], -counter = ["-"] - ) - for i = 2:10 - savea(df, "allocsPertubedWalk", i) - end - - df = DataFrame( - nextW = ["-"], - facetnormal = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsGenericWalk") - - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsFractalWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsFractalWalklex") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsFractalWalklookahead") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsFractalWalkcombined") - df = DataFrame( - nextW = "-", - currrentWeight = "-", - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - reprVec = ["-"], - inCone = ["-"], - inSeveralCone = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "allocsTranWalk") -end - -function prepareExampleElapsed(v::String) - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], -example = [v], - counter = ["-"] - ) - savea(df, "standardWalk") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], -example = [v], -counter = ["-"] - ) - for i = 2:10 - savea(df, "pertubedWalk", i) - end - - df = DataFrame( - NextcurrrentWeight = ["-"], - facetnormal = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "genericWalk") - - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "fractalWalk") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "fractalWalklex") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "fractalWalklookahead") - df = DataFrame( - NextcurrrentWeight = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "fractalWalkcombined") - df = DataFrame( - NextcurrrentWeight = "-", - currrentWeight = "-", - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - reprVec = ["-"], - inCone = ["-"], - inSeveralCone = ["-"], -example = [v], -counter = ["-"] - ) - savea(df, "tranWalk") -end - -function prepare() - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "standardWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - pert = ["-"], - inCone = ["-"], - laststd = ["-"], - degree = ["-"], - example = ["-"], -counter = ["-"] ) - for i = 2:10 - savew(df, "pertubedWalk", i) - end - df = DataFrame( - nextW = ["-"], - facetnormal = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftgeneric = ["-"], - interreduce = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "genericWalk") - - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "fractalWalk") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "fractalWalklex") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "fractalWalklookahead") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - inCone = ["-"], - pertvec = ["-"], - depth = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "fractalWalkcombined") - df = DataFrame( - nextW = ["-"], - currrentWeight = ["-"], - nGens = ["-"], - initials = ["-"], - stdH = ["-"], - liftAlternative = ["-"], - lift = ["-"], - interreduce = ["-"], - rep = ["-"], - inCone = ["-"], - inseveral = ["-"], - example = ["-"], -counter = ["-"] ) - savew(df, "tranWalk") -end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl b/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl deleted file mode 100644 index fb65e4cc4..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BspEinzeln.jl +++ /dev/null @@ -1,230 +0,0 @@ -include("GroebnerWalkFinalBenchmarkProcedures.jl") -include("runbenchmark.jl") -include("GroebnerWalkFinalBenchmark.jl") -include("runbenchmark2.jl") -include("BenchmarkHelper") -include("readWriteHelper.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples") - - - -using DataFrames -using CSV -function runAllSingleExample() - cd("/Users/JordiWelp/Results") - prepare() - prepare2() - prepareAlloc() - - id = katsura5() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll("Katsura5", id, S, StartOrd, TarOrd) - - - - id = katsura6() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll("Katsura6", id, S, StartOrd, TarOrd) - - - - example = "Cyclic7" - id = cyclic7() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - - - - example = "Cyclic6" - id = cyclic6() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - - example = "Cyclic5" - id = cyclic5() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - - example = "eco6" - id = eco6() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "eco7" - id = eco7() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "noon5" - id = noon5() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - - - example = "noon6" - id = noon6() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "noon7" - id = noon7() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "noon8" - id = noon8() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "redeco7" - id = redeco7() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "redeco8" - id = redeco8() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "wang91" - id = wang91() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "cohn4" - id = cohn4() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - example = "of" - id = oberfr() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int64, dim) - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - runAll(example, id, S, StartOrd, TarOrd) - - -end -#= - -dim = 7 -ve = [1, 1, 1, 1, 1,1,1] -example ="redeco7" -StartOrd = ordering_as_matrix(ve, :lex) -TarOrd = ordering_as_matrix(:lex, dim) -R, (x1,x2,x3,x4,u7,x5,x6) = Singular.PolynomialRing( - Singular.QQ, - ["x1","x2","x3","x4","u7","x5","x6"], - ordering = Singular.ordering_M(StartOrd), -) -S = change_order(R, TarOrd) - - f1 =-6*u7+x6 - f2 =x1+x2+x3+x4+x5+x6+1 - f3 =x1*x6-5*u7+x5 - f4 =x1*x5+x2*x6+x4-4*u7 - f5 =x1*x4+x2*x5+x3*x6+x3-3*u7 - f6 =x1*x3+x2*x4+x3*x5+x4*x6+x2-2*u7 - f7 =x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x1-u7 - -I = Singular.Ideal(R, [f1, f2,f3,f4,f5,f6,f7]) -runb(example, id, S, StartOrd, TarOrd) - -s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(I)]), - complete_reduction = true, -) -df = DataFrame(a = ["test1"], b = ["test2"],c=["example"]) -savew(df, "correct.txt") -for id in ideals - a = isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = equalitytest(s, id) - df = DataFrame(a = [a], b = [b], c=[example]) - savea(df, "correct.txt") -end -=# diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl deleted file mode 100644 index 61dcb4dbe..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar3.jl +++ /dev/null @@ -1,883 +0,0 @@ -include("GroebnerWalkFinalBenchmarkProcedures.jl") -include("runbenchmark.jl") -include("GroebnerWalkFinalBenchmark.jl") -include("runbenchmark2.jl") -include("BenchmarkHelper") -include("readWriteHelper.jl") -include("/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/Examples") -using DataFrames -using CSV - -function benchmarkVar3() - cd("/Users/JordiWelp/Results2") - prepare() - prepare2() - prepareAlloc() - dim = 3 - ve = [1, 1, 1] - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - ideals = [] - - #=push!( - ideals, - Singular.Ideal( - R,[48*b+23*a*c+47*a^5+69*a*b^4, - 53*b*c^2, - 65+21*a*b*c^2])) - push!( - ideals, - Singular.Ideal( - R,[R(47), - 4*a*b^3+64*a^3*b^2, - 40*a+90*b^2+59*a*b^2+74*b^4*c])) - push!( - ideals, - Singular.Ideal( - R,[89*c+78*a*c^3, - 26*a*c^2, - 26+4*c^2+89*a^4*b+73*a^2*b^2*c])) - for i in ideals - runAll("sparseid(3,0,5,100-(1*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[]=# - push!( - ideals, - Singular.Ideal( - R, - [ - 65 + a^3 + 37 * a^4 + 60 * a^3 * c^2, - 47 * a * b + 4 * a^2 * b + 35 * b * c^4, - a + 23 * a^3 * b + 84 * a * b^2 * c^2, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 86 + - 77 * a + - 13 * a^3 + - 23 * a^2 * b + - 21 * c^4 + - 4 * a * b^4 + - 7 * c^5, - 82 * c^2, - 23 * c^4 + 4 * a^3 * b * c, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 71 * c^3 + 67 * a^4 + 14 * b * c^4, - 64 + 87 * b^2 + 40 * a^2 * b + 21 * b^2 * c^2 + 73 * a^4 * b, - 50 * b + 21 * a^2 * b^3, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(2*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 22 + 38 * b * c^2 + 60 * a * c^4, - 14 * a + - 67 * a^2 + - 58 * b^2 * c^2 + - 87 * b^5 + - 88 * a^2 * b * c^2, - 67 * a * c + - 83 * a^2 * c + - 87 * b^4 + - 18 * a * c^3 + - 74 * b^3 * c^2, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 49 * a + 88 * a * b * c^2 + 55 * a * b * c^3, - 5 * c^2 + 83 * a^3 * b + 10 * a^4 * c + 28 * a * c^4, - 54 + - 19 * b^2 + - 8 * b * c^2 + - 54 * c^3 + - 10 * a * b^2 * c + - 40 * c^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 44 * c + 60 * b * c + 3 * a^2 * c + 43 * c^4, - 85 * a^2 + 36 * b^3 * c^2 + 19 * c^5, - 5 + - 64 * a * b^2 + - 55 * a^2 * b^2 + - 18 * b^4 + - 26 * b * c^4 + - 5 * c^5, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(3*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 74 * a * c + - 48 * b * c + - 26 * a * b^2 * c + - 9 * c^4 + - 83 * a * b^4 + - 45 * b^5 + - 49 * a^3 * c^2, - 85 + - 42 * a * b^2 * c + - 68 * a * c^3 + - 50 * b^2 * c^3 + - 45 * c^5, - 26 * a + - 59 * a^2 * b + - 49 * a^2 * c + - 75 * c^3 + - 40 * a^2 * c^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 48 * a * c + 19 * a * c^2 + 23 * a^3 * b^2 + 42 * a * b^2 * c^2, - 18 * b^2 + - 32 * a^2 * b + - 64 * b * c^2 + - 44 * a * b^3 + - 2 * b^4 + - 23 * a^3 * b^2 + - 2 * a^2 * b^3 + - 13 * b^3 * c^2, - 41 + 19 * c + 51 * a * b^3 + 9 * b * c^3 + 50 * a * b * c^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 49 * c^3 + 78 * c^5, - 12 * a + 22 * b^4 + 40 * a^3 * b * c + 44 * a * b * c^3, - 75 + - 87 * a * b + - 86 * c^2 + - 16 * a^2 * b + - 53 * c^3 + - 87 * a^3 * c + - 87 * a * c^3 + - 28 * b * c^3 + - 23 * a^2 * b^2 * c + - 15 * b^4 * c + - 65 * b^2 * c^3, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(4*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 36 * b * c + - 80 * b^3 + - 29 * c^3 + - 70 * a * b^2 * c + - 23 * a^2 * c^2 + - 86 * a^3 * b^2 + - 29 * b^4 * c + - 55 * b * c^4, - 65 + - 75 * a * c + - 58 * b^3 + - 69 * a^3 * b + - 64 * a * b^2 * c + - 82 * a * b^4 + - 24 * c^5, - 53 * b + - 39 * a^2 * b * c + - 42 * a^3 * b * c + - 42 * a^2 * b * c^2, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 78 + - 7 * a * c + - 21 * a^2 * b + - 20 * b^2 * c + - 85 * b^3 * c + - 34 * b * c^3 + - 9 * b^2 * c^3, - 37 * a^2 * b^2 + - 89 * a^3 * b^2 + - 45 * a * b^4 + - 76 * a^3 * c^2 + - 21 * a * c^4 + - 22 * b * c^4, - 37 * c + - 24 * b^2 + - 49 * b^2 * c + - 15 * a^2 * b * c + - 55 * a * c^3 + - 5 * a^2 * c^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 18 + - 89 * b^2 + - 80 * a^3 + - 22 * a^2 * c^2 + - 75 * b^2 * c^2 + - 58 * b * c^3 + - 64 * a * b^3 * c + - 85 * a^3 * c^2 + - 4 * a^2 * b * c^2 + - 46 * a^2 * c^3, - 16 * a * b + - 31 * a^3 + - 10 * b^3 + - 9 * a * b^2 * c + - 67 * a^2 * c^2 + - 46 * a^2 * b * c^2, - 86 * a + 19 * a^5 + 8 * b^4 * c, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(5*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 48 * a + - 18 * a^2 + - 90 * a * c + - 7 * b * c + - 81 * a * b * c + - 2 * b^2 * c + - 69 * b^4 + - 57 * a * b * c^2, - 20 + - 35 * b + - 24 * b^4 + - 11 * b^3 * c + - 49 * a * c^3 + - 22 * a^3 * b^2 + - 76 * a * b^4 + - 3 * a^2 * b^2 * c + - 47 * b^2 * c^3, - 89 * a^2 * b + - 9 * a * b^2 + - 62 * a * b^3 + - 74 * a^4 * b + - 32 * a^3 * b^2 + - 87 * a^2 * b^3 + - 62 * b * c^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 48 + 15 * a + 42 * a^2 + 35 * c^2 + 72 * b^4, - 37 * c^2 + - 17 * a * b^2 + - 46 * a * b * c + - 78 * a^2 * b * c + - 33 * a * b * c^2 + - 34 * b^2 * c^2 + - 63 * a * c^3 + - 71 * a^3 * b^2 + - 22 * a^4 * c + - 29 * a^2 * b^2 * c + - 12 * a^3 * c^2 + - 66 * a * c^4 + - 86 * b * c^4, - 73 * c + - 52 * a * b^2 + - 69 * a * b * c + - 18 * a * b * c^2 + - 49 * a^4 * b + - 77 * b^3 * c^2, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 50 * b + - 63 * c^2 + - 51 * a^3 + - 26 * b^4 * c + - 77 * a^3 * c^2 + - 67 * b^3 * c^2, - 11 * b + - 48 * a * b + - 57 * a^4 + - 10 * b^4 + - 23 * a^5 + - 14 * a * b^4, - 19 + - 79 * a * c + - 3 * a * b^2 + - 27 * a * b * c + - 74 * b^2 * c + - 62 * a^3 * c + - 31 * a^2 * b * c + - 30 * a * b^2 * c + - 43 * b^3 * c + - 8 * a * b^3 * c + - 31 * a^2 * b * c^2 + - 86 * b^3 * c^2, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(6*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 42 + - 23 * a * b + - 8 * a^2 * b + - 20 * a^2 * c + - 76 * a^3 * b * c + - 78 * b^3 * c^2 + - 2 * a * b * c^3 + - 6 * b^2 * c^3 + - 25 * b * c^4, - 31 * c + - 50 * b * c + - 80 * a^2 * b + - 79 * a^3 * b + - 85 * a * b * c^2 + - 58 * a * b^4 + - 2 * a^3 * c^2 + - 16 * c^5, - 88 * a + - 52 * a * b + - 17 * b^3 + - 78 * b * c^2 + - 40 * a^2 * b^2 + - 14 * b^3 * c + - 85 * a^2 * c^2 + - 85 * b^2 * c^2 + - 80 * c^4 + - 19 * a^2 * b^2 * c, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 61 * a * b + - 35 * b * c^2 + - 13 * a * b * c^2 + - 69 * b^2 * c^2 + - 20 * b * c^3 + - 21 * a * b^4 + - 21 * a * b^3 * c + - 53 * b^3 * c^2, - 90 + - 39 * a + - 62 * a^3 * c + - 61 * b * c^3 + - 55 * c^4 + - 22 * b^4 * c + - 35 * a^3 * c^2 + - 41 * a * c^4 + - 75 * c^5, - 56 * c + - a * c + - 13 * b * c + - 33 * a * b^2 + - 65 * b^3 + - 45 * a^2 * c + - 71 * b * c^2 + - 4 * a * b * c^2 + - 82 * a * b^3 * c + - 70 * b^2 * c^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 87 * a * c + - 73 * a * b^2 + - 62 * a * c^2 + - 55 * a^2 * b^2 + - 78 * b^4 + - 77 * c^4 + - 2 * a^3 * b^2 + - 40 * b^2 * c^3 + - 49 * b * c^4, - 58 + 42 * c + 85 * a * b + 58 * a^2 * b * c, - 70 * c + - 11 * b^2 + - 20 * a^2 * b + - 47 * b^2 * c + - 69 * b * c^2 + - 4 * a^3 * b + - 72 * a * b * c^2 + - 72 * a * c^3 + - 43 * a^2 * b^3 + - 76 * a * b^4 + - 22 * a^3 * b * c + - 36 * a^2 * b * c^2 + - 64 * b^2 * c^3 + - 28 * c^5, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(7*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 29 + - 47 * c + - 89 * b^2 + - 76 * b * c + - 26 * a^3 + - 5 * b^2 * c^2 + - 66 * c^4 + - 21 * a^4 * b + - 31 * a^3 * b^2 + - 33 * a * b^3 * c + - 18 * a * b^2 * c^2 + - 51 * b^2 * c^3, - 22 * a + - 57 * a * c^2 + - 56 * c^3 + - 62 * a^4 + - 10 * a^3 * c + - 22 * a * c^3 + - 68 * a^3 * b * c + - 10 * a^2 * c^3 + - 34 * a * b * c^3, - 21 * b^2 + - 15 * a * b * c + - 42 * b^2 * c + - 83 * a^3 * b + - 81 * a * b^2 * c + - 80 * b^2 * c^2 + - 33 * a * b * c^3 + - 42 * a * c^4 + - 82 * b * c^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 17 + - 21 * c + - 67 * a^2 * c + - 70 * b^2 * c + - 84 * a^2 * b^2 + - 14 * a * b^2 * c + - 66 * a * b * c^2 + - 23 * a * b^4 + - 6 * b^5 + - 22 * a^2 * c^3, - b + - 56 * a^2 + - 7 * b^2 + - 42 * a^2 * c + - 36 * a * b * c + - 28 * c^3 + - 53 * a^4 + - 49 * a^3 * c + - 12 * a^2 * b^3 + - 53 * a * b^4 + - 6 * b^4 * c + - 30 * a^2 * c^3 + - 88 * a * b * c^3 + - 54 * b^2 * c^3, - 28 * b * c + - 16 * a^3 * b + - 65 * a^2 * c^2 + - 23 * a * c^3 + - 54 * b^3 * c^2 + - 38 * a * b * c^3, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 64 * b^2 + - 4 * a^2 * b + - 78 * c^3 + - 17 * a * b^3 + - 48 * b^4 + - 28 * a * b^4 + - 16 * a^3 * c^2, - 49 * c + - 25 * a^2 + - 13 * c^2 + - 87 * a^2 * c + - 34 * c^3 + - 88 * a^2 * b * c + - 8 * a^3 * b^2 + - 6 * a^2 * b * c^2 + - 31 * a * c^4, - 64 + - 30 * b + - 14 * a * b * c + - 47 * a^2 * b^2 + - 38 * a * b^3 + - 23 * a^3 * c + - 10 * a^2 * b * c + - 21 * b^3 * c + - 46 * a^4 * c + - 38 * a^3 * b * c + - 34 * b^4 * c + - 17 * a^3 * c^2 + - 89 * a^2 * b * c^2 + - 71 * b^3 * c^2, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(8*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 88 * b + - 63 * c^2 + - 49 * a * b * c + - 78 * b * c^2 + - 31 * a^3 * b + - 77 * a * b^2 * c + - 12 * b^3 * c + - 44 * a^2 * c^2 + - 49 * b^2 * c^2 + - 36 * a * c^3 + - 42 * a^3 * b * c + - 21 * a^2 * b^2 * c + - 44 * a * b^2 * c^2, - 2 + - 55 * a * b + - 75 * a * c + - 75 * b * c + - 51 * a * b * c + - 59 * a^3 * b * c + - 39 * a^2 * c^3 + - 89 * c^5, - 36 * c + - 35 * a^2 * b + - 68 * b^2 * c + - 2 * c^3 + - 55 * a^3 * c + - 20 * a * b^2 * c + - 77 * a^2 * c^2 + - 30 * a^5 + - 61 * a^4 * b + - 42 * a^4 * c + - 29 * a * b^3 * c + - 77 * a^3 * c^2 + - 69 * c^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 44 + - 4 * a + - 60 * c^2 + - 35 * a^3 + - 15 * a^2 * c + - 47 * b^2 * c + - 68 * b * c^2 + - 2 * a * b^3 + - 4 * a^5 + - 7 * a^3 * b * c + - 70 * a^2 * b^2 * c + - 56 * a * b^3 * c + - 70 * b^2 * c^3 + - 2 * a * c^4 + - 40 * c^5, - 31 * c + - 34 * b * c + - 52 * a * c^2 + - 33 * a^3 * b + - 45 * a^3 * c + - 82 * a * b * c^2 + - 77 * b * c^3 + - 30 * a^2 * b^2 * c + - 31 * a^2 * b * c^2 + - 83 * c^5, - 33 * a * c + - 40 * b * c + - 25 * b^2 * c + - 78 * a^4 + - 68 * a^2 * b^2 + - 65 * a * b * c^2 + - c^4 + - 40 * a^2 * c^3 + - 49 * a * c^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 21 * c^2 + - 42 * a^2 * b + - 12 * a * b^2 + - 15 * a * c^2 + - 43 * b * c^2 + - 34 * a * b^3 + - 10 * a^3 * c + - 57 * a^2 * b * c + - 36 * b^2 * c^2 + - 64 * b^5 + - 86 * a^3 * b * c + - 7 * b^4 * c + - 78 * a * b * c^3 + - 52 * b^2 * c^3 + - 82 * c^5, - 45 * a * c + - 63 * a^3 + - 8 * a^4 + - 80 * b^2 * c^2 + - 76 * a^4 * b + - 46 * a * b^2 * c^2 + - 9 * b^3 * c^2 + - 11 * a * c^4, - 54 + - 73 * a + - 24 * c + - 70 * a^2 + - 7 * a * b + - 15 * a^2 * c + - 89 * a^4 + - 57 * b^4 + - 26 * b * c^3 + - 38 * a^2 * b^2 * c + - 81 * b^4 * c, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(9*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - push!( - ideals, - Singular.Ideal( - R, - [ - 8 * c + - 50 * b^2 + - 29 * b * c + - 55 * a^3 + - 8 * a^2 * c + - 27 * b^2 * c + - 67 * a * c^2 + - 55 * b^3 * c + - 26 * a^4 * b + - 85 * a^2 * b^3 + - 10 * b^5 + - 15 * a * b^2 * c^2 + - 64 * a^2 * c^3, - 76 * a + - 64 * a * b + - 20 * b^2 + - 24 * a^3 * b + - 79 * b^4 + - 11 * b^2 * c^2 + - 5 * a * c^3 + - 88 * b * c^3 + - 3 * c^4 + - 67 * a^3 * b^2 + - 37 * a^2 * b^3 + - 47 * a * b^3 * c + - 51 * a^2 * c^3, - 46 + - 35 * a * b^2 + - 26 * a * c^2 + - 27 * a^4 + - 54 * a * c^3 + - 31 * a^5 + - 42 * a^2 * b^3 + - 74 * b^2 * c^3 + - 33 * b * c^4, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 62 + - 85 * b + - 37 * c + - 9 * a * c + - 56 * a * c^2 + - 76 * b * c^2 + - 55 * c^3 + - 70 * a^4 + - 20 * a * b^3 + - 21 * a * c^3 + - 73 * a * b^2 * c^2 + - 69 * a * c^4, - 36 * b^3 + - 30 * b^2 * c + - 61 * a^3 * b + - 54 * a^2 * b^2 + - 10 * a * b^3 + - 87 * b^5 + - 49 * a^3 * c^2 + - 49 * a * b^2 * c^2 + - 76 * a^2 * c^3 + - 11 * a * b * c^3 + - 49 * b^2 * c^3, - 74 * b^2 + - 12 * a * c + - 11 * b * c + - 40 * a^2 * c + - 63 * a^4 + - 86 * b^4 + - 17 * a^2 * c^2 + - 86 * a^3 * b^2 + - 88 * b^5 + - 56 * a^2 * b^2 * c + - 13 * a * b^2 * c^2 + - 22 * c^5, - ], - ), - ) - push!( - ideals, - Singular.Ideal( - R, - [ - 30 * a + - 86 * a * b * c + - 74 * b^2 * c + - 9 * c^3 + - 57 * a^4 + - 65 * a^3 * b + - 46 * a * b^3 + - 23 * b^3 * c + - 13 * a * c^3 + - 65 * b * c^3 + - 3 * b^4 * c + - 15 * a^3 * c^2 + - 69 * b^3 * c^2 + - 86 * b * c^4, - 1 + - 57 * a^2 + - 7 * a * b + - 37 * a^3 + - 15 * a^2 * c + - 79 * a * b^3 + - 80 * b * c^3 + - 42 * a^3 * b^2 + - 38 * a^2 * b * c^2 + - 15 * b^2 * c^3 + - 32 * a * c^4, - 77 * b + - 76 * b^2 + - 2 * c^2 + - 15 * a * c^2 + - 9 * a^4 + - 40 * a^3 * b^2 + - 8 * a^2 * b^2 * c + - 16 * a^3 * c^2 + - 76 * a^2 * c^3 + - 24 * a * b * c^3, - ], - ), - ) - for i in ideals - runAll("sparseid(3,0,5,100-(10*2),90)", i, S, StartOrd, TarOrd) - end - ideals = [] - -end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl deleted file mode 100644 index d21c70588..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar4.jl +++ /dev/null @@ -1,247 +0,0 @@ -include("GroebnerWalkFinalBenchmarkProcedures.jl") -include("runbenchmark.jl") -include("GroebnerWalkFinalBenchmark.jl") -include("runbenchmark2.jl") -include("BenchmarkHelper") -include("readWriteHelper.jl") -include("Examples") -using DataFrames -using CSV - -function benchmarkVar4() - cd("/Users/JordiWelp/Results") - prepare() - prepare2() - prepareAlloc() - dim = 4 - ve = [1, 1, 1, 1] - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c", "d"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - ideals = [] - push!( - ideals, - Singular.Ideal( - R,87+55*b+17*a^3+82*a^4+17*b^2*c^2*d+71*a*b^2*d^2, - 26*c*d+14*a^3+89*b^4*c, - 88*a^2*b*c+61*a^2*d^2+48*c^5)) - push!( - ideals, - Singular.Ideal( - R,27*a^2*b^2*d+60*a*b*c*d^2, - 23+31*b*d^2+42*a^2*c*d+32*b*c^2*d+29*a*b^3*c, - d+6*a*d+67*a^3+48*a*b^3+86*a^2*b*d^2)) - push!( - ideals, - Singular.Ideal( - R,85*c*d^2+10*d^3+11*a^3*c+31*a^2*c*d+61*a^2*c*d^2, - 57+86*a^2*d^2+86*b^3*c^2+58*b^2*c^2*d, - 76*d+90*c*d+40*a*c^3*d)) - for i in ideals - runAll("sparseid(3,0,5,100-(1*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,3+35*a*d+78*c*d+47*a*c^2+30*c*d^2+65*a*c^3+55*a*b*c*d+25*a*b^3*c+52*b^2*c^3+52*a*c*d^3, - 71*a^3+65*a^4+9*a^2*b*c+65*b*c^2*d+25*a^4*c+32*a^3*c*d+45*a^2*c*d^2, - 49*d+16*a^2*b^3)) - push!( - ideals, - Singular.Ideal( - R,38*b^4+80*a^2*b^2*c+41*b*c^3*d+7*b^2*d^3, - 4+57*d+44*b*c+50*a^4+24*a*b^3+29*a^3*c+55*b*c^3*d+82*a*c^2*d^2+77*c^3*d^2, - 79*d^2+13*a*c^2+82*c^3+14*a*c*d+37*b^2*d^2+68*b^2*d^3)) - push!( - ideals, - Singular.Ideal( - R,70*b+4*a^2*c+85*c^4+21*a^2*b^2*c+17*a*b^3*c+31*a^2*c*d^2+14*c^3*d^2, - 2*c^2+35*d^2+44*b^3+34*a*b^2*c+87*b^2*c*d+31*a*c^2*d+6*a*c^4, - 16+88*a*c^2+50*c^2*d^2+70*a^3*b*c+62*a^3*c^2)) - for i in ideals - runAll("sparseid(3,0,5,100-(2*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,67*a*c*d+3*b*d^2+85*c*d^2+71*a^2*c^2+45*a*d^3+39*b*d^3+77*b^5+42*a^2*b*c*d+54*b^3*c*d+3*b^2*c*d^2+35*b*c^2*d^2+65*a*c*d^3, - 40+47*b+66*a*b+47*a*b^2*d+78*a*b*c*d+41*c^2*d^2+80*a^4*d+7*c*d^4, - 49*d^2+89*a^3+36*a*b*c^2+24*a^2*c^3+82*a*b^3*d+33*b^3*d^2)) - push!( - ideals, - Singular.Ideal( - R,62*d^2+44*a^3+43*a*b*d^2+13*a*c*d^2+14*b*c*d^2+65*a^3*b*d+74*a^2*c^2*d, - 5+57*b+14*a^3+65*a^2*b+79*a*c^2+65*a^3*d+82*b^2*c*d+44*a^2*b^2*c+55*b^4*c+34*a*b^2*d^2, - 30*b^2+29*b*c^2*d+49*b*c*d^2+22*a^3*b*c+21*a^2*c^3+19*a^2*b^2*d+61*b^2*c*d^2+50*a*b*d^3+9*b*d^4)) - push!( - ideals, - Singular.Ideal( - R,46+79*b^2*c^2+54*a^5+5*a*b^4+34*a*b^2*c^2+19*a^2*b*d^2+11*a*b^2*d^2, - 69*b*c+86*a^3+52*c*d^2+87*b^2*c^2+82*a*c^2*d+51*a^2*b^2*d+72*b^2*c^2*d+42*d^5, - 77*b+77*d^2+50*a^2*c+55*a*c^2+67*b^4+b^2*c^2+17*a*c^3+39*b*c^2*d+70*a^3*b*c+50*b^3*c^2+24*a*b*c^3)) - for i in ideals - runAll("sparseid(3,0,5,100-(3*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,6*c^2+49*b*d+54*a^3+35*a*b^2+6*c*d^3+28*c^5+7*a*c^3*d+3*b*c*d^3, - 80*a^2*b+82*a*b^3+8*b^3*d+6*b^2*d^2+42*b*c*d^2+80*a^5+42*a*b^4+50*a^4*d+69*a*b*c^2*d+87*c^3*d^2+13*a*c*d^3+72*b*d^4, - 27+16*b+81*c*d+53*a^3+41*b^2*c+63*a*b^2*c+21*a^3*d+5*c^3*d+12*a^2*d^2+36*a^3*b^2+85*b^2*c^3+28*a^2*b*c*d+77*b^2*c^2*d)) - push!( - ideals, - Singular.Ideal( - R,33*a+6*c*d+38*a*b^3+82*a^3*c+61*a^2*b*c+48*b*c^3+32*a^4*c+25*a^2*b^2*c+34*a^3*b*d+54*a*b^3*d+90*a^2*b*d^2+74*a*c^2*d^2+3*c*d^4, - 55+80*b^2+74*d^2+77*a*b^2+71*b^2*c+63*c^3+b*c*d+75*b^4+32*a^3*d+46*c^2*d^2+73*a*b^2*c^2+40*c^5+43*a^2*b^2*d+43*b^4*d+75*a^2*d^3, - 51*a^2*d+10*b^3*d+52*c*d^3+61*b^4*c+77*a^2*b*c^2)) - push!( - ideals, - Singular.Ideal( - R,80*c+68*b^2+52*b*c^2+53*b*d^2+14*d^3+63*b*c^3+34*a^2*c*d+42*b^2*c^2*d+14*a*c*d^3, - 11*b^2+75*a*b^2+77*a^2*b^2+88*b^3*c+71*b*c^2*d+74*a*b^2*c*d+51*a*c^3*d+67*b^2*d^3+68*a*d^4+83*b*d^4, - 38+28*b*d+22*b*d^2+27*a*b^3+39*b^2*c^2+26*a*b^2*d+81*c^3*d+16*a^5+81*b^3*c^2+45*a*c^4+27*a^4*d+80*a*b^3*d+11*a*c^2*d^2+21*b*c*d^3)) - for i in ideals - runAll("sparseid(3,0,5,100-(4*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,25*a^2+7*a*b^2+5*a^2*c+25*c^3+83*a*b^2*d+49*a^2*c*d+72*a*b*c*d+32*c*d^3+30*a*c^4+53*b^3*d^2+37*a^2*c*d^2+73*b^2*c*d^2, - 67*b^2+48*a*c*d+55*b*c*d+61*a^2*c*d+24*a^3*b*c+32*a^2*c^3+78*a^4*d+33*a*b*c^2*d+29*b^3*d^2+40*a*b*c*d^2+36*c^3*d^2, - 36+72*a+11*d+77*a*d+85*b^2*d+4*a^3*b+65*a^2*c*d+15*b^2*c*d+70*b*c^2*d+52*c^3*d+57*c*d^3+38*a*b^4+6*a^2*b^2*c+15*a*b*c^2*d+48*c^4*d+83*a*b^2*d^2+78*b^2*c*d^2)) - push!( - ideals, - Singular.Ideal( - R,5*c*d+48*a^3*b+29*a*b^3+30*a^2*c^2+7*a*b*c^2+29*b*c*d^2+80*a*b^4+75*b*c^4+35*b^2*c*d^2+14*a^2*d^3+51*b*d^4+82*c*d^4, - 23+18*b+64*d+70*c*d+67*d^2+12*a^2*b+36*a*c*d+19*b^3*c+50*b*c^2*d+73*a*c*d^2+42*a^4*c+7*a^2*c^3+9*a^2*c^2*d+23*a*b*c^2*d+88*b^2*c^2*d+68*c^4*d, - 22*a^3+40*a^2*b+59*a*b^2+10*a*b*d+90*a*b^2*c+36*a*c^3+33*a*c^2*d+75*a^2*b^3+66*a^3*b*c+60*c^3*d^2+29*a*b*d^3+2*b*d^4)) - push!( - ideals, - Singular.Ideal( - R,44*d+42*b*d+64*d^2+40*a*b*c+27*a^3*b+27*a*c^3+73*a*b^2*d+69*a*c^2*d+55*b*c*d^2+58*a*d^3+74*a^4*b+35*a*b*c^3+3*b^3*c*d+68*a*c^3*d+76*c^4*d+66*c^2*d^3, - 56*a^2*c+83*a*b*c+17*a*c^2+61*c^2*d+40*b^3*c+a*b*d^2+2*b^2*c^3+43*a^4*d+65*b^3*c*d+77*a*b*c^2*d+45*a^3*d^2+79*b^2*c*d^2+12*c*d^4, - 26+24*c+62*a^2+70*a^2*b+4*b^4+32*b*c^3+75*c^2*d^2+29*b^4*d+25*b^3*c*d+79*b*c^3*d+75*b^2*d^3)) - for i in ideals - runAll("sparseid(3,0,5,100-(5*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,17*c^2+24*b^3+71*c*d^2+38*a^3*b+90*a*b^3+90*a^2*b*c+40*a*b^2*c+27*b^2*c*d+70*a*c^2*d+52*a^3*b*d+32*a^3*c*d+12*a*b^2*c*d+78*b*c^3*d+86*c^4*d+7*a*b^2*d^2+50*a*d^4, - 44*a*c^2+2*a*b*d+80*c*d^2+60*d^3+87*a^4+85*a^2*b*c+88*a*c^3+67*b^2*d^2+17*b^5+68*a^2*b*c^2+64*b^2*c^3+86*b^2*d^3+49*c^2*d^3+46*b*d^4, - 25+77*c+77*d+75*a*d+52*c*d+89*d^2+11*b^3+65*a*c*d+64*b^3*c+10*a*b*c^2+22*b^2*d^2+14*a^5+60*a^3*b^2+22*a^2*b*c*d+34*a*b^2*c*d+81*a*b^2*d^2+20*b^3*d^2+7*b*c^2*d^2+84*a*c*d^3)) - push!( - ideals, - Singular.Ideal( - R,41*a^2+12*a*b^2+79*b^3+25*a^2*d+44*c^2*d+39*a^3*b+77*a*c^3+62*b*c^3+72*b*c^2*d+66*b^2*c^3+45*b^3*c*d+3*b*c^3*d+24*c^4*d+64*b^3*d^2+37*b*c^2*d^2+76*c*d^4, - 17*a^2+12*b^2+30*a^2*b+72*b*c*d+81*a*d^2+31*a^4+31*b^4+82*a^3*c+26*a^2*c^2+84*a^3*d+62*a^2*b*d+50*a*b^4+21*b^5+15*a^2*b^2*c+6*a*b^2*c^2+84*a*b*c^3+86*a*b^2*c*d+56*b*c^2*d^2+64*a*b*d^3)) - 88+90*a+88*b+30*c*d+19*b*d^2+86*a^2*b*d+88*b^3*d+53*b^2*c*d+62*a^3*b*c+41*b^3*c^2+28*a*b^2*d^2+48*b^3*d^2+83*a*b*c*d^2+30*c^3*d^2, - push!( - ideals, - Singular.Ideal( - R,23*a*d+45*a*b^2+9*a*d^2+53*d^3+85*b^2*c*d+42*a*c^2*d+25*a^2*d^2+12*a*b*d^2+29*b^2*d^2+45*b*c^4+48*a*b^2*d^2+52*b^3*d^2+36*a^2*d^3+14*b*d^4, - 52*c+6*c^2+24*c*d+42*a^2*b+24*a^4+41*a*c^2*d+16*a^3*b*c+55*a^2*c^3+44*b^2*c^3+66*a^2*b^2*d+11*a^3*c*d+10*a*c^2*d^2+4*a*c*d^3+87*b*c*d^3, - 59+2*d+74*c*d+b^3+83*a*b*c+73*a*b*d+a*c*d+69*a^2*b*c+40*c^4+30*a^3*d+58*a^2*c*d+14*c^3*d+22*a*d^3+35*a^3*b^2+79*b^2*c^3+15*a^3*c*d+68*a*c^3*d+10*c^4*d+31*a^2*c*d^2+44*b^2*c*d^2+17*c^2*d^3)) - for i in ideals - runAll("sparseid(3,0,5,100-(6*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,2*c^2+25*b^2*c+79*b*c^2+60*a^3*b+47*b^2*c*d+28*b*c*d^2+28*c^2*d^2+38*a*b^4+82*a^2*b*c^2+54*a^4*d+73*a*b^2*d^2+77*a*c^2*d^2+51*d^5, - 1+33*d+41*a*b+79*c*d+9*a^3+41*a*b*d+43*b*c*d+51*a^4+59*b^2*c^2+72*a*b*c*d+35*a^2*d^2+70*a*b*d^2+63*b^2*d^2+11*a^2*b^2*d+54*b^4*d+50*b^3*c*d+45*a^2*c^2*d+28*b*c^3*d+14*a^2*b*d^2+15*c^3*d^2+84*a*b*d^3+11*c^2*d^3, - 78*a+65*a*b+78*a*d+29*a*b^2+30*a^2*c+43*b*c^2+71*a*b*d+36*a^2*b*c+85*a^3*d+51*b^3*d+49*a^2*c*d+75*d^4+17*a^4*b+70*a*b^4+4*a^3*b*c+59*b*c^4+32*a^3*c*d+2*c^4*d+61*b^3*d^2+45*a*b*d^3+60*b*c*d^3)) - push!( - ideals, - Singular.Ideal( - R,40*b^2+53*c^2+13*b*c*d+54*a^4+84*a^2*c^2+83*b*c^3+38*a*b*d^2+18*a^2*b^3+76*b^3*d^2+23*b*c^2*d^2, - 10*d+63*b*c+67*b^3+69*a^2*c+84*a*c^2+31*c^3+88*b^2*d+66*b*d^2+31*b^4+42*a^3*d+46*b*c^2*d+14*c^3*d+64*a^5+30*a*b*c^3+56*b^2*c^3+37*a^2*b^2*d+85*a^2*c^2*d+10*a*c^3*d+82*c^4*d+90*a^2*b*d^2+2*a*b*d^3+87*a*c*d^3+76*b*d^4, - 50+64*d+37*a*b+9*b*c+8*a*b^2+19*c^3+68*a^4+58*a^2*c^2+68*a^3*d+34*a*b*c*d+87*b^2*c*d+64*a*c^2*d+22*a*d^3+76*a^3*b*c+82*b^4*c+53*a^2*b*c^2+10*a*c^4+81*b*c^4+57*c^5+49*a^4*d+25*a^2*b*d^2+79*b^2*d^3+47*c^2*d^3)) - push!( - ideals, - Singular.Ideal( - R,59*a+21*a*c^2+65*d^3+42*a*b^3+24*a*b*c^2+71*a*c^3+13*a*b*c*d+86*b^2*d^2+86*b^3*c^2+70*b^2*c^3+12*a*b^3*d+68*a^3*c*d+21*b^3*c*d+27*a^2*b*d^2+77*a*b*d^3+49*c^2*d^3+25*b*d^4+43*c*d^4, - 68+20*a*b+11*a*d+71*b^3+36*a*d^2+49*a^3*b+78*b^4+88*a^3*c+49*a*b^2*c+16*c^2*d^2+8*a^3*c^2+61*a^3*b*d+25*b^2*c^2*d+25*b^3*d^2+21*a^2*c*d^2+36*b^2*c*d^2+78*a*c^2*d^2, - 12*b+75*c^2+68*c*d+46*d^2+68*a^2*b+70*a*b^2+59*b^2*c+33*a*b*d+83*c^2*d+7*a^2*b*c+58*a*b*c*d+70*c^3*d+46*b*c*d^2+12*c*d^3+68*a^3*c^2+49*a^4*d+37*b^2*c^2*d+a^2*c*d^2+10*a^2*d^3+7*a*b*d^3+16*b*c*d^3)) - for i in ideals - runAll("sparseid(3,0,5,100-(7*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,89*c+37*c^3+29*b*c^3+70*a^2*c*d+38*a*c^2*d+63*a^2*d^2+73*b*d^3+40*c*d^3+59*d^4+69*a^2*b^3+86*b^4*d+26*a*c*d^3+14*c*d^4+49*d^5, - 31*d+50*a*c+56*c^2+28*c*d+46*a*b*d+74*a*c*d+12*a*d^2+57*d^3+86*a^2*b*c+6*b^2*d^2+72*a*c*d^2+26*b*d^3+20*a^4*b+83*a^3*b*c+27*b^3*c^2+a*b*c^3+67*b^2*c^3+64*a^4*d+19*a^2*c^2*d+71*a^2*c*d^2+28*a*b*c*d^2+89*b*c^2*d^2+56*c^2*d^3+74*c*d^4, - 33+6*b*c+58*d^2+87*b^2*c+3*a*b*d+11*a*c*d+64*a*d^2+83*d^3+28*a^4+11*a*b^3+21*a*b^2*c+69*b^2*c*d+44*c^2*d^2+33*a*d^3+4*b^4*c+50*a^3*c^2+29*b^3*c^2+60*a^3*b*d+63*a^2*b^2*d+11*a*b^2*c*d+82*a^2*b*d^2+43*b^3*d^2+89*c^3*d^2+16*d^5)) - push!( - ideals, - Singular.Ideal( - R,77+57*d+17*d^2+69*a^2*b+67*a*c^2+43*a^2*d+23*a^2*b^2+45*a^2*c^2+32*c^4+50*a*b^2*d+75*b^2*d^2+88*a^5+22*b^5+66*a^2*b*c^2+68*b*c^4+7*a^3*b*d+64*a^3*d^2+9*b*c^2*d^2, - 74*a^2+16*b*c+45*b^2*d+84*c^2*d+61*d^3+69*a^2*c^2+14*a*c^3+89*b*c^3+74*a*b*c*d+83*a*c^2*d+80*a*b*d^2+38*a^4*b+51*b^3*c^2+33*b^2*c^3+54*c^5+86*a^3*b*d+69*b^2*c^2*d+5*c^4*d+89*a^2*b*d^2+50*b^2*c*d^2+42*b*c^2*d^2+35*c^3*d^2+16*b^2*d^3, - 20*b+46*a*b+7*c^2+33*a^2*b+56*a^2*c+34*b^2*c+12*b*d^2+16*a*b^2*c+35*a^2*c^2+85*b*c^3+16*a^2*b*d+17*b*c*d^2+74*b*d^3+4*a*b^3*c+47*a*b*c^3+34*c^5+84*a^3*b*d+64*a*b^2*c*d+a^2*b*d^2+62*c^3*d^2+18*b*d^4)) - push!( - ideals, - Singular.Ideal( - R,54+47*b+8*a*c+30*c^2+6*a*b^2+16*b*d^2+56*c*d^2+77*a^3*c+2*a*b^2*c+71*a^2*c^2+83*a*b*c^2+13*b*c^3+63*b*c^2*d+23*b*c*d^2+68*a*d^3+65*b*d^3+82*a^5+7*a^3*b*c+58*b^4*c+25*a^2*b*c^2+81*b^2*c*d^2+65*b*c^2*d^2+12*c^3*d^2+76*b*c*d^3, - 80*a*c^2+87*a*b*d+72*c*d^2+48*b^4+72*b^3*c+75*a*b*c^2+89*a^5+25*b^5+31*a^4*c+48*a^3*b*c+55*a^2*b^2*c+56*a*b^3*c+84*a^2*b*c^2+54*a^3*d^2+46*b^2*c*d^2+19*b*c*d^3, - 62*a+66*a*b+53*a*c+2*c^2+64*a*b^2+19*b^2*c+48*c^3+42*c^2*d+77*b^2*c^2+39*a^2*c*d+50*a^2*d^2+83*b*c*d^2+14*a*d^3+26*a^5+90*a^4*b+28*a^4*c+42*b^2*c^3+28*b*c^4+25*c^5+64*a*b*c^2*d+5*a^2*c*d^2+62*b*c^2*d^2)) - for i in ideals - runAll("sparseid(3,0,5,100-(8*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,49*d+54*a^2+68*c^2+19*a^2*c+23*a*b*c+31*a*c^2+81*a*c*d+70*b*d^2+28*c*d^2+44*a^3*c+78*b^2*c^2+87*a*c^3+46*c^4+20*b*c^2*d+34*a*b*d^2+32*c^2*d^2+32*a^5+52*c^5+27*a^4*d+48*b^4*d+36*b^3*c*d+16*c^4*d+47*c*d^4, - 11*a+79*c*d+14*a^2*b+27*a*b*c+57*a*d^2+90*a^3*b+43*b^3*c+71*a^3*d+70*a^2*c*d+88*b^2*c*d+2*a*b^4+75*a^3*c^2+14*a^2*b*c^2+57*b^3*c^2+79*a*c^4+28*b*c^4+79*a^3*b*d+83*a*b^3*d+44*a*b*c^2*d+50*b^2*c^2*d+10*c^2*d^3+24*b*d^4, - 29+52*b+5*a^2+86*a*b+83*b*d+83*a*b^2+75*a*b*d+80*a^3*b+6*a^2*b^2+70*a^3*c+72*b*c^3+60*a^2*c*d+16*b*d^3+63*d^4+56*a^4*b+74*a^4*c+84*a*b^3*c+80*b^4*c+81*a^3*c^2+87*a^2*b*c^2+87*a*b^3*d+49*b^3*c*d+81*a*c^3*d+59*b*c^3*d+71*a*d^4+78*c*d^4)) - push!( - ideals, - Singular.Ideal( - R,83*a+23*b*c+54*c*d+4*d^2+69*a^2*b+31*a*b*c+6*a^2*d+47*a*b*d+76*b^2*d+5*c^2*d+56*a*b^3+18*b^2*c^2+a^2*b*d+30*a*b*d^2+34*a*c*d^2+54*d^4+63*a^2*b^3+40*a^2*b^2*c+33*a^2*b*c^2+78*c^5+52*a^4*d+90*a^3*b*d+63*a^2*b*c*d+50*a*b*c^2*d+81*a*c^3*d+60*b^2*c*d^2+45*a*b*d^3+82*b^2*d^3, - 88*a+84*a^2+61*a^2*d+36*b*c*d+37*a^2*b^2+32*a*b^2*c+19*c^4+47*a^2*b*d+66*a^2*c*d+89*b^2*c*d+21*c^2*d^2+13*a*d^3+65*a^5+87*a^3*b^2+36*a^2*b^3+85*a*b^4+85*a*b^2*c^2+33*b^3*c^2+23*b*c^4+46*a^3*b*d+86*a^3*c*d+49*a*c^3*d+25*c^4*d+15*a^2*b*d^2+56*a*b*c*d^2+70*a*d^4, - 90+52*c+12*a*c+10*b*c+75*b^3+67*b*d^2+32*c*d^2+21*b^4+44*a*b^2*d+53*b^2*c*d+54*a*b*d^2+13*a*d^3+40*a^3*b^2+89*a^2*b*c^2+62*a^2*c^3+5*a^3*c*d+28*a*c^3*d)) - push!( - ideals, - Singular.Ideal( - R,63*a*c+b^3+27*a*b*c+6*b*c^2+76*c^3+89*b^4+36*a^2*b*d+63*b*d^3+70*a^5+80*b^5+45*b^4*c+a^2*b*c^2+14*b^3*c^2+5*a*b*c^3+3*c^5+54*a*b^2*c*d+17*c^4*d+60*c^3*d^2+69*a^2*d^3+87*c^2*d^3, - 43*a+23*d+23*c^2+43*d^2+71*a^2*b+35*b^3+75*a*c^2+12*a^2*b*c+12*a*b^2*c+2*b^3*c+63*b*c^3+11*a*b^2*d+90*b^3*d+28*a*b*c*d+20*b*c^2*d+34*c*d^3+90*a^5+26*a*b^4+66*b^5+2*a^4*c+33*a^2*b^2*c+27*a*c^4+42*a^2*b*c*d+b^3*c*d+65*a*b*c^2*d+86*a*c^3*d+87*b^2*c*d^2+60*c*d^4, - 72+55*c+76*b^2+30*a*c+85*b*d+14*a*b^2+34*a^2*c+12*b^2*c+57*a*c*d+25*a^3*b+65*a^2*b^2+29*a^2*b*c+50*a*b^2*c+32*c^4+46*a^2*c*d+53*a*b*d^2+72*a*b^3*c+43*a^3*d^2+78*a^2*c*d^2+78*a^2*d^3+81*b^2*d^3+52*b*d^4+73*c*d^4)) - for i in ideals - runAll("sparseid(3,0,5,100-(9*2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,52*c+52*d+52*a^2+89*b*c+11*a^2*c+81*a^2*d+68*a*c*d+51*a^4+19*a^2*b^2+13*b^4+78*a^3*c+11*b^2*c^2+87*b*c^3+47*a*b^2*d+81*a*d^3+21*a^3*b^2+88*b^4*c+44*a^3*c^2+75*a^3*c*d+32*a^2*b*c*d+15*b*c^3*d+79*a^2*b*d^2+77*a*c^2*d^2+24*c^3*d^2+51*b*d^4, - 15*b+17*b*c+73*a^3+19*a*b*c+30*b^2*c+16*b*c^2+53*a*b*d+45*d^3+40*a^3*c+25*a*b^2*c+35*a*c*d^2+55*c^2*d^2+40*a^3*b*c+34*a*b^3*c+66*a^2*b*c^2+30*a*b*c^3+32*c^5+30*a*b^3*d+82*b^3*c*d+76*b^2*c^2*d+88*c^4*d+72*a^2*b*d^2+76*c^3*d^2+49*b*d^4, - 50+18*a*c+87*b*c+76*c*d+59*a^3+43*b^2*d+7*b*c*d+61*a^2*b^2+39*a*b^2*c+54*a*b*c^2+30*a*c^3+9*a^2*b*d+40*b^3*d+14*a^2*c*d+88*b*d^3+13*c*d^3+48*a^2*b^3+40*a^4*c+76*b^4*c+81*a*c^4+13*a^4*d+45*b^4*d+7*a^2*b*c*d+17*b*c^2*d^2+11*a*b*d^3+59*b*c*d^3+38*b*d^4+89*d^5)) - push!( - ideals, - Singular.Ideal( - R,29*b+68*a*d+6*b^3+27*a^2*c+28*b^2*c+a*d^2+27*d^3+23*a^3*b+37*b^3*c+28*a^3*d+43*b^3*d+7*a*b*c*d+59*c^3*d+44*a*b*d^2+67*a^2*c^3+62*a^2*b*c*d+75*a*b^2*c*d+52*a*c^3*d+60*a^2*b*d^2+55*b^3*d^2+72*a*b*c*d^2+69*a^2*d^3+4*c^2*d^3, - 11*c+12*c^2+38*a*b*c+68*a^2*d+3*b^2*d+54*b*d^2+80*a^2*b^2+69*a*b^3+a^2*b*d+35*b^3*d+87*a*c^2*d+80*a^2*d^2+6*b*d^3+46*a^2*b^3+23*a^4*c+84*b^3*c^2+50*b^2*c^3+33*a*c^4+5*a^2*b^2*d+69*a*b^2*c*d+89*a^3*d^2+28*a^2*b*d^2+34*b^3*d^2+22*a^2*c*d^2+52*a*b*c*d^2, - 7+35*b+69*b^2+4*a*d+74*b*d+21*d^2+39*a^2*d+9*a*b*d+53*b*d^2+66*a^3*b+86*a^2*b^2+49*a*b^3+58*a^2*b*d+51*b^3*d+87*a*c^2*d+22*a^2*d^2+27*a*b^3*c+18*a^2*b*c^2+45*a^2*c^3+12*a*b*c^3+4*a^3*b*d+78*a^2*b^2*d+19*b^3*c*d+23*a^2*c^2*d+56*c^4*d+26*b^2*c*d^2+13*a^2*d^3+87*a*b*d^3+65*c*d^4)) - push!( - ideals, - Singular.Ideal( - R,85*b^2+5*b*d+27*d^2+56*c*d^2+81*a^2*b^2+6*a*b^3+54*a^2*c^2+26*a*b*c^2+27*b^2*c^2+37*b*c^3+22*a*b^2*d+69*b*c^2*d+78*b^4*c+82*c^5+39*a^2*b^2*d+73*a*b^2*c*d+50*b^3*c*d+83*b^2*c^2*d+14*a*c^3*d+34*c^4*d+9*a^3*d^2+68*a*b^2*d^2+a*b*c*d^2+74*a^2*d^3+35*a*b*d^3+8*c*d^4, - 87*d+10*b^2+18*a*b*c+71*c^3+63*a^2*d+30*a*b*d+7*b^2*d+9*c^2*d+89*b*d^2+27*c*d^2+10*a*b^2*d+41*a^2*c*d+85*a*c^2*d+51*a^2*d^2+23*a*b*d^2+88*b^2*d^2+26*d^4+6*a^2*b^2*c+90*a*b^3*c+81*a*b^2*c^2+43*a^4*d+40*a^3*b*d+69*b^4*d+22*a*c^3*d+78*a^2*b*d^2+70*a*b^2*d^2+68*b^2*d^3+61*b*d^4+43*d^5, - 2+39*b+39*c+29*a*b+82*a*d+38*a^2*c+67*a^2*d+51*a*d^2+73*b^4+9*a^3*c+70*a*b*c*d+63*b^2*c*d+73*a*d^3+3*b*d^3+46*a^5+42*a*b^4+7*a^2*c^2*d+88*a^3*d^2+62*a^2*b*d^2+38*b^3*d^2+60*a^2*d^3+43*a*d^4)) - for i in ideals - runAll("sparseid(3,0,5,100-(10*2),90)", i, S, StartOrd, TarOrd) - end - -end diff --git a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl b/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl deleted file mode 100644 index d8ce973e7..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/BspVar5.jl +++ /dev/null @@ -1,250 +0,0 @@ -include("GroebnerWalkFinalBenchmarkProcedures.jl") -include("runbenchmark.jl") -include("GroebnerWalkFinalBenchmark.jl") -include("runbenchmark2.jl") -include("BenchmarkHelper") -include("readWriteHelper.jl") -include("Examples") - -using DataFrames -using CSV - -function benchmarkVar5() - cd("/Users/JordiWelp/Results") - prepare() - prepare2() - prepareAlloc() - dim = 5 - ve = [1, 1, 1, 1, 1] - StartOrd = ordering_as_matrix(ve, :lex) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d, e) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c", "d", "e"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - ideals = [] - - push!( - ideals, - Singular.Ideal( - R,[5*b*e^4, -14+16*b+37*a*b*d+88*a*e^2+20*c^2*e^2+83*a^2*b*c*e+19*b^2*d^2*e+41*b*e^4, -50*b^2+41*b*c^3+20*a*c*e^2])) - push!( - ideals, - Singular.Ideal( - R,[49*c^3*d+46*a^3*b*d+78*d^5, -12+73*b*d^2+82*a*d*e+90*b*c*e^2+67*b^3*c^2+73*b^2*c^2*e, -20*a+87*b*c+55*a^3*c])) - push!( - ideals, - Singular.Ideal( - R,[23*d^2*e, -68+5*b*c+46*b*c*d+61*b^4+69*b^3*e+23*b^2*c^3+9*d^4*e, -64*a+74*a*c*d^2+4*a*c^3*d+4*c*d*e^3])) - for i in ideals - runAll("sparseid(3,0,5,100-(1),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[45*c*d^2+78*a*b*c*d+16*c*d^2*e+24*b^5+55*a^3*b*d+57*b^2*d^2*e, -89*b+80*a*d+59*b*d^2+31*e^3+40*c^3*d+29*a*b*d*e^2, -35+47*a*b*d^2+55*c*d^2*e+13*b^3*c^2+27*a*b*c*d^2+84*b^2*c*e^2+43*b*c*d*e^2])) -push!( - ideals, - Singular.Ideal( - R,[a^2*c+87*a^2*c^2+43*b^3*e+27*a*d^2*e+15*a^3*b*d+35*b*c*d^3+60*a*e^4, -67+40*b+11*a*d^2+59*a*b*e+50*b*e^4, -44*a*e+76*a^2*b^2+53*a*b^2*e+9*a*d^4+29*a*b*c*d*e+87*a*b*c*e^2+35*a*d*e^3])) - push!( - ideals, - Singular.Ideal( - R,[27+61*c^3*e+23*b*c*d*e+83*a*d^2*e+84*b^4*c+71*b*c^2*d^2+64*b^3*c*e+81*a*b*c^2*e, -42*b*e+82*a*b*d+47*a*b^2*d+39*b^2*e^2, -37*d+31*a^2*c+5*a*e^2+81*a^3*b*e+84*a^2*c*e^2+50*a*b*d*e^2+23*e^5])) - - for i in ideals - runAll("sparseid(3,0,5,100-(2),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[55+90*c*d+64*d^2*e+16*d*e^2+77*a^2*b*c+90*b^3*d+73*a*b^2*e+c^5+69*b^2*c*d^2+42*a*c^2*d^2, -86*b^2+88*c*e^2+45*a^3*b+69*c^3*d+35*a*c^2*e+4*b^3*d^2+52*c*d^4+50*a^2*c^2*e+79*b^2*c*e^2+74*b*c^2*e^2, -78*d+61*a*c*d+23*b*d^3+7*a^3*c^2+70*b^2*c*e^2+77*a^2*d*e^2+78*c*d^2*e^2])) - push!( - ideals, - Singular.Ideal( - R,[44*c^2*d+15*b*c^3+80*a*d*e^2+87*a*c^3*d+14*a^4*e+51*a^3*c*e, -20*a*c*d+13*a^3*b+86*b*c^2*d+27*d^3*e+42*a*b*c^2*d+35*a*b^2*d*e+61*a*b*d*e^2+72*d^3*e^2+44*a*d*e^3+59*d*e^4, -84+9*d+50*b^2+2*b*d+44*b*c*d+77*e^3+46*d^3*e+a^2*e^2+87*b^3*c*d+57*a*b*c*e^2+78*a^2*e^3])) - push!( - ideals, - Singular.Ideal( - R,[83+19*d+7*a^2*c+26*b*d^2+61*d^3+2*a*d*e+83*a^2*c^2+49*b*d^3+3*a*c*d*e+33*a*b^2*d^2+55*a*b*d^2*e+35*a^2*c*e^2+45*a*d^2*e^2, -36*a^2*b*d+72*b*c^2*d+69*a*b^3*c+69*c^3*d^2+33*a^2*b^2*e+7*b^2*c^2*e+85*b*e^4, -37*b*e+80*e^2+66*a^2*c*e+46*b*d*e^2+79*c^3*d*e+31*b^2*d^2*e+82*b^2*e^3])) - for i in ideals - runAll("sparseid(3,0,5,100-(3),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[69*b*d+51*a*b*c+46*a*c*d^2+28*b*c*d^2+34*b^3*e+73*b*c^2*e+74*d*e^3+61*e^4+79*a*b^2*c^2+3*b*c^2*d*e+16*a*c*d*e^2+52*b^2*e^3, -79+81*a+7*a*c^2+17*a^2*d+78*b^2*d+41*c*d^2+57*c^4+90*a^3*b^2+7*b*c*d^3+38*b^2*c^2*e+44*c^4*e, -53*d^2+81*b*c*d^2+16*a^2*c*e+48*a^4*c+55*a^2*b^2*c+18*a*b^2*c*d+9*d^5+87*b*c^2*d*e+62*a*d^3*e+7*a^2*d*e^2+87*a*b*e^3])) - push!( - ideals, - Singular.Ideal( - R,[90*c+56*a*e+81*c^2*e+36*b*d*e+55*a^2*b*d+60*a*b*e^2+37*a^2*b*c^2+65*b^4*d+36*a*b*c*e^2+46*d*e^4, -72+25*a*d+72*a*b^2*c+30*a^2*c^2+11*a^3*d+68*c^2*e^2+4*a*b^2*c*d+86*a^3*c*e+40*b^3*d*e+19*a*c*d^2*e+74*a*b*c*e^2, -87*a^2*b+27*b^2*c+41*d^3+86*b^4+3*a*c^2*e+75*a*d^2*e+22*a^4*c+11*a^3*b*c+89*a^2*c*d^2+18*b*c^2*d^2+61*a*c*d^3+4*b^3*d*e+38*b^2*d*e^2])) - push!( - ideals, - Singular.Ideal( - R,[36+11*a*b*d+6*b^2*e+74*a*b^2*c+85*a^3*e+24*a^2*e^2+40*c*d*e^2+42*a^4*c+5*a*b^2*c^2+67*a^3*c*d+33*a^2*c*d^2, -11*b*d+34*a*e+34*c*d^2+33*a*c*e+86*b*c*d*e+73*a^3*c^2+45*a*c*d^3+55*b^2*c^2*e+11*d^4*e+9*a^2*c*e^2, -56*c+30*b*c*e+48*a^2*c^2+82*c^3*d+75*b^2*d^2+23*c*e^3+51*a^2*b^3+71*a^4*d+14*a^2*c*d^2+29*c^2*d^3+54*a^3*b*e+36*a^3*d*e+4*a^2*d^2*e])) - for i in ideals - runAll("sparseid(3,0,5,100-(4),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[46*d+22*a*b*c+71*a^2*e+18*a^4+69*b^3*d+47*a^2*c^3+37*c^5+88*a^3*d^2+13*a^2*c^2*e+88*a*c^2*d*e+19*b^2*c*e^2+48*a*b*d*e^2, -9+30*b*d+38*a^2*e+87*b^2*c*d+25*a*d^3+82*d^4+40*a^2*d^3+74*b*c^2*e^2+70*a*c*d*e^2+45*a*b*e^3, -74*a*c+46*e^2+19*a^2*b+12*b^3+64*a*c*d+76*b*c^3+90*b^2*d^2+40*c*d^3+38*b^3*e+35*b*c*e^2+5*a*e^3+79*b^4*c+44*a*b^3*e+69*a*c^3*e+39*a*b*d^2*e+35*b*c*d*e^2+9*b^2*e^3+71*b*d*e^3+54*e^5])) - push!( - ideals, - Singular.Ideal( - R,[84*e+34*a*b*c*d+69*b*c*d^2+70*a^2*e^2+9*a^5+47*a^2*b*c*d+63*a^2*d*e^2+45*b*c*d*e^2, -83+29*a*b+46*b^3+18*c*d*e+82*d^2*e+a^2*b^2+19*b^4+26*a*d^2*e+31*a*e^3+85*d*e^3+78*a^4*c+89*a*b^3*e+76*a*b*d*e^2+41*a*c*d*e^2+16*b*c*d*e^2+90*a*d^2*e^2+90*c*d^2*e^2+37*c^2*e^3+33*c*e^4, -85*a*c+83*c*e+17*a^3+82*a*b*d+65*c*e^2+82*a^3*b+86*a*b*c^2+77*b^2*d^2+19*a*b^4+27*b*c^4+47*a*b^2*c*d+86*b*c^2*d^2+25*b^3*c*e+53*a*c*e^3])) - push!( - ideals, - Singular.Ideal( - R,[13*b+44*a^2+39*a^2*b^2+12*a^2*b*e+56*d*e^3+41*e^4+3*a*b*c^3+85*b^4*d+42*a^2*d*e^2, -21*a*b+47*b*c^2+31*b*d^2+39*c*d^2+86*e^3+53*a*c^2*d+74*a*d^3+15*a*d*e^2+51*a^2*b^3+60*a^4*c+22*a*b*c^3+14*a*b*c*d^2+75*b*c*d^3+61*a*b^2*c*e+7*b^3*c*e+24*a*c*d^2*e+87*b*c*d*e^2+78*c^2*d*e^2+82*c*e^4, -13+68*d*e+26*a^2*d+23*b^2*d+12*a^3*d+40*a*b^2*e+5*b*c^2*e+57*b*e^3+60*a^2*b^2*d+b^3*d^2+31*a*c^3*e+61*b^2*d*e^2+4*a*b*e^3])) - for i in ideals - runAll("sparseid(3,0,5,100-(5),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[70*b^2*d+45*a*b^2*c+90*b^3*c+49*a^2*c^2+22*c*d^3+81*b*d^2*e+62*b^5+68*a^3*b*c+86*a^2*b^2*c+70*a*b^3*c+15*a*c^4+21*a*b^3*d+20*a*b^2*c*d+44*b*c^3*d+33*a*b*d^3+17*a^2*b*c*e+53*d^4*e+90*c^2*e^3, -65*b+16*c*d+31*d*e+68*e^2+19*a^2*b+47*c^4+18*a*b*c*d+64*a^2*c*e+67*a*d^2*e+63*a^2*e^2+79*a^4*c+11*a^2*b^2*e+31*c^2*d^2*e+9*c*e^4, -31+26*a*b^2+86*a^2*d+71*a*b*e+26*a*c*e+63*b*e^2+87*a*c*d^2+59*b*c*d^2+23*a*e^3+18*a*b^2*c*d+88*b*c^2*d^2+33*c^2*d^3+28*a^4*e+5*b*c^2*e^2+17*b*d^2*e^2+86*c*e^4])) - push!( - ideals, - Singular.Ideal( - R,[90*a+56*a*c+3*a^2*c+53*b*d^2+90*b^4+60*a*b*c^2+38*c*d^3+66*a^2*d*e+4*b^2*d*e+11*a*e^3+34*b^3*c^2+16*b^3*c*d+59*a*b*c^2*d+12*a*b^2*d^2+23*b*d^4+29*a^3*d*e+90*c^2*d^2*e, -48+57*a*b+25*b^3+17*a^2*d+77*a*d^2+41*a*b*c*d+45*b*d^3+64*d^3*e+4*a*d*e^2+6*a*b^3*c+51*a*b^2*c^2+69*b^2*c^2*d+54*a*c^2*d^2+26*c^3*d^2+51*c*d^4+65*b*d^3*e+46*c*d^3*e+55*b^3*e^2+19*b*c^2*e^2+47*d*e^4, -30*b*d+40*a^2*b+69*c*d*e+15*a*b*c^2+23*c^3*d+85*d*e^3+64*a^3*c^2+75*b^3*c^2+39*c^5+49*a*c^3*d+49*c*d^4])) - push!( - ideals, - Singular.Ideal( - R,[63*b*e+76*e^2+60*a*c*d+76*e^3+22*a^3*c+72*a*c*e^2+83*c^2*e^2+33*a^2*b^2*c+45*a^2*b*c*d+90*b*c^3*e+3*a^3*d*e+15*c^3*d*e+75*a*c*e^3+28*b*c*e^3+77*c^2*e^3, -35+83*d*e+65*b*c^2+29*c*d^2+33*d^2*e+20*a^2*c^2+67*a^3*d+20*a^2*b*d+4*d^4+54*a*c*d*e+50*b*c*d*e+77*a^4*c+22*b^4*c+62*a*b*c^3+11*a^2*b^2*d+19*a^2*b*c*d+19*c^4*d+24*a*b*c*d^2+32*a*b*d^3+45*c*d^3*e+29*b^2*e^3+23*b*d*e^3, -45*a+74*b^2*c+17*d*e^2+26*a*b^2*d+22*c^3*d+2*c*e^3+17*d*e^3+46*a*b^3*c+73*b^3*c*d+3*a^2*b^2*e+4*c^4*e])) - for i in ideals - runAll("sparseid(3,0,5,100-(6),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[4+25*d+56*b^2+48*b*d+22*a*b^2+88*b^2*d+37*a*b*e+80*c^4+10*b*c*d^2+60*c*d^2*e+39*c^2*e^2+60*a*b^3*c+53*a*c^4+29*c^5+32*a*b*c^2*d+8*a*c*d^3+21*a^2*b^2*e+14*a*b^3*e+68*c*e^4, -5*b*c+84*d^2+55*a*b^2+31*b^2*c+7*b^3*d+14*a^2*d^2+81*b^3*e+67*b*d^2*e+64*a*c*e^2+24*a^2*b^2*c+83*b^3*c^2+40*a^4*d+80*b^4*d+23*b*c^3*d+76*a^3*d^2+50*b*d^4+3*a^4*e+62*c^3*e^2+53*b^2*d*e^2+60*c^2*d*e^2+35*d^3*e^2+77*d*e^4, -86*b+81*c^2*d+72*b*d^2+63*d^3+10*a*b^3+14*b^2*c^2+64*b^3*d+47*a^3*e+61*a^2*c*e+25*c*d*e^2+48*c^4*d+88*a^2*c*d^2+58*a*c^2*d^2+20*b*c*d^3+82*b^3*c*e+85*b*d*e^3])) - push!( - ideals, - Singular.Ideal( - R,[7*c*d+81*a^3+48*a*c*e+32*a*b^2*e+75*a^2*c*e+59*a*c^2*e+41*a*b*d*e+57*d^2*e^2+8*b*e^3+33*c^4*d+45*a^2*b*d^2+40*b^4*e+39*a*d*e^3, -63+80*a+28*b+24*c*d+24*a^3*c+56*a*c^3+23*c^3*d+74*a^2*d^2+62*c*d^2*e+78*a^2*b^2*d+18*a^2*c*d^2+2*c*d^4+42*a^2*d^2*e+24*c*d^3*e+18*b^3*e^2+27*a*c^2*e^2+34*c^3*e^2+57*a^2*d*e^2+90*a*c*d*e^2+42*a*d*e^3+13*c*d*e^3, -75*a^2+60*b^2+68*c*d^2+88*d^3+86*a^2*e+4*a*b*e+65*c*d*e+73*e^3+71*b^3*d+65*b*c*d^2+85*c^3*e+21*c*d*e^2+29*a^2*b^3+20*a^2*b^2*c+90*a^2*b^2*d+5*a*b*d^3+26*a^2*b*c*e+87*a^3*d*e+25*a*b^2*d*e+90*a^2*c*e^2+34*b^2*e^3+55*c*d*e^3+83*a*e^4])) - push!( - ideals, - Singular.Ideal( - R,[25*a^2+13*c*d+33*d^3+28*a^2*e+22*a*b*e+29*a*b^3+62*a^2*c^2+37*a^3*d+5*b^2*c*d+64*b^2*c*e+59*a^2*d*e+54*a*d^2*e+62*d^3*e+8*a*b^3*c+43*a^2*c^3+64*a*b^2*c*e+28*a^2*c^2*e+39*c*d^2*e^2+26*d^3*e^2, -14*a*c+4*a*d+47*a*b*c+18*c^2*d+28*c*d^2+28*a*b^2*d+20*a^2*d^2+53*a*d*e^2+7*a^2*b^2*e+21*a*c^3*e+58*b*c*d^2*e+58*c^2*d^2*e+13*a^2*c*e^2+47*b*c*d*e^2+61*b*d*e^3, -46+70*b+76*c+3*a*c*d+50*c*d^2+2*a^2*b^2+34*b^3*d+34*b*c*d*e+2*d^2*e^2+21*b^4*c+44*a^3*c*d+54*a*b^2*c*d+39*b^3*c*d+27*a*b*c^2*d+6*a*c^3*d+83*c*d^4+66*d^5+55*b^4*e+66*b^2*c^2*e+27*a*b*c*d*e+43*c^2*d^2*e+45*a*b^2*e^2+52*b^2*d*e^2])) - for i in ideals - runAll("sparseid(3,0,5,100-(7),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[22+50*b*c+74*a*d+7*d^2+33*b*e^2+37*d*e^2+73*b^2*c^2+33*b^2*d^2+47*c*e^3+59*a^3*b^2+30*a*c*d^3+62*c^2*d^3+68*a*d^4+35*a*b^2*e^2+7*b*c*e^3+89*a*e^4, -31*b*d+42*a*b*c+50*a*c^2+89*b*c*d+68*b^2*c^2+27*a*b*c*d+79*b*c^2*d+44*b*c*e^2+80*b*d*e^2+71*a*e^3+14*b^5+9*a^2*c^3+5*a*c^4+2*a^3*b*d+3*a^3*d^2+26*c^3*d^2+40*b*d^4+53*a^2*c^2*e+24*a^2*d^2*e+22*d^4*e+79*a*b*c*e^2+33*b*c^2*e^2+76*c^2*d*e^2, -33*b+50*e+61*a*b*c+74*c^3+52*a^2*e+8*a*b*e+75*a*d^3+19*a*b*d*e+7*a*d^2*e+36*d^3*e+55*a^2*e^2+57*a*c*e^2+83*c*d*e^2+16*b*e^3+13*a^3*b^2+33*b*c^4+4*c^5+51*a^2*b*d^2+82*b^2*c*d^2+62*a*b^2*c*e+47*c^3*d*e+90*a*b*d^2*e+55*a^2*d*e^2+14*a*b*e^3+71*d*e^4])) - push!( - ideals, - Singular.Ideal( - R,[85*b+55*c+18*b*c+66*b*d+70*a^3+7*a*b*c+79*d^2*e+33*a^2*b^2+31*a*b^3+55*a*b^2*c+36*d^4+80*a^3*e+29*b^2*c*e+74*d^3*e+12*c*e^3+78*a^2*b^2*c+25*a*b^2*c^2+53*c^3*d*e+15*a*c*d^2*e+3*b^3*e^2+69*a*c^2*e^2+67*c*e^4, -73+64*a*b^2+75*c^2*d+81*b^4+70*a^2*c^2+58*a^3*c^2+71*a*b^3*d+77*a^4*e+83*a^3*c*e+83*a*b^2*c*e+50*b*c*d^2*e+23*a^2*c*e^2+45*a*b*d*e^2+33*a*d*e^3, -11*a*b+24*a*e+a*c*d+29*b*d^2+70*b^2*e+33*c^2*e+26*b^3*c+54*b^2*c^2+73*a*b*c*d+59*b*c^2*d+11*d^4+39*d^2*e^2+42*c*e^3+15*a^2*b^3+46*a^4*c+7*a^3*b*c+51*b^3*c^2+60*a^4*d+64*a^2*c^2*d+64*a*b*c*d^2+85*b^2*d^3+30*d^5+23*a^4*e+83*b^3*c*e+41*a*b^2*d*e+86*b*c*d^2*e+2*a*b^2*e^2+23*b*c*e^3])) - push!( - ideals, - Singular.Ideal( - R,[3*a+65*a*d+7*a*c^2+44*a^2*e+74*c*d*e+32*e^3+33*c^4+89*b*c^2*d+49*b^2*d^2+37*c^2*d^2+46*a^2*e^2+59*c^2*e^2+22*b^3*c^2+72*a*b*c^3+5*a*b^3*d+61*b^4*d+82*a*b^2*c*d+33*d^5+49*b^2*c^2*e+71*c^4*e+11*a^3*d*e+60*b*c^2*d*e+78*a^2*d^2*e+42*b*c^2*e^2+24*b*d*e^3, -19*a*e+60*c^3+10*c^2*d+30*b*c*e+11*d^2*e+3*b*e^2+57*a^3*c+64*a*b*d^2+88*c*d^3+80*b*c^2*e+86*b*c*d*e+53*c*d^2*e+80*a*b*e^2+30*b*e^3+74*a^3*b^2+86*a^2*b^3+71*a^2*c^2*d+8*a*b*c^2*d+46*a*b*c*d^2+57*a^2*d^3+37*b*d^4+9*b*d^2*e^2, -44+3*a+53*b*d+5*b*e+57*a^3*d+a*b^2*d+46*a*c*d^2+65*a^3*b*c+12*b^2*c^3+64*b^2*c^2*d+82*c^4*d+53*a^2*c*d*e+30*b^2*d^2*e+65*a*d^3*e+40*b*c^2*e^2+6*a*c*d*e^2+53*e^5])) - for i in ideals - runAll("sparseid(3,0,5,100-(8),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[80*b*d+35*c^2*d+39*b*c*e+11*c^2*e+49*a*d*e+60*a^2*b^2+67*a*b^2*c+66*a*c^2*d+11*c^3*d+4*c^2*d^2+43*a^3*e+52*b^2*c*e+55*c^2*d*e+48*b*d^2*e+43*c*e^3+61*b^3*c^2+64*a*c^3*d+24*a*b*c*d^2+10*a*c^2*d^2+61*b*d^4+5*c*d^4+7*a*b*d^2*e+60*a^2*b*e^2+90*b^3*e^2+18*c^2*d*e^2+23*a*d^2*e^2+38*b*d*e^3, -a+27*a*d+75*d^2+88*b*c^2+16*a^2*d+34*b*d^2+53*a*e^2+37*a^2*b^2+39*a*b*c^2+89*a^2*b*d+14*a^2*d^2+27*b^3*e+40*a*b^3*c+33*a*b^3*d+81*b^4*d+89*a*c^3*d+27*a^4*e+72*b^2*c^2*e+65*b^2*c*d*e+38*b^2*d*e^2+46*c*d^2*e^2+83*a*c*e^3+36*d*e^4, -45+72*d+50*a^2+3*c*e+15*a^3+10*b*e^2+35*a^3*b+5*a*b^2*d+59*a*b*c*e+6*a^2*e^2+83*a*b^3*c+18*b^4*d+9*a^3*c*d+63*b^3*d^2+51*a^2*c*d^2+4*b^2*c*d^2+11*c^3*d^2+18*a*b^3*e+89*a^2*c^2*e+13*a^2*c*d*e+40*b*d^3*e+87*c^2*e^3])) - push!( - ideals, - Singular.Ideal( - R,[16*a*c+31*b*d^2+24*a^2*e+70*a*d*e+15*d^2*e+71*d^4+b^2*c*e+58*a*c*e^2+33*b^4*c+74*a^3*c^2+86*a^2*b^2*d+7*c^3*d^2+53*b^2*d^3+86*a^4*e+48*a^2*b*c*e+64*a*b*c^2*e+88*b^2*c*d*e+42*a*c*d^2*e+a^2*b*e^2+4*a^2*d*e^2+6*c*d^2*e^2+60*b*d*e^3+7*e^5, -28*a+6*c*d+54*a^2*c+14*b^2*c+10*a^2*b^2+23*b^2*c^2+48*b^3*d+13*b*c^2*d+43*a*b*d^2+41*b^2*c*e+41*b*c^2*e+47*b^2*d*e+24*b*d^2*e+87*a^2*e^2+65*b^5+85*b^4*c+87*b^3*c*d+44*b^2*c^2*d+61*a^2*b*d^2+85*d^5+90*b*c^3*e+31*a^3*d*e+67*b*c^2*e^2+34*b*d^2*e^2+14*d^3*e^2, -46+52*d+20*a^2+56*b*e+9*d*e+88*a^3+24*a^2*b+25*a*d*e+19*b*d*e+20*a^3*b+58*b^4+40*b*c^2*d+66*a^2*d^2+14*b^2*d*e+67*a*e^3+26*a^3*b^2+55*a^3*c^2+68*a^2*b*d^2+16*a*b^3*e+4*c^2*d^2*e+5*b^2*c*e^2+89*c^3*e^2+30*a*b*e^3+31*c*e^4])) - push!( - ideals, - Singular.Ideal( - R,[31+89*b+9*a*c^2+76*b*e^2+51*a*b*d^2+52*c*d^3+64*a*b*c*e+77*a*b^4+32*a*b^3*d+43*b^3*c*d+62*d^5+4*a^2*b^2*e+62*a*b^2*e^2+86*a*c^2*e^2+36*a*b*d*e^2+65*a*c*e^3+72*c^2*e^3+90*a*d*e^3, -6*a^2+48*a*c+83*a*e+21*b*e+84*a*d^2+82*d^3+43*b^2*e+5*c*d*e+42*a^4+40*a^3*c+31*a^2*b*d+59*b^3*d+57*a^2*d^2+9*a*b*d*e+67*c*d^2*e+3*d^3*e+27*a*b*e^2+60*a^5+36*b^5+18*b^4*c+24*a^3*c^2+89*a^4*d+68*c^4*d+18*a*c*d^3+79*d^5+44*b^3*c*e+49*a*b*c^2*e+53*a^2*d*e^2+23*b*d^2*e^2+85*b*c*e^3+48*e^5, -87*a+39*b*e+3*a*b^2+3*b*d^2+44*c*d^2+84*b*e^2+57*b^3*c+72*a*b^2*d+5*a*d^3+17*a^2*b*e+25*a*b*c*e+11*c*d^2*e+70*d*e^3+71*a^5+58*a^4*c+35*a^3*b*d+44*a*b^2*c*d+a^3*b*e+20*a*b^3*e+a^2*c*d*e+64*a*c^2*d*e+41*a^2*b*e^2+2*c*d*e^3])) - for i in ideals - runAll("sparseid(3,0,5,100-(9),90)", i, S, StartOrd, TarOrd) - end - ideals =[] - push!( - ideals, - Singular.Ideal( - R,[53+6*a+4*a*d+15*c*d+5*d^2+20*a*e+37*c^2*d+4*d^3+43*b^2*e+55*d*e^2+55*c^4+21*b^2*d^2+11*a*b*c*e+67*a*c*e^2+12*a*e^3+47*b^2*c^2*d+35*b*c^3*d+25*b^4*e+80*a^3*c*e+8*b^2*c*d*e+45*a^2*d^2*e+11*b*c*d^2*e+41*a*b*c*e^2+73*c^2*e^3+55*b*d*e^3, -45*a*c+44*b*c*e+77*a*d*e+21*c*d*e+16*a*e^2+42*d*e^2+8*a^3*c+5*a*d^3+10*b*c*d*e+2*c*d^2*e+66*d^3*e+64*c^2*e^2+19*b^5+8*a^2*b^2*c+71*a^4*d+58*b^4*d+39*a*b^2*c*d+25*b^2*c^2*d+41*a*b*c*d^2+40*b^2*d^3+79*c^2*d^3+49*a^2*b^2*e+77*a*b^2*c*e+26*a*b*c^2*e+64*b^2*c*d*e+30*a*c*d*e^2+87*e^5, -42*b+48*a^2*e+64*b^2*e+28*a^3*b+72*b^3*c+64*b*c^3+24*c^4+77*a^3*d+17*b^3*d+18*a*c^2*d+69*a*c*d^2+41*b^2*c*e+8*c*d^2*e+71*a^5+51*a^2*b^3+8*b^5+54*a^2*c^3+24*b^2*c^2*d+9*c^4*d+25*a^3*d^2+50*b^3*d^2+24*a*b^3*e+88*b^2*c^2*e+41*b*c^3*e+48*a*b*d*e^2+40*c*d^2*e^2])) - push!( - ideals, - Singular.Ideal( - R,[14*a^3+9*b^2*c+84*a*b*d+17*a*d^2+67*c^2*e+19*b*d*e+60*a^3*c+17*a*c^2*d+10*b*c^2*d+49*a*d^3+69*a^3*e+6*b^2*c*e+67*a*c*d*e+40*b*c*d*e+74*a^3*b*c+37*a*b^3*c+55*b^3*c^2+30*a^2*b^2*d+16*a^2*b*c*d+18*b^3*c*d+85*a^2*c^2*d+90*c^4*d+21*a^2*b*d^2+11*a^2*c*d^2+59*b*c^3*e+49*a*b^2*d*e+42*a^2*c*d*e+13*a*c^2*d*e+41*b^2*d^2*e+60*b^2*d*e^2+49*b*d*e^3, -34+12*b+42*a^2+3*b^2+15*a*d+10*a*b*c+38*a*b*d+68*a*c*d+82*a^2*e+39*b*e^2+16*c^4+90*a*c*d^2+26*d^4+41*a^2*c*e+11*b^3*c^2+69*a^2*b*c*d+85*c^4*d+19*b*c^2*d^2+73*a^3*b*e+19*a^2*b*c*e+87*a*b*d^2*e+4*a*b*d*e^2+25*b^2*d*e^2+35*c^2*e^3+15*b*e^4, -79*b+87*b*c+27*c*e+78*a^2*c^2+32*c^3*d+7*b*c*d^2+43*c*d^3+30*a*b*c*e+31*b*c^2*e+29*c^3*e+57*a^2*d*e+78*d^3*e+12*a*b^4+49*a*b^3*c+28*a*c^4+80*b*d^4+42*b^4*e+55*a^2*b*c*e+32*b^3*d*e+87*b*c^2*d*e+42*a^2*d^2*e+80*b*c*d^2*e])) - push!( - ideals, - Singular.Ideal( - R,[6*c+22*b*c+11*a^3+13*b^2*c+84*a^2*d+32*a*b*d+2*a*d*e+15*a^2*b^2+49*b*c^2*d+61*b^3*e+40*a*c^2*e+12*b^2*d*e+22*c*d^2*e+72*b^2*e^2+26*b*c*e^2+54*a^3*c^2+87*a^2*b*c*d+46*c^4*d+17*a^2*d^3+17*b^3*c*e+66*b^2*c^2*e+60*b*d^3*e+12*a^2*b*e^2+32*c^2*e^3+12*b*d*e^3+57*c*d*e^3, -72+81*b+45*b*c+67*e^2+38*b*d*e+15*a*e^2+36*c*e^2+21*b^3*e+75*a*c*d*e+8*a*d^2*e+57*b*d^2*e+77*d^3*e+4*a^4*b+10*a^3*b^2+56*b^5+76*a^2*b*c^2+28*a*c^4+53*a^2*b^2*d+37*b^3*d^2+71*a*b*c*d^2+17*a^2*b^2*e+84*b^4*e+63*a*b*c^2*e+42*b^2*c*d*e+49*a*d^3*e+77*a*b^2*e^2+66*a^2*c*e^2+72*b^2*d*e^2+64*c*d^2*e^2+12*c*d*e^3, -24*d^2+85*e^2+80*b^2*d+9*c^2*d+42*a*d*e+48*a^3*c+75*a^2*b*d+81*c^3*d+6*a*b*d^2+23*c*d^2*e+47*d^3*e+53*b*c*e^2+36*e^4+10*a*b^2*c^2+61*a*b^3*d+17*a^3*c*d+46*a*c^2*d^2+5*a*b^2*d*e+65*c*d^2*e^2+89*b^2*e^3+48*d^2*e^3+42*c*e^4])) - for i in ideals - runAll("sparseid(3,0,5,100-(1),90)", i, S, StartOrd, TarOrd) - end - ideals =[] -end diff --git a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl deleted file mode 100644 index 1556467c3..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmark.jl +++ /dev/null @@ -1,698 +0,0 @@ -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl", -) -using BenchmarkTools - -############################################################### -#Implementation of the gröbner walk. -############################################################### - -#for counting the steps of the groebnerwalk. -counter = 0 -function getCounter() - global counter - temp = counter - counter = 0 - return temp -end -#= -@doc Markdown.doc""" -function groebnerwalk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - p::Int64 = 0, -) -Given an Ideal $G$ generated by a reduced Groebner Basis w.r.t. the monomial ordering $S$ this function -returns a reduced Groebner Basis w.r.t. the monomial ordering $T$ by converting it using the Groebner Walk. -The Groebner Walk is proposed by Collart et al. (1993) -One can choose a strategy of: -Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). -Pertubed Walk (:pertubed, with $p$ = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). -Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. -Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that $T$ represents the lex ordering. Pertubes only the target vector. -Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. -"""=# -function groebnerwalk2( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - p::Int64 = 0, -) - if grwalktype == :standard - walk = (x, y, z) -> standard_walkAlloc(x, y, z) - elseif grwalktype == :generic - walk = (x, y, z) -> generic_walk2(x, y, z) - elseif grwalktype == :pertubed - walk = (x, y, z) -> pertubed_walk2(x, y, z, p) - elseif grwalktype == :fractal - walk = - (x, y, z) -> fractal_walk2( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_start_order - walk = - (x, y, z) -> fractal_walk2_start_order( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_lex - walk = - (x, y, z) -> fractal_walk2_lex( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_look_ahead - walk = - (x, y, z) -> fractal_walk2_look_ahead( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :tran - walk = (x, y, z) -> tran_walk2(x, y, z) - elseif grwalktype == :fractal_combined - walk = - (x, y, z) -> fractal_combined2( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - end - - ######TODO:Check the parameter##### - R = base_ring(G) - I = Singular.Ideal(R, [R(x) for x in gens(G)]) - - Gb = walk(I, S, T) - #println("Cones crossed: ", getCounter()) - - S = change_order(Gb.base_ring, T) - return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) -end - - -function standard_walkAlloc( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - #println("standard_walkAlloc results") - #println("Crossed Cones in: ") - standard_walkAlloc(G, S, T, S[1, :], T[1, :]) -end - -function standard_walkAlloc( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, -) - R = base_ring(G) - Rn = change_order(R, cweight, T) - terminate = false - while !terminate - G = standard_stepAlloc(G, R, cweight, Rn) - #println(cweight) - #global counter = getCounter() + 1 - if cweight == tweight - terminate = true - else - cweight = next_weight(G, cweight, tweight) - if !checkInt32(cweight) - return G - end - R = Rn - Rn = change_order(Rn, cweight, T) - end - end - return G -end - -function standard_stepAlloc( - G::Singular.sideal, - R::Singular.PolyRing, - cw::Vector{Int64}, - Rn::Singular.PolyRing, -) - Gw = initials(Rn, gens(G), cw) - H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - return Singular.std(H, complete_reduction = true) -end - -############################################################### -#Generic-version of the groebner walk by Fukuda et al. (2007) -############################################################### - -function generic_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R = base_ring(G) - Rn = change_order(G.base_ring, T) - v = next_gamma(G, [0], S, T) - Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] - G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) - - #println("generic_walk2 results") - #println("Crossed Cones with facetNormal: ") - while !isempty(v) - #global counter = getCounter() + 1 - #println(v) - G, Lm = generic_stepAlloc(G, Lm, v, T, R) - v = next_gamma(G, Lm, v, S, T) - end - return Singular.interreduce(G) -end - -function generic_stepAlloc( - G::Singular.sideal, - Lm::Vector{Singular.spoly{L}}, - v::Vector{Int64}, - T::Matrix{Int64}, - R::Singular.PolyRing, -) where {L<:Nemo.RingElem} - - Rn = Singular.base_ring(G) - - facet_Generators = facet_initials(G, Lm, v) - H = Singular.std( - Singular.Ideal(Rn, facet_Generators), - complete_reduction = true, - ) - H, Lm = lift_generic(G, Lm, H) - G = interreduce(H, Lm) - G = Singular.Ideal(Rn, G) - G.isGB = true - return G, Lm -end - - -############################################################### -#Pertubed-version of the groebner walk Amrhein et al. -############################################################### -function pertubed_walk2( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - p::Int64, -) - cweight = pertubed_vector(G, S, p) - #cweight = S[1, :] - terminate = false - #println("pertubed_walk2 results") - #println("Crossed Cones in: ") - - while !terminate - tweight = pertubed_vector(G, T, p) - G = standard_walkAlloc(G, S, T, cweight, tweight) - if inCone(G, T, tweight) - terminate = true - else - if p == 1 - R = change_order(G.base_ring, T) - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - G = Singular.std(G, complete_reduction = true) - terminate = true - end - p = p - 1 - cweight = tweight - end - end - return G -end - -############################################################### -#fractal-walk by Amrhein et al. -#Inlcuding: -#fractal_walk2 -> standard-version -#fractal_walk22 -> checks if the starting weight is in the inner of a cone. -#fractal_walk23 -> fractal walk expecially for conversion to the lexikographic orderig. -# checks if the starting weight is in the inner of a cone. -############################################################### - -######################################## -#Counter for the steps in the fractal_walk2 -######################################## -counterFr = 0 -function deleteCounterFr() - global counterFr - temp = counterFr - counterFr = 0 - return temp -end -function getCounterFr() - global counterFr - return counterFr -end -function raiseCounterFr() - global counterFr = getCounterFr() + 1 -end -PertVecs = [] -sigma = [] - -function fractal_walk2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - #println(PertVecs) - #println("FacrtalWalk_standard results") - #println("Crossed Cones in: ") - Gb = fractal_recursiv2(G, S, T, PertVecs, 1) - #println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = base_ring(G) - terminate = false - G.isGB = true - w = S.w - - while !terminate - t = nextT(G, w, PertVecs[p]) - if (t == [0]) - if inCone(G, T, PertVecs[p]) - return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - Rn = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if p == nvars(R) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - H = fractal_recursiv2( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) - R = Rn - end - return G -end - -cwPert = [] -firstStepMode = false -function cwpert(p::Int64) - cwPert[p] -end - -function fractal_walk2_start_order( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - global sigma = S.w - #println("fractal_walk2_withStartorder results") - #println("Crossed Cones in: ") - Gb = fractal_walk2_recursiv_startorder2(G, S, T, PertVecs, 1) - #println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk2_recursiv_startorder2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = cwPert[p] - else - w = S.w - end - - while !terminate - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - #println(PertVecs[p], " in depth", p) - return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(cweight) - return G - end - T.w = w - Rn = change_order(R, T) - Gw = initials(R, gens(G), w) - if p == Singular.nvars(R) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - - H = fractal_walk2_recursiv_startorder2( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) - R = Rn - end - return G -end -function fractal_walk2_lex( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - #println("fractal_walk2_lex results") - #println("Crossed Cones in: ") - Gb = fractal_walk2_recursive_lex2(G, S, T, PertVecs, 1) - #println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk2_recursive_lex2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - w = S.w - while !terminate - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - return G - else - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - #println(PertVecs) - continue - end - end - if t == 1 && p == 1 - return fractal_walk2_recursive_lex2(G, S, T, PertVecs, p + 1) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - Rn = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - H = fractal_walk2_recursive_lex2( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) - R = Rn - end - return G -end -function fractal_walk2_look_ahead( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - #println("fractal_walk2_look_ahead results") - #println("Crossed Cones in: ") - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk2_look_ahead_recursiv2(G, S, T, PertVecs, 1) - #println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk2_look_ahead_recursiv2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - w = S.w - - while !terminate - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - Rn = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - H = fractal_walk2_look_ahead_recursiv2( - Singular.Ideal(R, Gw), - S, - T, - PertVecs, - p + 1, - ) - end - - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) - R = Rn - end - return G -end - - - - -function fractal_combined2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - #println("fractal_walk2_withStartorder results") - #println("Crossed Cones in: ") - Gb = fractal_walk2_combined(G, S, T, PertVecs, 1) - #println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk2_combined( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = cwPert[p] - else - w = S.w - end - while !terminate - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - #println(PertVecs[p], " in depth", p) - return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - if t == 1 && p == 1 - return fractal_walk2_combined(G, S, T, PertVecs, p + 1) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - b = w - Rn = change_order(R, T) - Gw = initials(R, gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - #println(w, " in depth", p) - #raiseCounterFr() - else - #println("up in: ", p, " with: ", w) - H = fractal_walk2_combined( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) - R = Rn - end - return G -end -############################################################### -#Tran-version of the groebner walk by Tran (2002) -############################################################### - -function tran_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - cweight = S[1, :] - tweight = T[1, :] - #println("tran_walk2 results") - #println("Crossed Cones in: ") - R = base_ring(G) - if !isMonomial(initials(R, Singular.gens(G), cweight)) - cweight = pertubed_vector(G, S, nvars(R)) - end - - terminate = false - while !terminate - w = next_weight(G, cweight, tweight) - if !checkInt32(w) - return G - end - Rn = change_order(R, w, T) - if w == tweight - if inCone(G, T, cweight) - return G - else - if inSeveralCones(initials(base_ring(G), gens(G), w)) - tweight = representation_vector(G, T) - continue - end - end - end - G = standard_stepAlloc(G, R, w, Rn) - #global counter = getCounter() + 1 - #println(w) - R = Rn - cweight = w - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl b/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl deleted file mode 100644 index a553cf6de..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/GroebnerWalkFinalBenchmarkProcedures.jl +++ /dev/null @@ -1,1773 +0,0 @@ -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl", -) -include( - "/Users/JordiWelp/github/Singular.jl/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl", -) -using BenchmarkTools -BenchmarkTools.DEFAULT_PARAMETERS.samples = 1 -BenchmarkTools.DEFAULT_PARAMETERS.evals = 5 -a = "-" -b = "-" -z = "-" -c = "-" -d = "-" -e = "-" -f = "-" -g = "-" -h = "-" -i = "-" -j = "-" -k = "-" -l = "-" - -a2 = "-" -b2 = "-" -z2 = "-" -c2 = "-" -d2 = "-" -e2 = "-" -f2 = "-" -g2 = "-" -h2 = "-" -i2 = "-" -j2 = "-" -k2 = "-" -l2 = "-" - -function cleardf() - global a = "-" - global b = "-" - global c = "-" - global d = "-" - global e = "-" - global f = "-" - global g = "-" - global h = "-" - global i = "-" - global j = "-" - global k = "-" - global l = "-" - global z = "-" - global a2 = "-" - global b2 = "-" - global c2 = "-" - global d2 = "-" - global e2 = "-" - global f2 = "-" - global g2 = "-" - global h2 = "-" - global i2 = "-" - global j2 = "-" - global k2 = "-" - global l2 = "-" - global z2 = "-" -end - - - - -############################################################### -#Implementation of the gröbner walk. -############################################################### - -#for counting the steps of the groebnerwalk. -counter = 0 -function getCounter() - global counter - temp = counter - counter = 0 - return temp -end -#= -@doc Markdown.doc""" -function groebnerwalk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - p::Int64 = 0, -) -Given an Ideal G generated by a reduced Groebner Basis w.r.t. the monomial ordering S this function -returns a reduced Groebner Basis w.r.t. the monomial ordering T by converting it using the Groebner Walk. -The Groebner Walk is proposed by Collart et al. (1993) -One can choose a strategy of: -Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). -Pertubed Walk (:pertubed, with p = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). -Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. -Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that T represents the lex ordering. Pertubes only the target vector. -Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. -"""=# -function groebnerwalk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - p::Int64 = 0, -) - if grwalktype == :standard - walk = (x, y, z) -> standard_walk(x, y, z) - elseif grwalktype == :generic - walk = (x, y, z) -> generic_walk(x, y, z) - elseif grwalktype == :pertubed - walk = (x, y, z) -> pertubed_walk(x, y, z, p) - elseif grwalktype == :fractal - walk = - (x, y, z) -> fractal_walk( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_start_order - walk = - (x, y, z) -> fractal_walk_start_order( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_lex - walk = - (x, y, z) -> fractal_walk_lex( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_look_ahead - walk = - (x, y, z) -> fractal_walk_look_ahead( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :tran - walk = (x, y, z) -> tran_walk(x, y, z) - elseif grwalktype == :fractal_combined - walk = - (x, y, z) -> fractal_walk_combined( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - end - - ######TODO:Check the parameter##### - R = base_ring(G) - I = Singular.Ideal(R, [R(x) for x in gens(G)]) - - Gb = walk(I, S, T) - println("Cones crossed: ", getCounter()) - - S = change_order(Gb.base_ring, T) - return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) -end - - -function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - println("standard_walk results") - println("Crossed Cones in: ") - standard_walk(G, S, T, S[1, :], T[1, :]) -end - -function standard_walk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, -) - R = base_ring(G) - Rn = change_order(R, cweight, T) - terminate = false - while !terminate - println(cweight) - global b = cweight - global b2 = cweight - Gtemp = G - G = standard_step(G, R, cweight, Rn) - if !isequal(Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(Gtemp)]), G) - global counter = getCounter() + 1 - println(true) - end - if cweight == tweight - terminate = true - else - global a = - @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = - 2 - global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals = 5 samples = - 2 - - cweight = next_weight(G, cweight, tweight) - if !checkInt32(cweight) - return G - end - R = Rn - Rn = change_order(Rn, cweight, T) - end - end - global z = Singular.ngens(G) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = ["-"], - counter = [getCounter()], - ) - savea(df, "standardWalk") - return G -end - -function standard_step( - G::Singular.sideal, - R::Singular.PolyRing, - cw::Vector{Int64}, - Rn::Singular.PolyRing, -) - global z = length(Singular.gens(G)) - global z2 = length(Singular.gens(G)) - - - global c = @belapsed initials($Rn, gens($G), $cw) evals = 5 samples = 2 - global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 5 samples = 2 - - Gw = initials(Rn, gens(G), cw) - global d = @belapsed Singular.std( - Singular.Ideal($Rn, $Gw), - complete_reduction = true, - ) evals = 5 samples = 2 - - global d2 = @ballocated Singular.std( - Singular.Ideal($Rn, $Gw), - complete_reduction = true, - ) evals = 5 samples = 2 - - H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - - - global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - - global f = @belapsed lift($G, $R, $H, $Rn) evals = 5 samples = 2 - global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 5 samples = 2 - - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - global g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - global g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = ["-"], - counter = ["-"] - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = ["-"], - counter = ["-"] - ) - - savea(df, "standardWalk") - savea(df2, "allocsStandardWalk") - cleardf() - return Singular.std(H, complete_reduction = true) -end -############################## -#just for benchmark###### -############################# -function standard_walk2(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - println("standard_walk results") - println("Crossed Cones in: ") - standard_walk2(G, S, T, S[1, :], T[1, :]) -end - -function standard_walk2( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, - k::Int64, -) - R = base_ring(G) - Rn = change_order(R, cweight, T) - terminate = false - while !terminate - println(cweight) - global b = cweight - global b2 = cweight - - Gtemp = G - G = standard_step2(G, R, cweight, Rn) - - if !isequal(Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(Gtemp)]), G) - global counter = getCounter() + 1 - println(true) - end - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - l = [l], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - l2 = [l2], - counter = ["-"] - - ) - cleardf() - savea(df, "pertubedWalk", k) - savea(df2, "allocsPertubedWalk", k) - - if cweight == tweight - terminate = true - else - global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals = 5 samples = - 2 - global a = - @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = - 2 - cweight = next_weight(G, cweight, tweight) - if !checkInt32(cweight) - return G - end - R = Rn - Rn = change_order(Rn, cweight, T) - end - end - return G -end - -function standard_step2( - G::Singular.sideal, - R::Singular.PolyRing, - cw::Vector{Int64}, - Rn::Singular.PolyRing, -) - global z = length(Singular.gens(G)) - global z2 = length(Singular.gens(G)) - - - global c = @belapsed initials($Rn, gens($G), $cw) evals = 5 samples = 2 - global c2 = @ballocated initials($Rn, gens($G), $cw) evals = 5 samples = 2 - - Gw = initials(Rn, gens(G), cw) - - global d = @belapsed Singular.std( - Singular.Ideal($Rn, $Gw), - complete_reduction = true, - ) evals = 5 samples = 2 - - global d2 = @ballocated Singular.std( - Singular.Ideal($Rn, $Gw), - complete_reduction = true, - ) evals = 5 samples = 2 - - H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - - global e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - - global e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - - global f2 = @ballocated lift($G, $R, $H, $Rn) evals = 5 samples = 2 - global f = @belapsed lift($G, $R, $H, $Rn) evals = 5 samples = 2 - #H = liftGW2(G, R, Gw, H, Rn) - H = lift(G, R, H, Rn) - global g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - global g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - - return Singular.std(H, complete_reduction = true) -end -############################################################### -#Generic-version of the groebner walk by Fukuda et al. (2007) -############################################################### - -function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R = base_ring(G) - Rn = change_order(G.base_ring, T) - global a = @belapsed next_gamma($G, $[0], $S, $T) evals = 5 samples = 2 - global a2 = @ballocated next_gamma($G, $[0], $S, $T) evals = 5 samples = 2 - - v = next_gamma(G, [0], S, T) - Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] - G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) - - println("generic_walk results") - println("Crossed Cones with facetNormal: ") - while !isempty(v) - global counter = getCounter() + 1 - global b = v - global b2 = v - - println(v) - global z = Singular.ngens(G) - global z2 = z - G, Lm = generic_step(G, Lm, v, T, R) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - counter = ["-"] - - ) - savea(df2, "allocsGenericWalk") - savea(df, "genericWalk") - cleardf() - global a2 = - @ballocated next_gamma($G, $Lm, $v, $S, $T) evals = 5 samples = 2 - - global a = - @belapsed next_gamma($G, $Lm, $v, $S, $T) evals = 5 samples = 2 - v = next_gamma(G, Lm, v, S, T) - end - global z = Singular.ngens(G) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - counter = [getCounter()], - ) - savea(df, "genericWalk") - return Singular.interreduce(G) -end - -function generic_step( - G::Singular.sideal, - Lm::Vector{Singular.spoly{L}}, - v::Vector{Int64}, - T::Matrix{Int64}, - R::Singular.PolyRing, -) where {L<:Nemo.RingElem} - - - Rn = Singular.base_ring(G) - global c = @belapsed facet_initials($G, $Lm, $v) evals = 5 samples = 2 - global c2 = @ballocated facet_initials($G, $Lm, $v) evals = 5 samples = 2 - - facet_Generators = facet_initials(G, Lm, v) - global d = @belapsed Singular.std( - Singular.Ideal($Rn, $facet_Generators), - complete_reduction = true, - ) evals = 5 samples = 2 - - global d2 = @ballocated Singular.std( - Singular.Ideal($Rn, $facet_Generators), - complete_reduction = true, - ) evals = 5 samples = 2 - H = Singular.std( - Singular.Ideal(Rn, facet_Generators), - complete_reduction = true, - ) - global e2 = @ballocated lift_generic($G, $Lm, $H) evals = 5 samples = 2 - - global e = @belapsed lift_generic($G, $Lm, $H) evals = 5 samples = 2 - H, Lm = lift_generic(G, Lm, H) - global f = @belapsed interreduce($H, $Lm) evals = 5 samples = 2 - global f2 = @ballocated interreduce($H, $Lm) evals = 5 samples = 2 - - G = interreduce(H, Lm) - G = Singular.Ideal(Rn, G) - G.isGB = true - return G, Lm -end - - -############################################################### -#Pertubed-version of the groebner walk Amrhein et al. -############################################################### -function pertubed_walk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - p::Int64, -) - k = p - k2 = p - df = DataFrame( - a = ["-"], - b = ["-"], - z = ["-"], - c = ["-"], - d = ["-"], - e = ["-"], - f = ["-"], - g = ["-"], - h = ["-"], - i = ["-"], - j = ["-"], - k = [(p, p)], - l = ["-"], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = ["-"], - b2 = ["-"], - z2 = ["-"], - c2 = ["-"], - d2 = ["-"], - e2 = ["-"], - f2 = ["-"], - g2 = ["-"], - h2 = ["-"], - i2 = ["-"], - j2 = ["-"], - k2 = [(p, p)], - l2 = ["-"], - counter = ["-"] - - ) - savea(df2, "allocsPertubedWalk", k) - savea(df, "pertubedWalk", k) - cweight = pertubed_vector(G, S, p) - #cweight = S[1, :] - terminate = false - println("pertubed_walk results") - println("Crossed Cones in: ") - - while !terminate - global h = @belapsed pertubed_vector($G, $T, $p) evals = 5 samples = 2 - global h2 = - @ballocated pertubed_vector($G, $T, $p) evals = 5 samples = 2 - - tweight = pertubed_vector(G, T, p) - G = standard_walk2(G, S, T, cweight, tweight, k) - - if inCone(G, T, tweight) - global i = @belapsed inCone($G, $T, $tweight) evals = 5 samples = 2 - global i2 = - @ballocated inCone($G, $T, $tweight) evals = 5 samples = 2 - - terminate = true - else - if p == 1 - R = change_order(G.base_ring, T) - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - global j = - @belapsed Singular.std($G, complete_reduction = true) evals = - 2 samples = 1 - global j2 = - @ballocated Singular.std($G, complete_reduction = true) evals = - 2 samples = 1 - - G = Singular.std(G, complete_reduction = true) - terminate = true - end - p = p - 1 - cweight = tweight - end - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - l = [l], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - l2 = [l2], - counter = ["-"] - - ) - savea(df, "pertubedWalk", k) - savea(df2, "allocsPertubedWalk", k) - cleardf() - - end - global z = Singular.ngens(G) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - l = [l], - counter = [getCounter()], - ) - savea(df, "pertubedWalk", k) - - return G -end - -############################################################### -#fractal-walk by Amrhein et al. -#Inlcuding: -#fractal_walk -> standard-version -#fractal_walk2 -> checks if the starting weight is in the inner of a cone. -#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. -# checks if the starting weight is in the inner of a cone. -############################################################### - -######################################## -#Counter for the steps in the fractal_walk -######################################## -counterFr = 0 -function deleteCounterFr() - global counterFr - temp = counterFr - counterFr = 0 - return temp -end -function getCounterFr() - global counterFr - return counterFr -end -function raiseCounterFr() - global counterFr = getCounterFr() + 1 -end -PertVecs = [] -sigma = [] - -function fractal_walk( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println(PertVecs) - println("FractalWalk_standard results") - println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S, T, PertVecs, 1) - z = length(Singular.gens(Gb)) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = [deleteCounterFr()], - ) - savea(df, "fractalWalk") - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = base_ring(G) - terminate = false - G.isGB = true - w = S.w - h = "-" - i = "-" - h2 = "-" - i2 = "-" - while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - - t = nextT(G, w, PertVecs[p]) - if (t == [0]) - if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 - h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = - 2 - - return G - else - i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - - i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println(PertVecs) - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - b = w - b2 = w - T.w = w - Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) - - c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - - c = @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 - Gw = initials(R, Singular.gens(G), w) - if p == nvars(R) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - d2 = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - d2 = "rec" - - H = fractal_recursiv( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - f2 = - @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - - g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - G = Singular.std(H, complete_reduction = true) - R = Rn - j = p - j2 = p - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - counter = ["-"] - - ) - - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = ["-"] - - ) - savea(df, "fractalWalk") - savea(df2, "allocsFractalWalk") - cleardf() - end - return G -end - -cwPert = [] -firstStepMode = false -function cwpert(p::Int64) - cwPert[p] -end - -function fractal_walk_start_order( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - global sigma = S.w - println("fractal_walk_withStartorder results") - println("Crossed Cones in: ") - Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) - z = length(Singular.gens(Gb)) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = [deleteCounterFr()], - ) - savea(df, "fractalWalk") - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk_recursiv_startorder( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = cwPert[p] - else - w = S.w - end - h = "-" - i = "-" - h2 = "-" - i2 = "-" - while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 - h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = - 2 - - return G - else - i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - - i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println(PertVecs) - - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - b = w - b2 = w - - Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) - - c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - - c = @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 - Gw = initials(R, gens(G), w) - if p == Singular.nvars(R) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - d2 = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - d2 = "rec" - - - H = fractal_walk_recursiv_startorder( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - f2 = - @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - - H = liftGW2(G, R, Gw, H, Rn) - #H = lift_fractal_walk(G, R, H, Rn) - g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - - g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - j = p - j2 = p - - G = Singular.std(H, complete_reduction = true) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - counter = ["-"] - - ) - savea(df2, "allocsFractalWalkstartorder") - savea(df, "fractalWalkstartorder") - cleardf() - - R = Rn - end - return G -end -function fractal_walk_lex( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println("fractal_walk_lex results") - println("Crossed Cones in: ") - Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) - z = length(Singular.gens(Gb)) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = [deleteCounterFr()], - ) - savea(df, "fractalWalklex") - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk_recursive_lex( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - w = S.w - h = "-" - i = "-" - h2 = "-" - i2 = "-" - while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 - h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = - 2 - - return G - else - i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:Singular.nvars(R)] - println(PertVecs) - continue - end - end - if t == 1 && p == 1 - println("up in: ", p, " with: ", w) - return fractal_walk_recursive_lex(G, S, T, PertVecs, p + 1) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - b = w - b2 = w - - Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) - - c2 = - @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - - c = - @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - d2 = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - d2 = "rec" - - - H = fractal_walk_recursive_lex( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - f2 = - @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - - H = liftGW2(G, R, Gw, H, Rn) - #H = lift_fractal_walk(G, R, H, Rn) - g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - - j = p - j2 = p - - G = Singular.std(H, complete_reduction = true) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - counter = ["-"] - - ) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = ["-"] - - ) - savea(df, "fractalWalklex") - savea(df2, "allocsFractalWalklex") - cleardf() - R = Rn - end - return G -end -function fractal_walk_look_ahead( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - println("fractal_walk_look_ahead results") - println("Crossed Cones in: ") - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) - z = length(Singular.gens(Gb)) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = [deleteCounterFr()], - ) - savea(df, "fractalWalklookahead") - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk_look_ahead_recursiv( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - w = S.w - h = "-" - i = "-" - h2 = "-" - i2 = "-" - while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 - h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = - 2 - - return G - else - i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - b = w - b2 = w - - Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) - c2 = @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - - c = @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = 2 - Gw = initials(R, Singular.gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - d2 = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - d2 = "rec" - - H = fractal_walk_look_ahead_recursiv( - Singular.Ideal(R, Gw), - S, - T, - PertVecs, - p + 1, - ) - end - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - f2 = - @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - - j = p - j2 = p - - G = Singular.std(H, complete_reduction = true) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - counter = ["-"] - - ) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = ["-"] - - ) - savea(df, "fractalWalklookahead") - savea(df2, "allocsFractalWalklookahead") - cleardf() - - R = Rn - end - return G -end - - - - -function fractal_walk_combined( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println("fractal_walk_combined results") - println("Crossed Cones in: ") - Gb = fractal_walk_combined(G, S, T, PertVecs, 1) - z = length(Singular.gens(Gb)) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = [deleteCounterFr()], - ) - savea(df, "fractalWalkcombined") - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_walk_combined( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PertVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - w = cwPert[p] - else - w = S.w - end - h = "-" - i = "-" - h2 = "-" - i2 = "-" - while !terminate - a = @belapsed nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - a2 = @ballocated nextT($G, $w, PertVecs[$p]) evals = 5 samples = 2 - - t = nextT(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs[p]) - h = @belapsed inCone($G, $T, PertVecs[$p]) evals = 5 samples = 2 - h2 = - @ballocated inCone($G, $T, PertVecs[$p]) evals = 5 samples = - 2 - println(PertVecs[p], " in depth", p) - return G - else - i2 = - @ballocated [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - - i = - @belapsed [pertubed_vector($G, $T, i) for i = 1:nvars($R)] evals = 5 samples = 2 - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - continue - end - end - if t == 1 && p == 1 - return fractal_walk_combined(G, S, T, PertVecs, p + 1) - else - w = w + t * (PertVecs[p] - w) - w = convert_bounding_vector(w) - if !checkInt32(w) - return G - end - T.w = w - b = w - b2 = w - - Rn = change_order(R, T) - z = length(Singular.gens(G)) - z2 = length(Singular.gens(G)) - - c2 = - @ballocated initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - - c = - @belapsed initials($R, Singular.gens($G), $w) evals = 5 samples = - 2 - Gw = initials(R, gens(G), w) - if (p == Singular.nvars(R) || isbinomial(Gw)) - d = @belapsed Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - d2 = @ballocated Singular.std( - Singular.Ideal($Rn, [change_ring(x, $Rn) for x in $Gw]), - complete_reduction = true, - ) evals = 5 samples = 2 - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println("up in: ", p, " with: ", w) - d = "rec" - d2 = "rec" - - - H = fractal_walk_combined( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PertVecs, - p + 1, - ) - global firstStepMode = false - end - end - e = @belapsed liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - e2 = @ballocated liftGW2($G, $R, $Gw, $H, $Rn) evals = 5 samples = 2 - f2 = - @ballocated lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - f = @belapsed lift_fractal_walk($G, $R, $H, $Rn) evals = 5 samples = 2 - H = liftGW2(G, R, Gw, H, Rn) - #H = lift_fractal_walk(G, R, H, Rn) - g2 = - @ballocated Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - g = - @belapsed Singular.std($H, complete_reduction = true) evals = 5 samples = - 2 - j = p - j2 = p - - G = Singular.std(H, complete_reduction = true) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - counter = ["-"] - - ) - savea(df, "fractalWalkcombined") - savea(df2, "allocsFractalWalkcombined") - cleardf() - - R = Rn - end - return G -end - -############################################################### -#Tran-version of the groebner walk by Tran (2002) -############################################################### - -function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - cweight = S[1, :] - tweight = T[1, :] - println("tran_walk results") - println("Crossed Cones in: ") - R = base_ring(G) - if !isMonomial(initials(R, Singular.gens(G), cweight)) - cweight = pertubed_vector(G, S, nvars(R)) - end - - terminate = false - while !terminate - global a2 = - @ballocated next_weight($G, $cweight, $tweight) evals = 5 samples = - 2 - - global a = - @belapsed next_weight($G, $cweight, $tweight) evals = 5 samples = 2 - w = next_weight(G, cweight, tweight) - if !checkInt32(w) - return G - end - Rn = change_order(R, w, T) - if w == tweight - if inCone(G, T, cweight) - global i2 = - @ballocated inCone($G, $T, $cweight) evals = 5 samples = 2 - - global i = - @belapsed inCone($G, $T, $cweight) evals = 5 samples = 2 - global z = Singular.nGens(G) - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = [getCounter()], - ) - savea(df, "tranWalk") - - return G - else - if inSeveralCones(initials(base_ring(G), gens(G), w)) - global j = @belapsed inSeveralCones( - initials(base_ring($G), gens($G), $w), - ) evals = 5 samples = 2 - global j2 = @ballocated inSeveralCones( - initials(base_ring($G), gens($G), $w), - ) evals = 5 samples = 2 - global h2 = - @ballocated representation_vector($G, $T) evals = 5 samples = - 2 - global h = - @belapsed representation_vector($G, $T) evals = 5 samples = - 2 - tweight = representation_vector(G, T) - continue - end - end - end - G = standard_step2(G, R, w, Rn) - global counter = getCounter() + 1 - println(w) - global b = w - global b2 = w - - R = Rn - cweight = w - df = DataFrame( - a = [a], - b = [b], - z = [z], - c = [c], - d = [d], - e = [e], - f = [f], - g = [g], - h = [h], - i = [i], - j = [j], - k = [k], - counter = ["-"] - - ) - df2 = DataFrame( - a2 = [a2], - b2 = [b2], - z2 = [z2], - c2 = [c2], - d2 = [d2], - e2 = [e2], - f2 = [f2], - g2 = [g2], - h2 = [h2], - i2 = [i2], - j2 = [j2], - k2 = [k2], - counter = ["-"] - - ) - savea(df, "tranWalk") - savea(df2, "allocsTranWalk") - cleardf() - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/parser.jl b/src/GroebnerWalkFinal/Benchmarking/parser.jl deleted file mode 100644 index e835f5485..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/parser.jl +++ /dev/null @@ -1,51 +0,0 @@ -cd("/Users/JordiWelp/Results/1ideals") -include("readWriteHelper.jl") -using CSV -using DataFrames - -function parseideal(k::String) - csv_reader = CSV.File("Beispiele" * "$k" * "Variablen.txt") - for row in csv_reader - poly = collect(split("$(row.generator)", "")) - result = "" - println("from", poly) - d = length(poly) - - for i = 1:d - a = poly[i] - if i == d - result = result * a - result = result * "," - println("to", result) - break - end - b = poly[i+1] - - if (a == "+" || a == "-") - result = result * a - else - if tryparse(Int32, string(a)) != nothing - if tryparse(Int32, string(b)) != nothing - result = result * a - elseif (b == "+" || b == "-") - result = result * a - else - result = result * a * "*" - end - else - if (tryparse(Int32, string(b)) != nothing) - result = result * a * "^" - elseif (b == "+" || b == "-") - result = result * a - else - result = result * a * "*" - end - end - end - end - df = DataFrame(generator = Symbol(result)) - savea(df, "cBeispiele" * "$k" * "Variablen") - cd("/Users/JordiWelp/Results/1ideals") - - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl b/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl deleted file mode 100644 index 14dfcda8e..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/readWriteHelper.jl +++ /dev/null @@ -1,27 +0,0 @@ -using DataFrames -using CSV -function savew(df::DataFrame, file::String) - - open(file * ".txt", "w") do io # create a file and write with header as the file does not exist - foreach(row -> print(io, row), CSV.RowWriter(df)) - end -end - -function savea(df::DataFrame, file::String) - - open(file * ".txt", "a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end -end - -function savea(df::DataFrame, file::String, p::Int64) - open(file * "$p.txt", "a") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end -end - -function savew(df::DataFrame, file::String, p::Int64) - open(file * "$p.txt", "w") do io # append to file and write without header - foreach(row -> print(io, row), CSV.RowWriter(df, writeheader = false)) - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl deleted file mode 100644 index b476d7d13..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark.jl +++ /dev/null @@ -1,51 +0,0 @@ -using BenchmarkTools - - -function runb( - v::String, - ideal::Singular.sideal, - S::Singular.PolyRing, - StartOrd::Matrix{Int64}, - TarOrd::Matrix{Int64}, -) - println("starting Benchmark") - prepareExampleAlloc(v) - prepareExampleElapsed(v) - - println("Computing deglex-Basis") - I = Singular.std(ideal, complete_reduction = true) - - println("Benchmarking GroebnerWalk") - ideals = [] - for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :pertubed, i)) - end - - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :standard)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :generic)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_lex)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :fractal_combined)) - push!(ideals, groebnerwalk(I, StartOrd, TarOrd, :tran)) - - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(ideal)]), - complete_reduction = true, - ) - - df = DataFrame(test1 = ["-"], test2 = ["-"], example = ["-"]) - savea(df, "correct") - - println("Benchmarking ideals") - for id in ideals - a = Singular.isequal( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - b = "-" - df = DataFrame(a = [a], b = [b], c = [v]) - savea(df, "correct") - end -end diff --git a/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl b/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl deleted file mode 100644 index 6c79b4f69..000000000 --- a/src/GroebnerWalkFinal/Benchmarking/runbenchmark2.jl +++ /dev/null @@ -1,120 +0,0 @@ -using BenchmarkTools - - -function runb2( - v::String, - ideal::Singular.sideal, - S::Singular.PolyRing, - StartOrd::Matrix{Int64}, - TarOrd::Matrix{Int64}, -) - println("starting Benchmark2") - - - println("Computing deglex-Basis") - stime = - @belapsed Singular.std($ideal, complete_reduction = true) evals = 5 samples = - 1 - I = Singular.std(ideal, complete_reduction = true) - ideals = [] - println("Benchmarking groebnerwalk2") - pertubed2 = "-" - pertubed3 = "-" - pertubed4 = "-" - pertubed5 = "-" - pertubed6 = "-" - pertubed7 = "-" - pertubed8 = "-" - pertubed9 = "-" - pertubed10 = "-" - for i = 2:nvars(S) - if i == 2 - pertubed2 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 3 - pertubed3 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 4 - pertubed4 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 5 - pertubed5 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 6 - pertubed6 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 7 - pertubed7 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 8 - pertubed8 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 9 - pertubed9 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - elseif i == 10 - pertubed10 = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:pertubed, $i) evals = - 1 samples = 1 - end - end - standard = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:standard) evals = 1 samples = - 1 - generic = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:generic) evals = 1 samples = - 1 - fractal = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal) evals = 1 samples = - 1 - fractallex = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_lex) evals = 1 samples = - 1 - fractallookahead = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_look_ahead) evals = - 1 samples = 1 - fractalcombined = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:fractal_combined) evals = - 1 samples = 1 - tran = - @belapsed groebnerwalk2($I, $StartOrd, $TarOrd, $:tran) evals = 1 samples = - 1 - - println("Computing lex-Basis") - ttime = @belapsed Singular.std( - Singular.Ideal($S, [change_ring(x, $S) for x in Singular.gens($ideal)]), - complete_reduction = true, - ) evals = 5 samples = 1 - - df = DataFrame( - example = [v], - standard = [standard], - pertubed2 = [pertubed2], - pertubed3 = [pertubed3], - pertubed4 = [pertubed4], - pertubed5 = [pertubed5], - pertubed6 = [pertubed6], - pertubed7 = [pertubed7], - pertubed8 = [pertubed8], - pertubed9 = [pertubed9], - pertubed10 = [pertubed10], - fractal = [fractal], - fractallex = [fractallex], - fractallookahead = [fractallookahead], - fractalcombined = [fractalcombined], - generic = [generic], - tran = [tran], - stime = [stime], - ttime = [ttime], - ) - savea(df, "CompareAlg") - -end diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 3774119bc..266136a95 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -162,7 +162,9 @@ function change_order( S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Singular.ordering_a(T.w) * Singular.ordering_a(T.t) * Singular.ordering_M(T.m), + ordering = Singular.ordering_a(T.w) * + Singular.ordering_a(T.t) * + Singular.ordering_M(T.m), ) return S end diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl index 9ee9a29d0..8a8fd326a 100644 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -29,9 +29,6 @@ function test(case::Int) :pertubed, 4, ) - - - @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), @@ -583,93 +580,105 @@ function test(case::Int) end - if case ==7 || case == 99 - dim = 4 - ve = [1, 1, 1, 1] - StartOrd = ordering_as_matrix(:degrevlex,dim) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c", "d"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - I = Singular.Ideal(R,[ 5+a^2*b+2*a*c^2+a^4+3*a^2*b*c,c+5*a*b+4*c^2+2*a*c*d+2*b^4+3*c^4+2*a*d^3]) - I = Singular.std(I, complete_reduction = true) - - - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 3, - ) - - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal, - ) - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_look_ahead, - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 2, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 3, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :generic, - ) - - - - #@time T0 = Singular.std( - # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - # complete_reduction = true, - #) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - - - - println("test tran: ", equalitytest(T6, T1)) - println("test fractal: ", equalitytest(T6, T2)) - println("test fractal: ", equalitytest(T6, T3)) - println("test pertubed: ", equalitytest(T5, T6)) - println("test standard: ", equalitytest(T4, T6)) - println("test generic: ", equalitytest(T6, T6)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end + if case == 7 || case == 99 + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + I = Singular.Ideal( + R, + [ + 5 + a^2 * b + 2 * a * c^2 + a^4 + 3 * a^2 * b * c, + c + + 5 * a * b + + 4 * c^2 + + 2 * a * c * d + + 2 * b^4 + + 3 * c^4 + + 2 * a * d^3, + ], + ) + I = Singular.std(I, complete_reduction = true) + + + + @time T = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3, + ) + + @time F = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal, + ) + @time FA = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_look_ahead, + ) + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 2, + ) + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3, + ) + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :generic, + ) + + + + #@time T0 = Singular.std( + # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + # complete_reduction = true, + #) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + + + + println("test tran: ", equalitytest(T6, T1)) + println("test fractal: ", equalitytest(T6, T2)) + println("test fractal: ", equalitytest(T6, T3)) + println("test pertubed: ", equalitytest(T5, T6)) + println("test standard: ", equalitytest(T4, T6)) + println("test generic: ", equalitytest(T6, T6)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end end println("All tests were: ", test_successfull) end diff --git a/src/GroebnerWalkFinal/UnitTests b/src/GroebnerWalkFinal/UnitTests index a1ef8ec8f..04572cfeb 100644 --- a/src/GroebnerWalkFinal/UnitTests +++ b/src/GroebnerWalkFinal/UnitTests @@ -5,148 +5,209 @@ include("Examples") @testset "UnitTests" begin @testset "Testing GroebnerwalkUtilitys" begin - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - - f1 = 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 - f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 - I = Singular.Ideal(R, [f1, f2]) - sol = [14 * x^2 * y^3, y^3 *z + 7*x^2*y^2*z^2] - @test initials(R, gens(I), [1,3,1]) == sol - - @test difference_lead_tail(I) == [[0, 3, -1],[0, 3, 0],[-1, 2, 0],[2, -1, 1],[0, 2, 0]] - - F = [13*x^3*z^2, 14*x^2*y^3, 98*x*y^5*z^2, y^7*z + x^2*z^3, 14*x*y^6*z] - g = y^7*z + x^2*z^3 + 28 *x^2 * y^4 - q = Array{Singular.elem_type(R),1}(undef, 5) - q[1] = R(0) - q[2] = R(2*y) - q[3] = R(0) - q[4] = R(1) - q[5] = R(0) - @test divalg(g,F,R) == q - - J = Singular.Ideal(R, [f2, f1]) - f1 = 4 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 - f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 - K = Singular.Ideal(R, [f1,f2]) - @test equalitytest(I,J) == true - @test equalitytest(I,K) == false - - @test deg(f1, 3) == 5 - - - id = trinks1() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int, dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - I= Singular.std(id, complete_reduction = true) - @test pertubed_vector(I,StartOrd, 1) == [1,1,1,1,1,1] - @test pertubed_vector(I,StartOrd, 2) == [4,4,4,4,4,3] - @test pertubed_vector(I,StartOrd, 3) == [49,49,49,49,48,42] - @test pertubed_vector(I,StartOrd, 4) == [1000,1000,1000,999,990,900] - @test pertubed_vector(I,TarOrd, 1) == [1,0,0,0,0,0] - @test pertubed_vector(I,TarOrd, 2) == [4,1,0,0,0,0] - @test pertubed_vector(I,TarOrd, 3) == [49,7,1,0,0,0] - @test pertubed_vector(I,TarOrd, 4) == [1000,100,10,1,0,0] - - @test inCone(I, StartOrd, [1000,1000,1000,999,990,900]) == true - @test inCone(I, StartOrd, [100,1000,1000,999,990,900]) == false - - - @test dot([1,2,3,4], [2,2,2,2]) == 20 - -end - -@testset "Testing FraktalWalkUtilitys" begin - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = 3 * x^2 - f2 = y^3 * z + 17 * x^2 * z^2 - I = Singular.Ideal(R, [f1,f2]) - f1 = 3 * x^2 - f2 = y^3 * z - J = Singular.Ideal(R, [f1,f2]) - - @test isMonomial(gens(I)) == false - @test isMonomial(gens(J)) == true - @test isbinomial(gens(I)) == true - @test isbinomial(gens(J)) == true - -end - -@testset "Testing GenericWalkUtilitys" begin - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), - ) - - - f1 = x^2-y^3 - f2 = x^3-y^2-x - I = Singular.Ideal(R, [f1,f2]) - G = Singular.std(I, complete_reduction = true) - - @test next_gamma(G,[0], ordering_as_matrix(:degrevlex, 2),ordering_as_matrix(:lex, 2)) == [-2,3] - - Rn, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 2)), - ) - g = [Rn(y^3 - x^2), Rn(x^3)] - @test facet_initials(Singular.Ideal(Rn,[change_ring(x, Rn) for x in gens(G)]), [change_ring(Singular.leading_term(g), Rn) for g in gens(G)], [-2,3]) == g - - @test difference_lead_tail(G,[Singular.leading_term(g) for g in gens(G)]) == [[-2,3],[3,-2],[2,0]] - - @test isParallel([1,2], [1,4]) == false - @test isParallel([1,2], [2,4]) == true - @test isParallel([-1, 0], [-2,1]) == false - @test isParallel([-1, 0], [2,0]) == true - - @test less_facet([-2,3],[-1,4], ordering_as_matrix(:degrevlex, 2),ordering_as_matrix(:lex, 2)) == true - @test less_facet([-1,7],[-1,4], ordering_as_matrix(:degrevlex, 2),ordering_as_matrix(:lex, 2)) == false - - dim = 5 - ve = [1, 1, 1, 1, 1] - StartOrd = ordering_as_matrix(:degrevlex,dim) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d, e) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c", "d", "e"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) -J = Singular.Ideal(R,[ b+3*b^3+2*b*c*e+5*b*d*e, -4+b^2+4*b*c+5*b^3+c*d*e, -d*e+5*b^2*e]) - I= Singular.std(J, complete_reduction = true) - f1 = R(a^3 +a^2 + b^5*a^3*c^9 +e^3 +b^2*a^2*c^4 +d^3 +e^3 + b^8*d^10*e^18) - f2 = R(a^3 *b^3) - f3 = R(a^2*b^4 +c^2 +a^3*4 +a*e^3) - f4 = R(0) - t = @timed modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) - println(t.time) - - - @test (reduce(f1, I), true) == modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f2, I), true) == modulo(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f3, I), true) == modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f4, I), false) == modulo(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) - J= Singular.std(J) - @test equalitytest(Singular.std(J, complete_reduction = true),Singular.Ideal(R,interreduce(collect(gens(J)), [Singular.leading_term(g) for g in gens(J)]))) - - -end + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + + f1 = 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 + I = Singular.Ideal(R, [f1, f2]) + sol = [14 * x^2 * y^3, y^3 * z + 7 * x^2 * y^2 * z^2] + @test initials(R, gens(I), [1, 3, 1]) == sol + + @test difference_lead_tail(I) == + [[0, 3, -1], [0, 3, 0], [-1, 2, 0], [2, -1, 1], [0, 2, 0]] + + F = [ + 13 * x^3 * z^2, + 14 * x^2 * y^3, + 98 * x * y^5 * z^2, + y^7 * z + x^2 * z^3, + 14 * x * y^6 * z, + ] + g = y^7 * z + x^2 * z^3 + 28 * x^2 * y^4 + q = Array{Singular.elem_type(R),1}(undef, 5) + q[1] = R(0) + q[2] = R(2 * y) + q[3] = R(0) + q[4] = R(1) + q[5] = R(0) + @test divalg(g, F, R) == q + + J = Singular.Ideal(R, [f2, f1]) + f1 = 4 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 + K = Singular.Ideal(R, [f1, f2]) + @test equalitytest(I, J) == true + @test equalitytest(I, K) == false + + @test deg(f1, 3) == 5 + + + id = trinks1() + R = base_ring(id) + dim = nvars(R) + ve = ones(Int, dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + I = Singular.std(id, complete_reduction = true) + @test pertubed_vector(I, StartOrd, 1) == [1, 1, 1, 1, 1, 1] + @test pertubed_vector(I, StartOrd, 2) == [4, 4, 4, 4, 4, 3] + @test pertubed_vector(I, StartOrd, 3) == [49, 49, 49, 49, 48, 42] + @test pertubed_vector(I, StartOrd, 4) == + [1000, 1000, 1000, 999, 990, 900] + @test pertubed_vector(I, TarOrd, 1) == [1, 0, 0, 0, 0, 0] + @test pertubed_vector(I, TarOrd, 2) == [4, 1, 0, 0, 0, 0] + @test pertubed_vector(I, TarOrd, 3) == [49, 7, 1, 0, 0, 0] + @test pertubed_vector(I, TarOrd, 4) == [1000, 100, 10, 1, 0, 0] + + @test inCone(I, StartOrd, [1000, 1000, 1000, 999, 990, 900]) == true + @test inCone(I, StartOrd, [100, 1000, 1000, 999, 990, 900]) == false + + + @test dot([1, 2, 3, 4], [2, 2, 2, 2]) == 20 + + end + + @testset "Testing FraktalWalkUtilitys" begin + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = 3 * x^2 + f2 = y^3 * z + 17 * x^2 * z^2 + I = Singular.Ideal(R, [f1, f2]) + f1 = 3 * x^2 + f2 = y^3 * z + J = Singular.Ideal(R, [f1, f2]) + + @test isMonomial(gens(I)) == false + @test isMonomial(gens(J)) == true + @test isbinomial(gens(I)) == true + @test isbinomial(gens(J)) == true + + end + + @testset "Testing GenericWalkUtilitys" begin + R, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), + ) + + + f1 = x^2 - y^3 + f2 = x^3 - y^2 - x + I = Singular.Ideal(R, [f1, f2]) + G = Singular.std(I, complete_reduction = true) + + @test next_gamma( + G, + [0], + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + ) == [-2, 3] + + Rn, (x, y) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 2)), + ) + g = [Rn(y^3 - x^2), Rn(x^3)] + @test facet_initials( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]), + [change_ring(Singular.leading_term(g), Rn) for g in gens(G)], + [-2, 3], + ) == g + + @test difference_lead_tail( + G, + [Singular.leading_term(g) for g in gens(G)], + ) == [[-2, 3], [3, -2], [2, 0]] + + @test isParallel([1, 2], [1, 4]) == false + @test isParallel([1, 2], [2, 4]) == true + @test isParallel([-1, 0], [-2, 1]) == false + @test isParallel([-1, 0], [2, 0]) == true + + @test less_facet( + [-2, 3], + [-1, 4], + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + ) == true + @test less_facet( + [-1, 7], + [-1, 4], + ordering_as_matrix(:degrevlex, 2), + ordering_as_matrix(:lex, 2), + ) == false + + dim = 5 + ve = [1, 1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d, e) = Singular.PolynomialRing( + Singular.QQ, + ["a", "b", "c", "d", "e"], + ordering = Singular.ordering_M(StartOrd), + ) + S = change_order(R, TarOrd) + J = Singular.Ideal( + R, + [ + b + 3 * b^3 + 2 * b * c * e + 5 * b * d * e, + 4 + b^2 + 4 * b * c + 5 * b^3 + c * d * e, + d * e + 5 * b^2 * e, + ], + ) + I = Singular.std(J, complete_reduction = true) + f1 = R( + a^3 + + a^2 + + b^5 * a^3 * c^9 + + e^3 + + b^2 * a^2 * c^4 + + d^3 + + e^3 + + b^8 * d^10 * e^18, + ) + f2 = R(a^3 * b^3) + f3 = R(a^2 * b^4 + c^2 + a^3 * 4 + a * e^3) + f4 = R(0) + t = @timed modulo( + f1, + gens(I), + [Singular.leading_term(g) for g in gens(I)], + ) + println(t.time) + + + @test (reduce(f1, I), true) == + modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f2, I), true) == + modulo(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f3, I), true) == + modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f4, I), false) == + modulo(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) + J = Singular.std(J) + @test equalitytest( + Singular.std(J, complete_reduction = true), + Singular.Ideal( + R, + interreduce( + collect(gens(J)), + [Singular.leading_term(g) for g in gens(J)], + ), + ), + ) + + + end end diff --git a/src/GroebnerWalkFinal/examplesFinal.jl b/src/GroebnerWalkFinal/examplesFinal.jl deleted file mode 100644 index 1bb829d4c..000000000 --- a/src/GroebnerWalkFinal/examplesFinal.jl +++ /dev/null @@ -1,37 +0,0 @@ -include("GroebnerWalkFinal.jl") - -#function test(case::Int) -test_successfull = true -#if case == 1 || case == 99 - -dim = 4 -ve = [1, 1, 1, 1] -StartOrd = ordering_as_matrix(:degrevlex, dim) -TarOrd = ordering_as_matrix(:lex, dim) -R, (a, b, c, d) = Singular.PolynomialRing( - Singular.N_ZpField(32003), - ["a", "b", "c", "d"], - ordering = Singular.ordering_M(StartOrd), -) -S = change_order(R, TarOrd) - -I = Singular.std( - Singular.Ideal( - R, - [ - 5 + a^2 * b + 2 * a * c^2 + a^4 + 3 * a^2 * b * c, - c + - 5 * a * b + - 4 * c^2 + - 2 * a * c * d + - 2 * b^4 + - 3 * c^4 + - 2 * a * d^3, - ], - ), - complete_reduction = true, -) -println(I) -println(groebnerwalk(I, StartOrd, TarOrd, :pertubed, 4)) -# end -#end diff --git a/src/GroebnerWalkFinal/tests b/src/GroebnerWalkFinal/tests index c7c8a70a1..2315a0f62 100644 --- a/src/GroebnerWalkFinal/tests +++ b/src/GroebnerWalkFinal/tests @@ -73,7 +73,7 @@ using Test end end - let id = cohn4() + let id = katsura5() R = base_ring(id) dim = nvars(R) ve=ones(Int64,dim) diff --git a/src/Groebnerwalk/AlternativeAlgorithm.jl b/src/Groebnerwalk/AlternativeAlgorithm.jl deleted file mode 100644 index 3035f65f0..000000000 --- a/src/Groebnerwalk/AlternativeAlgorithm.jl +++ /dev/null @@ -1,168 +0,0 @@ -counterFr = 0 -counterFrFin = false -function deleteCounterFr() - global counterFr - temp = counterFr - counterFr = 0 - global counterFrFin = false - return temp -end -function getCounterFr() - global counterFr - return counterFr -end -function raiseCounterFr(std::Bool = false) - global counterFrFin - if !counterFrFin || std - counterFrFin = true - global counterFr = getCounterFr() + 1 - return true - end - return false -end -function resetCounterFr() - global counterFrFin = false -end - -PVecs = [] -P = Singular.sideal -function checkPvecs() - global PVecs - println(PVecs) -end - -sigma = [] -function alternative_algorithm_top( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - println("FractalWalk_lookahead results") - println("Crossed Cones in: ") - R = base_ring(G) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - - Gb = alternative_algorithm(G, S, T, PVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end -function alternative_algorithm( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - term = false - G.isGB = true - cweight = S.w - - while !term - println("d") - w = nextW_2(G, cweight, PVecs[p]) - println("e") - if (w == [0]) - if inCone(G, T, PVecs[p]) - println("f") - if raiseCounterFr() - println(PVecs[p], " in depth", p) - end - return G - else - println("g") - global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] - #checkPvecs() - continue - end - end - println("c") - T.w = w - Rn, V = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - bin = isBinomial(Gw) - if p > 3 || bin - if bin - Gnew = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr(true) - elseif p > 3 - Gnew = generic_walk(Singular.Ideal(R, [x for x in Gw]), S.m, T.m) - println(w, " in depth", p) - raiseCounterFr(true) - end - else - println("up in: ", p, " with: ", w) - resetCounterFr() - Gnew = alternative_algorithm( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PVecs, - p + 1, - ) - end - G = liftGWfr(G, Gnew, R, Rn) - println("k") - G = Singular.std(G, complete_reduction = true) - println("a") - R = Rn - println("b") - S = T - cweight = w - end - return G -end - -function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R, V = change_order(G.base_ring, T) - - v = nextV(G, [0], S, T) - lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - - println("GenericWalk results") - println("Crossed Cones with facetNormal: ") - while !isempty(v) - global counter = getCounter() + 1 - println(v) - G, lm = generic_step(G, R, v, T, lm) - #@info "Current Gröbnerbase: " G - #println("nextv") - v = nextV(G, lm, v, S, T) - end - return G -end - -function generic_step( - G::Singular.sideal, - S::Singular.PolyRing, - v::Vector{Int64}, - T::Matrix{Int64}, - lm::Vector{Singular.spoly{L}}, -) where {L<:Nemo.RingElem} - - R = Singular.base_ring(G) - - #println("initials") - facet_Generators = facet_initials(S, G, v, lm) - #println("std") - facet_Ideal = Singular.std( - Singular.Ideal(S, [S(x) for x in facet_Generators]), - complete_reduction = true, - ) - - #println("liftgeneric") - liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) - - Gnew = Singular.Ideal(S, [x for x in liftArray]) - - #println("interred") - Gnew = interreduce_generic(Gnew, Newlm) - Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) - Gnew.isGB = true - return Gnew, Newlm -end diff --git a/src/Groebnerwalk/FractalWalkUtilitys.jl b/src/Groebnerwalk/FractalWalkUtilitys.jl deleted file mode 100644 index f088b1acf..000000000 --- a/src/Groebnerwalk/FractalWalkUtilitys.jl +++ /dev/null @@ -1,203 +0,0 @@ -include("GroebnerWalkUtilitys.jl") - -#Solves problems with weight vectors of floats. -function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int64}() - for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) - end - return w -end - -#Checks if a weight vector t is in the cone of the ordering T w.r.t. an ideal. -function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64}) - R, V = change_order(G.base_ring, T.t, T.m) - I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end -#= -function inCone(G::Singular.sideal, T::MonomialOrder{Matrix{Int64}, Vector{Int64}},t::Vector{Int64},c::Vector{Int64}) - R, V = change_order(G.base_ring, t, T.m) - I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), c)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end=# - -#return a copy of the PolynomialRing I, equipped with the ordering represented by T. -function change_order( - R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int64}, Vector{Int64}}, -) where {L<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(T.w)* - Singular.ordering_M(T.m), - ) -#= S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(T.t) *Singular.ordering_a(T.w)* - Singular.ordering_M(T.m) - ) - return S, H - =# -end - - -function liftGWfr(G::Singular.sideal, Gw::Singular.sideal, R::Singular.PolyRing, S::Singular.PolyRing) - G.isGB = true -rest = [ - change_ring(gen, S) - change_ring(Singular.reduce(change_ring(gen, R), G), S) - for gen in Singular.gens(Gw) -] -G = Singular.Ideal(S, [S(x) for x in rest]) -G.isGB = true -return G -end - -#returns ´true´ if all polynomials of the array are monomials. -function ismonomial(Gw::Vector{spoly{L}})where {L<:Nemo.RingElem} - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 1 - return false - end - end - return true -end - -#returns ´true´ if all polynomials of the array are binomial or less. -function isBinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 - return false - end - end - return true -end - -#= -The version of Cox, O´shea and Fukuda et al. is limited because it returns 1 -if there are no more cones to cross and when the target vector lays on a facet. -function nextw_fr( - G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} -if (cweight == tweight) - return [0] -end - tv = [] - for v in diff_vectors(G) - tw = dot(tweight, v) - if tw < 0 - push!(tv, dot(cweight, v) // (dot(cweight, v) - tw)) - end - end - push!(tv, 1) - t = minimum(tv) - if (0 == numerator(t)) - filter!(x -> (numerator(x) > 0 && x!=1), tv) - if isempty(tv) - return[0] - else - t = minimum(tv) - end - end - if (t == 1) - return tweight - end - w = (1 - t) * cweight + t * tweight - return convertBoundingVector(w) -end -=# - -function diff_vectors_lt(I::Singular.sideal) - zip = [] - v = [] - for g in gens(I) - ltu = Singular.leading_exponent_vector(g) - for e in Singular.exponent_vectors(tail(g)) - push!(v, (ltu .- e)) - end - push!(zip, (unique(v), ltu)) - v = [] - end - return zip -end - -#Computes next weight vector. Version used in Amrhein Gloor. -function nextW_2(G::Singular.sideal, - w::Array{T,1}, - tau::Array{K,1}, - ) where {T<:Number,K<:Number} - if (w == tau) - return [0] - end - -tmin = 2 -t = 0 - for g in gens(G) - a = Singular.leading_exponent_vector(g) - d = Singular.exponent_vectors(tail(g)) - for v in d - frac = (dot(w,a)- dot(w,v) + dot(tau,v) - dot(tau, a)) - if frac != 0 - t = (dot(w,a) - dot(w,v)) // frac - end - if t > 0 && t < tmin - tmin = t - end - end - end - - if tmin <= 1 - w = w + tmin * (tau - w) -else - return [0] -end - return convertBoundingVector(w) - end - function nextT(G::Singular.sideal, - w::Array{T,1}, - tau::Array{K,1}, - ) where {T<:Number,K<:Number} - if (w == tau) - return [0] - end - - tmin = 2 - t = 0 - for g in gens(G) - a = Singular.leading_exponent_vector(g) - d = Singular.exponent_vectors(tail(g)) - for v in d - frac = (dot(w,a)- dot(w,v) + dot(tau,v) - dot(tau, a)) - if frac != 0 - t = (dot(w,a) - dot(w,v)) // frac - end - if t > 0 && t < tmin - tmin = t - end - end - end - - if tmin <= 1 - return tmin - else - return [0] - end - end diff --git a/src/Groebnerwalk/GWtest.jl b/src/Groebnerwalk/GWtest.jl deleted file mode 100644 index 2999b3f77..000000000 --- a/src/Groebnerwalk/GWtest.jl +++ /dev/null @@ -1,559 +0,0 @@ -include("GroebnerWalk.jl") - -function test(case::Int) - - test_successfull = true - -if case == 1 || case == 99 - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), - ) - - f1 = x^2 - y^3 - f2 = x^3 - y^2 - x - I = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :tran, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :fractal - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :fractal_walk_lookahead, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :standard, - ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :pertubed, - 2, - ) - - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :generic, - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) - - - if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) - test_successfull = false - end -end - -if case == 2 || case == 99 - - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([5, 4, 1], :deglex)), - ) - - f1 = x^2 - y - f2 = y^2 - x * z - y * z - I = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(I, complete_reduction = true) - @time H = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :tran, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :fractal, - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :fractal_walk_lookahead, - ) - @time K = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :pertubed, - 3, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :standard, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :generic, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), - ) - - - T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equalitytest(T4, T0)) - - - if !(equalitytest(T2, T1) && equalitytest(T3, T4) && equalitytest(T0, T5)) - test_successfull = false - end -end - - -if case == 3 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - - f1 = y^4 + y * z^2 - u^2 * w - f2 = 2 * x^2 * y + x^3 * w * u^2 + x - f3 = 2 - 3 * x^2 * v * z^4 * w - I = Singular.Ideal(R, [f1, f2, f3]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) - #= @time J = fractal_walk( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - ) =# - - - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_walk_lookahead, - ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - #println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equal(T4, T0)) - - if !( - equalitytest(T2, T0) && - equalitytest(T3, T0) && - equalitytest(T0, T5) && - Singular.equal(T0, T4) - ) - test_successfull = false - end - -end -if case == 4 || case == 99 - R, (q, c, p, d) = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), - ) - - - f1 = - 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + - c^2 * q^2 + - 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - 8 * p + - c^2 + - 4 * d^2 - 2 * q + - 10 * p^2 + - 2 - f2 = - 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - - 3 * p * q * c + 4 * c - f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q - f4 = - 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + - 3 * c^2 + - 9 * p^2 * d^2 + - 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + - 12 * d^2 + - 4 * p^2 + - 12 * c * d * p + - 12 * c * d * q + - 12 * c * d * p * q - 12 * c * d - I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :tran, - ) - @time J = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :fractal, - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :fractal_walk_lookahead, - ) - - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :pertubed, - 4, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :standard, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :generic, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal: ", equalitytest(T0, T1)) - println("test fractal2: ", equalitytest(T0, T5)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", Singular.equal(T4, T0)) - - - if !( - equalitytest(T2, T1) && - equalitytest(T3, T0) && - equalitytest(T0, T5) && - Singular.equal(T0, T4) - ) - test_successfull = false - end -end - -if case == 5 || case == 99 - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 - f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 - f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 - I = Singular.Ideal(R, [f1, f2, f3]) - - I = Singular.std(I, complete_reduction = true) - - S, V = - Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) - - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :tran - ) - @time J = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal, - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_walk_lookahead, - ) - - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :standard, - ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :pertubed, - 3, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :generic, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", Singular.equal(T4, T0)) - - - if !( - equalitytest(T2, T1) && - equalitytest(T3, T0) && - equalitytest(T0, T5) && - Singular.equal(T0, T4) - ) - test_successfull = false - end - -end - - - -if case == 6 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - - f1 = 2*w*y + 2*v*z+u^2 + x^2+x - f2 = 2* w*z+2*v*u+2*y*x+y - f3 = 2*w*u + v^2 + 2*z*x+z+y^2 - f4= 2*w*v + 2*u*x+u+2*z*y - f5= w^2 + 2*v*x + v + 2*u*y + z^2 - f6= 2*w*x + w+2*v*y + 2*u*z - I = Singular.Ideal(R, [f1, f2, f3, f4,f5,f6]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) - #= @time J = fractal_walk( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - ) =# - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_walk_lookahead, - ) - - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 6, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal2, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - #println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equal(T4, T0)) - println(T3) - println(T5) - println(T0) - - if !( - equalitytest(T2, T0) && - equalitytest(T3, T0) && - equalitytest(T0, T5) && - Singular.equal(T0, T4) - ) - test_successfull = false - end - -end -println("All tests were: ", test_successfull) -end diff --git a/src/Groebnerwalk/GenericWalkUtilitys.jl b/src/Groebnerwalk/GenericWalkUtilitys.jl deleted file mode 100644 index cd5370055..000000000 --- a/src/Groebnerwalk/GenericWalkUtilitys.jl +++ /dev/null @@ -1,383 +0,0 @@ -include("GroebnerWalkUtilitys.jl") - -############################################################### -#Utilitys for generic_walk -############################################################### - -#Return the facet_initials of polynomials w.r.t. a weight vector. -function facet_initials( - R::Singular.PolyRing, - G::Singular.sideal, - v::Vector{Int64}, - lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} - inits = [] - count = 1 - for g in Singular.gens(G) - inw = Singular.MPolyBuildCtx(R) - el = first(Singular.exponent_vectors(lm[count])) - for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - if el == e || isparallel(el - e, v) - Singular.push_term!(inw, c, e) - end - end - h = finish(inw) - push!(inits, h) - count += 1 - - end - #@info "Facet Initials: " inits - return inits -end - -# -function isparallel(u::Vector{Int64}, v::Vector{Int64}) - count = 1 - x = 0 - for i = 1:length(u) - if u[i] == 0 - if v[count] == 0 - count += +1 - else - return false - end - else - x = v[count] // u[i] - count += 1 - break - end - end - if count > length(v) - return true - end - for i = count:length(v) - if v[i] != x * u[i] - return false - end - end - return true -end - -#lifting step of the generic_walk -function liftgeneric( - G::Singular.sideal, - Lm::Vector{Singular.spoly{L}}, - H::Singular.sideal, -) where {L<:Nemo.RingElem} - S = base_ring(G) - Newlm = Array{Singular.elem_type(S),1}(undef, 0) - liftArray = Array{Singular.elem_type(S),1}(undef, 0) - for g in Singular.gens(H) - r, b = reducegeneric_recursiv(g, gens(G), Lm, S) - diff = g - r - if diff != 0 - push!(Newlm, Singular.leading_term(g)) - push!(liftArray, diff) - end - end - return liftArray, Newlm, S -end - -#removes polynomials with zero coefficients. -function check_zeros( - G::Vector{spoly{L}}, - Lm::Vector{spoly{L}}, - S::Singular.PolyRing, -) where {L<:Nemo.RingElem} - - lmfin = Array{Singular.elem_type(S),1}(undef, 0) - Gfin = Array{Singular.elem_type(S),1}(undef, 0) - for lm in Lm - if lm != 0 - push!(lmfin, lm) - end - end - for g in G - if g != 0 - push!(Gfin, g) - end - end - return Gfin, lmfin -end - - -function filter_btz(S::Matrix{Int64}, V::Vector{Vector{Int64}}) - btz = Set{Vector{Int64}}() - for v in V - if bigger_than_zero(S, v) - push!(btz, v) - end - end - return btz -end - -function filter_ltz(S::Matrix{Int64}, V::Set{Vector{Int64}}) - btz = Set{Vector{Int64}}() - for v in V - if less_than_zero(S, v) - push!(btz, v) - end - end - return btz -end -function filter_lf( - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, - V::Set{Vector{Int64}}, -) - btz = Set{Vector{Int64}}() - for v in V - if less_facet(w, v, S, T) - push!(btz, v) - end - end - return btz -end - -#return the next facet_normal. -function nextV( - G::Singular.sideal, - Lm::Vector{spoly{L}}, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) where {L<:Nemo.RingElem} - V = filter_btz(S, diff_vectors(G, Lm)) - #@info "#1 Current V: " V - - V = filter_ltz(T, V) - #@info "#2 Current V: " V - - if (w != [0]) - V = filter_lf(w, S, T, V) - end - #@info "#3 Current V: " V - if isempty(V) - return V - end - - minV = first(V) - for v in V - if less_facet(v, minV, S, T) - minV = v - end - end - - #@info "#4 Current V: " minV - return minV -end - -#return the next facet_normal. -function nextV( - G::Singular.sideal, - w::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - V = filter_btz(S, diff_vectors(G)) - #@info "#1 Current V: " V - - V = filter_ltz(T, V) - #@info "#2 Current V: " V - - if (w != [0]) - V = filter_lf(w, S, T, V) - end - #@info "#3 Current V: " V - if isempty(V) - return V - end - - minV = first(V) - for v in V - if less_facet(v, minV, S, T) - minV = v - end - end - - #@info "#4 Current V: " minV - return minV -end - -function bigger_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - for i = 1:size(M)[1] - d = dot(M[i, :], v) - if d != 0 - return d > 0 - end - end - return false -end - -function less_than_zero(M::Matrix{Int64}, v::Vector{Int64}) - nrows, ncols = size(M) - for i = 1:nrows - d = 0 - for j = 1:ncols - @inbounds d += M[i, j] * v[j] - #d = dot(M[i, :], v) - end - if d != 0 - return d < 0 - end - end - return false -end - -function less_facet( - u::Vector{Int64}, - v::Vector{Int64}, - S::Matrix{Int64}, - T::Matrix{Int64}, -) - for i = 1:size(T)[1] - for j = 1:size(S)[1] - Tuv = dot(T[i, :], u) * dot(S[j, :], v) - Tvu = dot(T[i, :], v) * dot(S[j, :], u) - if Tuv != Tvu - return Tuv < Tvu - end - end - end - return false -end - -#returns divrem() -function divrem_generic( - p::Singular.spoly, - lm::Singular.spoly, - S::Singular.PolyRing, -) - div = false - newpoly = Singular.MPolyBuildCtx(S) - for term in Singular.terms(p) - (b, c) = Singular.divides(term, lm) - if b - push_term!( - newpoly, - first(Singular.coefficients(c)), - first(Singular.exponent_vectors(c)), - ) - div = true - end - end - return (finish(newpoly), div) -end - -function reducegeneric_recursiv( - p::Singular.spoly, - G::Vector{spoly{L}}, - Lm::Vector{spoly{L}}, - R::Singular.PolyRing, - c::Bool = false, -) where {L<:Nemo.RingElem} - I = 0 - Q = zero(R) - for i = 1:length(G) - (q, b) = divrem_generic(p, Lm[i], R) - if b - I = i - Q = q - break - end - end - if I != 0 - r, b = reducegeneric_recursiv(p - (Q * G[I]), G, Lm, R) - return r, true - else - return p, false - end -end -function subtractTerms( - p::Singular.spoly{L}, - q::Singular.spoly{L}, - dim::Int64, -) where {L<:Nemo.RingElem} - sol = MPolyBuildCtx(parent(p)) - ep = collect(Singular.exponent_vectors(p)) - eq = collect(Singular.exponent_vectors(q)) - cp = collect(Singular.coefficients(p)) - cq = collect(Singular.coefficients(q)) - for j = 1:length(ep) - fin = true - for k = 1:length(eq) - equals = true - if ep[j] != eq[k] - equals = false - end - if equals - diff = cp[j] - cq[k] - if diff != 0 - Singular.push_term!(sol, diff, ep[j]) - end - fin = false - eq[k][1] = -1 #delete Vector if equal - break - end - end - if fin - Singular.push_term!(sol, cp[j], ep[j]) - end - end - for i = 1:length(eq) - if eq[i][1] != -1 - Singular.push_term!(sol, -cq[i], eq[i]) - end - end - h = Singular.finish(sol) - return h -end - -function interreduce_generic( - G::Singular.sideal, - Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} - R = Singular.base_ring(G) - gens = collect(Singular.gens(G)) - changed = true - while changed - changed = false - for i = 1:Singular.ngens(G) - gensrest = Array{Singular.elem_type(R),1}(undef, 0) - Lmrest = Array{Singular.elem_type(R),1}(undef, 0) - for j = 1:Singular.ngens(G) - if i != j - push!(gensrest, gens[j]) - push!(Lmrest, Lm[j]) - end - end - r, b = reducegeneric_recursiv(gens[i], gensrest, Lmrest, R) - if b - changed = true - gens[i] = r - break - end - end - end - return Singular.Ideal(R, [R(p) for p in gens]) -end - #= -function interredLc( - p::Singular.spoly, - lm::Singular.spoly, - S::Singular.PolyRing, -) - newpoly = Singular.MPolyBuildCtx(S) - newpoly2 = Singular.MPolyBuildCtx(S) - c = first(Singular.coefficients(lm)) - if c != 1 - println("after:", c) - for term in Singular.terms(p) - cp = first(Singular.coefficients(term)) - push_term!( - newpoly, - div(cp,c), - first(Singular.exponent_vectors(term)), - ) - end - return finish(newpoly) -end -return p -end -=# diff --git a/src/Groebnerwalk/GroebnerWalk.jl b/src/Groebnerwalk/GroebnerWalk.jl deleted file mode 100644 index b94003ae2..000000000 --- a/src/Groebnerwalk/GroebnerWalk.jl +++ /dev/null @@ -1,669 +0,0 @@ -include("GroebnerWalkUtilitys.jl") -include("FractalWalkUtilitys.jl") -include("GenericWalkUtilitys.jl") -include("StandardWalkUtilitys.jl") -include("TranWalkUtilitys.jl") -include("AlternativeAlgorithm.jl") - - - -export groebnerwalk - -############################################################### -#Implementation of the gröbner walk. -############################################################### - -#for counting the steps of the groebnerwalk. -counter = 0 -function getCounter() - global counter - temp = counter - counter = 0 - return temp -end - -#Top-level function -function groebnerwalk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - grwalktype::Symbol = :standard, - k::Int64 = 0, -) - - if grwalktype == :standard - walk = (x, y, z) -> standard_walk(x, y, z) - elseif grwalktype == :generic - walk = (x, y, z) -> generic_walk(x, y, z) - elseif grwalktype == :pertubed - walk = (x, y, z) -> pertubed_walk(x, y, z, k) - elseif grwalktype == :fractal - walk = - (x, y, z) -> fractal_walk( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal2 - walk = - (x, y, z) -> fractal_walk2( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal3 - walk = - (x, y, z) -> fractal_walk3( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :fractal_walk_lookahead - walk = - (x, y, z) -> fractal_walk_lookahead( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - elseif grwalktype == :tran - walk = (x, y, z) -> tran_walk(x, y, z) - elseif grwalktype == :alternative - walk = (x,y,z) -> alternative_algorithm_top( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) - end - - ######TODO:Check the parameter##### - R = base_ring(G) - I = Singular.Ideal(R, [R(x) for x in gens(G)]) - - Gb = walk(I, S, T) - println("Cones crossed: ", getCounter()) - - S, V = change_order(Gb.base_ring, T) - return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) -end - - -############################################################### -#Standard-version of the groebner walk by Collart et al. -############################################################### -function standard_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - cweight = S[1, :] - tweight = T[1, :] - println("Standardwalk results") - println("Crossed Cones in: ") - - standard_walk(G, S, T, cweight, tweight) -end - -function standard_walk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - cweight::Vector{Int64}, - tweight::Vector{Int64}, -) - - #loop - term = false - while !term - G = standard_step(G, cweight, tweight, T) - println(cweight) - global counter = getCounter() + 1 - if cweight == tweight - term = true - else - cweight = nextw(G, cweight, tweight) - end - end - return G -end - -function standard_step( - G::Singular.sideal, - cw::Array{Int64,1}, - tw::Array{Int64,1}, - T::Matrix{Int64}, -) - R = base_ring(G) - S, V = change_order(R, cw, T) - - #taking initials - inwG = initials(S, gens(G), cw) - inwG2 = initials2(R, gens(G), cw) - - #Initial Ideal - IinwG = Singular.std( - Singular.Ideal(S, [S(x) for x in inwG]), - complete_reduction = true, - ) - - #Lifting to GB of new cone - #Gnew = liftGW(G, IinwG, R, S) - @time Gnew = liftGW2(G,inwG2, IinwG, R, S) - - #Interreduce - return Singular.std(Gnew, complete_reduction = true) -end - -############################################################### -#Generic-version of the groebner walk by Fukuda et al. (2007) -############################################################### - - -function generic_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - R, V = change_order(G.base_ring, T) - - v = nextV(G, [0], S, T) - lm = [change_ring(Singular.leading_term(g), R) for g in gens(G)] - G = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - - println("GenericWalk results") - println("Crossed Cones with facetNormal: ") - while !isempty(v) - global counter = getCounter() + 1 - println(v) - G, lm = generic_step(G, R, v, T, lm) - println(ngens(G)) - #@info "Current Gröbnerbase: " G - #println("nextv") - v = nextV(G, lm, v, S, T) - end - return interreduce(G) -end - -function generic_step( - G::Singular.sideal, - S::Singular.PolyRing, - v::Vector{Int64}, - T::Matrix{Int64}, - lm::Vector{Singular.spoly{L}}, -) where {L<:Nemo.RingElem} - - R = Singular.base_ring(G) - - #println("initials") - facet_Generators = facet_initials(S, G, v, lm) - #println("std") - facet_Ideal = Singular.std( - Singular.Ideal(S, [S(x) for x in facet_Generators]), - complete_reduction = true, - ) - - #println("liftgeneric") - liftArray, Newlm = liftgeneric(G, lm, facet_Ideal) - Gnew = Singular.Ideal(S, [x for x in liftArray]) - - #println("interred") - Gnew = interreduce_generic(Gnew, Newlm) - Gnew = Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) - Gnew.isGB = true - return Gnew, Newlm -end - - -############################################################### -#Pertubed-version of the groebner walk Amrhein et al. -############################################################### -function pertubed_walk( - G::Singular.sideal, - S::Matrix{Int64}, - T::Matrix{Int64}, - p::Int64, -) - #sweight = pert_Vectors(G, S, p) - sweight = S[1,:] - Gnew = G - #loop - term = false - println("PertubedWalk results") - println("Crossed Cones in: ") - - while !term - #test = [pert_Vectors(Gnew, T, i) for i = 1:p] - tweight = pert_Vectors(Gnew, T, p) - Gnew = standard_walk(Gnew, S, T, sweight, tweight) - if inCone(Gnew, T, tweight) - term = true - else - if p == 1 - R, V = change_order(Gnew.base_ring, T) - Gnew = - Singular.Ideal(R, [change_ring(x, R) for x in gens(Gnew)]) - Gnew = Singular.std(Gnew, complete_reduction = true) - term = true - end - p = p - 1 - sweight = tweight - end - end - return Gnew -end - -############################################################### -#fractal-walk by Amrhein et al. -#Inlcuding: -#fractal_walk -> standard-version -#fractal_walk2 -> checks if the starting weight is in the inner of a cone. -#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. -# checks if the starting weight is in the inner of a cone. -############################################################### - -######################################## -#Counter for the steps in the fractalwalk -######################################## -counterFr = 0 -counterFrFin = false -function deleteCounterFr() - global counterFr - temp = counterFr - counterFr = 0 - global counterFrFin = false - return temp -end -function getCounterFr() - global counterFr - return counterFr -end -function raiseCounterFr(std::Bool = false) - global counterFrFin - if !counterFrFin || std - counterFrFin = true - global counterFr = getCounterFr() + 1 - return true - end - return false -end -function resetCounterFr() - global counterFrFin = false -end - -PVecs = [] -P = Singular.sideal -function checkPvecs() - global PVecs - println(PVecs) -end - -sigma = [] -#= -function getSigma() - global sigma - return sigma -end =# - - -function fractal_walk( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) -R= base_ring(G) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - println("FacrtalWalk_standard results") - println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S, T, S.w, PVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - s::Vector{Int64}, - PVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = base_ring(G) - term = false - G.isGB = true - cweight = s - - while !term - if p == 1 - global P = G - end - #w = nextW_2(G, cweight, PVecs[p]) - t = nextT(G,cweight,PVecs[p]) - if (t == [0]) - #Look up if inCone is special for a deeper step - if inCone(G, T, PVecs[p]) - if raiseCounterFr() - println(PVecs[p], " in depth", p) - end - return G - else - global P - #global PVecs = [pert_Vectors(P, T, 2, i) for i = 1:nvars(R)] - global PVecs = [representationVector(G, T.m) for i = 1:nvars(R)] - - println(PVecs) - continue - end - end - w = cweight + t * (PVecs[p] - cweight) - w = convertBoundingVector(w) - T.w = w - Rn, V = change_order(R, T) - Gw = initials(R, gens(G), w) - - if p == nvars(R) - Gnew = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr(true) - else - println("counter") - resetCounterFr() - println("up in: ", p, " with: ", w) - - Gnew = fractal_recursiv( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - s, - PVecs, - p + 1, - ) - resetCounterFr() - - end - G = liftGWfr(G, Gnew, R, Rn) - G = Singular.std(G, complete_reduction = true) - R = Rn - S = T - cweight = w - end - - return G -end - -cwPert = [] -firstStepMode = false -function cwpert(p::Int64) - cwPert[p] -end - -function fractal_walk2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - global sigma = S.w - println("FractalWalk_withStartorder results") - println("Crossed Cones in: ") - Gb = fractal_recursiv2(G, S, T, PVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv2( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - term = false - G.isGB = true - if (p == 1) - if !ismonomial(initials(R, Singular.gens(G), S.w)) - println("nomonomial") - global cwPert = [pert_Vectors(G, S, S.w, i) for i = 1:nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - cweight = cwPert[p] - else - cweight = S.w - end - - while !term - w = nextW_2(G, cweight, PVecs[p]) - if w == [0] - - if inCone(G, T, PVecs[p]) - if raiseCounterFr() - println(PVecs[p], " in depth", p) - end - return G - else - global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] - continue - end - end - T.w = w - Rn, V = change_order(R, T) - Gw = initials(R, gens(G), w) - if p == Singular.nvars(R) - Gnew = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr(true) - #println("Computed Gröbnerbase: ", w, "in depth: ", p) - - else - Gnew = fractal_recursiv2( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PVecs, - p + 1, - ) - resetCounterFr() - - global firstStepMode = false - end - - G = liftGWfr(G, Gnew, R, Rn) - G = Singular.std(G, complete_reduction = true) - R = Rn - S = T - cweight = w - end - return G -end -function fractal_walk3( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(base_ring(G))] - println("FractalWalk_withStartorderLex results") - println("Crossed Cones in: ") - Gb = fractal_recursiv3(G, S, T, PVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv3( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - term = false - G.isGB = true - if (p == 1) - if !ismonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = - [pert_Vectors(G, S, S.w, i) for i = 1:Singular.nvars(R)] - global firstStepMode = true - end - end - if firstStepMode - #cweight = cwPert[p] - cweight = S.w - else - cweight = S.w - end - - #println(cwPert) - while !term - w = nextW_2(G, cweight, PVecs[p]) - #println(cweight, w) - - if (p == 1 && w == PVecs[p]) - p = p + 1 - end - if w == [0] - - if inCone(G, T, PVecs[p]) - if raiseCounterFr() - println(PVecs[p], " in depth", p) - end - return G - else - global PVecs = - [pert_Vectors(G, T, 2, i) for i = 1:Singular.nvars(R)] - continue - end - end - T.w = w - Rn, V = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if p == Singular.nvars(R) - Gnew = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr(true) - #println("Computed Gröbnerbase: ", w, "in depth: ", p) - - else - resetCounterFr - Gnew = fractal_recursiv3( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PVecs, - p + 1, - ) - global firstStepMode = false - end - - G = liftGWfr(G, Gnew, R, Rn) - G = Singular.std(G, complete_reduction = true) - R = Rn - S = T - cweight = w - end - return G -end -function fractal_walk_lookahead( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, -) - println("FractalWalk_lookahead results") - println("Crossed Cones in: ") - R = base_ring(G) - global PVecs = [pert_Vectors(G, T, i) for i = 1:nvars(R)] - - Gb = fractal_recursiv_lookahead(G, S, T, PVecs, 1) - println("Cones crossed: ", deleteCounterFr()) - return Gb -end - -function fractal_recursiv_lookahead( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int64},Vector{Int64}}, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - PVecs::Vector{Vector{Int64}}, - p::Int64, -) - R = Singular.base_ring(G) - term = false - G.isGB = true - cweight = S.w - - while !term - w = nextW_2(G, cweight, PVecs[p]) - if (w == [0]) - if inCone(G, T, PVecs[p]) - if raiseCounterFr() - println(PVecs[p], " in depth", p) - end - return G - else - global PVecs = [pert_Vectors(G, T, 2, i) for i = 1:nvars(R)] - #checkPvecs() - continue - end - end - T.w = w - Rn, V = change_order(R, T) - Gw = initials(R, Singular.gens(G), w) - if (p == Singular.nvars(R) || isBinomial(Gw)) - Gnew = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr(true) - else - println("up in: ", p, " with: ", w) - - resetCounterFr() - Gnew = fractal_recursiv_lookahead( - Singular.Ideal(R, [x for x in Gw]), - S, - T, - PVecs, - p + 1, - ) - end - - G = liftGWfr(G, Gnew, R, Rn) - G = Singular.std(G, complete_reduction = true) - R = Rn - S = T - cweight = w - end - return G -end - -############################################################### -#Tran-version of the groebner walk by Tran (2002) -############################################################### - -function tran_walk(G::Singular.sideal, S::Matrix{Int64}, T::Matrix{Int64}) - cweight = S[1, :] - tweight = T[1, :] - println("Tranwalk results") - println("Crossed Cones in: ") - - #loop - term = false - while !term - w = nextw(G, cweight, tweight) - if w == tweight - if inCone(G, T, cweight) - return G - else - if inSeveralCones(initials(base_ring(G),gens(G), w)) - tweight = representationVector(G, T) - continue - end - end - end - G = standard_step(G, w, tweight, T) - global counter = getCounter() + 1 - println(w) - cweight = w - end -end diff --git a/src/Groebnerwalk/GroebnerWalkUtilitys.jl b/src/Groebnerwalk/GroebnerWalkUtilitys.jl deleted file mode 100644 index 7ebf0e7d3..000000000 --- a/src/Groebnerwalk/GroebnerWalkUtilitys.jl +++ /dev/null @@ -1,539 +0,0 @@ -############################################################### -#Utilitys for Groebnerwalks -############################################################### - -#Return the initials of polynomials w.r.t. a weight vector. -function initials(R::Singular.PolyRing, G::Vector{spoly{n_Q}}, w::Vector{Int64}) - inits = spoly{elem_type(base_ring(R))}[] - indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] - for g in G - empty!(indexw) - maxw = 0 - eczip = zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - for (e, c) in eczip - tmpw = dot(w, e) - if maxw == tmpw - push!(indexw, (e, c)) - #rethink this. gens are preordered - elseif maxw < tmpw - empty!(indexw) - push!(indexw, (e, c)) - maxw = tmpw - end - end - inw = MPolyBuildCtx(R) - for (e, c) in indexw - Singular.push_term!(inw, c, e) - end - h = finish(inw) - push!(inits, h) - end - return inits -end -#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) -mutable struct MonomialOrder{ - T<:Matrix{Int64}, - v<:Vector{Int64}, - tv<:Vector{Int64}, -} - m::T - w::v - t::tv -end - -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. -function diff_vectors( - I::Singular.sideal, - Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} - v = Vector{Int}[] - for i = 1:ngens(I) - ltu = Singular.leading_exponent_vector(Lm[i]) - for e in Singular.exponent_vectors(gens(I)[i]) - if ltu != e - push!(v, ltu .- e) - end - end - end - return unique!(v) -end - -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. -function diff_vectors(I::Singular.sideal) - v = Vector{Int}[] - for g in gens(I) - ltu = Singular.leading_exponent_vector(g) - for e in Singular.exponent_vectors(tail(g)) - push!(v, ltu .- e) - end - end - return unique!(v) -end - -#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) -function change_order( - R::Singular.PolyRing, - cweight::Array{L,1}, - T::Matrix{Int64}, -) where {L<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), - cached = false, - ) - return S, H -end - -#return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) -function change_order( - R::Singular.PolyRing, - M::Matrix{Int64}, -) where {T<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_M(M), - cached = false, - ) - #@error("Not implemented yet") - return S, H -end - -function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - Singular.push_term!(M, c, v) - end - return finish(M) -end -function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - Singular.push_term!(M, c, v) - end - return finish(M) -end - -function ordering_as_matrix(w::Vector{Int64}, ord::Symbol) - if length(w) > 2 - if ord == :lex || ord == Symbol("Singular(lp)") - return [ - w' - ident_matrix(length(w))[1:length(w)-1, :] - ] - end - if ord == :deglex - return [ - w' - ones(Int64, length(w))' - ident_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :degrevlex - return [ - w' - ones(Int64, length(w))' - anti_diagonal_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :revlex || a.ord == Symbol("Singular(dp)") - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - end - else - error("not implemented yet") - end -end - -function change_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) - return [ - w' - M[2:length(w), :] - ] -end -function insert_weight_vector(w::Vector{Int64}, M::Matrix{Int64}) - return [ - w' - M[1:length(w)-1, :] - ] -end - - -function ordering_as_matrix(ord::Symbol, nvars::Int64) - if ord == :lex - #return [w'; ident_matrix(length(w))[1:length(w)-1,:]] - return ident_matrix(nvars) - end - if ord == :deglex - return [ - ones(Int64, nvars)' - ident_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :degrevlex - return [ - ones(Int64, nvars)' - anti_diagonal_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :revlex || a.ord == Symbol("Singular(dp)") - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - end -end - -function pert_Vectors( - G::Singular.sideal, - Mo::MonomialOrder{Matrix{Int64}}, - t::Vector{Int64}, - p::Integer, -) - if t == Mo.m[1, :] - M = Mo.m - else - M = insert_weight_vector(t, Mo.m) - end - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxtdeg = 0 - for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td - end - end - e = maxtdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - println(w) - - return w -end - -function pert_Vectors(G::Singular.sideal, M::Matrix{Int64}, p::Integer) - m = [] - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxtdeg = 0 - for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td - end - end - e = maxtdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - println(w) - return w -end -function pert_Vectors( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - p::Integer, -) - m = [] - if T.t == T.m[1, :] - M = T.m - else - M = insert_weight_vector(T.t, T.m) - end - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxtdeg = 0 - for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td - end - end - e = maxtdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - println(w) - - return w -end -function pert_Vectors( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int64},Vector{Int64}}, - mult::Int64, - p::Integer, -) - m = [] - if T.t == T.m[1, :] - M = T.m - else - M = insert_weight_vector(T.t, T.m) - end - n = size(M)[1] - for i = 1:p - max = M[i, 1] - for j = 2:n - temp = abs(M[i, j]) - if temp > max - max = temp - end - end - push!(m, max) - end - msum = 0 - for i = 2:p - msum += m[i] - end - maxtdeg = 0 - for g in gens(G) - td = tdeg(g, n) - if (td > maxtdeg) - maxtdeg = td - end - end - #TODO: rethink * mult - e = maxtdeg * msum + 1 - w = M[1, :] * e^(p - 1) - for i = 2:p - w += e^(p - i) * M[i, :] - end - println(w) - return w -end - -function tdeg(p::Singular.spoly, n::Int64) - max = 0 - for mon in Singular.monomials(p) - ev = Singular.exponent_vectors(mon) - sum = 0 - for e in ev - for i = 1:n - sum += e[i] - end - end - if (max < sum) - max = sum - end - end - return max -end - -function inCone(G::Singular.sideal, T::Matrix{Int64}, t::Vector{Int64}) - R, V = change_order(G.base_ring, T) - I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end - -function liftGW( - G::Singular.sideal, - InG::Singular.sideal, - R::Singular.PolyRing, - S::Singular.PolyRing, -) - G.isGB = true - rest = [ - gen - change_ring(Singular.reduce(change_ring(gen, R), G), S) for - gen in gens(InG) - ] - Gnew = Singular.Ideal(S, [S(x) for x in rest]) - Gnew.isGB = true - return Gnew -end - - -############################################# -# unspecific help functions -############################################# - -#Use MPolybuildCTX -function vec_sum( - p::Vector{spoly{n_Q}}, - q::Vector{spoly{n_Q}}, - S::Singular.PolyRing, -) - poly = 0 - fin = Singular.MPolyBuildCtx(S) - for i = 1:length(p) - cp = Singular.coefficients(p[i]) - cq = Singular.coefficients(q[i]) - ep = exponent_vectors(p[i]) - eq = exponent_vectors(q[i]) - for k = 1:length(cp) - for j = 1:length(cq) - push_term!(fin, cp[k] * cq[j], ep[k] + eq[j]) - end - end - end - return finish(fin) -end - -function ident_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int64) - M = zeros(Int64, n, n) - for i = 1:n - M[i, n+1-i] = -1 - end - return M -end - -# Singular.isequal depends on order of generators -function equalitytest(G::Singular.sideal, K::Singular.sideal) - generators = Singular.gens(G) - count = 0 - for gen in generators - for r in Singular.gens(K) - if gen - r == 0 - count += 1 - end - end - end - if count == Singular.ngens(G) - return true - end - return false -end - -function dot(v::Vector{Int64}, w::Vector{Int64}) - n = length(v) - sum = 0 - for i = 1:n - sum += v[i] * w[i] - end - return sum -end - - - - - - - -#####test -function initials2( - R::Singular.PolyRing, - G::Vector{spoly{n_Q}}, - w::Vector{Int64}, -) - inits = spoly{elem_type(base_ring(R))}[] - indexw = Tuple{Vector{Int},elem_type(base_ring(R))}[] - for i = 1:length(G) - empty!(indexw) - maxw = 0 - eczip = - zip(Singular.exponent_vectors(G[i]), Singular.coefficients(G[i])) - for (e, c) in eczip - tmpw = dot(w, e) - if maxw == tmpw - push!(indexw, (e, c)) - #rethink this. gens are preordered - elseif maxw < tmpw - empty!(indexw) - push!(indexw, (e, c)) - maxw = tmpw - end - end - inw = MPolyBuildCtx(R) - for (e, c) in indexw - Singular.push_term!(inw, c, e) - end - h = finish(inw) - push!(inits, h) - end - return inits -end - - -function liftGW2( - G::Singular.sideal, - inG::Vector{spoly{L}}, - H::Singular.sideal, - R::Singular.PolyRing, - S::Singular.PolyRing, -) where {L<:Nemo.RingElem} - H.isGB = true - gH = gens(H) - gG = gens(G) - new = [] - for i = 1:length(gH) - rest = R(0) - for j = 1:length(inG) - b, pji = divides(change_ring(gH[i], R), inG[j]) - if b - rest = rest + pji * gG[j] - end - end - push!(new, rest) - end - Gnew = Singular.Ideal(S, [change_ring(x, S) for x in new]) - Gnew.isGB = true - return Gnew -end diff --git a/src/Groebnerwalk/StandardWalkUtilitys.jl b/src/Groebnerwalk/StandardWalkUtilitys.jl deleted file mode 100644 index 378e3a872..000000000 --- a/src/Groebnerwalk/StandardWalkUtilitys.jl +++ /dev/null @@ -1,40 +0,0 @@ -include("GroebnerWalkUtilitys.jl") - -############################################################### -#Utilitys for standard_walk -############################################################### - - -#Solves problems with weight vectors of floats. -function convertBoundingVector(wtemp::Vector{T}) where {T<:Number} - w = Vector{Int64}() - for i = 1:length(wtemp) - push!(w, float(divexact(wtemp[i], gcd(wtemp)))) - end - return w -end - -#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. -#This Version is used by the standard_walk, pertubed_walk and tran_walk. -function nextw( - G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} - tv = [] - for v in diff_vectors(G) - cw = dot(cweight, v) - tw = dot(tweight, v) - ctw = cw - tw - if tw < 0 - if ctw != 0 - push!(tv, cw // ctw) - end - end - end - push!(tv, 1) - filter!(x -> numerator(x) != 0, tv) - t = minimum(tv) - w = (1 - t) * cweight + t * tweight - return convertBoundingVector(w) -end diff --git a/src/Groebnerwalk/TranWalkUtilitys.jl b/src/Groebnerwalk/TranWalkUtilitys.jl deleted file mode 100644 index 4068651ec..000000000 --- a/src/Groebnerwalk/TranWalkUtilitys.jl +++ /dev/null @@ -1,46 +0,0 @@ -include("GroebnerWalkUtilitys.jl") - - -function representationVector(G::Singular.sideal, T::Matrix{Int64}) - n = size(T)[1] - M = 0 - for i = 1:n - for j = 1:n - temp = T[i, j] - if M < temp - M = temp - end - end - end - - d0 = 0 - for g in Singular.gens(G) - # println(g, " in tedeg", tdeg(g)) - temp = tdeg(g, n) - if d0 < temp - d0 = temp - end - end - d = M * (2 * d0^2 + (n + 1) * d0) - w = d^(n - 1) * T[1, :] - for i = 2:n - w = w + d^(n - i) * T[i, :] - end - return w -end - -function inSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} - counter = 0 - for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 - return true - end - if size(collect(Singular.coefficients(g)))[1] == 2 - counter = counter +1 - end -end - if counter > 1 - return true - end - return false -end diff --git a/src/Groebnerwalk/examples b/src/Groebnerwalk/examples deleted file mode 100644 index 31feefd5c..000000000 --- a/src/Groebnerwalk/examples +++ /dev/null @@ -1,294 +0,0 @@ -include("GroebnerWalk.jl") - -function test(case::Int) - - test_successfull = true - -if case == 1 || case == 99 - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), - ) - - f1 = x^2 - y^3 - f2 = x^3 - y^2 - x - I = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :standard, - ) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - println("test tran: ", equalitytest(T0, T6)) - - - if !(equalitytest(T6, T0) ) - test_successfull = false - end -end - -if case == 2 || case == 99 - - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([5, 4, 1], :deglex)), - ) - - f1 = x^2 - y - f2 = y^2 - x * z - y * z - I = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(I, complete_reduction = true) - @time H = groebnerwalk( - I, - ordering_as_matrix([5, 4, 1], :deglex), - ordering_as_matrix([6, 1, 3], :lex), - :alternative, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([6, 1, 3], :lex)), - ) - - - T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - - - if !(equalitytest(T0, T6)) - test_successfull = false - end -end - - -if case == 3 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - - f1 = y^4 + y * z^2 - u^2 * w - f2 = 2 * x^2 * y + x^3 * w * u^2 + x - f3 = 2 - 3 * x^2 * v * z^4 * w - I = Singular.Ideal(R, [f1, f2, f3]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :alternative, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - - if !( - Singular.equal(T0, T6) - ) - test_successfull = false - end - -end -if case == 4 || case == 99 - R, (q, c, p, d) = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), - ) - - - f1 = - 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + - c^2 * q^2 + - 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - 8 * p + - c^2 + - 4 * d^2 - 2 * q + - 10 * p^2 + - 2 - f2 = - 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - - 3 * p * q * c + 4 * c - f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q - f4 = - 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + - 3 * c^2 + - 9 * p^2 * d^2 + - 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + - 12 * d^2 + - 4 * p^2 + - 12 * c * d * p + - 12 * c * d * q + - 12 * c * d * p * q - 12 * c * d - I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :alternative, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - - - if !( - equalitytest(T6, T0) - ) - test_successfull = false - end -end - -if case == 5 || case == 99 - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 - f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 - f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 - I = Singular.Ideal(R, [f1, f2, f3]) - - I = Singular.std(I, complete_reduction = true) - - S, V = - Singular.PolynomialRing(Singular.QQ, ["x", "y", "z"], ordering = :lex) - - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :alternative, - ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - - - - if !( - Singular.equal(T0, T6) - ) - test_successfull = false - end - -end - - - -if case == 6 || case == 99 - R, (v,u,t,z,y,x) = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y", "x"], - ordering = Singular.ordering_M(ordering_as_matrix([1,1,1,1,1,1],:lex)), - ) - - f1 = 2*x^2+2*y^2+2*z^2+2*t^2+2*u^2+v^2-v - f2= x*y+y*z+2*z*t+2*t*u+2*u*v-u - f3= 2*x*z+2*y*t+2*z*u+u^2+2*t*v-t - f4= 2*x*t+2*y*u+2*t*u+2*z*v-z - f5= t^2+2*x*v+2*y*v+2*z*v-y - f6= 2*x+2*y+2*z+2*t+2*u+v-1 - - I = Singular.Ideal(R, [f1, f2, f3, f4,f5,f6]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix([1,1,1,1,1,1],:lex), - ordering_as_matrix(:lex, 6), - :pertubed, - 5 - ) - - @time J = groebnerwalk( - I, - ordering_as_matrix([1,1,1,1,1,1],:lex), - ordering_as_matrix(:lex, 6), - :fractal, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["v", "u", "t", "z", "y", "x"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - - T0 = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - - #println(interreduce(T0)) - if !( - isequal(T6, T0) - ) - test_successfull = false - end -end -println("All tests were: ", test_successfull) -end diff --git a/src/Groebnerwalk/testwiese b/src/Groebnerwalk/testwiese deleted file mode 100644 index e64fe4fa9..000000000 --- a/src/Groebnerwalk/testwiese +++ /dev/null @@ -1,149 +0,0 @@ -include("GroebnerWalk.jl") -function test() - - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), - ) - -f1= y^4 -x^2 +x +x^3 -f2= x^4 - I = Singular.Ideal(R, [f1, f2]) - I = Singular.std(I, complete_reduction = true) - println("last", I) - - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :generic, - ) - println(JJ) - - S, V = Singular.PolynomialRing(Singular.QQ, ["x", "y"], ordering = :lex) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - println(T0) - -end - -function test2() - - R, (x, y,z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([29,10,40],:revlex)), - ) - - f1= y*z^2 + z*y - f2= y^5*z - z*y - f3= x + y^3*z - f4= z^3 - y^4*z - - - - I = Singular.Ideal(R, [ f1,f3,f2]) - println(I) - I = Singular.std(I, complete_reduction = true) - println("last", I) - @time JJ = groebnerwalk( - I, - ordering_as_matrix([29,10,40],:revlex), - ordering_as_matrix(:lex, 3), - :generic, - 3, - ) - println(JJ) - end - function test1() - - R, (x, y,z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix([2,3,4],:revlex)), - ) -f1= y^2 + x*z -f2= x*y - x*z -f3= z^3 + x^2 -f4= x*z^2 -f5= x^2*z -f6= x^3 - - - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - println(I) - I = Singular.std(I, complete_reduction = true) - println("last", I) - @time JJ = groebnerwalk( - I, - ordering_as_matrix([2,3,4],:revlex), - ordering_as_matrix([3,2,1],:revlex), - :standard, - ) -#= @time JJ = groebnerwalk( - I, - ordering_as_matrix([1,11,8],:lex), - ordering_as_matrix([2,1,1],:lex), - :generic, - 3, - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix([1,11,8],:lex), - ordering_as_matrix([2,1,1],:lex), - :fractal_walk_lookahead, - 3, - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix([1,4,10],:lex), - ordering_as_matrix([2,1,1],:lex), - :fractal_walk_lookahead, - 3, - ) - @time JJ = groebnerwalk( - I, - ordering_as_matrix([1,4,10],:lex), - ordering_as_matrix([2,1,1],:lex), - :tran, - 3, - ) - - @time JJ = groebnerwalk( - I, - ordering_as_matrix([1,4,10],:lex), - ordering_as_matrix([2,1,1],:lex), - :generic, - 3, - ) -=# - println(JJ) - end - function test3() - - R, (x, y) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y"], - ordering = Singular.ordering_M(ordering_as_matrix(:deglex, 2)), - ) - f1 = x^2 + x*y - f2= x*y - f3= 2*y^2 - x - I = Singular.Ideal(R, [f1, f2,f3]) - println(I) - - println(std(I)) - I = Singular.std(I, complete_reduction = true) - println("last", I) - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 2), - ordering_as_matrix(:lex, 2), - :generic, - ) - println(JJ) - end From 08e5818e249a5776ab693618c881915823f33a9b Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 14 Feb 2022 18:26:58 +0100 Subject: [PATCH 52/85] fix: Tippfehler --- src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl | 1 + src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 1 - src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 428c115f2..0abbc2577 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -328,6 +328,7 @@ function modulo( end return result, r end=# + #= @doc Markdown.doc""" function interreduce( diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index e0fc443fe..6ed024331 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -117,7 +117,6 @@ function groebnerwalk( return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end - function standard_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) println("standard_walk results") println("Crossed Cones in: ") diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 43e678399..69d6ae7d7 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -157,6 +157,7 @@ function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) end return true end + #Fukuda et al function lift( G::Singular.sideal, From cdb7de5276e1ee6387818f5e672a4e521cb2a92f Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 21 Feb 2022 18:32:08 +0100 Subject: [PATCH 53/85] improvements --- src/GroebnerWalkFinal/Examples | 17 ++ .../FractalWalkUtilitysFinal.jl | 4 +- src/GroebnerWalkFinal/GWtestFinal.jl | 49 ++-- .../GenericWalkUtilitysFinal.jl | 113 ++++++-- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 255 ++++++++---------- .../GroebnerWalkUtilitysFinal.jl | 55 ++-- src/GroebnerWalkFinal/UnitTests | 16 +- src/GroebnerWalkFinal/tests | 10 +- 8 files changed, 301 insertions(+), 218 deletions(-) diff --git a/src/GroebnerWalkFinal/Examples b/src/GroebnerWalkFinal/Examples index 41977bb0b..4153b3454 100644 --- a/src/GroebnerWalkFinal/Examples +++ b/src/GroebnerWalkFinal/Examples @@ -151,6 +151,23 @@ function cyclic5() return Singular.Ideal(R, [f1, f2, f3, f4, f5]) end +function cyclic4() + dim = 4 + ve = [1, 1, 1, 1] + example = "Cyclic4" + StartOrd = ordering_as_matrix(:degrevlex, dim) + R, (v, w, x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["v", "w", "x", "y", "z"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = w+x+y+z + f2 = w*x+x*y+w*z+y*z + f3 = w*x*y+w*x*z+w*y*z+x*y*z + f4 = w*x*y*z-1 + return Singular.Ideal(R, [f1, f2, f3, f4]) +end function eco6() dim = 6 ve = [1, 1, 1, 1, 1, 1] diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 266136a95..8ea384e3e 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -82,7 +82,7 @@ Returns ´true´ if all polynomials of the given array are monomials. """=# function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 1 + if length(Singular.coefficients(g)) > 1 return false end end @@ -98,7 +98,7 @@ Returns ´true´ if all polynomials of the given array are binomials or less. """=# function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw - if size(collect(Singular.coefficients(g)))[1] > 2 + if length(Singular.coefficients(g)) > 2 return false end end diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl index 8a8fd326a..4b08c87bb 100644 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ b/src/GroebnerWalkFinal/GWtestFinal.jl @@ -3,10 +3,8 @@ include("Examples") function test(case::Int) test_successfull = true - if case == 1 || case == 99 id = katsura5() - R = base_ring(id) dim = nvars(R) ve = ones(Int, dim) @@ -21,46 +19,59 @@ function test(case::Int) + #I = Singular.std(id, complete_reduction = true) @time T = groebnerwalk( - I, + deepcopy(I), ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :pertubed, - 4, + :fractal, + 1, ) + + + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :fractal, + :fractal_look_ahead, + 2 ) + @time FA = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :fractal_look_ahead, + :fractal_combined, ) + + + + + @time St = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :pertubed, + :fractal_start_order, 3, ) + @time Pe = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, - 3, + 4, ) @time Ge = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic, + 4 ) @@ -119,7 +130,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - :fractal, + :fractal_start_order ) @@ -127,7 +138,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - :fractal_look_ahead, + :fractal_combined, ) @time Pe = groebnerwalk( I, @@ -205,6 +216,7 @@ function test(case::Int) :pertubed, 4, ) + #= @time J = fractal_walk( I, MonomialOrder( @@ -224,7 +236,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 6), ordering_as_matrix(:lex, 6), - :fractal_look_ahead, + :fractal_combined, ) @time K = groebnerwalk( I, @@ -325,14 +337,14 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal, + :fractal ) @time Fa = groebnerwalk( I, ordering_as_matrix(:degrevlex, 4), ordering_as_matrix(:lex, 4), - :fractal_look_ahead, + :fractal_combined, ) @time Pe = groebnerwalk( @@ -420,7 +432,7 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, 3), ordering_as_matrix(:lex, 3), - :fractal, + :fractal_combined ) @time FA = groebnerwalk( I, @@ -503,7 +515,7 @@ function test(case::Int) ordering_as_matrix(:lex, 6), :standard, ) - @time J = fractal_walk_combined( +#= @time J = fractal_walk_combined( I, MonomialOrder( ordering_as_matrix(:degrevlex, 6), @@ -515,7 +527,7 @@ function test(case::Int) [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], ), - ) + )=# @@ -620,8 +632,9 @@ function test(case::Int) I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :fractal, + :fractal_start_order ) + @time FA = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index 0abbc2577..df5aad8f5 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -86,7 +86,7 @@ function isParallel(u::Vector{Int}, v::Vector{Int}) return true end for i = count:length(v) - if v[i] != x * u[i] + @inbounds if v[i] != x * u[i] return false end end @@ -111,7 +111,7 @@ function lift_generic( Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) for g in Singular.gens(H) - r, b = modulo(g, gens(G), Lm) + r = modulo(g, gens(G), Lm) diff = g - r if diff != 0 push!(Newlm, Singular.leading_term(g)) @@ -203,8 +203,12 @@ function next_gamma( end function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) - for i = 1:size(M)[1] - d = dot(M[i, :], v) + nrows, ncols = size(M) + for i = 1:nrows + d = 0 + for j = 1:ncols + @inbounds d += M[i, j] * v[j] + end if d != 0 return d > 0 end @@ -232,10 +236,10 @@ function less_facet( S::Matrix{Int}, T::Matrix{Int}, ) - for i = 1:size(T)[1] - for j = 1:size(S)[1] - Tuv = dot(T[i, :], u) * dot(S[j, :], v) - Tvu = dot(T[i, :], v) * dot(S[j, :], u) + for i = 1:size(T,1) + for j = 1:size(S, 1) + @inbounds Tuv = dot(T[i, :], u) * dot(S[j, :], v) + @inbounds Tvu = dot(T[i, :], v) * dot(S[j, :], u) if Tuv != Tvu return Tuv < Tvu end @@ -263,7 +267,7 @@ function dividesGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) div = true end end - return (finish(newpoly), div) + return finish(newpoly), div end #= @@ -281,25 +285,14 @@ function modulo( p::Singular.spoly, G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, - c::Bool = false, ) where {L<:Nemo.RingElem} - I = 0 - R = parent(p) - Q = zero(R) for i = 1:length(G) - (q, b) = dividesGW(p, Lm[i], R) + (q, b) = dividesGW(p, Lm[i], parent(p)) if b - I = i - Q = q - break + return modulo(p-(q* G[i]), G, Lm) end end - if I != 0 - r, b = modulo(p - (Q * G[I]), G, Lm) - return r, true - else - return p, false - end + return p end #= function modulo( @@ -351,10 +344,76 @@ function interreduce( push!(Lmrest, Lm[j]) end end - r, b = modulo(G[i], gensrest, Lmrest) - if b - G[i] = r - end + G[i] = modulo(G[i], gensrest, Lmrest) end return G end +function submult( + p::Singular.spoly{L}, + q::Singular.spoly{L}, + c::Singular.spoly{L}, + dim::Int64, +) where {L<:Nemo.RingElem} + sol = MPolyBuildCtx(parent(p)) + ep = collect(Singular.exponent_vectors(p)) + eq = collect(Singular.exponent_vectors(q)) + cp = collect(Singular.coefficients(p)) + cq = collect(Singular.coefficients(q)) + ec = collect(Singular.exponent_vectors(c)) + cc = collect(Singular.coefficients(c)) + multc = Array{RingElem,1}(undef, 0) + multe = Array{Vector{Int},1}(undef, 0) + + for m in 1:length(cq) + for n in 1:length(cc) + skip = false + so = eq[m] + ec[n] + for i in 1:length(multe) + if multe[i] == so + multc[i] = multc[i] + (cq[m]*cc[n]) + skip = true + end + end + if !skip + push!(multe, so) + push!(multc,cq[m] * cc[n]) + end + end + end + for j = 1:length(ep) + fin = true + for k = 1:length(multe) + equals = true + if ep[j] != multe[k] + equals = false + end + if equals + diff = cp[j] - multc[k] + if diff != 0 + Singular.push_term!(sol, diff, ep[j]) + diff = nothing + end + fin = false + multe[k][1] = -1 #delete Vector if equal + break + end + end + if fin + Singular.push_term!(sol, cp[j], ep[j]) + end + end + for i = 1:length(multe) + if multe[i][1] != -1 + Singular.push_term!(sol, -multc[i], multe[i]) + end + end + ep = nothing + eq = nothing + cp = nothing + cq = nothing + ec = nothing + cc = nothing + multc = nothing + multe = nothing + return Singular.finish(sol) +end diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 6ed024331..9544f2d3a 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -68,42 +68,17 @@ function groebnerwalk( elseif grwalktype == :pertubed walk = (x, y, z) -> pertubed_walk(x, y, z, p) elseif grwalktype == :fractal - walk = - (x, y, z) -> fractal_walk( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) + walk = (x, y, z) -> fractal_walk(x, y, z) elseif grwalktype == :fractal_start_order - walk = - (x, y, z) -> fractal_walk_start_order( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) + walk = (x, y, z) -> fractal_walk_start_order(x, y, z) elseif grwalktype == :fractal_lex - walk = - (x, y, z) -> fractal_walk_lex( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) + walk = (x, y, z) -> fractal_walk_lex(x, y, z) elseif grwalktype == :fractal_look_ahead - walk = - (x, y, z) -> fractal_walk_look_ahead( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) + walk = (x, y, z) -> fractal_walk_look_ahead(x, y, z) elseif grwalktype == :tran walk = (x, y, z) -> tran_walk(x, y, z) elseif grwalktype == :fractal_combined - walk = - (x, y, z) -> fractal_walk_combined( - x, - MonomialOrder(S, S[1, :], [0]), - MonomialOrder(T, T[1, :], T[1, :]), - ) + walk = (x, y, z) -> fractal_walk_combined(x, y, z) end ######TODO:Check the parameter##### @@ -159,8 +134,8 @@ function standard_step( ) Gw = initials(Rn, gens(G), cw) H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) return Singular.std(H, complete_reduction = true) end @@ -267,42 +242,42 @@ end PertVecs = [] sigma = [] -function fractal_walk( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, -) - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(base_ring(G))] +function fractal_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println(PertVecs) println("FractalWalk_standard results") println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S, T, PertVecs, 1) + Gb = fractal_recursiv(G, S, T, S[1, :], PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end function fractal_recursiv( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, + cw::Vector{Int}, PertVecs::Vector{Vector{Int}}, p::Int, ) R = base_ring(G) terminate = false G.isGB = true - w = S.w - + w = cw while !terminate t = next_weightfr(G, w, PertVecs[p]) - if (t == [0]) + if t == 1 + if inCone(G, T, cw) + return G + end + end + if t == [0] if inCone(G, T, PertVecs[p]) println(PertVecs[p], " in Cone", p) return G else - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] - T.t = PertVecs[p] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue end @@ -310,8 +285,7 @@ function fractal_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - T.w = w - Rn = change_order(R, T) + Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, Singular.gens(G), w) if p == nvars(R) H = Singular.std( @@ -324,18 +298,18 @@ function fractal_recursiv( println("up in: ", p, " with: ", w) H = fractal_recursiv( Singular.Ideal(R, [x for x in Gw]), - MonomialOrder(S.m, S.w, PertVecs[p]), - MonomialOrder(T.m, T.w, PertVecs[p + 1]), + S, + T, + deepcopy(cw), PertVecs, p + 1, ) end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S.w = T.w - + cw = w end return G end @@ -348,23 +322,24 @@ end function fractal_walk_start_order( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, ) global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - global sigma = S.w + global sigma = S[1, :] println("fractal_walk_withStartorder results") println("Crossed Cones in: ") - Gb = fractal_walk_recursiv_startorder(G, S, T, PertVecs, 1) + Gb = fractal_walk_recursiv_startorder(G, S, T, S[1, :], PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end function fractal_walk_recursiv_startorder( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, + cw::Vector{Int}, PertVecs::Vector{Vector{Int}}, p::Int, ) @@ -372,26 +347,30 @@ function fractal_walk_recursiv_startorder( terminate = false G.isGB = true if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S.m, i) for i = 1:nvars(R)] + if !isMonomial(initials(R, Singular.gens(G), cw)) + global cwPert = [pertubed_vector(G, S, i) for i = 1:nvars(R)] global firstStepMode = true end end if firstStepMode w = cwPert[p] else - w = S.w + w = cw end while !terminate t = next_weightfr(G, w, PertVecs[p]) + if t == 1 + if inCone(G, T, w) + return G + end + end if t == [0] if inCone(G, T, PertVecs[p]) println(PertVecs[p], " in Cone", p) return G else - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] - T.t = PertVecs[p] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue end @@ -399,8 +378,7 @@ function fractal_walk_recursiv_startorder( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - T.w = w - Rn = change_order(R, T) + Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, gens(G), w) if p == Singular.nvars(R) H = Singular.std( @@ -411,49 +389,45 @@ function fractal_walk_recursiv_startorder( raiseCounterFr() else println("up in: ", p, " with: ", w) - H = fractal_walk_recursiv_startorder( Singular.Ideal(R, [x for x in Gw]), - MonomialOrder(S.m, S.w, PertVecs[p]), - MonomialOrder(T.m, T.w, PertVecs[p + 1]), + S, + T, + deepcopy(cw), PertVecs, p + 1, ) global firstStepMode = false end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S.w = T.w - + cw = w end return G end -function fractal_walk_lex( - G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, -) - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(base_ring(G))] +function fractal_walk_lex(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println("fractal_walk_lex results") println("Crossed Cones in: ") - Gb = fractal_walk_recursive_lex(G, S, T, PertVecs, 1) + Gb = fractal_walk_recursive_lex(G, S, T, S[1, :], PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end function fractal_walk_recursive_lex( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, + cw::Vector{Int}, PertVecs::Vector{Vector{Int}}, p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true - w = S.w + w = cw while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] @@ -461,21 +435,18 @@ function fractal_walk_recursive_lex( println(PertVecs[p], " in Cone", p) return G else - global PertVecs = - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] - T.t = PertVecs[p] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue end end if t == 1 && p == 1 - return fractal_walk_recursive_lex(G, S, MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1) + return fractal_walk_recursive_lex(G, S, T, w, PertVecs, p + 1) else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - T.w = w - Rn = change_order(R, T) + Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) H = Singular.std( @@ -488,57 +459,57 @@ function fractal_walk_recursive_lex( println("up in: ", p, " with: ", w) H = fractal_walk_recursive_lex( Singular.Ideal(R, [x for x in Gw]), - MonomialOrder(S.m, S.w, PertVecs[p]), - MonomialOrder(T.m, T.w, PertVecs[p + 1]), + S, + T, + deepcopy(cw), PertVecs, p + 1, ) global firstStepMode = false end end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S.w = T.w - + cw = w end return G end function fractal_walk_look_ahead( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, ) println("fractal_walk_look_ahead results") println("Crossed Cones in: ") - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv(G, S, T, PertVecs, 1) + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = fractal_walk_look_ahead_recursiv(G, S, T, S[1, :], PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end function fractal_walk_look_ahead_recursiv( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, + cw::Vector{Int}, PertVecs::Vector{Vector{Int}}, p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true - w = S.w + w = cw while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T.m, PertVecs[p]) - println(PertVecs[p], " in Cone ",p) + if inCone(G, T, PertVecs[p]) + println(PertVecs[p], " in Cone ", p) return G else - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] - T.t = PertVecs[p] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println(PertVecs[p], " not in Cone") continue end @@ -546,8 +517,7 @@ function fractal_walk_look_ahead_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - T.w = w - Rn = change_order(R, T) + Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( @@ -560,53 +530,52 @@ function fractal_walk_look_ahead_recursiv( println("up in: ", p, " with: ", w) H = fractal_walk_look_ahead_recursiv( Singular.Ideal(R, Gw), - MonomialOrder(S.m, S.w, PertVecs[p]), - MonomialOrder(T.m, T.w, PertVecs[p + 1]), + S, + T, + deepcopy(cw), PertVecs, p + 1, ) end - - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S.w = T.w + cw = w end return G end - - function fractal_walk_combined( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, ) global PertVecs = - [pertubed_vector(G, T.m, i) for i = 1:nvars(Singular.base_ring(G))] -println(PertVecs) + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + println(PertVecs) println("fractal_walk_combined results") println("Crossed Cones in: ") - Gb = fractal_walk_combined(G, S, T, PertVecs, 1) + Gb = fractal_walk_combined(G, S, T, S[1, :], PertVecs, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end function fractal_walk_combined( G::Singular.sideal, - S::MonomialOrder{Matrix{Int},Vector{Int}}, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + S::Matrix{Int}, + T::Matrix{Int}, + cw::Vector{Int}, PertVecs::Vector{Vector{Int}}, p::Int, ) -R = Singular.base_ring(G) + R = Singular.base_ring(G) terminate = false G.isGB = true if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), S.w)) - global cwPert = [pertubed_vector(G, S.m, i) for i = 1:nvars(R)] + if !isMonomial(initials(R, Singular.gens(G), cw)) + global cwPert = [pertubed_vector(G, S, i) for i = 1:nvars(R)] println(cwPert) global firstStepMode = true end @@ -614,31 +583,34 @@ R = Singular.base_ring(G) if firstStepMode w = cwPert[p] else - w = S.w + w = cw end while !terminate t = next_weightfr(G, w, PertVecs[p]) + if t == 1 + if inCone(G, T, cw) + return G + end + end if t == [0] - if inCone(G, T.m, PertVecs[p]) + if inCone(G, T, PertVecs[p]) println(PertVecs[p], " in Cone", p) return G else - global PertVecs = [pertubed_vector(G, T.m, i) for i = 1:nvars(R)] - T.t = PertVecs[p] + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue end - end + end if t == 1 && p == 1 println("up in: ", p, " with: t = 1") - return fractal_walk_combined(G, S, MonomialOrder(T.m, T.w, PertVecs[p + 1]), PertVecs, p + 1) + return fractal_walk_combined(G, S, T, w, PertVecs, p + 1) else w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - T.w = w - Rn = change_order(R, T) + Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( @@ -648,22 +620,23 @@ R = Singular.base_ring(G) println(w, " in depth", p) raiseCounterFr() else - println("from $(S.w) to $(T.w)","up in: ", p, " with: ", w) + println("from $(cw) to $(w)", "up in: ", p, " with: ", w) H = fractal_walk_combined( Singular.Ideal(R, [x for x in Gw]), - MonomialOrder(S.m, S.w, PertVecs[p]), - MonomialOrder(T.m, T.w, PertVecs[p + 1]), + S, + T, + deepcopy(cw), PertVecs, p + 1, ) global firstStepMode = false end end - H = liftGW2(G, R, Gw, H, Rn) - #H = lift(G, R, H, Rn) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = Singular.std(H, complete_reduction = true) R = Rn - S.w = T.w + cw = w end return G end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 69d6ae7d7..365c88333 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -9,12 +9,10 @@ function next_weight( cweight::Vector{Int}, tweight::Vector{Int}, ) where {K<:Number} - tmin = BigInt(1) for v in difference_lead_tail(G) cw = BigInt(dot(cweight, v)) tw = BigInt(dot(tweight, v)) - if tw < 0 t = cw // (cw - tw) if t < tmin @@ -22,7 +20,6 @@ function next_weight( end end end - w = convert_bounding_vector(cweight + tmin * (tweight- cweight)) #= if !checkInt32(w) println(w) @@ -106,11 +103,11 @@ p::Integer Computes a p-pertubed weight vector of M. """=# function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) - m = [] - n = size(M)[1] + m = Int[] + n = size(M,1) for i = 1:p max = M[i, 1] - for j = 2:n + for j = 1:n temp = abs(M[i, j]) if temp > max max = temp @@ -157,7 +154,6 @@ function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) end return true end - #Fukuda et al function lift( G::Singular.sideal, @@ -196,12 +192,11 @@ function liftGW2( gH = collect(gens(H)) gG = collect(gens(G)) - s = length(inG) - inGR = [change_ring(x, R) for x in inG] + inG = [change_ring(x, R) for x in inG] for i = 1:length(gH) - q = divalg(change_ring(gH[i], R), inGR, R) + q = divalg(change_ring(gH[i], R), inG, R) gH[i] = Rn(0) - for j = 1:s + for j = 1:length(inG) gH[i] = change_ring(gH[i], Rn) + change_ring(q[j], Rn) * change_ring(gG[j], Rn) @@ -217,15 +212,14 @@ function divalg( f::Vector{spoly{L}}, R::Singular.PolyRing, ) where {L<:Nemo.RingElem} - s = length(f) - q = Array{Singular.elem_type(R),1}(undef, s) - for i = 1:s + q = Array{Singular.elem_type(R),1}(undef, length(f)) + for i = 1:length(f) q[i] = R(0) end while !isequal(p, R(0)) i = 1 div = false - while (div == false && i <= s) + while (div == false && i <= length(f)) b, m = divides(leading_term(p), leading_term(f[i])) if b q[i] = q[i] + m @@ -246,7 +240,8 @@ end @doc Markdown.doc""" convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). -"""=#function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} +"""=# +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} w = Vector{Int}() g = gcd(wtemp) for i = 1:length(wtemp) @@ -258,7 +253,8 @@ end @doc Markdown.doc""" convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). -"""=#function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} +"""=# +function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int}() g = gcd(wtemp) for i = 1:length(wtemp) @@ -295,7 +291,27 @@ function change_order( ) end return S +end +#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) +function change_order( + R::Singular.PolyRing, + w::Vector{Int}, + t::Vector{Int}, + T::Matrix{Int}, +) where {} + G = Singular.gens(R) + Gstrich = string.(G) + s = size(T) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(w) * + Singular.ordering_a(t) * + Singular.ordering_M(T), + cached = false, + ) + return S end #return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) @@ -375,10 +391,9 @@ function equalitytest(G::Singular.sideal, K::Singular.sideal) end function dot(v::Vector{Int}, w::Vector{Int}) - n = length(v) sum = 0 - for i = 1:n - sum += v[i] * w[i] + for i = 1:length(v) + @inbounds sum += v[i] * w[i] end return sum end diff --git a/src/GroebnerWalkFinal/UnitTests b/src/GroebnerWalkFinal/UnitTests index 04572cfeb..b04db2db6 100644 --- a/src/GroebnerWalkFinal/UnitTests +++ b/src/GroebnerWalkFinal/UnitTests @@ -85,11 +85,17 @@ include("Examples") f1 = 3 * x^2 f2 = y^3 * z J = Singular.Ideal(R, [f1, f2]) + f1 = x^3*y^2 + z^2 +y^2 + f2 = y^3 + K = Singular.Ideal(R, [f1, f2]) + @test isMonomial(gens(I)) == false @test isMonomial(gens(J)) == true @test isbinomial(gens(I)) == true @test isbinomial(gens(J)) == true + @test isbinomial(gens(K)) == false + @test isMonomial(gens(K)) == false end @@ -175,7 +181,7 @@ include("Examples") b^2 * a^2 * c^4 + d^3 + e^3 + - b^8 * d^10 * e^18, + b^12 * d^10 * e^18, ) f2 = R(a^3 * b^3) f3 = R(a^2 * b^4 + c^2 + a^3 * 4 + a * e^3) @@ -188,13 +194,13 @@ include("Examples") println(t.time) - @test (reduce(f1, I), true) == + @test (reduce(f1, I)) == modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f2, I), true) == + @test (reduce(f2, I)) == modulo(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f3, I), true) == + @test (reduce(f3, I)) == modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f4, I), false) == + @test (reduce(f4, I)) == modulo(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) J = Singular.std(J) @test equalitytest( diff --git a/src/GroebnerWalkFinal/tests b/src/GroebnerWalkFinal/tests index 2315a0f62..581691146 100644 --- a/src/GroebnerWalkFinal/tests +++ b/src/GroebnerWalkFinal/tests @@ -14,7 +14,7 @@ using Test I = Singular.std(id, complete_reduction = true) ideals = [] - for i = 2:nvars(S) + for i = 2:nvars(S)-1 push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) end push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) @@ -73,7 +73,7 @@ using Test end end - let id = katsura5() + let id = cyclic4() R = base_ring(id) dim = nvars(R) ve=ones(Int64,dim) @@ -84,7 +84,7 @@ using Test I = Singular.std(id, complete_reduction = true) ideals = [] - for i = 2:nvars(S) + for i = 2:nvars(S)-1 push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) end push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) @@ -113,7 +113,7 @@ using Test R = base_ring(id) dim = nvars(R) ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex) + StartOrd = ordering_as_matrix(:degrevlex,dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -121,7 +121,7 @@ using Test ideals = [] for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :pertubed, i)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) end push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :standard)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :generic)) From d2b29e6a664771b0fa962feea2d2295e81e5d076 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 2 Mar 2022 11:14:25 +0100 Subject: [PATCH 54/85] update --- src/GroebnerWalkFinal/Examples | 2 +- .../FractalWalkUtilitysFinal.jl | 30 ++++- .../GenericWalkUtilitysFinal.jl | 29 +++-- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 103 +++++++++--------- .../GroebnerWalkUtilitysFinal.jl | 68 ++++++++++-- src/GroebnerWalkFinal/UnitTests | 14 +-- 6 files changed, 154 insertions(+), 92 deletions(-) diff --git a/src/GroebnerWalkFinal/Examples b/src/GroebnerWalkFinal/Examples index 4153b3454..f084f93d2 100644 --- a/src/GroebnerWalkFinal/Examples +++ b/src/GroebnerWalkFinal/Examples @@ -3,7 +3,7 @@ function katsura5() ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, u, t, z, y) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["v", "u", "t", "z", "y"], ordering = Singular.ordering_M(StartOrd), ) diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 8ea384e3e..020d7a7dd 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -63,12 +63,9 @@ function lift_fractal_walk( Rn::Singular.PolyRing, ) G.isGB = true - rest = [ - change_ring(gen, Rn) - - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in Singular.gens(H) - ] - G = Singular.Ideal(Rn, [Rn(x) for x in rest]) + G = Singular.Ideal(Rn, [change_ring(gen, Rn) - + change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for + gen in Singular.gens(H)]) G.isGB = true return G end @@ -190,3 +187,24 @@ function next_weightfr( end return tmin end + +#= +@doc Markdown.doc""" +function inCone( + G::Singular.sideal, + T::Matrix{Int}, + t::Vector{Int}, +) +Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. +"""=# +function inCone(G::Singular.sideal, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, p::Int) + R = change_order(G.base_ring, T) + I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) + cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), pvecs[p-1]), initials(R, Singular.gens(I), pvecs[p])) + for (g, in, in2) in cvzip + if !isequal(Singular.leading_term(g), Singular.leading_term(in)) || !isequal(Singular.leading_term(g), Singular.leading_term(in2)) + return false + end + end + return true +end diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index df5aad8f5..c877a631f 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -14,14 +14,14 @@ function facet_initials( Returns the facet initials of the polynomials w.r.t. the vector v. """=# function facet_initials( - G::Singular.sideal, + G::Vector{Singular.spoly{L}}, lm::Vector{spoly{L}}, v::Vector{Int}, ) where {L<:Nemo.RingElem} - Rn = base_ring(G) + Rn = parent(first(G)) initials = Array{Singular.elem_type(Rn),1}(undef, 0) count = 1 - for g in Singular.gens(G) + for g in G inw = Singular.MPolyBuildCtx(Rn) el = first(Singular.exponent_vectors(lm[count])) for (e, c) in @@ -46,13 +46,13 @@ function difference_lead_tail( Returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. """=# function difference_lead_tail( - I::Singular.sideal, + G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} v = Vector{Int}[] - for i = 1:ngens(I) + for i = 1:length(G) ltu = Singular.leading_exponent_vector(Lm[i]) - for e in Singular.exponent_vectors(gens(I)[i]) + for e in Singular.exponent_vectors(G[i]) if ltu != e push!(v, ltu .- e) end @@ -103,20 +103,16 @@ function lift_generic( Performs a lifting step in the Groebner Walk proposed by Fukuda et. al. """=# function lift_generic( - G::Singular.sideal, + G::Vector{spoly{L}}, Lm::Vector{Singular.spoly{L}}, H::Singular.sideal, ) where {L<:Nemo.RingElem} - Rn = base_ring(G) + Rn = parent(first(G)) Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) for g in Singular.gens(H) - r = modulo(g, gens(G), Lm) - diff = g - r - if diff != 0 push!(Newlm, Singular.leading_term(g)) - push!(liftPolys, diff) - end + push!(liftPolys, g - modulo(g, G, Lm)) end return liftPolys, Newlm end @@ -156,7 +152,7 @@ function filter_lf( end function next_gamma( - G::Singular.sideal, + G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, w::Vector{Int}, S::Matrix{Int}, @@ -178,7 +174,7 @@ function next_gamma( end return minV end - +#= function next_gamma( G::Singular.sideal, w::Vector{Int}, @@ -201,7 +197,7 @@ function next_gamma( end return minV end - +=# function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i = 1:nrows @@ -348,6 +344,7 @@ function interreduce( end return G end + function submult( p::Singular.spoly{L}, q::Singular.spoly{L}, diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 9544f2d3a..806cc4a14 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -1,6 +1,8 @@ include("GroebnerWalkUtilitysFinal.jl") include("FractalWalkUtilitysFinal.jl") include("GenericWalkUtilitysFinal.jl") +#include("GenericWalkUtilitysFinalPert.jl") + include("StandardWalkUtilitysFinal.jl") include("TranWalkUtilitysFinal.jl") @@ -65,6 +67,8 @@ function groebnerwalk( walk = (x, y, z) -> standard_walk(x, y, z) elseif grwalktype == :generic walk = (x, y, z) -> generic_walk(x, y, z) + # elseif grwalktype == :pgeneric + # walk = (x,y,z) -> pgeneric_walk(x,y,z,p) elseif grwalktype == :pertubed walk = (x, y, z) -> pertubed_walk(x, y, z, p) elseif grwalktype == :fractal @@ -119,6 +123,12 @@ function standard_walk( if !checkInt32(cweight) return G end + # while !checkInt32(cweight) + # cweight, b = truncw(G, cweight) + # if !b + # return G + # end + # end R = Rn Rn = change_order(Rn, cweight, T) end @@ -136,7 +146,7 @@ function standard_step( H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - return Singular.std(H, complete_reduction = true) + return interreduceGW(H) end ############################################################### @@ -146,31 +156,31 @@ end function generic_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) R = base_ring(G) Rn = change_order(G.base_ring, T) - v = next_gamma(G, [0], S, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] - G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) + G = [change_ring(x, Rn) for x in gens(G)] + v = next_gamma(G, Lm, [0], S, T) + println("generic_walk results") println("Crossed Cones with facetNormal: ") while !isempty(v) global counter = getCounter() + 1 println(v) - G, Lm = generic_step(G, Lm, v, T, R) + G, Lm = generic_step(G, Lm, v, Rn) v = next_gamma(G, Lm, v, S, T) end + G = Singular.Ideal(Rn, G) + G.isGB= true return Singular.interreduce(G) end function generic_step( - G::Singular.sideal, + G::Vector{Singular.spoly{L}}, Lm::Vector{Singular.spoly{L}}, v::Vector{Int}, - T::Matrix{Int}, - R::Singular.PolyRing, + Rn::Singular.PolyRing, ) where {L<:Nemo.RingElem} - Rn = Singular.base_ring(G) - facet_Generators = facet_initials(G, Lm, v) H = Singular.std( Singular.Ideal(Rn, facet_Generators), @@ -178,8 +188,6 @@ function generic_step( ) H, Lm = lift_generic(G, Lm, H) G = interreduce(H, Lm) - G = Singular.Ideal(Rn, G) - G.isGB = true return G, Lm end @@ -267,13 +275,8 @@ function fractal_recursiv( while !terminate t = next_weightfr(G, w, PertVecs[p]) - if t == 1 - if inCone(G, T, cw) - return G - end - end if t == [0] - if inCone(G, T, PertVecs[p]) + if inCone(G, T, PertVecs,p) println(PertVecs[p], " in Cone", p) return G else @@ -285,9 +288,9 @@ function fractal_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, Singular.gens(G), w) if p == nvars(R) + Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -305,9 +308,11 @@ function fractal_recursiv( p + 1, ) end + Rn = change_order(R, w, PertVecs[p], T) + #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) + G = interreduceGW(H) R = Rn cw = w end @@ -359,12 +364,7 @@ function fractal_walk_recursiv_startorder( end while !terminate - t = next_weightfr(G, w, PertVecs[p]) - if t == 1 - if inCone(G, T, w) - return G - end - end + t = next_weightfr(G, w, PertVecs, p) if t == [0] if inCone(G, T, PertVecs[p]) println(PertVecs[p], " in Cone", p) @@ -378,9 +378,9 @@ function fractal_walk_recursiv_startorder( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, gens(G), w) if p == Singular.nvars(R) + Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -399,9 +399,11 @@ function fractal_walk_recursiv_startorder( ) global firstStepMode = false end + Rn = change_order(R, w, PertVecs[p], T) + #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) + G = interreduceGW(H) R = Rn cw = w end @@ -431,7 +433,7 @@ function fractal_walk_recursive_lex( while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PertVecs[p]) + if inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G else @@ -446,9 +448,9 @@ function fractal_walk_recursive_lex( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, Singular.gens(G), w) if p == Singular.nvars(R) + Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -468,9 +470,10 @@ function fractal_walk_recursive_lex( global firstStepMode = false end end + Rn = change_order(R, w, PertVecs[p], T) #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) + G = interreduceGW(H) R = Rn cw = w end @@ -505,7 +508,7 @@ function fractal_walk_look_ahead_recursiv( while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PertVecs[p]) + if inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone ", p) return G else @@ -517,9 +520,9 @@ function fractal_walk_look_ahead_recursiv( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, Singular.gens(G), w) if (p == Singular.nvars(R) || isbinomial(Gw)) + Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -537,9 +540,10 @@ function fractal_walk_look_ahead_recursiv( p + 1, ) end + Rn = change_order(R, w, PertVecs[p], T) #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) + G = interreduceGW(H) R = Rn cw = w end @@ -588,13 +592,8 @@ function fractal_walk_combined( while !terminate t = next_weightfr(G, w, PertVecs[p]) - if t == 1 - if inCone(G, T, cw) - return G - end - end if t == [0] - if inCone(G, T, PertVecs[p]) + if inCone(G, T, PertVecs,p) println(PertVecs[p], " in Cone", p) return G else @@ -610,9 +609,10 @@ function fractal_walk_combined( w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) - Rn = change_order(R, w, PertVecs[p], T) Gw = initials(R, gens(G), w) + if (p == Singular.nvars(R) || isbinomial(Gw)) + Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -632,9 +632,11 @@ function fractal_walk_combined( global firstStepMode = false end end + Rn = change_order(R, w, PertVecs[p], T) #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = Singular.std(H, complete_reduction = true) + @time H = lift_fractal_walk(G, R, H, Rn) + G = interreduceGW(H) + G = G.value R = Rn cw = w end @@ -658,18 +660,19 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) while !terminate w = next_weight(G, cweight, tweight) println(w) - if !checkInt32(w) - return G - end + while !checkInt32(w) + # w, b = truncw(G, w) + # if !b + # return G + # end + #end Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) return G - else - if inSeveralCones(initials(base_ring(G), gens(G), tweight)) - tweight = representation_vector(G, T) - continue - end + elseif inSeveralCones(initials(base_ring(G), gens(G), tweight)) + tweight = representation_vector(G, T) + continue end end G = standard_step(G, R, w, Rn) diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 365c88333..10d4b23fa 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -21,7 +21,8 @@ function next_weight( end end w = convert_bounding_vector(cweight + tmin * (tweight- cweight)) - #= if !checkInt32(w) + #=cw = cweight + if !checkInt32(w) println(w) for i in 1:length(cweight) cweight[i] = round(cweight[i] * 0.10) @@ -29,11 +30,11 @@ function next_weight( cweight = 1 end end - if !inCone(G, T, cweight) + if !inCone(G, add_weight_vector(cw, T), cweight) println("not", cweight) return w end - w= next_weight(G,T,cweight,tweight) + w= next_weight(G,cweight,tweight,T) end=# return w end @@ -47,7 +48,20 @@ function checkInt32(w::Vector{Int}) end return true end - +function truncw(G::Singular.sideal, w::Vector{Int}) +wtemp = Vector{Int}(undef, length(w)) +R = base_ring(G) +for i = 1:length(w) + wtemp[i] = round(w[i] * 0.10) +end +if initials(R, gens(G), w) != initials(R, gens(G), wtemp) + println(wtemp) + println(initials(R, gens(G), w) ," and ", initials(R, gens(G), wtemp)) + return w, false +else + return wtemp, true +end +end #Return the initials of polynomials w.r.t. a weight vector. function initials( R::Singular.PolyRing, @@ -154,6 +168,23 @@ function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) end return true end + +#= +@doc Markdown.doc""" +function isGb( + G::Singular.sideal, + T::Matrix{Int}, +) +"""=# +function isGb(G::Singular.sideal, T::Matrix{Int}) + R = change_order(G.base_ring, T) + for g in Singular.gens(G) + if !isequal(Singular.leading_term(g), change_ring(Singular.leading_term(change_ring(g, R)), G.base_ring)) + return false + end + end + return true +end #Fukuda et al function lift( G::Singular.sideal, @@ -162,11 +193,8 @@ function lift( Rn::Singular.PolyRing, ) G.isGB = true - rest = [ - gen - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in gens(H) - ] - G = Singular.Ideal(Rn, [Rn(x) for x in rest]) + G = Singular.Ideal(Rn, [gen - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for + gen in gens(H)]) G.isGB = true return G end @@ -349,6 +377,28 @@ function change_ring(p::Singular.spoly, R::Singular.PolyRing) end +#= +@doc Markdown.doc""" +function interreduce( + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} +G represents a Gröbnerbasis. This function interreduces G w.r.t. the leading terms Lm with tail-reduction. +"""=# +function interreduceGW( + G::Singular.sideal, +) where {L<:Nemo.RingElem} + Rn = base_ring(G) + Generator = collect(gens(G)) + I = 0 + for i in 1:ngens(G) + I = Singular.Ideal(Rn,Generator[1:end .!= i]) + I.isGB = true + Generator[i] = reduce(Generator[i], I) + end + G = Singular.Ideal(Rn, Generator) + return G +end ############################################# # unspecific help functions ############################################# diff --git a/src/GroebnerWalkFinal/UnitTests b/src/GroebnerWalkFinal/UnitTests index b04db2db6..18d9cb6b0 100644 --- a/src/GroebnerWalkFinal/UnitTests +++ b/src/GroebnerWalkFinal/UnitTests @@ -181,25 +181,20 @@ include("Examples") b^2 * a^2 * c^4 + d^3 + e^3 + - b^12 * d^10 * e^18, + b^2 * d^2 * e^7, ) f2 = R(a^3 * b^3) f3 = R(a^2 * b^4 + c^2 + a^3 * 4 + a * e^3) f4 = R(0) - t = @timed modulo( - f1, - gens(I), - [Singular.leading_term(g) for g in gens(I)], - ) - println(t.time) + @time modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) + @test (reduce(f3, I)) == + modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f1, I)) == modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f2, I)) == modulo(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) - @test (reduce(f3, I)) == - modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f4, I)) == modulo(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) J = Singular.std(J) @@ -214,6 +209,5 @@ include("Examples") ), ) - end end From 7e9e482b0117716615104f02d681c015270b81b9 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 2 Mar 2022 11:27:22 +0100 Subject: [PATCH 55/85] formatting --- .../FractalWalkUtilitysFinal.jl | 29 ++++++-- .../GenericWalkUtilitysFinal.jl | 40 +++++----- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 19 +++-- .../GroebnerWalkUtilitysFinal.jl | 74 ++++++++++--------- 4 files changed, 91 insertions(+), 71 deletions(-) diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl index 020d7a7dd..ab48501a1 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl @@ -63,9 +63,14 @@ function lift_fractal_walk( Rn::Singular.PolyRing, ) G.isGB = true - G = Singular.Ideal(Rn, [change_ring(gen, Rn) - - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in Singular.gens(H)]) + G = Singular.Ideal( + Rn, + [ + change_ring(gen, Rn) - + change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for + gen in Singular.gens(H) + ], + ) G.isGB = true return G end @@ -152,7 +157,7 @@ Returns a new PolynomialRing w.r.t. the monomial ordering T. """=# function change_order( R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int},Vector{Int}}, + T::Matrix{Int}, ) where {L<:Number,K<:Number} G = Singular.gens(R) Gstrich = string.(G) @@ -197,12 +202,22 @@ function inCone( ) Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. """=# -function inCone(G::Singular.sideal, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, p::Int) +function inCone( + G::Singular.sideal, + T::Matrix{Int}, + pvecs::Vector{Vector{Int}}, + p::Int, +) R = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), pvecs[p-1]), initials(R, Singular.gens(I), pvecs[p])) + cvzip = zip( + Singular.gens(I), + initials(R, Singular.gens(I), pvecs[p-1]), + initials(R, Singular.gens(I), pvecs[p]), + ) for (g, in, in2) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(in)) || !isequal(Singular.leading_term(g), Singular.leading_term(in2)) + if !isequal(Singular.leading_term(g), Singular.leading_term(in)) || + !isequal(Singular.leading_term(g), Singular.leading_term(in2)) return false end end diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl index c877a631f..ffe2106dd 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl @@ -111,8 +111,8 @@ function lift_generic( Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) for g in Singular.gens(H) - push!(Newlm, Singular.leading_term(g)) - push!(liftPolys, g - modulo(g, G, Lm)) + push!(Newlm, Singular.leading_term(g)) + push!(liftPolys, g - modulo(g, G, Lm)) end return liftPolys, Newlm end @@ -232,7 +232,7 @@ function less_facet( S::Matrix{Int}, T::Matrix{Int}, ) - for i = 1:size(T,1) + for i = 1:size(T, 1) for j = 1:size(S, 1) @inbounds Tuv = dot(T[i, :], u) * dot(S[j, :], v) @inbounds Tvu = dot(T[i, :], v) * dot(S[j, :], u) @@ -285,7 +285,7 @@ function modulo( for i = 1:length(G) (q, b) = dividesGW(p, Lm[i], parent(p)) if b - return modulo(p-(q* G[i]), G, Lm) + return modulo(p - (q * G[i]), G, Lm) end end return p @@ -361,22 +361,22 @@ function submult( multc = Array{RingElem,1}(undef, 0) multe = Array{Vector{Int},1}(undef, 0) - for m in 1:length(cq) - for n in 1:length(cc) - skip = false - so = eq[m] + ec[n] - for i in 1:length(multe) - if multe[i] == so - multc[i] = multc[i] + (cq[m]*cc[n]) - skip = true - end - end - if !skip - push!(multe, so) - push!(multc,cq[m] * cc[n]) - end - end - end + for m = 1:length(cq) + for n = 1:length(cc) + skip = false + so = eq[m] + ec[n] + for i = 1:length(multe) + if multe[i] == so + multc[i] = multc[i] + (cq[m] * cc[n]) + skip = true + end + end + if !skip + push!(multe, so) + push!(multc, cq[m] * cc[n]) + end + end + end for j = 1:length(ep) fin = true for k = 1:length(multe) diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 806cc4a14..83fa25ae5 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -1,8 +1,6 @@ include("GroebnerWalkUtilitysFinal.jl") include("FractalWalkUtilitysFinal.jl") include("GenericWalkUtilitysFinal.jl") -#include("GenericWalkUtilitysFinalPert.jl") - include("StandardWalkUtilitysFinal.jl") include("TranWalkUtilitysFinal.jl") @@ -170,7 +168,7 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) v = next_gamma(G, Lm, v, S, T) end G = Singular.Ideal(Rn, G) - G.isGB= true + G.isGB = true return Singular.interreduce(G) end @@ -276,7 +274,7 @@ function fractal_recursiv( while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PertVecs,p) + if inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G else @@ -593,7 +591,7 @@ function fractal_walk_combined( while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == [0] - if inCone(G, T, PertVecs,p) + if inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G else @@ -661,11 +659,11 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) w = next_weight(G, cweight, tweight) println(w) while !checkInt32(w) - # w, b = truncw(G, w) - # if !b - # return G - # end - #end + # w, b = truncw(G, w) + # if !b + return G + # end + end Rn = change_order(R, w, T) if w == tweight if inCone(G, T, cweight) @@ -680,4 +678,5 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) R = Rn cweight = w end + return G end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl index 10d4b23fa..3c654f9d5 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl @@ -20,7 +20,7 @@ function next_weight( end end end - w = convert_bounding_vector(cweight + tmin * (tweight- cweight)) + w = convert_bounding_vector(cweight + tmin * (tweight - cweight)) #=cw = cweight if !checkInt32(w) println(w) @@ -49,18 +49,18 @@ function checkInt32(w::Vector{Int}) return true end function truncw(G::Singular.sideal, w::Vector{Int}) -wtemp = Vector{Int}(undef, length(w)) -R = base_ring(G) -for i = 1:length(w) - wtemp[i] = round(w[i] * 0.10) -end -if initials(R, gens(G), w) != initials(R, gens(G), wtemp) - println(wtemp) - println(initials(R, gens(G), w) ," and ", initials(R, gens(G), wtemp)) - return w, false -else - return wtemp, true -end + wtemp = Vector{Int}(undef, length(w)) + R = base_ring(G) + for i = 1:length(w) + wtemp[i] = round(w[i] * 0.10) + end + if initials(R, gens(G), w) != initials(R, gens(G), wtemp) + println(wtemp) + println(initials(R, gens(G), w), " and ", initials(R, gens(G), wtemp)) + return w, false + else + return wtemp, true + end end #Return the initials of polynomials w.r.t. a weight vector. function initials( @@ -118,7 +118,7 @@ Computes a p-pertubed weight vector of M. """=# function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) m = Int[] - n = size(M,1) + n = size(M, 1) for i = 1:p max = M[i, 1] for j = 1:n @@ -179,7 +179,10 @@ function isGb( function isGb(G::Singular.sideal, T::Matrix{Int}) R = change_order(G.base_ring, T) for g in Singular.gens(G) - if !isequal(Singular.leading_term(g), change_ring(Singular.leading_term(change_ring(g, R)), G.base_ring)) + if !isequal( + Singular.leading_term(g), + change_ring(Singular.leading_term(change_ring(g, R)), G.base_ring), + ) return false end end @@ -193,8 +196,13 @@ function lift( Rn::Singular.PolyRing, ) G.isGB = true - G = Singular.Ideal(Rn, [gen - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) for - gen in gens(H)]) + G = Singular.Ideal( + Rn, + [ + gen - change_ring(Singular.reduce(change_ring(gen, R), G), Rn) + for gen in gens(H) + ], + ) G.isGB = true return G end @@ -331,14 +339,14 @@ function change_order( G = Singular.gens(R) Gstrich = string.(G) s = size(T) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(w) * - Singular.ordering_a(t) * - Singular.ordering_M(T), - cached = false, - ) + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(w) * + Singular.ordering_a(t) * + Singular.ordering_M(T), + cached = false, + ) return S end @@ -385,15 +393,13 @@ function interreduce( ) where {L<:Nemo.RingElem} G represents a Gröbnerbasis. This function interreduces G w.r.t. the leading terms Lm with tail-reduction. """=# -function interreduceGW( - G::Singular.sideal, -) where {L<:Nemo.RingElem} +function interreduceGW(G::Singular.sideal) where {L<:Nemo.RingElem} Rn = base_ring(G) - Generator = collect(gens(G)) - I = 0 - for i in 1:ngens(G) - I = Singular.Ideal(Rn,Generator[1:end .!= i]) - I.isGB = true + Generator = collect(gens(G)) + I = 0 + for i = 1:ngens(G) + I = Singular.Ideal(Rn, Generator[1:end.!=i]) + I.isGB = true Generator[i] = reduce(Generator[i], I) end G = Singular.Ideal(Rn, Generator) @@ -428,7 +434,7 @@ function equalitytest(G::Singular.sideal, K::Singular.sideal) count = 0 for gen in generators for r in Singular.gens(K) - if gen*leading_coefficient(r) - r*leading_coefficient(gen) == 0 + if gen * leading_coefficient(r) - r * leading_coefficient(gen) == 0 count += 1 break end From 67f2bbe1a5d63734805c70d3ff257a78a041d5a7 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 2 Mar 2022 16:18:36 +0100 Subject: [PATCH 56/85] update FractalWalk --- src/GroebnerWalkFinal/GroebnerWalkFinal.jl | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl index 83fa25ae5..b8e638bf8 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalkFinal/GroebnerWalkFinal.jl @@ -590,15 +590,19 @@ function fractal_walk_combined( while !terminate t = next_weightfr(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs, p) + if t == 1 && p != 1 + if inCone(G, T, cw) + println(cw, " in Cone", p) + return G + end + elseif t == [0] + if inCone(G, T, cw) println(PertVecs[p], " in Cone", p) return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue end + global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue end if t == 1 && p == 1 println("up in: ", p, " with: t = 1") @@ -608,9 +612,9 @@ function fractal_walk_combined( w = convert_bounding_vector(w) checkInt32(w) Gw = initials(R, gens(G), w) + Rn = change_order(R, w, T) if (p == Singular.nvars(R) || isbinomial(Gw)) - Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -630,11 +634,10 @@ function fractal_walk_combined( global firstStepMode = false end end - Rn = change_order(R, w, PertVecs[p], T) + #H = liftGW2(G, R, Gw, H, Rn) - @time H = lift_fractal_walk(G, R, H, Rn) + H = lift_fractal_walk(G, R, H, Rn) G = interreduceGW(H) - G = G.value R = Rn cw = w end From 88f90df15e615c2c659ad3923d497610d31770ae Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 2 Mar 2022 18:42:45 +0100 Subject: [PATCH 57/85] Formatting --- .../Examples | 0 .../FractalWalkUtilitys.jl} | 2 +- .../GenericWalkUtilitys.jl} | 2 +- .../GroebnerWalk.jl} | 180 +++-- .../GroebnerWalkUtilitys.jl} | 0 .../TranWalkUtilitys.jl} | 2 +- .../UnitTests | 2 +- src/GroebnerWalkFinal/GWtestFinal.jl | 697 ------------------ .../StandardWalkUtilitysFinal.jl | 5 - src/GroebnerWalkFinal/tests | 147 ---- 10 files changed, 141 insertions(+), 896 deletions(-) rename src/{GroebnerWalkFinal => GroebnerWalk}/Examples (100%) rename src/{GroebnerWalkFinal/FractalWalkUtilitysFinal.jl => GroebnerWalk/FractalWalkUtilitys.jl} (99%) rename src/{GroebnerWalkFinal/GenericWalkUtilitysFinal.jl => GroebnerWalk/GenericWalkUtilitys.jl} (99%) rename src/{GroebnerWalkFinal/GroebnerWalkFinal.jl => GroebnerWalk/GroebnerWalk.jl} (81%) rename src/{GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl => GroebnerWalk/GroebnerWalkUtilitys.jl} (100%) rename src/{GroebnerWalkFinal/TranWalkUtilitysFinal.jl => GroebnerWalk/TranWalkUtilitys.jl} (95%) rename src/{GroebnerWalkFinal => GroebnerWalk}/UnitTests (99%) delete mode 100644 src/GroebnerWalkFinal/GWtestFinal.jl delete mode 100644 src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl delete mode 100644 src/GroebnerWalkFinal/tests diff --git a/src/GroebnerWalkFinal/Examples b/src/GroebnerWalk/Examples similarity index 100% rename from src/GroebnerWalkFinal/Examples rename to src/GroebnerWalk/Examples diff --git a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl b/src/GroebnerWalk/FractalWalkUtilitys.jl similarity index 99% rename from src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl rename to src/GroebnerWalk/FractalWalkUtilitys.jl index ab48501a1..69031656d 100644 --- a/src/GroebnerWalkFinal/FractalWalkUtilitysFinal.jl +++ b/src/GroebnerWalk/FractalWalkUtilitys.jl @@ -1,4 +1,4 @@ -include("GroebnerWalkUtilitysFinal.jl") +include("GroebnerWalkUtilitys.jl") #Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) #Maybe not needed diff --git a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl b/src/GroebnerWalk/GenericWalkUtilitys.jl similarity index 99% rename from src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl rename to src/GroebnerWalk/GenericWalkUtilitys.jl index ffe2106dd..2770aa8cd 100644 --- a/src/GroebnerWalkFinal/GenericWalkUtilitysFinal.jl +++ b/src/GroebnerWalk/GenericWalkUtilitys.jl @@ -1,4 +1,4 @@ -include("GroebnerWalkUtilitysFinal.jl") +include("GroebnerWalkUtilitys.jl") ############################################################### #Utilitys for generic_walk diff --git a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl b/src/GroebnerWalk/GroebnerWalk.jl similarity index 81% rename from src/GroebnerWalkFinal/GroebnerWalkFinal.jl rename to src/GroebnerWalk/GroebnerWalk.jl index b8e638bf8..567d490e0 100644 --- a/src/GroebnerWalkFinal/GroebnerWalkFinal.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -1,8 +1,8 @@ -include("GroebnerWalkUtilitysFinal.jl") -include("FractalWalkUtilitysFinal.jl") -include("GenericWalkUtilitysFinal.jl") -include("StandardWalkUtilitysFinal.jl") -include("TranWalkUtilitysFinal.jl") +include("GroebnerWalkUtilitys.jl") +include("FractalWalkUtilitys.jl") +include("GenericWalkUtilitys.jl") +include("StandardWalkUtilitys.jl") +include("TranWalkUtilitys.jl") export groebnerwalk @@ -273,22 +273,33 @@ function fractal_recursiv( while !terminate t = next_weightfr(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs, p) + if t == 1 && p != 1 + if !inCone(G, T, PertVecs, p) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue + end + if inCone(G, T, cw) + println(cw, " in Cone", p) + return G + end + elseif t == [0] + if p == 1 || inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + end + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue - end end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) Gw = initials(R, Singular.gens(G), w) + Rn = change_order(R, w, T) if p == nvars(R) - Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -306,8 +317,6 @@ function fractal_recursiv( p + 1, ) end - Rn = change_order(R, w, PertVecs[p], T) - #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) G = interreduceGW(H) @@ -362,23 +371,35 @@ function fractal_walk_recursiv_startorder( end while !terminate - t = next_weightfr(G, w, PertVecs, p) - if t == [0] - if inCone(G, T, PertVecs[p]) + t = next_weightfr(G, w, PertVecs[p]) + if t == 1 && p != 1 + if !inCone(G, T, PertVecs, p) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue + end + if inCone(G, T, cw) + println(cw, " in Cone", p) + return G + end + elseif t == [0] + if p == 1 ||inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + end + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue - end end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) Gw = initials(R, gens(G), w) + Rn = change_order(R, w, T) + if p == Singular.nvars(R) - Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -397,8 +418,6 @@ function fractal_walk_recursiv_startorder( ) global firstStepMode = false end - Rn = change_order(R, w, PertVecs[p], T) - #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) G = interreduceGW(H) @@ -430,15 +449,26 @@ function fractal_walk_recursive_lex( w = cw while !terminate t = next_weightfr(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs, p) + if t == 1 && p != 1 + if !inCone(G, T, PertVecs, p) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue + end + if inCone(G, T, cw) + println(cw, " in Cone", p) + return G + end + elseif t == [0] + if p == 1 || inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] + end + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", PertVecs) continue - end end if t == 1 && p == 1 return fractal_walk_recursive_lex(G, S, T, w, PertVecs, p + 1) @@ -447,6 +477,8 @@ function fractal_walk_recursive_lex( w = convert_bounding_vector(w) checkInt32(w) Gw = initials(R, Singular.gens(G), w) + Rn = change_order(R, w, T) + if p == Singular.nvars(R) Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( @@ -468,7 +500,6 @@ function fractal_walk_recursive_lex( global firstStepMode = false end end - Rn = change_order(R, w, PertVecs[p], T) #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) G = interreduceGW(H) @@ -505,22 +536,34 @@ function fractal_walk_look_ahead_recursiv( while !terminate t = next_weightfr(G, w, PertVecs[p]) - if t == [0] - if inCone(G, T, PertVecs, p) - println(PertVecs[p], " in Cone ", p) + if t == 1 && p != 1 + if !inCone(G, T, PertVecs, p) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue + end + if inCone(G, T, cw) + println(cw, " in Cone", p) + return G + end + elseif t == [0] + if p == 1 || inCone(G, T, PertVecs, p) + println(PertVecs[p], " in Cone", p) return G - else - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println(PertVecs[p], " not in Cone") - continue end + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue end w = w + t * (PertVecs[p] - w) w = convert_bounding_vector(w) checkInt32(w) Gw = initials(R, Singular.gens(G), w) + Rn = change_order(R, w, T) + if (p == Singular.nvars(R) || isbinomial(Gw)) - Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -538,7 +581,6 @@ function fractal_walk_look_ahead_recursiv( p + 1, ) end - Rn = change_order(R, w, PertVecs[p], T) #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, R, H, Rn) G = interreduceGW(H) @@ -591,18 +633,25 @@ function fractal_walk_combined( while !terminate t = next_weightfr(G, w, PertVecs[p]) if t == 1 && p != 1 - if inCone(G, T, cw) - println(cw, " in Cone", p) + if !inCone(G, T, PertVecs, p) + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue + end + if inCone(G, T, cw) + println(cw, " in Cone", p) return G end elseif t == [0] - if inCone(G, T, cw) + if inCone(G, T, PertVecs, p) println(PertVecs[p], " in Cone", p) return G end - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + global PertVecs = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", PertVecs) + continue end if t == 1 && p == 1 println("up in: ", p, " with: t = 1") @@ -683,3 +732,48 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) end return G end + +function pgeneric_walk( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + p::Int, +) + R = base_ring(G) + Rn = change_order(G.base_ring, T) + v = next_gamma(G, [0], S, T, p) + Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) + + println("generic_walk results") + println("Crossed Cones with facetNormal: ") + while !isempty(v) + global counter = getCounter() + 1 + println(v) + G, Lm = generic_step(G, Lm, v, T, R) + v = next_gamma(G, Lm, v, S, T, p) + end + return Singular.interreduce(G) +end + +function generic_step( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + v::Vector{Int}, + T::Matrix{Int}, + R::Singular.PolyRing, +) where {L<:Nemo.RingElem} + + Rn = Singular.base_ring(G) + + facet_Generators = facet_initials(G, Lm, v) + H = Singular.std( + Singular.Ideal(Rn, facet_Generators), + complete_reduction = true, + ) + H, Lm = lift_generic(G, Lm, H) + G = interreduce(H, Lm) + G = Singular.Ideal(Rn, G) + G.isGB = true + return G, Lm +end diff --git a/src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl b/src/GroebnerWalk/GroebnerWalkUtilitys.jl similarity index 100% rename from src/GroebnerWalkFinal/GroebnerWalkUtilitysFinal.jl rename to src/GroebnerWalk/GroebnerWalkUtilitys.jl diff --git a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl b/src/GroebnerWalk/TranWalkUtilitys.jl similarity index 95% rename from src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl rename to src/GroebnerWalk/TranWalkUtilitys.jl index 3a30a2aee..c6b2c73bb 100644 --- a/src/GroebnerWalkFinal/TranWalkUtilitysFinal.jl +++ b/src/GroebnerWalk/TranWalkUtilitys.jl @@ -1,4 +1,4 @@ -include("GroebnerWalkUtilitysFinal.jl") +include("GroebnerWalkUtilitys.jl") function representation_vector(G::Singular.sideal, T::Matrix{Int}) diff --git a/src/GroebnerWalkFinal/UnitTests b/src/GroebnerWalk/UnitTests similarity index 99% rename from src/GroebnerWalkFinal/UnitTests rename to src/GroebnerWalk/UnitTests index 18d9cb6b0..cc5d3e4bb 100644 --- a/src/GroebnerWalkFinal/UnitTests +++ b/src/GroebnerWalk/UnitTests @@ -1,5 +1,5 @@ using Test -include("GroebnerWalkFinal.jl") +include("GroebnerWalk.jl") include("Examples") @testset "UnitTests" begin diff --git a/src/GroebnerWalkFinal/GWtestFinal.jl b/src/GroebnerWalkFinal/GWtestFinal.jl deleted file mode 100644 index 4b08c87bb..000000000 --- a/src/GroebnerWalkFinal/GWtestFinal.jl +++ /dev/null @@ -1,697 +0,0 @@ -include("GroebnerWalkFinal.jl") -include("Examples") -function test(case::Int) - - test_successfull = true - if case == 1 || case == 99 - id = katsura5() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int, dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - R2 = change_order(R, StartOrd) - S = change_order(R, TarOrd) - I = Singular.std( - Singular.Ideal(R2, [change_ring(x, R2) for x in gens(id)]), - complete_reduction = true, - ) - - - - - #I = Singular.std(id, complete_reduction = true) - @time T = groebnerwalk( - deepcopy(I), - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal, - 1, - ) - - - - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_look_ahead, - 2 - ) - - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_combined, - ) - - - - - - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_start_order, - 3, - ) - - - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 4, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :generic, - 4 - ) - - - - #@time T0 = Singular.std( - # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - # complete_reduction = true, - #) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - - - - println("test tran: ", equalitytest(T6, T1)) - println("test fractal: ", equalitytest(T6, T2)) - println("test fractal: ", equalitytest(T6, T3)) - println("test pertubed: ", equalitytest(T5, T6)) - println("test standard: ", equalitytest(T4, T6)) - println("test generic: ", equalitytest(T6, T6)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end - end - if case == 2 || case == 99 - - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = 16 + 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 - f2 = 6 + y^3 * z + 17 * x^2 * z^2 + 7 * x * y^2 * z^2 + 13 * x^3 * z^2 - I = Singular.Ideal(R, [f1, f2]) - - - I = Singular.std(I, complete_reduction = true) - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :tran, - ) - - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_start_order - ) - - - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_combined, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :pertubed, - 2, - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :standard, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :generic, - ) - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 3)), - ) - - T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) - - - - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end - end - - if case == 3 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - f1 = y^4 + y * z^2 - u^2 * w - f2 = 2 * x^2 * y + x^3 * w * u^2 + x - f3 = 2 - 3 * x^2 * v * z^4 * w - I = Singular.Ideal(R, [f1, f2, f3]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - - #= @time J = fractal_walk( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - ) =# - - - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_combined, - ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - #println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equal(T4, T0)) - - if !( - equalitytest(T2, T0) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - end - if case == 4 || case == 99 - R, (q, c, p, d) = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), - ) - - f1 = - 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + - c^2 * q^2 + - 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - - 8 * p + - c^2 + - 4 * d^2 - 2 * q + - 10 * p^2 + - 2 - f2 = - 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - - 3 * p * q * c + 4 * c - f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q - f4 = - 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + - 3 * c^2 + - 9 * p^2 * d^2 + - 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + - 12 * d^2 + - 4 * p^2 + - 12 * c * d * p + - 12 * c * d * q + - 12 * c * d * p * q - 12 * c * d - I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Singular.std(I, complete_reduction = true) - - - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :tran, - ) - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :fractal - ) - - @time Fa = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :fractal_combined, - ) - - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :pertubed, - 4, - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :standard, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :generic, - ) - - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Fa)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) - - if !( - equalitytest(T2, T1) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - - end - if case == 5 || case == 99 - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 - f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 - f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 - I = Singular.Ideal(R, [f1, f2, f3]) - - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = :lex, - ) - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :tran, - ) - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_combined - ) - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_look_ahead, - ) - - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :standard, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :pertubed, - 3, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :generic, - ) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - - end - - - - if case == 6 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - - f1 = 2 * w * y + 2 * v * z + u^2 + x^2 + x - f2 = 2 * w * z + 2 * v * u + 2 * y * x + y - f3 = 2 * w * u + v^2 + 2 * z * x + z + y^2 - f4 = 2 * w * v + 2 * u * x + u + 2 * z * y - f5 = w^2 + 2 * v * x + v + 2 * u * y + z^2 - f6 = 2 * w * x + w + 2 * v * y + 2 * u * z - I = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) -#= @time J = fractal_walk_combined( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - )=# - - - - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_look_ahead, - ) - - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_look_ahead, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - #println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equal(T4, T0)) - - if !( - equalitytest(T2, T0) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - - end - - if case == 7 || case == 99 - dim = 4 - ve = [1, 1, 1, 1] - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d) = Singular.PolynomialRing( - Singular.QQ, - ["a", "b", "c", "d"], - ordering = Singular.ordering_M(StartOrd), - ) - S = change_order(R, TarOrd) - I = Singular.Ideal( - R, - [ - 5 + a^2 * b + 2 * a * c^2 + a^4 + 3 * a^2 * b * c, - c + - 5 * a * b + - 4 * c^2 + - 2 * a * c * d + - 2 * b^4 + - 3 * c^4 + - 2 * a * d^3, - ], - ) - I = Singular.std(I, complete_reduction = true) - - - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 3, - ) - - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_start_order - ) - - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_look_ahead, - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 2, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 3, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :generic, - ) - - - - #@time T0 = Singular.std( - # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - # complete_reduction = true, - #) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - - - - println("test tran: ", equalitytest(T6, T1)) - println("test fractal: ", equalitytest(T6, T2)) - println("test fractal: ", equalitytest(T6, T3)) - println("test pertubed: ", equalitytest(T5, T6)) - println("test standard: ", equalitytest(T4, T6)) - println("test generic: ", equalitytest(T6, T6)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end - end - println("All tests were: ", test_successfull) -end diff --git a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl b/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl deleted file mode 100644 index 97e90e9d4..000000000 --- a/src/GroebnerWalkFinal/StandardWalkUtilitysFinal.jl +++ /dev/null @@ -1,5 +0,0 @@ -include("GroebnerWalkUtilitysFinal.jl") - -############################################################### -#Utilitys for standard_walk -############################################################### diff --git a/src/GroebnerWalkFinal/tests b/src/GroebnerWalkFinal/tests deleted file mode 100644 index 581691146..000000000 --- a/src/GroebnerWalkFinal/tests +++ /dev/null @@ -1,147 +0,0 @@ -include("GroebnerWalkFinal.jl") -include("Examples") -using Test - -@testset "Groebnerwalks" begin - @testset "Testing Groebnerwalks" begin - let id = cyclic5() - R = base_ring(id) - dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - I = Singular.std(id, complete_reduction = true) - - ideals = [] - for i = 2:nvars(S)-1 - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) - end - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) - #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - complete_reduction = true, - ) - - for id in ideals - @test equalitytest( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - end - end - - let id = katsura5() - R = base_ring(id) - dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - - I = Singular.std(id, complete_reduction = true) - - ideals = [] - for i = 1:nvars(S)-1 - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) - end - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - complete_reduction = true, - ) - - for id in ideals - @test equalitytest( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - end - end - - let id = cyclic4() - R = base_ring(id) - dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - - I = Singular.std(id, complete_reduction = true) - - ideals = [] - for i = 2:nvars(S)-1 - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) - end - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - complete_reduction = true, - ) - - - for id in ideals - @test equalitytest( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - end - end - - let id = ex1() - R = base_ring(id) - dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex,dim) - TarOrd = ordering_as_matrix(:lex, dim) - S = change_order(R, TarOrd) - - I = Singular.std(id, complete_reduction = true) - - ideals = [] - for i = 2:nvars(S) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) - end - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :standard)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :generic)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_lex)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex), ordering_as_matrix(:lex, dim), :generic)) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - complete_reduction = true, - ) - - for id in ideals - @test equalitytest( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - end - end - end -end From 663166b766a86a3ff95b72d91b38ff83a1764e36 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 2 Mar 2022 19:11:46 +0100 Subject: [PATCH 58/85] simple improvements --- src/GroebnerWalk/GWtestFinal.jl | 702 +++++++++++++++++++++++ src/GroebnerWalk/GenericWalkUtilitys.jl | 25 +- src/GroebnerWalk/GroebnerWalk.jl | 15 +- src/GroebnerWalk/GroebnerWalkUtilitys.jl | 8 - 4 files changed, 712 insertions(+), 38 deletions(-) create mode 100644 src/GroebnerWalk/GWtestFinal.jl diff --git a/src/GroebnerWalk/GWtestFinal.jl b/src/GroebnerWalk/GWtestFinal.jl new file mode 100644 index 000000000..f74c81575 --- /dev/null +++ b/src/GroebnerWalk/GWtestFinal.jl @@ -0,0 +1,702 @@ +include("GroebnerWalk.jl") +include("Examples") +function test(case::Int) + + test_successfull = true + if case == 1 || case == 99 + id = katsura5() + R = base_ring(id) + dim = nvars(R) + ve = ones(Int, dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R2 = change_order(R, StartOrd) + S = change_order(R, TarOrd) + I = Singular.std( + Singular.Ideal(R2, [change_ring(x, R2) for x in gens(id)]), + complete_reduction = true, + ) + #I = Singular.std(id, complete_reduction = true) + @time T = groebnerwalk( + deepcopy(I), + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :generic, + 2, + ) + @time F = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal, + 2, + ) + + + + @time FA = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_combined, + ) + + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3, + ) + + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 4, + ) + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :generic, + 4, + ) + + #@time T0 = Singular.std( + # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + # complete_reduction = true, + #) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + + + + println("test tran: ", equalitytest(T6, T1)) + println("test fractal: ", equalitytest(T6, T2)) + println("test fractal: ", equalitytest(T6, T3)) + println("test pertubed: ", equalitytest(T5, T6)) + println("test standard: ", equalitytest(T4, T6)) + println("test generic: ", equalitytest(T6, T6)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end + end + if case == 2 || case == 99 + + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + + f1 = 16 + 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 + f2 = 6 + y^3 * z + 17 * x^2 * z^2 + 7 * x * y^2 * z^2 + 13 * x^3 * z^2 + J = Singular.Ideal(R, [f1, f2]) + + + + I = Singular.std(J, complete_reduction = true) + @time T = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :tran, + 3, + ) + + @time F = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal_start_order, + ) + + + @time FA = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal_combined, + ) + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :pertubed, + 2, + ) + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :standard, + ) + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :generic, + ) + + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 3)), + ) + + T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) + + + + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end + end + + if case == 3 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), + ) + + f1 = y^4 + y * z^2 - u^2 * w + f2 = 2 * x^2 * y + x^3 * w * u^2 + x + f3 = 2 - 3 * x^2 * v * z^4 * w + I = Singular.Ideal(R, [f1, f2, f3]) + I = Singular.std(I, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 4, + ) + + #= @time J = fractal_walk( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + ) =# + + + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_combined, + ) + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 4, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test tran: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + #println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equal(T4, T0)) + + + if !( + equalitytest(T2, T0) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + equalitytest(T0, T4) + ) + test_successfull = false + end + end + if case == 4 || case == 99 + R, (q, c, p, d) = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), + ) + + f1 = + 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - + 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + + c^2 * q^2 + + 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - + 8 * p + + c^2 + + 4 * d^2 - 2 * q + + 10 * p^2 + + 2 + f2 = + 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - + 3 * p * q * c + 4 * c + f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q + f4 = + 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + + 3 * c^2 + + 9 * p^2 * d^2 + + 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + + 12 * d^2 + + 4 * p^2 + + 12 * c * d * p + + 12 * c * d * q + + 12 * c * d * p * q - 12 * c * d + I = Singular.Ideal(R, [f1, f2, f3, f4]) + I = Singular.std(I, complete_reduction = true) + + + + @time T = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :tran, + ) + @time F = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :pertubed, + 3 + ) + + @time Fa = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :fractal_combined, + ) + + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :pertubed, + 4, + ) + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :standard, + ) + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 4), + ordering_as_matrix(:lex, 4), + :generic, + ) + + + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["q", "c", "p", "d"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), + ) + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Fa)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) + + if !( + equalitytest(T2, T1) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + equalitytest(T0, T4) + ) + test_successfull = false + end + + end + if case == 5 || case == 99 + R, (x, y, z) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), + ) + + f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 + f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 + f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 + I = Singular.Ideal(R, [f1, f2, f3]) + + I = Singular.std(I, complete_reduction = true) + + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z"], + ordering = :lex, + ) + + @time T = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :tran, + ) + @time F = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :fractal_combined, + ) + @time FA = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :pertubed, + 3 + ) + + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :standard, + ) + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :pertubed, + 3, + ) + + + + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 3), + ordering_as_matrix(:lex, 3), + :generic, + ) + + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + println("test tran: ", equalitytest(T0, T1)) + println("test fractal: ", equalitytest(T0, T2)) + println("test fractal: ", equalitytest(T0, T3)) + println("test pertubed: ", equalitytest(T5, T0)) + println("test standard: ", equalitytest(T4, T0)) + println("test generic: ", equalitytest(T6, T0)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + equalitytest(T0, T4) + ) + test_successfull = false + end + + end + + + + if case == 6 || case == 99 + R, (x, y, z, u, v, w) = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = :degrevlex, + ) + + + f1 = 2 * w * y + 2 * v * z + u^2 + x^2 + x + f2 = 2 * w * z + 2 * v * u + 2 * y * x + y + f3 = 2 * w * u + v^2 + 2 * z * x + z + y^2 + f4 = 2 * w * v + 2 * u * x + u + 2 * z * y + f5 = w^2 + 2 * v * x + v + 2 * u * y + z^2 + f6 = 2 * w * x + w + 2 * v * y + 2 * u * z + J = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) + I = Singular.std(J, complete_reduction = true) + + @time H = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :standard, + ) + #= @time J = fractal_walk_combined( + I, + MonomialOrder( + ordering_as_matrix(:degrevlex, 6), + [1, 1, 1, 1, 1, 1], + [0], + ), + MonomialOrder( + ordering_as_matrix(:lex, 6), + [1, 0, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + ), + )=# + + @time JJ = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_combined, + ) + + @time K = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :pertubed, + 4, + ) + @time L = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :fractal_combined, + ) + @time M = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, 6), + ordering_as_matrix(:lex, 6), + :generic, + ) + S, V = Singular.PolynomialRing( + Singular.QQ, + ["x", "y", "z", "u", "v", "w"], + ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), + ) + + @time T0 = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + complete_reduction = true, + ) + # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) + + println("test standard: ", equalitytest(T0, T6)) + println("test fractal2: ", equalitytest(T0, T5)) + #println("test fractal: ", equalitytest(T0, T1)) + println("test pertubed: ", equalitytest(T2, T0)) + println("test standard: ", equalitytest(T3, T0)) + println("test generic: ", equal(T4, T0)) + + if !( + equalitytest(T2, T0) && + equalitytest(T3, T6) && + equalitytest(T0, T5) && + equalitytest(T0, T4) + ) + test_successfull = false + end + + end + + if case == 7 || case == 99 + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + + S = change_order(R, TarOrd) + I = Singular.Ideal( + R, + [ + 2 * a^2 * b + + 3 * a * b^2 + + 3 * b^3 + + 4 * c^3 + + 4 * a * b * d + + c^2 * d + + 2 * b * d^2 + + 2 * d^3 + + 4 * c^2 + + 2 * c * d + + 2 * c, + 2 * a^2 * b + + 5 * a^2 * c + + 2 * b * c^2 + + c^2 * d + + a * c + + 2 * b * d + + 2 * c * d + + d^2 + + a + + 4 * d, + ], + ) + + + I = Singular.std(I, complete_reduction = true) + + + @time T = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_combined, + 4, + ) + @time F = groebnerwalk( + deepcopy(I), + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_start_order, + ) + @time FA = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 3 + ) + @time St = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :pertubed, + 4, + ) + @time Pe = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :fractal_combined, + 3, + ) + @time Ge = groebnerwalk( + I, + ordering_as_matrix(:degrevlex, dim), + ordering_as_matrix(:lex, dim), + :generic, + ) + + + #@time T6 = Singular.std( + # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), + # complete_reduction = true, + # ) + + T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) + T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) + T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) + T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) + T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) + T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) + + println("test tran: ", equalitytest(T6, T1)) + println("test fractal: ", equalitytest(T6, T2)) + println("test fractal: ", equalitytest(T6, T3)) + println("test pertubed: ", equalitytest(T5, T6)) + println("test standard: ", equalitytest(T4, T6)) + println("test generic: ", equalitytest(T6, T6)) + if !( + equalitytest(T2, T1) && + equalitytest(T3, T4) && + equalitytest(T6, T5) + ) + test_successfull = false + end + end + println("All tests were: ", test_successfull) +end diff --git a/src/GroebnerWalk/GenericWalkUtilitys.jl b/src/GroebnerWalk/GenericWalkUtilitys.jl index 2770aa8cd..1be26cc5d 100644 --- a/src/GroebnerWalk/GenericWalkUtilitys.jl +++ b/src/GroebnerWalk/GenericWalkUtilitys.jl @@ -174,30 +174,7 @@ function next_gamma( end return minV end -#= -function next_gamma( - G::Singular.sideal, - w::Vector{Int}, - S::Matrix{Int}, - T::Matrix{Int}, -) - V = filter_btz(S, difference_lead_tail(G)) - V = filter_ltz(T, V) - if (w != [0]) - V = filter_lf(w, S, T, V) - end - if isempty(V) - return V - end - minV = first(V) - for v in V - if less_facet(v, minV, S, T) - minV = v - end - end - return minV -end -=# + function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i = 1:nrows diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index 567d490e0..e71b4677e 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -1,7 +1,6 @@ include("GroebnerWalkUtilitys.jl") include("FractalWalkUtilitys.jl") include("GenericWalkUtilitys.jl") -include("StandardWalkUtilitys.jl") include("TranWalkUtilitys.jl") export groebnerwalk @@ -54,6 +53,11 @@ Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhe - `fractal_look_ahead`:Fractal Walk with look-ahead computation. *`p::Int`: Pertubationdegree (p,p) for the pertubed Walk. Default is 2. """=# +function groebnerWalk(G::Singular.sideal, StartOrder::Symbol = :degrevlex, TargetOrder::Symbol = :lex, WalkType::Symbol = :standard) + Rn = change_order(base_ring(G), ordering_as_matrix(StartOrder, nvars(base_ring(G)))) + Gb = std(change_ring(x, Rn) for x in gens(G), complete_reduction= true) +end + function groebnerwalk( G::Singular.sideal, S::Matrix{Int}, @@ -309,7 +313,7 @@ function fractal_recursiv( else println("up in: ", p, " with: ", w) H = fractal_recursiv( - Singular.Ideal(R, [x for x in Gw]), + Singular.Ideal(R, Gw), S, T, deepcopy(cw), @@ -409,7 +413,7 @@ function fractal_walk_recursiv_startorder( else println("up in: ", p, " with: ", w) H = fractal_walk_recursiv_startorder( - Singular.Ideal(R, [x for x in Gw]), + Singular.Ideal(R, Gw), S, T, deepcopy(cw), @@ -480,7 +484,6 @@ function fractal_walk_recursive_lex( Rn = change_order(R, w, T) if p == Singular.nvars(R) - Rn = change_order(R, w, PertVecs[p], T) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, @@ -490,7 +493,7 @@ function fractal_walk_recursive_lex( else println("up in: ", p, " with: ", w) H = fractal_walk_recursive_lex( - Singular.Ideal(R, [x for x in Gw]), + Singular.Ideal(R, Gw), S, T, deepcopy(cw), @@ -673,7 +676,7 @@ function fractal_walk_combined( else println("from $(cw) to $(w)", "up in: ", p, " with: ", w) H = fractal_walk_combined( - Singular.Ideal(R, [x for x in Gw]), + Singular.Ideal(R, Gw), S, T, deepcopy(cw), diff --git a/src/GroebnerWalk/GroebnerWalkUtilitys.jl b/src/GroebnerWalk/GroebnerWalkUtilitys.jl index 3c654f9d5..8ae455d80 100644 --- a/src/GroebnerWalk/GroebnerWalkUtilitys.jl +++ b/src/GroebnerWalk/GroebnerWalkUtilitys.jl @@ -375,14 +375,6 @@ function change_ring(p::Singular.spoly, R::Singular.PolyRing) end return finish(M) end -function change_ring(p::Singular.spoly, R::Singular.PolyRing) - cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) - M = MPolyBuildCtx(R) - for (c, v) in cvzip - Singular.push_term!(M, c, v) - end - return finish(M) -end #= From 794d4fa7e6759bb524bd51f519b93bd45ec078ad Mon Sep 17 00:00:00 2001 From: welpj Date: Sat, 5 Mar 2022 11:39:48 +0100 Subject: [PATCH 59/85] refactoring --- src/GroebnerWalk/{Examples => Examples.jl} | 62 +- src/GroebnerWalk/FractalWalkUtilitys.jl | 101 +-- src/GroebnerWalk/GWtestFinal.jl | 25 +- src/GroebnerWalk/GenericWalkUtilitys.jl | 92 ++- src/GroebnerWalk/GroebnerWalk.jl | 633 ++++++++++++------- src/GroebnerWalk/GroebnerWalkUtilitys.jl | 233 ++----- src/GroebnerWalk/Helper.jl | 155 +++++ src/GroebnerWalk/Testideals.jl | 208 ++++++ src/GroebnerWalk/{UnitTests => UnitTests.jl} | 36 +- src/GroebnerWalk/runtests | 8 + 10 files changed, 946 insertions(+), 607 deletions(-) rename src/GroebnerWalk/{Examples => Examples.jl} (93%) create mode 100644 src/GroebnerWalk/Helper.jl create mode 100644 src/GroebnerWalk/Testideals.jl rename src/GroebnerWalk/{UnitTests => UnitTests.jl} (86%) create mode 100644 src/GroebnerWalk/runtests diff --git a/src/GroebnerWalk/Examples b/src/GroebnerWalk/Examples.jl similarity index 93% rename from src/GroebnerWalk/Examples rename to src/GroebnerWalk/Examples.jl index f084f93d2..58f13a06f 100644 --- a/src/GroebnerWalk/Examples +++ b/src/GroebnerWalk/Examples.jl @@ -3,7 +3,7 @@ function katsura5() ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, u, t, z, y) = Singular.PolynomialRing( - Singular.N_ZpField(32003), + Singular.N_ZpField(32003), ["v", "u", "t", "z", "y"], ordering = Singular.ordering_M(StartOrd), ) @@ -23,7 +23,7 @@ function katsura6() ve = [1, 1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, u, t, z, y, x) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["v", "u", "t", "z", "y", "x"], ordering = Singular.ordering_M(StartOrd), ) @@ -132,7 +132,7 @@ function cyclic5() example = "Cyclic5" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (v, w, x, y, z) = Singular.PolynomialRing( - Singular.QQ, + Singular.n_ZpField(32003), ["v", "w", "x", "y", "z"], ordering = Singular.ordering_M(StartOrd), ) @@ -156,16 +156,16 @@ function cyclic4() ve = [1, 1, 1, 1] example = "Cyclic4" StartOrd = ordering_as_matrix(:degrevlex, dim) - R, (v, w, x, y, z) = Singular.PolynomialRing( + R, (w, x, y, z) = Singular.PolynomialRing( Singular.QQ, - ["v", "w", "x", "y", "z"], + ["w", "x", "y", "z"], ordering = Singular.ordering_M(StartOrd), ) - f1 = w+x+y+z - f2 = w*x+x*y+w*z+y*z - f3 = w*x*y+w*x*z+w*y*z+x*y*z - f4 = w*x*y*z-1 + f1 = w + x + y + z + f2 = w * x + x * y + w * z + y * z + f3 = w * x * y + w * x * z + w * y * z + x * y * z + f4 = w * x * y * z - 1 return Singular.Ideal(R, [f1, f2, f3, f4]) end function eco6() @@ -370,7 +370,7 @@ function noon8() example = "noon8" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6, x7, x8) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"], ordering = Singular.ordering_M(StartOrd), ) @@ -449,7 +449,7 @@ function redeco7() example = "redeco7" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, u7, x5, x6) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "u7", "x5", "x6"], ordering = Singular.ordering_M(StartOrd), ) @@ -625,3 +625,43 @@ function ex1() ], ) end + +function ex2() + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + + S = change_order(R, TarOrd) + return Singular.Ideal( + R, + [ + 2 * a^2 * b + + 3 * a * b^2 + + 3 * b^3 + + 4 * c^3 + + 4 * a * b * d + + c^2 * d + + 2 * b * d^2 + + 2 * d^3 + + 4 * c^2 + + 2 * c * d + + 2 * c, + 2 * a^2 * b + + 5 * a^2 * c + + 2 * b * c^2 + + c^2 * d + + a * c + + 2 * b * d + + 2 * c * d + + d^2 + + a + + 4 * d, + ], + ) +end diff --git a/src/GroebnerWalk/FractalWalkUtilitys.jl b/src/GroebnerWalk/FractalWalkUtilitys.jl index 69031656d..a633e27cf 100644 --- a/src/GroebnerWalk/FractalWalkUtilitys.jl +++ b/src/GroebnerWalk/FractalWalkUtilitys.jl @@ -1,67 +1,20 @@ include("GroebnerWalkUtilitys.jl") -#Structure which is used to define a MonomialOrdering a(v)*a(tv)*ordering_M(T) -#Maybe not needed -mutable struct MonomialOrder{T<:Matrix{Int},v<:Vector{Int},tv<:Vector{Int}} - m::T - w::v - t::tv -end -#= -#= -@doc Markdown.doc""" - convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} -Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). -"""=# -function convert_bounding_vector(v::Vector{T}) where {T<:Number} - w = Vector{Int}() - for i = 1:length(v) - push!(w, float(divexact(v[i], gcd(v)))) - end - return w -end=# - -#= -@doc Markdown.doc""" -function inCone( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int},Vector{Int}}, - t::Vector{Int}, -) -Returns 'true' if the leading tems of $G$ w.r.t the monomial ordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the monomial ordering $T$. -"""=# -function inCone( - G::Singular.sideal, - T::MonomialOrder{Matrix{Int},Vector{Int}}, - t::Vector{Int}, -) - R = change_order(G.base_ring, T.m) - I = Singular.Ideal(R, [change_ring(x, R) for x in Singular.gens(G)]) - cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) - for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) - return false - end - end - return true -end - #= @doc Markdown.doc""" function lift_fractal_walk( - G::Singular.sideal, - Gw::Singular.sideal, - R::Singular.PolyRing, - S::Singular.PolyRing, +G::Singular.sideal, +H::Singular.sideal, +Rn::Singular.PolyRing, ) -Performs a lifting step in the Groebner Walk proposed by Amrhein et. al. and Cox Little Oshea +Performs a lifting step in the Fractal Walk. """=# function lift_fractal_walk( G::Singular.sideal, - R::Singular.PolyRing, H::Singular.sideal, Rn::Singular.PolyRing, ) + R = base_ring(G) G.isGB = true G = Singular.Ideal( Rn, @@ -77,12 +30,12 @@ end #= @doc Markdown.doc""" -function isMonomial( +function ismonomial( Gw::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} Returns ´true´ if all polynomials of the given array are monomials. """=# -function isMonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} +function ismonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if length(Singular.coefficients(g)) > 1 return false @@ -115,7 +68,7 @@ function nextT( w::Array{T,1}, tw::Array{K,1}, ) where {T<:Number,K<:Number} -Returns the next t to compute the next weight vector w(t) = w + t * (tw - w). +Returns the next t to compute the next weight vector $w(t) = w + t * (tw - w)$ like it´s done in Amrhein & Gloor (1998) """=# function nextT( G::Singular.sideal, @@ -149,28 +102,13 @@ end #= @doc Markdown.doc""" -function change_order( - R::Singular.PolyRing, - T::MonomialOrder{Matrix{Int},Vector{Int}}, -) where {L<:Number,K<:Number} -Returns a new PolynomialRing w.r.t. the monomial ordering T. +function next_weightfr( + G::Singular.sideal, + cweight::Array{T,1}, + tweight::Array{K,1}, +) where {T<:Number,K<:Number} +Returns the next t to compute the next weight vector $w(t) = w + t * (tw - w)$ like it´s done in Fukuda et al. (2005). """=# -function change_order( - R::Singular.PolyRing, - T::Matrix{Int}, -) where {L<:Number,K<:Number} - G = Singular.gens(R) - Gstrich = string.(G) - S, H = Singular.PolynomialRing( - R.base_ring, - Gstrich, - ordering = Singular.ordering_a(T.w) * - Singular.ordering_a(T.t) * - Singular.ordering_M(T.m), - ) - return S -end - function next_weightfr( G::Singular.sideal, cweight::Array{T,1}, @@ -179,10 +117,10 @@ function next_weightfr( if (cweight == tweight) return [0] end - tmin = 1 + tmin = BigInt(1) for v in difference_lead_tail(G) - cw = dot(cweight, v) - tw = dot(tweight, v) + cw = BigInt(dot(cweight, v)) + tw = BigInt(dot(tweight, v)) if tw < 0 t = cw // (cw - tw) if t < tmin @@ -198,9 +136,10 @@ end function inCone( G::Singular.sideal, T::Matrix{Int}, - t::Vector{Int}, + pvecs::Vector{Vector{Int}}, + p::Int, ) -Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. +Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the Matrixordering $T$. """=# function inCone( G::Singular.sideal, diff --git a/src/GroebnerWalk/GWtestFinal.jl b/src/GroebnerWalk/GWtestFinal.jl index f74c81575..b034252fd 100644 --- a/src/GroebnerWalk/GWtestFinal.jl +++ b/src/GroebnerWalk/GWtestFinal.jl @@ -1,10 +1,11 @@ include("GroebnerWalk.jl") -include("Examples") +include("Examples.jl") function test(case::Int) + test_successfull = true if case == 1 || case == 99 - id = katsura5() + id = redeco7() R = base_ring(id) dim = nvars(R) ve = ones(Int, dim) @@ -21,19 +22,18 @@ function test(case::Int) deepcopy(I), ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :generic, + :fractal_combined, 2, ) + @time F = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :fractal, + :fractal_combined, 2, ) - - @time FA = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), @@ -41,14 +41,15 @@ function test(case::Int) :fractal_combined, ) + + @time St = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), - :pertubed, + :standard, 3, ) - @time Pe = groebnerwalk( I, ordering_as_matrix(:degrevlex, dim), @@ -76,9 +77,6 @@ function test(case::Int) T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - - println("test tran: ", equalitytest(T6, T1)) println("test fractal: ", equalitytest(T6, T2)) println("test fractal: ", equalitytest(T6, T3)) @@ -106,8 +104,6 @@ function test(case::Int) f2 = 6 + y^3 * z + 17 * x^2 * z^2 + 7 * x * y^2 * z^2 + 13 * x^3 * z^2 J = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(J, complete_reduction = true) @time T = groebnerwalk( I, @@ -151,13 +147,13 @@ function test(case::Int) :generic, ) - S, V = Singular.PolynomialRing( Singular.QQ, ["x", "y", "z"], ordering = Singular.ordering_M(ordering_as_matrix(:lex, 3)), ) + T0 = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), complete_reduction = true, @@ -222,7 +218,6 @@ function test(case::Int) ), ) =# - @time JJ = groebnerwalk( I, ordering_as_matrix(:degrevlex, 6), diff --git a/src/GroebnerWalk/GenericWalkUtilitys.jl b/src/GroebnerWalk/GenericWalkUtilitys.jl index 1be26cc5d..6411a55e2 100644 --- a/src/GroebnerWalk/GenericWalkUtilitys.jl +++ b/src/GroebnerWalk/GenericWalkUtilitys.jl @@ -11,7 +11,7 @@ function facet_initials( lm::Vector{spoly{L}}, v::Vector{Int}, ) where {L<:Nemo.RingElem} -Returns the facet initials of the polynomials w.r.t. the vector v. +Returns the initials of the polynomials w.r.t. the vector v. """=# function facet_initials( G::Vector{Singular.spoly{L}}, @@ -26,7 +26,7 @@ function facet_initials( el = first(Singular.exponent_vectors(lm[count])) for (e, c) in zip(Singular.exponent_vectors(g), Singular.coefficients(g)) - if el == e || isParallel(el - e, v) + if el == e || isparallel(el - e, v) Singular.push_term!(inw, c, e) end end @@ -40,10 +40,10 @@ end #= @doc Markdown.doc""" function difference_lead_tail( - I::Singular.sideal, - Lm::Vector{spoly{L}}, +G::Vector{spoly{L}}, +Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} -Returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. +Returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of $I$. """=# function difference_lead_tail( G::Vector{spoly{L}}, @@ -63,10 +63,10 @@ end #= @doc Markdown.doc""" -function isParallel(u::Vector{Int}, v::Vector{Int}) -Returns true if the vector u is parallel to the vector v. +function isparallel(u::Vector{Int}, v::Vector{Int}) +Returns true if the vector $u$ is parallel to the vector $v$. """=# -function isParallel(u::Vector{Int}, v::Vector{Int}) +function isparallel(u::Vector{Int}, v::Vector{Int}) count = 1 x = 0 for i = 1:length(u) @@ -96,11 +96,11 @@ end #= @doc Markdown.doc""" function lift_generic( - G::Singular.sideal, +G::Vector{spoly{L}}, Lm::Vector{Singular.spoly{L}}, H::Singular.sideal, ) where {L<:Nemo.RingElem} -Performs a lifting step in the Groebner Walk proposed by Fukuda et. al. +Performs a lifting step in the Groebner Walk proposed by Fukuda et al. (2005). """=# function lift_generic( G::Vector{spoly{L}}, @@ -112,7 +112,7 @@ function lift_generic( liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) for g in Singular.gens(H) push!(Newlm, Singular.leading_term(g)) - push!(liftPolys, g - modulo(g, G, Lm)) + push!(liftPolys, g - reduce_walk(g, G, Lm)) end return liftPolys, Newlm end @@ -151,6 +151,17 @@ function filter_lf( return btz end +#= +@doc Markdown.doc""" +function next_gamma( + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, +) where {L<:Nemo.RingElem} +Computes the next vector in the generic walk. +"""=# function next_gamma( G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, @@ -223,10 +234,10 @@ end #= @doc Markdown.doc""" -function dividesGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) -Returns the multiple m for all terms q in p with lm * m = q. +function divides_walk(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) +Returns the multiple $m$ for all terms $q$ in $p$ with $lm * m = q$. """=# -function dividesGW(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) +function divides_walk(p::Singular.spoly, lm::Singular.spoly, S::Singular.PolyRing) div = false newpoly = Singular.MPolyBuildCtx(S) for term in Singular.terms(p) @@ -245,55 +256,29 @@ end #= @doc Markdown.doc""" -function modulo( +function reduce_walk( p::Singular.spoly, G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, c::Bool = false, ) where {L<:Nemo.RingElem} -Returns p modulo G w.r.t. the leading terms Lm and true if a division occured. +Returns $p$ reduced by $G$ w.r.t. the leading terms Lm and true if a division occured. """=# -function modulo( +function reduce_walk( p::Singular.spoly, G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} for i = 1:length(G) - (q, b) = dividesGW(p, Lm[i], parent(p)) + (q, b) = divides_walk(p, Lm[i], parent(p)) if b - return modulo(p - (q * G[i]), G, Lm) + return reduce_walk(p - (q * G[i]), G, Lm) + #return reduce_walk(submult(p,q,G[i],nvars(parent(p))),G,Lm) end end return p end -#= -function modulo( - p::Singular.spoly, - G::Vector{spoly{L}}, - Lm::Vector{spoly{L}}, - c::Bool = false, -) where {L<:Nemo.RingElem} - I = 0 - R = parent(p) - Q = zero(R) - result = p - b = true - r = false - while b - b = false - for i = 1:length(G) - (q, b) = dividesGW(result, Lm[i], R) - if b - result = result - (q * G[i]) - b = true - r = true - break - end - end - end - return result, r -end=# #= @doc Markdown.doc""" @@ -301,7 +286,7 @@ function interreduce( G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, ) where {L<:Nemo.RingElem} -G represents a Gröbnerbasis. This function interreduces G w.r.t. the leading terms Lm with tail-reduction. +$G$ represents a Gröbnerbasis. This function interreduces $G$ w.r.t. the leading terms $Lm$ with tail-reduction. """=# function interreduce( G::Vector{spoly{L}}, @@ -309,19 +294,13 @@ function interreduce( ) where {L<:Nemo.RingElem} Rn = parent(first(G)) for i = 1:Singular.length(G) - gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) - Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) - for j = 1:length(G) - if i != j - push!(gensrest, G[j]) - push!(Lmrest, Lm[j]) - end - end - G[i] = modulo(G[i], gensrest, Lmrest) + G[i] = reduce_walk(G[i], G[1:end.!=i], Lm[1:end.!=i]) end return G end +#= +helping function for the reduction function submult( p::Singular.spoly{L}, q::Singular.spoly{L}, @@ -391,3 +370,4 @@ function submult( multe = nothing return Singular.finish(sol) end +=# diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index e71b4677e..d01d9ee34 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -1,15 +1,17 @@ +include("Helper.jl") include("GroebnerWalkUtilitys.jl") include("FractalWalkUtilitys.jl") include("GenericWalkUtilitys.jl") include("TranWalkUtilitys.jl") + export groebnerwalk ############################################################### #Implementation of the gröbner walk. ############################################################### -#for counting the steps of the groebnerwalk. +#For Counting Steps in the GroebnerWalk counter = 0 function getCounter() global counter @@ -17,6 +19,68 @@ function getCounter() counter = 0 return temp end +#= +@doc Markdown.doc""" +function groebnerwalk( +G::Singular.sideal, +startOrder::Symbol = :degrevlex, +targetOrder::Symbol = :lex, +walktype::Symbol = :standard, +pertubationDegree::Int = 2, +) +Given an Ideal $G$ generated by a reduced Groebner Basis w.r.t. the monomial ordering startOrder this function +returns a reduced Groebner Basis w.r.t. the monomial ordering targetOrder by converting it using the Groebner Walk. +The Groebner Walk is proposed by Collart et al. (1993) +One can choose a strategy of: +Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). +Pertubed Walk (:pertubed, with $p$ = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). +Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). +Fractal Walk (Combined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with all of the following extensions. This Version uses the Buchberger Algorithm to skip weightvectors with entrys bigger than Int32. +Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. +Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes both, the start und the target vector. +Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that the $targetOrder$ represents the lex ordering. Pertubes only the target vector. +Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. + +#Arguments +*`I::Singular.sideal`: Gröbnerbasis to compute the Gröbnerbasis w.r.t. the traget-ordering. +*`startOrder::Symbol`: The ordering w.r.t. the Gröbnerbasis I. Default is :degrevlex +*`targetOrder::Symbol`: The ordering we want to compute a Gröbnerbasis for. Default is :lex. +*`walktype::Symbol`: Strategy of the Gröbnerwalk to be used. There are the strategies: + - `standard`: Standard Walk (default), + - `pertubed`: Pertubed Walk, + - `tran`: Tran´s Walk, + - `generic`: Generic Walk, + - `fractal`: Standard-Version of the Fractal Walk, + - `fractalcombined`: Combined Fractal Walk with handling of a weight vector w.r.t. the start ordering and look-ahead computation for lexicographic target-ordering, + - `fractal_look_ahead`:Fractal Walk with look-ahead computation. +*`pertubationDegree::Int`: Pertubationdegree for the pertubed Walk. Default is 2. +"""=# +function groebnerwalk( + G::Singular.sideal, + startOrder::Symbol = :degrevlex, + targetOrder::Symbol = :lex, + walktype::Symbol = :standard, + pertubationDegree::Int = 2, +) + R = change_order( + base_ring(G), + ordering_as_matrix(startOrder, nvars(base_ring(G))), + ) + Gb = std( + Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]), + complete_reduction = true, + ) + + return groebnerwalk( + Gb, + ordering_as_matrix(startOrder, nvars(R)), + ordering_as_matrix(targetOrder, nvars(R)), + walktype, + pertubationDegree, + ) +end + #= @doc Markdown.doc""" function groebnerwalk( @@ -35,14 +99,14 @@ Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. Pertubed Walk (:pertubed, with $p$ = Pertubation degree) computes the Walk like it´s presented in Amrhein et al. (1997). Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes oth, the start und the target vector. +Fractal Walk (:fractal_start_order) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes both, the start und the target vector. Fractal Walk (:fractal_lex) computes the Walk like it´s presented in Amrhein & Gloor (1998) in the special case that $T$ represents the lex ordering. Pertubes only the target vector. Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhein & Gloor (1998). This Version uses the buchberger algorithm under certain circumstances before reaching the maximal pertubation depth. #Arguments *`I::Singular.sideal`: Gröbnerbasis to compute the Gröbnerbasis w.r.t. the traget-ordering. -*`S::Matrix{Int}`: The ordering w.r.t. the Gröbnerbasis I. Note that S has to be a nxn-matrix with rank(S)=n. -*`T::Matrix{Int}`: The ordering we want to compute a Gröbnerbasis for. Note that T has to be a nxn-matrix with rank(T)=n. +*`S::Matrix{Int}`: The start ordering w.r.t. the Gröbnerbasis $I$. Note that $S$ has to be a nxn-matrix with rank(S)=n. +*`T::Matrix{Int}`: The target ordering we want to compute a Gröbnerbasis for. Note that $T$ has to be a nxn-matrix with rank(T)=n. *`grwalktype::Symbol`: Strategy of the Gröbnerwalk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, @@ -51,53 +115,57 @@ Fractal Walk (:factal_look_ahead) computes the Walk like it´spresented in Amrhe - `fractal`: Standard-Version of the Fractal Walk, - `fractalcombined`: Combined Fractal Walk with handling of start-ordering and look-ahead computation for lexicographic target-ordering, - `fractal_look_ahead`:Fractal Walk with look-ahead computation. -*`p::Int`: Pertubationdegree (p,p) for the pertubed Walk. Default is 2. +*`p::Int`: Pertubationdegree for the pertubed Walk. Default is 2. """=# -function groebnerWalk(G::Singular.sideal, StartOrder::Symbol = :degrevlex, TargetOrder::Symbol = :lex, WalkType::Symbol = :standard) - Rn = change_order(base_ring(G), ordering_as_matrix(StartOrder, nvars(base_ring(G)))) - Gb = std(change_ring(x, Rn) for x in gens(G), complete_reduction= true) -end - function groebnerwalk( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - grwalktype::Symbol = :standard, + walktype::Symbol = :standard, p::Int = 2, ) - if grwalktype == :standard + if walktype == :standard walk = (x, y, z) -> standard_walk(x, y, z) - elseif grwalktype == :generic + elseif walktype == :generic walk = (x, y, z) -> generic_walk(x, y, z) # elseif grwalktype == :pgeneric # walk = (x,y,z) -> pgeneric_walk(x,y,z,p) - elseif grwalktype == :pertubed + elseif walktype == :pertubed walk = (x, y, z) -> pertubed_walk(x, y, z, p) - elseif grwalktype == :fractal + elseif walktype == :fractal walk = (x, y, z) -> fractal_walk(x, y, z) - elseif grwalktype == :fractal_start_order + elseif walktype == :fractal_start_order walk = (x, y, z) -> fractal_walk_start_order(x, y, z) - elseif grwalktype == :fractal_lex + elseif walktype == :fractal_lex walk = (x, y, z) -> fractal_walk_lex(x, y, z) - elseif grwalktype == :fractal_look_ahead + elseif walktype == :fractal_look_ahead walk = (x, y, z) -> fractal_walk_look_ahead(x, y, z) - elseif grwalktype == :tran + elseif walktype == :tran walk = (x, y, z) -> tran_walk(x, y, z) - elseif grwalktype == :fractal_combined + elseif walktype == :fractal_combined walk = (x, y, z) -> fractal_walk_combined(x, y, z) end + !check_ordering_M(S, T, G) && throw( + error( + "The matrices representing the Ordering have to be nxn-matrices with full rank.", + ), + ) - ######TODO:Check the parameter##### R = base_ring(G) I = Singular.Ideal(R, [R(x) for x in gens(G)]) Gb = walk(I, S, T) println("Cones crossed: ", getCounter()) - S = change_order(Gb.base_ring, T) + S = change_order(R, T) return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end + +############################################################### +#Implementation of the standard walk. +############################################################### + function standard_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) println("standard_walk results") println("Crossed Cones in: ") @@ -108,47 +176,44 @@ function standard_walk( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - cweight::Vector{Int}, - tweight::Vector{Int}, + currweight::Vector{Int}, + tarweight::Vector{Int}, ) - R = base_ring(G) - Rn = change_order(R, cweight, T) terminate = false while !terminate - G = standard_step(G, R, cweight, Rn) - println(cweight) + G = standard_step(G, currweight, T) + println(currweight) global counter = getCounter() + 1 - if cweight == tweight + if currweight == tarweight terminate = true else - cweight = next_weight(G, cweight, tweight) - if !checkInt32(cweight) - return G - end - # while !checkInt32(cweight) - # cweight, b = truncw(G, cweight) - # if !b - # return G - # end - # end - R = Rn - Rn = change_order(Rn, cweight, T) + currweight = next_weight(G, currweight, tarweight) end end return G end -function standard_step( - G::Singular.sideal, - R::Singular.PolyRing, - cw::Vector{Int}, - Rn::Singular.PolyRing, -) - Gw = initials(Rn, gens(G), cw) +function standard_step(G::Singular.sideal, w::Vector{Int}, T::Matrix{Int}) + R = base_ring(G) + + #check if no entry of w is bigger than In32. If it´s bigger multiply it by 0.1 and round. + if !checkInt32(w) + Gw = initials(R, gens(G), w) + w, b = truncw(G, w, Gw) + if !b + throw(Exception) + end + Rn = change_order(R, w, T) + Gw = [change_ring(x, Rn) for x in Gw] + else + Rn = change_order(R, w, T) + Gw = initials(Rn, gens(G), w) + end + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) - return interreduceGW(H) + return interreduce_walk(H) end ############################################################### @@ -162,7 +227,6 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) G = [change_ring(x, Rn) for x in gens(G)] v = next_gamma(G, Lm, [0], S, T) - println("generic_walk results") println("Crossed Cones with facetNormal: ") while !isempty(v) @@ -195,7 +259,7 @@ end ############################################################### -#Pertubed-version of the groebner walk Amrhein et al. +#Pertubed-version of the groebner walk by Amrhein et al. (1997) ############################################################### function pertubed_walk( G::Singular.sideal, @@ -203,20 +267,19 @@ function pertubed_walk( T::Matrix{Int}, p::Int, ) - cweight = pertubed_vector(G, S, p) - #cweight = S[1, :] + currweight = pertubed_vector(G, S, p) terminate = false println("pertubed_walk results") println("Crossed Cones in: ") while !terminate - tweight = pertubed_vector(G, T, p) - Tn = add_weight_vector(tweight, T) - G = standard_walk(G, S, Tn, cweight, tweight) - if inCone(G, T, tweight) + tarweight = pertubed_vector(G, T, p) + Tn = add_weight_vector(tarweight, T) + G = standard_walk(G, S, Tn, currweight, tarweight) + if inCone(G, T, tarweight) terminate = true else p = p - 1 - cweight = tweight + currweight = tarweight S = Tn end end @@ -224,17 +287,12 @@ function pertubed_walk( end ############################################################### -#fractal-walk by Amrhein et al. -#Inlcuding: -#fractal_walk -> standard-version -#fractal_walk2 -> checks if the starting weight is in the inner of a cone. -#fractal_walk3 -> fractal walk expecially for conversion to the lexikographic orderig. -# checks if the starting weight is in the inner of a cone. +#fractal walk ############################################################### -######################################## +########################################## #Counter for the steps in the fractal_walk -######################################## +########################################## counterFr = 0 function deleteCounterFr() global counterFr @@ -249,15 +307,21 @@ end function raiseCounterFr() global counterFr = getCounterFr() + 1 end -PertVecs = [] -sigma = [] + +########################################## +#global weightvectors +########################################## +pTargetWeights = [] +pStartWeights = [] +firstStepMode = false function fractal_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println(PertVecs) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + println(pTargetWeights) println("FractalWalk_standard results") println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S, T, S[1, :], PertVecs, 1) + Gb = fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -266,42 +330,53 @@ function fractal_recursiv( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - cw::Vector{Int}, - PertVecs::Vector{Vector{Int}}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, p::Int, ) R = base_ring(G) terminate = false G.isGB = true - w = cw + w = currweight while !terminate - t = next_weightfr(G, w, PertVecs[p]) + t = next_weightfr(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, PertVecs, p) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue - end - if inCone(G, T, cw) - println(cw, " in Cone", p) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue + end + if inCone(G, T, currweight) + println(currweight, " in Cone", p) return G end elseif t == [0] - if p == 1 || inCone(G, T, PertVecs, p) - println(PertVecs[p], " in Cone", p) + if p == 1 || inCone(G, T, pTargetWeights, p) + println(pTargetWeights[p], " in Cone", p) return G end - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue end - w = w + t * (PertVecs[p] - w) + + # Handling the current weight with regards to Int32-entrys. + w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - checkInt32(w) Gw = initials(R, Singular.gens(G), w) + if !checkInt32(w) + w, b = truncw(G, w, Gw) + if !b + throw(Exception) + end + end + + # Converting the Groebnerbasis Rn = change_order(R, w, T) if p == nvars(R) H = Singular.std( @@ -316,37 +391,34 @@ function fractal_recursiv( Singular.Ideal(R, Gw), S, T, - deepcopy(cw), - PertVecs, + deepcopy(currweight), + pTargetWeights, p + 1, ) end + # Lifting #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = interreduceGW(H) + H = lift_fractal_walk(G, H, Rn) + G = interreduce_walk(H) R = Rn - cw = w + currweight = w end return G end -cwPert = [] -firstStepMode = false -function cwpert(p::Int) - cwPert[p] -end + + function fractal_walk_start_order( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, ) - global PertVecs = + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - global sigma = S[1, :] println("fractal_walk_withStartorder results") println("Crossed Cones in: ") - Gb = fractal_walk_recursiv_startorder(G, S, T, S[1, :], PertVecs, 1) + Gb = fractal_walk_recursiv_startorder(G, S, T, S[1, :], pTargetWeights, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -355,54 +427,66 @@ function fractal_walk_recursiv_startorder( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - cw::Vector{Int}, - PertVecs::Vector{Vector{Int}}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true + + # Handling the starting weight. if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), cw)) - global cwPert = [pertubed_vector(G, S, i) for i = 1:nvars(R)] + if !ismonomial(initials(R, Singular.gens(G), currweight)) + global pStartWeights = [pertubed_vector(G, S, i) for i = 1:nvars(R)] global firstStepMode = true end end if firstStepMode - w = cwPert[p] + w = pStartWeights[p] else - w = cw + w = currweight end while !terminate - t = next_weightfr(G, w, PertVecs[p]) + t = next_weightfr(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, PertVecs, p) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue - end - if inCone(G, T, cw) - println(cw, " in Cone", p) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue + end + if inCone(G, T, currweight) + println(currweight, " in Cone", p) return G end elseif t == [0] - if p == 1 ||inCone(G, T, PertVecs, p) - println(PertVecs[p], " in Cone", p) + if p == 1 || inCone(G, T, pTargetWeights, p) + println(pTargetWeights[p], " in Cone", p) return G end - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue end - w = w + t * (PertVecs[p] - w) + + # Handling the current weight with regards to Int32-entrys. + w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - checkInt32(w) Gw = initials(R, gens(G), w) + if !checkInt32(w) + w, b = truncw(G, w, Gw) + if !b + throw(Exception) + end + end Rn = change_order(R, w, T) + # Converting the Groebnerbasis if p == Singular.nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -416,25 +500,26 @@ function fractal_walk_recursiv_startorder( Singular.Ideal(R, Gw), S, T, - deepcopy(cw), - PertVecs, + deepcopy(currweight), + pTargetWeights, p + 1, ) global firstStepMode = false end #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = interreduceGW(H) + H = lift_fractal_walk(G, H, Rn) + G = interreduce_walk(H) R = Rn - cw = w + currweight = w end return G end function fractal_walk_lex(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] println("fractal_walk_lex results") println("Crossed Cones in: ") - Gb = fractal_walk_recursive_lex(G, S, T, S[1, :], PertVecs, 1) + Gb = fractal_walk_recursive_lex(G, S, T, S[1, :], pTargetWeights, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -443,46 +528,57 @@ function fractal_walk_recursive_lex( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - cw::Vector{Int}, - PertVecs::Vector{Vector{Int}}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true - w = cw + w = currweight while !terminate - t = next_weightfr(G, w, PertVecs[p]) + t = next_weightfr(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, PertVecs, p) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue - end - if inCone(G, T, cw) - println(cw, " in Cone", p) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue + end + if inCone(G, T, currweight) + println(currweight, " in Cone", p) return G end elseif t == [0] - if p == 1 || inCone(G, T, PertVecs, p) - println(PertVecs[p], " in Cone", p) + if p == 1 || inCone(G, T, pTargetWeights, p) + println(pTargetWeights[p], " in Cone", p) return G end - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue end if t == 1 && p == 1 - return fractal_walk_recursive_lex(G, S, T, w, PertVecs, p + 1) + return fractal_walk_recursive_lex(G, S, T, w, pTargetWeights, p + 1) else - w = w + t * (PertVecs[p] - w) + + w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - checkInt32(w) Gw = initials(R, Singular.gens(G), w) + + # Handling the current weight with regards to Int32-entrys. + if !checkInt32(w) + w, b = truncw(G, w, Gw) + if !b + throw(Exception) + end + end Rn = change_order(R, w, T) + # Converting the Groebnerbasis if p == Singular.nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -496,18 +592,18 @@ function fractal_walk_recursive_lex( Singular.Ideal(R, Gw), S, T, - deepcopy(cw), - PertVecs, + deepcopy(currweight), + pTargetWeights, p + 1, ) global firstStepMode = false end end #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = interreduceGW(H) + H = lift_fractal_walk(G, H, Rn) + G = interreduce_walk(H) R = Rn - cw = w + currweight = w end return G end @@ -518,8 +614,9 @@ function fractal_walk_look_ahead( ) println("fractal_walk_look_ahead results") println("Crossed Cones in: ") - global PertVecs = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv(G, S, T, S[1, :], PertVecs, 1) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] + Gb = fractal_walk_look_ahead_recursiv(G, S, T, S[1, :], pTargetWeights, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -528,44 +625,54 @@ function fractal_walk_look_ahead_recursiv( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - cw::Vector{Int}, - PertVecs::Vector{Vector{Int}}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true - w = cw + w = currweight while !terminate - t = next_weightfr(G, w, PertVecs[p]) + t = next_weightfr(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, PertVecs, p) - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue - end - if inCone(G, T, cw) - println(cw, " in Cone", p) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue + end + if inCone(G, T, currweight) + println(currweight, " in Cone", p) return G end elseif t == [0] - if p == 1 || inCone(G, T, PertVecs, p) - println(PertVecs[p], " in Cone", p) + if p == 1 || inCone(G, T, pTargetWeights, p) + println(pTargetWeights[p], " in Cone", p) return G end - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue end - w = w + t * (PertVecs[p] - w) + w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - checkInt32(w) Gw = initials(R, Singular.gens(G), w) + + # Handling the current weight with regards to Int32-entrys. + if !checkInt32(w) + w, b = truncw(G, w, Gw) + if !b + throw(Exception) + end + end Rn = change_order(R, w, T) + # Converting the Groebnerbasis if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -579,16 +686,16 @@ function fractal_walk_look_ahead_recursiv( Singular.Ideal(R, Gw), S, T, - deepcopy(cw), - PertVecs, + deepcopy(currweight), + pTargetWeights, p + 1, ) end #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = interreduceGW(H) + H = lift_fractal_walk(G, H, Rn) + G = interreduce_walk(H) R = Rn - cw = w + currweight = w end return G end @@ -599,12 +706,11 @@ function fractal_walk_combined( S::Matrix{Int}, T::Matrix{Int}, ) - global PertVecs = + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println(PertVecs) println("fractal_walk_combined results") println("Crossed Cones in: ") - Gb = fractal_walk_combined(G, S, T, S[1, :], PertVecs, 1) + Gb = fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) println("Cones crossed: ", deleteCounterFr()) return Gb end @@ -613,59 +719,86 @@ function fractal_walk_combined( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - cw::Vector{Int}, - PertVecs::Vector{Vector{Int}}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, p::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true + + # Handling the weight of the start ordering. if (p == 1) - if !isMonomial(initials(R, Singular.gens(G), cw)) - global cwPert = [pertubed_vector(G, S, i) for i = 1:nvars(R)] - println(cwPert) + if !ismonomial(initials(R, Singular.gens(G), currweight)) + global pStartWeights = [pertubed_vector(G, S, i) for i = 1:nvars(R)] + println(pStartWeights) global firstStepMode = true end end if firstStepMode - w = cwPert[p] + w = pStartWeights[p] else - w = cw + w = currweight end while !terminate - t = next_weightfr(G, w, PertVecs[p]) + t = next_weightfr(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, PertVecs, p) - global PertVecs = + if inCone(G, T, currweight) + println(currweight, " in Cone", p) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + println("not in Cone ", pTargetWeights) end - if inCone(G, T, cw) - println(cw, " in Cone", p) return G end elseif t == [0] - if inCone(G, T, PertVecs, p) - println(PertVecs[p], " in Cone", p) + if inCone(G, T, pTargetWeights, p) + println(pTargetWeights[p], " in Cone", p) return G end - global PertVecs = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", PertVecs) - continue + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + continue end if t == 1 && p == 1 println("up in: ", p, " with: t = 1") - return fractal_walk_combined(G, S, T, w, PertVecs, p + 1) + return fractal_walk_combined(G, S, T, w, pTargetWeights, p + 1) else - w = w + t * (PertVecs[p] - w) + w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) - checkInt32(w) Gw = initials(R, gens(G), w) + + # Handling the current weight with regards to Int32-entrys. Addtionally use Buchberger´s Algorithm to skip a weight>Int32 + if !checkInt32(w) + w, b = truncw(G, w, Gw) + if !b + Rn = change_order(R, T) + w = T[1, :] + G = Singular.std( + Singular.Ideal( + Rn, + [change_ring(x, Rn) for x in gens(G)], + ), + complete_reduction = true, + ) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + end + return G + else + Rn = change_order(R, w, T) + end + end Rn = change_order(R, w, T) + # Converting the Groebnerbasis if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -674,68 +807,94 @@ function fractal_walk_combined( println(w, " in depth", p) raiseCounterFr() else - println("from $(cw) to $(w)", "up in: ", p, " with: ", w) + println( + "from $(currweight) to $(w)", + "up in: ", + p, + " with: ", + w, + ) H = fractal_walk_combined( Singular.Ideal(R, Gw), S, T, - deepcopy(cw), - PertVecs, + deepcopy(currweight), + pTargetWeights, p + 1, ) global firstStepMode = false end end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, R, H, Rn) - G = interreduceGW(H) + H = lift_fractal_walk(G, H, Rn) + G = interreduce_walk(H) R = Rn - cw = w + currweight = w end return G end + ############################################################### -#Tran-version of the groebner walk by Tran (2002) +#Tran´s version of the groebner walk by Tran (2002). ############################################################### function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) - cweight = S[1, :] - tweight = T[1, :] + currweight = S[1, :] + tarweight = T[1, :] println("tran_walk results") println("Crossed Cones in: ") R = base_ring(G) - if !isMonomial(initials(R, Singular.gens(G), cweight)) - cweight = pertubed_vector(G, S, nvars(R)) + if !ismonomial(initials(R, Singular.gens(G), currweight)) + currweight = pertubed_vector(G, S, nvars(R)) end terminate = false while !terminate - w = next_weight(G, cweight, tweight) + w = next_weight(G, currweight, tarweight) println(w) - while !checkInt32(w) - # w, b = truncw(G, w) - # if !b - return G - # end + if !checkInt32(w) + w, b = truncw(G, w, initials(R, gens(G), w)) + if !b + return G + end end Rn = change_order(R, w, T) - if w == tweight - if inCone(G, T, cweight) + if w == tarweight + if inCone(G, T, currweight) + #this checks if in_{<_{cw}}(g)= in_<(in_cw(g)) = in_<<(g) f.a. g in G return G - elseif inSeveralCones(initials(base_ring(G), gens(G), tweight)) - tweight = representation_vector(G, T) + elseif inSeveralCones(initials(base_ring(G), gens(G), tarweight)) + tarweight = representation_vector(G, T) continue end end - G = standard_step(G, R, w, Rn) + G = standard_step_without_int32_check(G, w, T) global counter = getCounter() + 1 R = Rn - cweight = w + currweight = w end return G end +############################################################### +# Standard_step without the checking of the weight $w$ w.r.t. Int32 +############################################################### + +function standard_step_without_int32_check( + G::Singular.sideal, + w::Vector{Int}, + T::Matrix{Int}, +) + R = base_ring(G) + Rn = change_order(R, w, T) + + Gw = initials(Rn, gens(G), w) + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) + #H = liftGW2(G, R, Gw, H, Rn) + H = lift(G, R, H, Rn) + return interreduce_walk(H) +end + function pgeneric_walk( G::Singular.sideal, S::Matrix{Int}, diff --git a/src/GroebnerWalk/GroebnerWalkUtilitys.jl b/src/GroebnerWalk/GroebnerWalkUtilitys.jl index 8ae455d80..782b77d1b 100644 --- a/src/GroebnerWalk/GroebnerWalkUtilitys.jl +++ b/src/GroebnerWalk/GroebnerWalkUtilitys.jl @@ -6,37 +6,21 @@ #This Version is used by the standard_walk, pertubed_walk and tran_walk. function next_weight( G::Singular.sideal, - cweight::Vector{Int}, - tweight::Vector{Int}, + cw::Vector{Int}, + tw::Vector{Int}, ) where {K<:Number} tmin = BigInt(1) for v in difference_lead_tail(G) - cw = BigInt(dot(cweight, v)) - tw = BigInt(dot(tweight, v)) - if tw < 0 - t = cw // (cw - tw) + cdotw = BigInt(dot(cw, v)) + tdotw = BigInt(dot(tw, v)) + if tdotw < 0 + t = cdotw // (cdotw - tdotw) if t < tmin tmin = t end end end - w = convert_bounding_vector(cweight + tmin * (tweight - cweight)) - #=cw = cweight - if !checkInt32(w) - println(w) - for i in 1:length(cweight) - cweight[i] = round(cweight[i] * 0.10) - if cweight[i]== 0 - cweight = 1 - end - end - if !inCone(G, add_weight_vector(cw, T), cweight) - println("not", cweight) - return w - end - w= next_weight(G,cweight,tweight,T) - end=# - return w + return convert_bounding_vector(cw + tmin * (tw - cw)) end function checkInt32(w::Vector{Int}) @@ -48,19 +32,25 @@ function checkInt32(w::Vector{Int}) end return true end -function truncw(G::Singular.sideal, w::Vector{Int}) - wtemp = Vector{Int}(undef, length(w)) - R = base_ring(G) - for i = 1:length(w) - wtemp[i] = round(w[i] * 0.10) - end - if initials(R, gens(G), w) != initials(R, gens(G), wtemp) - println(wtemp) - println(initials(R, gens(G), w), " and ", initials(R, gens(G), wtemp)) - return w, false - else - return wtemp, true +function truncw( + G::Singular.sideal, + w::Vector{Int}, + inw::Vector{L}, +) where {L<:Nemo.RingElem} + while !checkInt32(w) + println("$w > Int32") + R = base_ring(G) + for i = 1:length(w) + w[i] = round(w[i] * 0.10) + end + w = convert_bounding_vector(w) + if inw != initials(R, gens(G), w) + println("Initials are different - return not rounded weight") + return w, false + end end + println("Converted to Vector $w of the same face.") + return w, true end #Return the initials of polynomials w.r.t. a weight vector. function initials( @@ -230,7 +220,7 @@ function liftGW2( gG = collect(gens(G)) inG = [change_ring(x, R) for x in inG] for i = 1:length(gH) - q = divalg(change_ring(gH[i], R), inG, R) + q = division_algorithm(change_ring(gH[i], R), inG, R) gH[i] = Rn(0) for j = 1:length(inG) gH[i] = @@ -243,7 +233,7 @@ function liftGW2( return G end -function divalg( +function division_algorithm( p::spoly{L}, f::Vector{spoly{L}}, R::Singular.PolyRing, @@ -300,10 +290,10 @@ function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} end -#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) +#return a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T) function change_order( R::Singular.PolyRing, - cweight::Array{L,1}, + cw::Array{L,1}, T::Matrix{Int}, ) where {L<:Number,K<:Number} G = Singular.gens(R) @@ -313,23 +303,33 @@ function change_order( S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Singular.ordering_a(cweight) * Singular.ordering_M(T), + ordering = Singular.ordering_a(cw) * Singular.ordering_M(T), cached = false, ) - else + elseif s[1] - s[2] == 1 S, H = Singular.PolynomialRing( R.base_ring, Gstrich, - ordering = Singular.ordering_a(cweight) * + ordering = Singular.ordering_a(cw) * Singular.ordering_a(T[1, :]) * Singular.ordering_M(T[2:end, :]), cached = false, ) + else + S, H = Singular.PolynomialRing( + R.base_ring, + Gstrich, + ordering = Singular.ordering_a(cw) * + Singular.ordering_a(T[1, :]) * + Singular.ordering_a(T[2, :]) * + Singular.ordering_M(T[3:end, :]), + cached = false, + ) end return S end -#return a copy of the PolynomialRing I, equipped with the ordering a(cweight)*ordering_M(T) +#return a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T) function change_order( R::Singular.PolyRing, w::Vector{Int}, @@ -363,7 +363,6 @@ function change_order( ordering = Singular.ordering_M(M), cached = false, ) - #@error("Not implemented yet") return S end @@ -385,7 +384,7 @@ function interreduce( ) where {L<:Nemo.RingElem} G represents a Gröbnerbasis. This function interreduces G w.r.t. the leading terms Lm with tail-reduction. """=# -function interreduceGW(G::Singular.sideal) where {L<:Nemo.RingElem} +function interreduce_walk(G::Singular.sideal) where {L<:Nemo.RingElem} Rn = base_ring(G) Generator = collect(gens(G)) I = 0 @@ -397,147 +396,3 @@ function interreduceGW(G::Singular.sideal) where {L<:Nemo.RingElem} G = Singular.Ideal(Rn, Generator) return G end -############################################# -# unspecific help functions -############################################# - -function ident_matrix(n::Int) - M = zeros(Int, n, n) - for i = 1:n - M[i, i] = 1 - end - return M -end - -function anti_diagonal_matrix(n::Int) - M = zeros(Int, n, n) - for i = 1:n - M[i, n+1-i] = -1 - end - return M -end - -# Singular.isequal depends on order of generators -function equalitytest(G::Singular.sideal, K::Singular.sideal) - if Singular.ngens(G) != Singular.ngens(K) - return false - end - generators = Singular.gens(G) - count = 0 - for gen in generators - for r in Singular.gens(K) - if gen * leading_coefficient(r) - r * leading_coefficient(gen) == 0 - count += 1 - break - end - end - end - if count == Singular.ngens(G) - return true - end - return false -end - -function dot(v::Vector{Int}, w::Vector{Int}) - sum = 0 - for i = 1:length(v) - @inbounds sum += v[i] * w[i] - end - return sum -end - -function ordering_as_matrix(w::Vector{Int}, ord::Symbol) - if length(w) > 2 - if ord == :lex - return [ - w' - ident_matrix(length(w))[1:length(w)-1, :] - ] - end - if ord == :deglex - return [ - w' - ones(Int, length(w))' - ident_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :degrevlex - return [ - w' - ones(Int, length(w))' - anti_diagonal_matrix(length(w))[1:length(w)-2, :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - end - else - error("not implemented") - end -end - -function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M[2:length(w), :] - ] -end -function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M[1:length(w)-1, :] - ] -end -function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) - return [ - w' - M - ] -end - -function ordering_as_matrix(ord::Symbol, nvars::Int) - if ord == :lex - return ident_matrix(nvars) - end - if ord == :deglex - return [ - ones(Int, nvars)' - ident_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :degrevlex - return [ - ones(Int, nvars)' - anti_diagonal_matrix(nvars)[1:nvars-1, :] - ] - end - if ord == :revlex - return [ - w' - anti_diagonal_matrix(length(w))[1:length(w)-1, :] - ] - else - error("not implemented") - end -end - - -function deg(p::Singular.spoly, n::Int) - max = 0 - for mon in Singular.monomials(p) - ev = Singular.exponent_vectors(mon) - sum = 0 - for e in ev - for i = 1:n - sum += e[i] - end - if (max < sum) - max = sum - end - end - end - return max -end diff --git a/src/GroebnerWalk/Helper.jl b/src/GroebnerWalk/Helper.jl new file mode 100644 index 000000000..99269a69e --- /dev/null +++ b/src/GroebnerWalk/Helper.jl @@ -0,0 +1,155 @@ +############################################# +# unspecific help functions +############################################# + +function ident_matrix(n::Int) + M = zeros(Int, n, n) + for i = 1:n + M[i, i] = 1 + end + return M +end + +function anti_diagonal_matrix(n::Int) + M = zeros(Int, n, n) + for i = 1:n + M[i, n+1-i] = -1 + end + return M +end + +# Singular.isequal depends on order of generators +function equalitytest(G::Singular.sideal, K::Singular.sideal) + if Singular.ngens(G) != Singular.ngens(K) + return false + end + generators = Singular.gens(G) + count = 0 + for gen in generators + for r in Singular.gens(K) + if gen * leading_coefficient(r) - r * leading_coefficient(gen) == 0 + count += 1 + break + end + end + end + if count == Singular.ngens(G) + return true + end + return false +end + +function dot(v::Vector{Int}, w::Vector{Int}) + sum = 0 + for i = 1:length(v) + @inbounds sum += v[i] * w[i] + end + return sum +end + +function ordering_as_matrix(w::Vector{Int}, ord::Symbol) + if length(w) > 2 + if ord == :lex + return [ + w' + ident_matrix(length(w))[1:length(w)-1, :] + ] + end + if ord == :deglex + return [ + w' + ones(Int, length(w))' + ident_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :degrevlex + return [ + w' + ones(Int, length(w))' + anti_diagonal_matrix(length(w))[1:length(w)-2, :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + end + else + error("not implemented") + end +end + +function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M[2:length(w), :] + ] +end +function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M[1:length(w)-1, :] + ] +end +function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) + return [ + w' + M + ] +end + +function ordering_as_matrix(ord::Symbol, nvars::Int) + if ord == :lex + return ident_matrix(nvars) + end + if ord == :deglex + return [ + ones(Int, nvars)' + ident_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :degrevlex + return [ + ones(Int, nvars)' + anti_diagonal_matrix(nvars)[1:nvars-1, :] + ] + end + if ord == :revlex + return [ + w' + anti_diagonal_matrix(length(w))[1:length(w)-1, :] + ] + else + error("not implemented") + end +end + + +function deg(p::Singular.spoly, n::Int) + max = 0 + for mon in Singular.monomials(p) + ev = Singular.exponent_vectors(mon) + sum = 0 + for e in ev + for i = 1:n + sum += e[i] + end + if (max < sum) + max = sum + end + end + end + return max +end + +function check_ordering_M(S::Matrix{Int}, T::Matrix{Int}, G::Singular.sideal) + (nrows, ncols) = size(T) + return ( + (nrows, ncols) == size(S) && + nrows == ncols && + nrows == nvars(base_ring(G)) && + rank(T) == nvars(base_ring(G)) && + rank(S) == nvars(base_ring(G)) + ) +end diff --git a/src/GroebnerWalk/Testideals.jl b/src/GroebnerWalk/Testideals.jl new file mode 100644 index 000000000..ae84de174 --- /dev/null +++ b/src/GroebnerWalk/Testideals.jl @@ -0,0 +1,208 @@ +include("GroebnerWalk.jl") +include("Examples.jl") +using Test + +@testset "Groebnerwalks" begin + @testset "Testing Groebnerwalks" begin + let id = katsura6() + R = base_ring(id) + dim = nvars(R) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + I = Singular.std(id, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S)-2 + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) + end + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) + #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + complete_reduction = true, + ) + + for id in ideals + @test equalitytest( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + let id = katsura5() + R = base_ring(id) + dim = nvars(R) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix([1,3,1,3,1],:lex) + TarOrd = ordering_as_matrix([1,0,0,0,2],:lex) + S = change_order(R, TarOrd) + + I = Singular.std(Singular.Ideal(change_order(R,StartOrd), [change_ring(x, change_order(R,StartOrd)) for x in gens(id)]), complete_reduction = true) + + ideals = [] + for i = 1:nvars(S)-1 + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :pertubed, i)) + end + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :standard)) + #push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :generic)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + complete_reduction = true, + ) + + for id in ideals + @test equalitytest( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + let id = cyclic4() + R = base_ring(id) + dim = nvars(R) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + + I = Singular.std(id, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S)-1 + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) + end + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + complete_reduction = true, + ) + + + for id in ideals + @test equalitytest( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + let id = ex2() + R = base_ring(id) + dim = nvars(R) + ve=ones(Int64,dim) + StartOrd = ordering_as_matrix(:degrevlex,dim) + TarOrd = ordering_as_matrix(:lex, dim) + S = change_order(R, TarOrd) + + I = Singular.std(id, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) + end + push!(ideals, groebnerwalk(I, :degrevlex, :lex, :standard)) + #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + complete_reduction = true, + ) + + for id in ideals + @test equalitytest( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end + + + id = noon8() + R = base_ring(id) + dim = nvars(R) + ve = ones(Int, dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R2 = change_order(R, StartOrd) + S = change_order(R, TarOrd) + I = Singular.std(id, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S)-3 + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) + end + push!(ideals, groebnerwalk(I, :degrevlex, :lex, :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + complete_reduction = true, + ) + + for id in ideals + @test equalitytest( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + + id = redeco7() + R = base_ring(id) + dim = nvars(R) + ve = ones(Int, dim) + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R2 = change_order(R, StartOrd) + S = change_order(R, TarOrd) + I = Singular.std(id, complete_reduction = true) + + ideals = [] + for i = 2:nvars(S)-3 + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) + end + push!(ideals, groebnerwalk(I, :degrevlex, :lex, :standard)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + + s = Singular.std( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + complete_reduction = true, + ) + + for id in ideals + @test equalitytest( + Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), + s, + ) + end + end +end diff --git a/src/GroebnerWalk/UnitTests b/src/GroebnerWalk/UnitTests.jl similarity index 86% rename from src/GroebnerWalk/UnitTests rename to src/GroebnerWalk/UnitTests.jl index cc5d3e4bb..57b82ef04 100644 --- a/src/GroebnerWalk/UnitTests +++ b/src/GroebnerWalk/UnitTests.jl @@ -1,6 +1,6 @@ using Test include("GroebnerWalk.jl") -include("Examples") +include("Examples.jl") @testset "UnitTests" begin @testset "Testing GroebnerwalkUtilitys" begin @@ -35,7 +35,7 @@ include("Examples") q[3] = R(0) q[4] = R(1) q[5] = R(0) - @test divalg(g, F, R) == q + @test division_algorithm(g, F, R) == q J = Singular.Ideal(R, [f2, f1]) f1 = 4 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 @@ -85,17 +85,17 @@ include("Examples") f1 = 3 * x^2 f2 = y^3 * z J = Singular.Ideal(R, [f1, f2]) - f1 = x^3*y^2 + z^2 +y^2 + f1 = x^3 * y^2 + z^2 + y^2 f2 = y^3 K = Singular.Ideal(R, [f1, f2]) - @test isMonomial(gens(I)) == false - @test isMonomial(gens(J)) == true + @test ismonomial(gens(I)) == false + @test ismonomial(gens(J)) == true @test isbinomial(gens(I)) == true @test isbinomial(gens(J)) == true @test isbinomial(gens(K)) == false - @test isMonomial(gens(K)) == false + @test ismonomial(gens(K)) == false end @@ -113,7 +113,8 @@ include("Examples") G = Singular.std(I, complete_reduction = true) @test next_gamma( - G, + gens(G), + [Singular.leading_term(g) for g in gens(G)], [0], ordering_as_matrix(:degrevlex, 2), ordering_as_matrix(:lex, 2), @@ -126,20 +127,20 @@ include("Examples") ) g = [Rn(y^3 - x^2), Rn(x^3)] @test facet_initials( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]), + [change_ring(x, Rn) for x in gens(G)], [change_ring(Singular.leading_term(g), Rn) for g in gens(G)], [-2, 3], ) == g @test difference_lead_tail( - G, + gens(G), [Singular.leading_term(g) for g in gens(G)], ) == [[-2, 3], [3, -2], [2, 0]] - @test isParallel([1, 2], [1, 4]) == false - @test isParallel([1, 2], [2, 4]) == true - @test isParallel([-1, 0], [-2, 1]) == false - @test isParallel([-1, 0], [2, 0]) == true + @test isparallel([1, 2], [1, 4]) == false + @test isparallel([1, 2], [2, 4]) == true + @test isparallel([-1, 0], [-2, 1]) == false + @test isparallel([-1, 0], [2, 0]) == true @test less_facet( [-2, 3], @@ -188,15 +189,14 @@ include("Examples") f4 = R(0) - @time modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f3, I)) == - modulo(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) + reduce_walk(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f1, I)) == - modulo(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) + reduce_walk(f1, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f2, I)) == - modulo(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) + reduce_walk(f2, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f4, I)) == - modulo(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) + reduce_walk(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) J = Singular.std(J) @test equalitytest( Singular.std(J, complete_reduction = true), diff --git a/src/GroebnerWalk/runtests b/src/GroebnerWalk/runtests new file mode 100644 index 000000000..1ec2efc0d --- /dev/null +++ b/src/GroebnerWalk/runtests @@ -0,0 +1,8 @@ +using Singular +using Nemo +using Test + +@testset "GroebnerWalk" begin + include("Testideals.jl") + include("UnitTests.jl") +end From 5ad54be0a51ddfe5287929be4fd799deea7e7d58 Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 21 Mar 2022 13:04:53 +0100 Subject: [PATCH 60/85] BenchmarkingCommit --- src/GroebnerWalk/FractalWalkUtilitys.jl | 19 +++-- src/GroebnerWalk/GroebnerWalk.jl | 95 ++++++++++++------------ src/GroebnerWalk/GroebnerWalkUtilitys.jl | 50 +++++++++++-- 3 files changed, 102 insertions(+), 62 deletions(-) diff --git a/src/GroebnerWalk/FractalWalkUtilitys.jl b/src/GroebnerWalk/FractalWalkUtilitys.jl index a633e27cf..49ddbd988 100644 --- a/src/GroebnerWalk/FractalWalkUtilitys.jl +++ b/src/GroebnerWalk/FractalWalkUtilitys.jl @@ -117,18 +117,18 @@ function next_weightfr( if (cweight == tweight) return [0] end - tmin = BigInt(1) + tmin = 1 for v in difference_lead_tail(G) - cw = BigInt(dot(cweight, v)) - tw = BigInt(dot(tweight, v)) + tw = dot(tweight, v) if tw < 0 + cw = dot(cweight, v) t = cw // (cw - tw) if t < tmin tmin = t end end end - return tmin + return BigInt(numerator(tmin))//BigInt(denominator(tmin)) end #= @@ -148,15 +148,14 @@ function inCone( p::Int, ) R = change_order(G.base_ring, T) - I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) cvzip = zip( - Singular.gens(I), - initials(R, Singular.gens(I), pvecs[p-1]), - initials(R, Singular.gens(I), pvecs[p]), + Singular.gens(G), + initials(R, Singular.gens(G), pvecs[p-1]), + initials(R, Singular.gens(G), pvecs[p]), ) for (g, in, in2) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(in)) || - !isequal(Singular.leading_term(g), Singular.leading_term(in2)) + if !isequal(Singular.leading_exponent_vector(change_ring(g, R)), Singular.leading_exponent_vector(in)) || + !isequal(Singular.leading_exponent_vector(change_ring(g, R)), Singular.leading_exponent_vector(in2)) return false end end diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index d01d9ee34..7e6ed803d 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -155,7 +155,6 @@ function groebnerwalk( I = Singular.Ideal(R, [R(x) for x in gens(G)]) Gb = walk(I, S, T) - println("Cones crossed: ", getCounter()) S = change_order(R, T) return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) @@ -169,7 +168,9 @@ end function standard_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) println("standard_walk results") println("Crossed Cones in: ") - standard_walk(G, S, T, S[1, :], T[1, :]) + Gb = standard_walk(G, S, T, S[1, :], T[1, :]) + println("Cones crossed: ", getCounter()) + return Gb end function standard_walk( @@ -195,13 +196,15 @@ end function standard_step(G::Singular.sideal, w::Vector{Int}, T::Matrix{Int}) R = base_ring(G) + Rn = 0 + Gw = 0 #check if no entry of w is bigger than In32. If it´s bigger multiply it by 0.1 and round. if !checkInt32(w) Gw = initials(R, gens(G), w) w, b = truncw(G, w, Gw) if !b - throw(Exception) + throw(error("Some entrys of the intermediate weight-vector $w are bigger than int32")) end Rn = change_order(R, w, T) Gw = [change_ring(x, Rn) for x in Gw] @@ -209,7 +212,6 @@ function standard_step(G::Singular.sideal, w::Vector{Int}, T::Matrix{Int}) Rn = change_order(R, w, T) Gw = initials(Rn, gens(G), w) end - H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) @@ -237,6 +239,7 @@ function generic_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) end G = Singular.Ideal(Rn, G) G.isGB = true + println("Cones crossed: ", getCounter()) return Singular.interreduce(G) end @@ -275,7 +278,7 @@ function pertubed_walk( tarweight = pertubed_vector(G, T, p) Tn = add_weight_vector(tarweight, T) G = standard_walk(G, S, Tn, currweight, tarweight) - if inCone(G, T, tarweight) + if same_cone(G, T) terminate = true else p = p - 1 @@ -283,6 +286,8 @@ function pertubed_walk( S = Tn end end + println("Cones crossed: ", getCounter()) + return G end @@ -344,18 +349,17 @@ function fractal_recursiv( # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - continue - end - if inCone(G, T, currweight) + if same_cone(G, T) println(currweight, " in Cone", p) + if !inCone(G, T,pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + end return G end elseif t == [0] - if p == 1 || inCone(G, T, pTargetWeights, p) + if p == 1 || inCone(G, T,pTargetWeights, p) println(pTargetWeights[p], " in Cone", p) return G end @@ -372,7 +376,7 @@ function fractal_recursiv( if !checkInt32(w) w, b = truncw(G, w, Gw) if !b - throw(Exception) + return G end end @@ -453,18 +457,17 @@ function fractal_walk_recursiv_startorder( # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - continue - end - if inCone(G, T, currweight) + if same_cone(G, T) println(currweight, " in Cone", p) + if !inCone(G, T,pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + end return G end elseif t == [0] - if p == 1 || inCone(G, T, pTargetWeights, p) + if p == 1 || inCone(G, T,pTargetWeights, p) println(pTargetWeights[p], " in Cone", p) return G end @@ -541,18 +544,17 @@ function fractal_walk_recursive_lex( # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - continue - end - if inCone(G, T, currweight) + if same_cone(G, T) println(currweight, " in Cone", p) + if !inCone(G, T,pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + end return G end elseif t == [0] - if p == 1 || inCone(G, T, pTargetWeights, p) + if p == 1 || inCone(G, T,pTargetWeights, p) println(pTargetWeights[p], " in Cone", p) return G end @@ -639,18 +641,17 @@ function fractal_walk_look_ahead_recursiv( # Handling the final step in the current depth. if t == 1 && p != 1 - if !inCone(G, T, pTargetWeights, p) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - continue - end - if inCone(G, T, currweight) + if same_cone(G, T) println(currweight, " in Cone", p) + if !inCone(G, T,pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + println("not in Cone ", pTargetWeights) + end return G end elseif t == [0] - if p == 1 || inCone(G, T, pTargetWeights, p) + if p == 1 || inCone(G, T,pTargetWeights, p) println(pTargetWeights[p], " in Cone", p) return G end @@ -699,7 +700,7 @@ function fractal_walk_look_ahead_recursiv( end return G end - +global time = 0 function fractal_walk_combined( G::Singular.sideal, @@ -712,6 +713,7 @@ function fractal_walk_combined( println("Crossed Cones in: ") Gb = fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) println("Cones crossed: ", deleteCounterFr()) + println(time) return Gb end @@ -742,13 +744,13 @@ function fractal_walk_combined( end while !terminate - t = next_weightfr(G, w, pTargetWeights[p]) + t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. if t == 1 && p != 1 - if inCone(G, T, currweight) + if same_cone(G, T) println(currweight, " in Cone", p) - if !inCone(G, T, pTargetWeights, p) + if !inCone(G, T,pTargetWeights, p) global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", pTargetWeights) @@ -756,7 +758,7 @@ function fractal_walk_combined( return G end elseif t == [0] - if inCone(G, T, pTargetWeights, p) + if inCone(G, T,pTargetWeights, p) println(pTargetWeights[p], " in Cone", p) return G end @@ -786,7 +788,7 @@ function fractal_walk_combined( ), complete_reduction = true, ) - if !inCone(G, T, pTargetWeights, p) + if !inCone(G, T,pTargetWeights, p) global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] println("not in Cone ", pTargetWeights) @@ -808,7 +810,7 @@ function fractal_walk_combined( raiseCounterFr() else println( - "from $(currweight) to $(w)", + "from $(currweight) to $(pTargetWeights[p])", "up in: ", p, " with: ", @@ -860,7 +862,7 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) end Rn = change_order(R, w, T) if w == tarweight - if inCone(G, T, currweight) + if same_cone(G, T) #this checks if in_{<_{cw}}(g)= in_<(in_cw(g)) = in_<<(g) f.a. g in G return G elseif inSeveralCones(initials(base_ring(G), gens(G), tarweight)) @@ -873,6 +875,7 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) R = Rn currweight = w end + println("Cones crossed: ", getCounter()) return G end diff --git a/src/GroebnerWalk/GroebnerWalkUtilitys.jl b/src/GroebnerWalk/GroebnerWalkUtilitys.jl index 782b77d1b..e93d489cd 100644 --- a/src/GroebnerWalk/GroebnerWalkUtilitys.jl +++ b/src/GroebnerWalk/GroebnerWalkUtilitys.jl @@ -9,24 +9,24 @@ function next_weight( cw::Vector{Int}, tw::Vector{Int}, ) where {K<:Number} - tmin = BigInt(1) + tmin = 1 for v in difference_lead_tail(G) - cdotw = BigInt(dot(cw, v)) - tdotw = BigInt(dot(tw, v)) + tdotw = dot(tw, v) if tdotw < 0 + cdotw = dot(cw, v) t = cdotw // (cdotw - tdotw) if t < tmin tmin = t end end end - return convert_bounding_vector(cw + tmin * (tw - cw)) + return convert_bounding_vector(cw + BigInt(numerator(tmin))//BigInt(denominator(tmin)) * (tw - cw)) end function checkInt32(w::Vector{Int}) for i = 1:length(w) if tryparse(Int32, string(w[i])) == nothing - println("int32") + #println("int32") return false end end @@ -152,7 +152,45 @@ function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) cvzip = zip(Singular.gens(I), initials(R, Singular.gens(I), t)) for (g, ing) in cvzip - if !isequal(Singular.leading_term(g), Singular.leading_term(ing)) + if !isequal(Singular.leading_exponent_vector(g), Singular.leading_exponent_vector(ing)) + return false + end + end + return true +end + +#= +@doc Markdown.doc""" +function inCone( + G::Singular.sideal, + T::Matrix{Int}, + t::Vector{Int}, +) +Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. +"""=# +function inCone(G::Singular.sideal, t::Vector{Int}) + cvzip = zip(Singular.gens(G), initials(base_ring(G), Singular.gens(G), t)) + for (g, ing) in cvzip + if !isequal(Singular.leading_exponent_vector(g), Singular.leading_exponent_vector(ing)) + return false + end + end + return true +end + +#= +@doc Markdown.doc""" +function inCone( + G::Singular.sideal, + T::Matrix{Int}, + t::Vector{Int}, +) +Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ with the current ordering. +"""=# +function same_cone(G::Singular.sideal, T::Matrix{Int}) + R = change_order(G.base_ring, T) + for g in gens(G) + if !isequal(Singular.leading_exponent_vector(change_ring(g,R)), Singular.leading_exponent_vector(g)) return false end end From 08e04c99594fa5f2d0fba969aef654af4648d68b Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 23 Mar 2022 18:16:31 +0100 Subject: [PATCH 61/85] feat: tracing the walk --- src/GroebnerWalk/Examples.jl | 180 ++++- src/GroebnerWalk/FractalWalkUtilitys.jl | 80 +- src/GroebnerWalk/GenericWalkUtilitys.jl | 94 +-- src/GroebnerWalk/GroebnerWalk.jl | 939 +++++++++++++++-------- src/GroebnerWalk/GroebnerWalkUtilitys.jl | 130 +--- src/GroebnerWalk/Helper.jl | 12 +- src/GroebnerWalk/Testideals.jl | 30 - src/GroebnerWalk/TranWalkUtilitys.jl | 4 +- src/GroebnerWalk/UnitTests.jl | 12 +- src/Groebnerwalk.jl | 5 +- 10 files changed, 860 insertions(+), 626 deletions(-) diff --git a/src/GroebnerWalk/Examples.jl b/src/GroebnerWalk/Examples.jl index 58f13a06f..d212d00ac 100644 --- a/src/GroebnerWalk/Examples.jl +++ b/src/GroebnerWalk/Examples.jl @@ -2,17 +2,17 @@ function katsura5() dim = 5 ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) - R, (v, u, t, z, y) = Singular.PolynomialRing( + R, (x0, x1, x2, x3, x4) = Singular.PolynomialRing( Singular.N_ZpField(32003), - ["v", "u", "t", "z", "y"], + ["x0", "x1", "x2", "x3", "x4"], ordering = Singular.ordering_M(StartOrd), ) - f1 = 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2 * z * y + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t - f4 = 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + f1 = 2 * x4^2 + 2 * x3^2 + 2 * x2^2 + 2 * x1^2 + x0^2 - x0 + f2 = 2 * x3 * x4 + 2 * x3 * x2 + 2 * x2 * x1 + 2 * x1 * x0 - x1 + f3 = 2 * x4 * x2 + 2 * x3 * x1 + 2 * x1^2 + 2 * x2 * x0 - x2 + f4 = 2 * x4 * x1 + 2 * x2 * x1 + 2 * x3 * x0 - x3 + f5 = 2 * x4 + 2 * x3 + 2 * x2 + 2 * x1 + x0 - 1 return Singular.Ideal(R, [f1, f2, f3, f4, f5]) end @@ -22,28 +22,95 @@ function katsura6() dim = 6 ve = [1, 1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) - R, (v, u, t, z, y, x) = Singular.PolynomialRing( + R, (x0, x1, x2, x3, x4, x5) = Singular.PolynomialRing( Singular.N_ZpField(32003), - ["v", "u", "t", "z", "y", "x"], + ["x0", "x1", "x2", "x3", "x4", "x5"], ordering = Singular.ordering_M(StartOrd), ) - f1 = 2 * x^2 + 2 * y^2 + 2 * z^2 + 2 * t^2 + 2 * u^2 + v^2 - v - f2 = 2 * x * y + 2 * y * z + 2 * z * t + 2 * t * u + 2 * u * v - u - f3 = 2 * x * z + 2 * y * t + 2 * z * u + 2 * u^2 + 2 * t * v - t - f4 = 2 * x * t + 2 * y * u + 2 * t * u + 2 * z * v - z - f5 = t^2 + 2 * x * v + 2 * y * v + 2 * z * v - y - f6 = 2 * x + 2 * y + 2 * z + 2 * t + 2 * u + v - 1 + f1 = 2 * x5^2 + 2 * x4^2 + 2 * x3^2 + 2 * x2^2 + 2 * x1^2 + x0^2 - x0 + f2 = 2 * x5 * x4 + 2 * x4 * x3 + 2 * x3 * x2 + 2 * x2 * x1 + 2 * x1 * x0 - x1 + f3 = 2 * x5 * x3 + 2 * x4 * x2 + 2 * x3 * x1 + 2 * x1^2 + 2 * x2 * x0 - x2 + f4 = 2 * x5 * x2 + 2 * x4 * x1 + 2 * x2 * x1 + 2 * x3 * x0 - x3 + f5 = x2^2 + 2 * x5 * x0 + 2 * x4 * x0 + 2 * x3 * x0 - x4 + f6 = 2 * x5 + 2 * x4 + 2 * x3 + 2 * x2 + 2 * x1 + x0 - 1 return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) end + +function katsura7() + dim = 7 + ve = [1, 1, 1, 1, 1, 1,1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + R, (x0,x1,x2,x3,x4,x5,x6) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["x0","x1","x2","x3","x4","x5","x6"], + ordering = Singular.ordering_M(StartOrd), + ) + f1 = x0+2*x1+2*x2+2*x3+2*x4+2*x5+2*x6-1 + f2 = 2*x2*x3+2*x1*x4+2*x0*x5+2*x1*x6-x5 + f3 = x2^2+2*x1*x3+2*x0*x4+2*x1*x5+2*x2*x6-x4 + f4 = 2*x1*x2+2*x0*x3+2*x1*x4+2*x2*x5+2*x3*x6-x3 + f5 = x1^2+2*x0*x2+2*x1*x3+2*x2*x4+2*x3*x5+2*x4*x6-x2 + f6 = 2*x0*x1+2*x1*x2+2*x2*x3+2*x3*x4+2*x4*x5+2*x5*x6-x1 + f7 = x0^2+2*x1^2+2*x2^2+2*x3^2+2*x4^2+2*x5^2+2*x6^2-x0 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7]) +end + + + +function katsura8() + dim = 8 + ve = [1, 1, 1, 1, 1, 1, 1,1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + R, (u0, u1, u2, u3, u4, u5, u6, u7) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["u0","u1","u2","u3", "u4","u5","u6", "u7"], + ordering = Singular.ordering_M(StartOrd), + ) +f1= u0+2*u1+2*u2+2*u3+2*u4+2*u5+2*u6+2*u7-1 +f2= u3^2+2*u2*u4+2*u1*u5+2*u0*u6+2*u1*u7-u6 +f3= 2*u2*u3+2*u1*u4+2*u0*u5+2*u1*u6+2*u2*u7-u5 +f4= u2^2+2*u1*u3+2*u0*u4+2*u1*u5+2*u2*u6+2*u3*u7-u4 +f5= 2*u1*u2+2*u0*u3+2*u1*u4+2*u2*u5+2*u3*u6+2*u4*u7-u3 +f6= u1^2+2*u0*u2+2*u1*u3+2*u2*u4+2*u3*u5+2*u4*u6+2*u5*u7-u2 +f7= 2*u0*u1+2*u1*u2+2*u2*u3+2*u3*u4+2*u4*u5+2*u5*u6+2*u6*u7-u1 +f8= u0^2+2*u1^2+2*u2^2+2*u3^2+2*u4^2+2*u5^2+2*u6^2+2*u7^2-u0 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) +end + +function katsura9() + dim = 9 + ve = [1, 1, 1, 1, 1, 1,1,1,1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + R, (u0,u1,u2,u3,u4,u5,u6,u7,u8) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["u0","u1","u2","u3","u4","u5","u6","u7","u8"], + ordering = Singular.ordering_M(StartOrd), + ) + f1 = u0+2*u1+2*u2+2*u3+2*u4+2*u5+2*u6+2*u7+2*u8-1 + f2 = 2*u3*u4+2*u2*u5+2*u1*u6+2*u0*u7+2*u1*u8-u7 + f3 = u3^2+2*u2*u4+2*u1*u5+2*u0*u6+2*u1*u7+2*u2*u8-u6 + f4 = 2*u2*u3+2*u1*u4+2*u0*u5+2*u1*u6+2*u2*u7+2*u3*u8-u5 + f5 = u2^2+2*u1*u3+2*u0*u4+2*u1*u5+2*u2*u6+2*u3*u7+2*u4*u8-u4 + f6 = 2*u1*u2+2*u0*u3+2*u1*u4+2*u2*u5+2*u3*u6+2*u4*u7+2*u5*u8-u3 + f7 = u1^2+2*u0*u2+2*u1*u3+2*u2*u4+2*u3*u5+2*u4*u6+2*u5*u7+2*u6*u8-u2 + f8 = 2*u0*u1+2*u1*u2+2*u2*u3+2*u3*u4+2*u4*u5+2*u5*u6+2*u6*u7+2*u7*u8-u1 + f9 = u0^2+2*u1^2+2*u2^2+2*u3^2+2*u4^2+2*u5^2+2*u6^2+2*u7^2+2*u8^2-u0 + + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8, f9]) +end + + function cyclic7() dim = 7 ve = [1, 1, 1, 1, 1, 1, 1] example = "Cyclic7" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], ordering = Singular.ordering_M(StartOrd), ) @@ -93,7 +160,7 @@ function cyclic6() example = "Cyclic6" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6"], ordering = Singular.ordering_M(StartOrd), ) @@ -157,7 +224,7 @@ function cyclic4() example = "Cyclic4" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (w, x, y, z) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["w", "x", "y", "z"], ordering = Singular.ordering_M(StartOrd), ) @@ -168,13 +235,37 @@ function cyclic4() f4 = w * x * y * z - 1 return Singular.Ideal(R, [f1, f2, f3, f4]) end + +function cyclic8() + dim = 8 + ve = [1, 1, 1, 1, 1 ,1 ,1 ,1] + example = "Cyclic8" + StartOrd = ordering_as_matrix(:degrevlex, dim) + R, (x1,x2,x3,x4,x5,x6,x7,x8) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["x1","x2", "x3","x4","x5","x6","x7","x8"], + ordering = Singular.ordering_M(StartOrd), + ) + + f1 = x1+x2+x3+x4+x5+x6+x7+x8 + f2 = x1*x2+x2*x3+x3*x4+x4*x5+x5*x6+x6*x7+x1*x8+x7*x8 + f3 = x1*x2*x3+x2*x3*x4+x3*x4*x5+x4*x5*x6+x5*x6*x7+x1*x2*x8+x1*x7*x8+x6*x7*x8 + f4 = x1*x2*x3*x4+x2*x3*x4*x5+x3*x4*x5*x6+x4*x5*x6*x7+x1*x2*x3*x8+x1*x2*x7*x8+x1*x6*x7*x8+x5*x6*x7*x8 + f5 = x1*x2*x3*x4*x5+x2*x3*x4*x5*x6+x3*x4*x5*x6*x7+x1*x2*x3*x4*x8+x1*x2*x3*x7*x8+x1*x2*x6*x7*x8+x1*x5*x6*x7*x8+x4*x5*x6*x7*x8 + f6 = x1*x2*x3*x4*x5*x6+x2*x3*x4*x5*x6*x7+x1*x2*x3*x4*x5*x8+x1*x2*x3*x4*x7*x8+x1*x2*x3*x6*x7*x8+x1*x2*x5*x6*x7*x8+x1*x4*x5*x6*x7*x8+x3*x4*x5*x6*x7*x8 + f7 = x1*x2*x3*x4*x5*x6*x7+x1*x2*x3*x4*x5*x6*x8+x1*x2*x3*x4*x5*x7*x8+x1*x2*x3*x4*x6*x7*x8+x1*x2*x3*x5*x6*x7*x8+x1*x2*x4*x5*x6*x7*x8+x1*x3*x4*x5*x6*x7*x8+x2*x3*x4*x5*x6*x7*x8 + f8 = x1*x2*x3*x4*x5*x6*x7*x8-1 + return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) +end + + function eco6() dim = 6 ve = [1, 1, 1, 1, 1, 1] example = "eco6" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6"], ordering = Singular.ordering_M(StartOrd), ) @@ -196,7 +287,7 @@ function eco7() example = "eco7" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6"], ordering = Singular.ordering_M(StartOrd), ) @@ -225,7 +316,7 @@ function noon5() example = "noon5" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5"], ordering = Singular.ordering_M(StartOrd), ) @@ -255,7 +346,7 @@ function noon6() example = "noon6" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6"], ordering = Singular.ordering_M(StartOrd), ) @@ -306,7 +397,7 @@ function noon7() example = "noon7" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, x5, x6, x7) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "x5", "x6", "x7"], ordering = Singular.ordering_M(StartOrd), ) @@ -471,7 +562,7 @@ function redeco8() example = "redeco8" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3, x4, u8, x5, x6, x7) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3", "x4", "u8", "x5", "x6", "x7"], ordering = Singular.ordering_M(StartOrd), ) @@ -494,7 +585,7 @@ function wang91() example = "Wang-91" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x3, x2, x1, x0, b, a) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x3", "x2", "x1", "x0", "b", "a"], ordering = Singular.ordering_M(StartOrd), ) @@ -513,7 +604,7 @@ function cohn4() example = "cohn4" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x, y, z, t) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x", "y", "z", "t"], ordering = Singular.ordering_M(StartOrd), ) @@ -568,7 +659,7 @@ function oberfr() example = "Oberfranz" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x1, x2, x3) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x1", "x2", "x3"], ordering = Singular.ordering_M(StartOrd), ) @@ -584,7 +675,7 @@ function trinks1() example = "trinks1" StartOrd = ordering_as_matrix(:degrevlex, dim) R, (x, y, z, t, u, v) = Singular.PolynomialRing( - Singular.QQ, + Singular.N_ZpField(32003), ["x", "y", "z", "t", "u", "v"], ordering = Singular.ordering_M(StartOrd), ) @@ -665,3 +756,36 @@ function ex2() ], ) end + +function v3g7d50() + + dim = 3 + ve = [1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["a", "b", "c"], + ordering = Singular.ordering_M(StartOrd), + ) + + S = change_order(R, TarOrd) + return Singular.Ideal(R,[5*a^7+4*a^5*b^2+2*a^3*b^4+5*a^2*b^5+4*b^7+5*a^3*b^3*c+3*a^2*b^4*c+4*a^5*c^2+5*a^2*b^3*c^2+5*a^4*c^3+a^3*b*c^3+2*a^2*b^2*c^3+3*a*b^3*c^3+4*a^2*c^5+5*a*b*c^5+b^2*c^5+a^6+3*a^4*b^2+4*a*b^5+3*a^5*c+3*a*b^4*c+5*a^3*b*c^2+2*a^3*c^3+5*a^2*b*c^3+2*a^2*c^4+2*b^2*c^4+a*c^5+2*b*c^5+2*c^6+3*a^3*b^2+a*b^4+5*a*b^3*c+4*a^2*b*c^2+a*b^2*c^2+a^2*c^3+5*a*c^4+4*c^5+2*a^3*b+2*b^4+4*a*b^2*c+3*a*b*c^2+5*b*c^3+2*a*b^2+5*b^2*c+5*a*c^2+5*c^3+3*a^2+a*c+b*c+2*c^2+a+2*c,4*a^6*b+4*a^5*b^2+3*a^4*b^3+4*a^3*b^4+5*a*b^6+4*a^6*c+4*a^4*b^2*c+5*a^4*b*c^2+a^3*b^2*c^2+4*a^2*b^3*c^2+a^4*c^3+5*a^3*b*c^3+4*b^4*c^3+3*a^2*b*c^4+a*b^2*c^4+3*b^3*c^4+4*a^2*c^5+5*a*b*c^5+3*a*c^6+c^7+3*a^5*b+2*a^3*b^3+5*a^2*b^4+3*b^6+a^5*c+5*a^4*b*c+4*a^2*b^3*c+5*b^5*c+a^4*c^2+4*a^3*b*c^2+4*a^2*b^2*c^2+4*a^3*c^3+4*a^2*b*c^3+4*b^3*c^3+3*a^2*c^4+a^5+5*a^2*b^3+4*a*b^4+5*b^5+5*a^4*c+5*a^2*b^2*c+4*b^4*c+4*a^3*c^2+3*a^2*b*c^2+5*b^3*c^2+3*a^2*c^3+4*b^2*c^3+3*c^5+5*a^4+2*a^3*b+b^4+2*a^3*c+3*a^2*b*c+4*a*b^2*c+2*b^3*c+4*a^2*c^2+3*b^2*c^2+2*c^4+3*a^3+3*b^3+a*b*c+2*b^2*c+2*a*c^2+c^3+2*b^2+4*a*c+5*a+5]) +end + +function v4g3() + + dim = 4 + ve = [1, 1, 1, 1] + StartOrd = ordering_as_matrix(:degrevlex, dim) + TarOrd = ordering_as_matrix(:lex, dim) + R, (a, b, c, d) = Singular.PolynomialRing( + Singular.N_ZpField(32003), + ["a", "b", "c", "d"], + ordering = Singular.ordering_M(StartOrd), + ) + + S = change_order(R, TarOrd) + return Singular.Ideal(R,[3*a^3+3*a^2*b+5*a*b^2+2*b^3+a^2*c+2*b^2*c+3*a*c^2+3*a^2*d+5*b^2*d+3*a*c*d+a*d^2+b*d^2+3*c*d^2+5*d^3+4*b^2+3*a*c+5*b*c+3*c^2+4*a*d+2*b*d+c*d+d^2+4*a+4*b+c,3*a^2*b+5*a*b^2+2*a^2*c+5*a*b*c+4*b^2*c+4*a*c^2+5*c^3+5*a^2*d+a*b*d+4*b^2*d+2*a*c*d+3*b*c*d+4*c^2*d+5*b*d^2+4*a*b+3*b^2+2*a*c+5*c^2+5*a*d+2*d^2+4*a+5*c +]) +end diff --git a/src/GroebnerWalk/FractalWalkUtilitys.jl b/src/GroebnerWalk/FractalWalkUtilitys.jl index 49ddbd988..ae51ba699 100644 --- a/src/GroebnerWalk/FractalWalkUtilitys.jl +++ b/src/GroebnerWalk/FractalWalkUtilitys.jl @@ -1,14 +1,11 @@ include("GroebnerWalkUtilitys.jl") -#= -@doc Markdown.doc""" -function lift_fractal_walk( -G::Singular.sideal, -H::Singular.sideal, -Rn::Singular.PolyRing, -) -Performs a lifting step in the Fractal Walk. -"""=# +################################################################# +# Procedures of the fractal walk. +# The fractal walk is proposed by Amrhein & Gloor (1998) +################################################################# + +#Performs a lifting step in the Fractal Walk. function lift_fractal_walk( G::Singular.sideal, H::Singular.sideal, @@ -28,13 +25,7 @@ function lift_fractal_walk( return G end -#= -@doc Markdown.doc""" -function ismonomial( -Gw::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} -Returns ´true´ if all polynomials of the given array are monomials. -"""=# +# returns ´true´ if all polynomials of the given array are monomials. function ismonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if length(Singular.coefficients(g)) > 1 @@ -44,13 +35,7 @@ function ismonomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} return true end -#= -@doc Markdown.doc""" -function isbinomial( -Gw::Vector{spoly{L}}, -) -Returns ´true´ if all polynomials of the given array are binomials or less. -"""=# +# returns ´true´ if all polynomials of the given array are binomials or less. function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} for g in Gw if length(Singular.coefficients(g)) > 2 @@ -60,16 +45,7 @@ function isbinomial(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} return true end - -#= -@doc Markdown.doc""" -function nextT( - G::Singular.sideal, - w::Array{T,1}, - tw::Array{K,1}, -) where {T<:Number,K<:Number} -Returns the next t to compute the next weight vector $w(t) = w + t * (tw - w)$ like it´s done in Amrhein & Gloor (1998) -"""=# +# returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Amrhein & Gloor (1998). This Method is NOT tested sufficiently. function nextT( G::Singular.sideal, w::Array{T,1}, @@ -100,15 +76,7 @@ function nextT( end end -#= -@doc Markdown.doc""" -function next_weightfr( - G::Singular.sideal, - cweight::Array{T,1}, - tweight::Array{K,1}, -) where {T<:Number,K<:Number} -Returns the next t to compute the next weight vector $w(t) = w + t * (tw - w)$ like it´s done in Fukuda et al. (2005). -"""=# +# returns the next t to compute the next weight vector w(t) = w + t * (tw - w) like it´s done in Cox, Little & O'Sheao (2005). function next_weightfr( G::Singular.sideal, cweight::Array{T,1}, @@ -128,25 +96,21 @@ function next_weightfr( end end end - return BigInt(numerator(tmin))//BigInt(denominator(tmin)) + + # BigInt is needed to prevent overflows in the conversion of the weight vectors. + return BigInt(numerator(tmin)) // BigInt(denominator(tmin)) end -#= -@doc Markdown.doc""" -function inCone( - G::Singular.sideal, - T::Matrix{Int}, - pvecs::Vector{Vector{Int}}, - p::Int, -) -Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the Matrixordering $T$. -"""=# +# returns 'true' if the leading tems of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the Matrixordering T. function inCone( G::Singular.sideal, T::Matrix{Int}, pvecs::Vector{Vector{Int}}, p::Int, ) + if p == 1 + return true + end R = change_order(G.base_ring, T) cvzip = zip( Singular.gens(G), @@ -154,8 +118,14 @@ function inCone( initials(R, Singular.gens(G), pvecs[p]), ) for (g, in, in2) in cvzip - if !isequal(Singular.leading_exponent_vector(change_ring(g, R)), Singular.leading_exponent_vector(in)) || - !isequal(Singular.leading_exponent_vector(change_ring(g, R)), Singular.leading_exponent_vector(in2)) + if !isequal( + Singular.leading_exponent_vector(change_ring(g, R)), + Singular.leading_exponent_vector(in), + ) || + !isequal( + Singular.leading_exponent_vector(change_ring(g, R)), + Singular.leading_exponent_vector(in2), + ) return false end end diff --git a/src/GroebnerWalk/GenericWalkUtilitys.jl b/src/GroebnerWalk/GenericWalkUtilitys.jl index 6411a55e2..9d47a6ce0 100644 --- a/src/GroebnerWalk/GenericWalkUtilitys.jl +++ b/src/GroebnerWalk/GenericWalkUtilitys.jl @@ -1,18 +1,11 @@ include("GroebnerWalkUtilitys.jl") -############################################################### -#Utilitys for generic_walk -############################################################### +################################################################# +# Procedures of the generic walk. +# The generic walk is proposed by Fukuda, Lauritzen & Thomas (2005). +################################################################# -#= -@doc Markdown.doc""" -function facet_initials( - G::Singular.sideal, - lm::Vector{spoly{L}}, - v::Vector{Int}, -) where {L<:Nemo.RingElem} -Returns the initials of the polynomials w.r.t. the vector v. -"""=# +# returns the initials of the polynomials w.r.t. the vector v. function facet_initials( G::Vector{Singular.spoly{L}}, lm::Vector{spoly{L}}, @@ -37,14 +30,7 @@ function facet_initials( return initials end -#= -@doc Markdown.doc""" -function difference_lead_tail( -G::Vector{spoly{L}}, -Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} -Returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of $I$. -"""=# +# returns the differences of the exponent vectors of the leading terms and the polynomials of the generators of I. function difference_lead_tail( G::Vector{spoly{L}}, Lm::Vector{spoly{L}}, @@ -61,11 +47,7 @@ function difference_lead_tail( return unique!(v) end -#= -@doc Markdown.doc""" -function isparallel(u::Vector{Int}, v::Vector{Int}) -Returns true if the vector $u$ is parallel to the vector $v$. -"""=# +# returns true if the vector u is parallel to the vector v. function isparallel(u::Vector{Int}, v::Vector{Int}) count = 1 x = 0 @@ -93,15 +75,7 @@ function isparallel(u::Vector{Int}, v::Vector{Int}) return true end -#= -@doc Markdown.doc""" -function lift_generic( -G::Vector{spoly{L}}, - Lm::Vector{Singular.spoly{L}}, - H::Singular.sideal, -) where {L<:Nemo.RingElem} -Performs a lifting step in the Groebner Walk proposed by Fukuda et al. (2005). -"""=# +# performs a lifting step in the Groebner Walk proposed by Fukuda et al. (2005). function lift_generic( G::Vector{spoly{L}}, Lm::Vector{Singular.spoly{L}}, @@ -117,6 +91,7 @@ function lift_generic( return liftPolys, Newlm end +# returns all v\in V if v>0 w.r.t. the ordering represented by S. function filter_btz(S::Matrix{Int}, V::Vector{Vector{Int}}) btz = Set{Vector{Int}}() for v in V @@ -127,6 +102,7 @@ function filter_btz(S::Matrix{Int}, V::Vector{Vector{Int}}) return btz end +# returns all v \in V if v<0 w.r.t. the ordering represented by S. function filter_ltz(S::Matrix{Int}, V::Set{Vector{Int}}) btz = Set{Vector{Int}}() for v in V @@ -136,6 +112,8 @@ function filter_ltz(S::Matrix{Int}, V::Set{Vector{Int}}) end return btz end + +# returns all v \in V if w0 w.r.t. the ordering M. function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i = 1:nrows @@ -200,6 +169,7 @@ function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) return false end +# tests if v<0 w.r.t. the ordering M. function less_than_zero(M::Matrix{Int}, v::Vector{Int}) nrows, ncols = size(M) for i = 1:nrows @@ -214,6 +184,7 @@ function less_than_zero(M::Matrix{Int}, v::Vector{Int}) return false end +# tests if u standard_walk(x, y, z) + walk = (x) -> standard_walk(x, S, T, infoLevel) elseif walktype == :generic - walk = (x, y, z) -> generic_walk(x, y, z) - # elseif grwalktype == :pgeneric - # walk = (x,y,z) -> pgeneric_walk(x,y,z,p) + walk = (x) -> generic_walk(x, S, T, infoLevel) elseif walktype == :pertubed - walk = (x, y, z) -> pertubed_walk(x, y, z, p) + walk = (x) -> pertubed_walk(x, S, T, p, infoLevel) elseif walktype == :fractal - walk = (x, y, z) -> fractal_walk(x, y, z) + walk = (x) -> fractal_walk(x, S, T, infoLevel) elseif walktype == :fractal_start_order - walk = (x, y, z) -> fractal_walk_start_order(x, y, z) + walk = (x) -> fractal_walk_start_order(x, S, T, infoLevel) elseif walktype == :fractal_lex - walk = (x, y, z) -> fractal_walk_lex(x, y, z) + walk = (x) -> fractal_walk_lex(x, S, T, infoLevel) elseif walktype == :fractal_look_ahead - walk = (x, y, z) -> fractal_walk_look_ahead(x, y, z) + walk = (x) -> fractal_walk_look_ahead(x, S, T, infoLevel) elseif walktype == :tran - walk = (x, y, z) -> tran_walk(x, y, z) + walk = (x) -> tran_walk(x, S, T, infoLevel) elseif walktype == :fractal_combined - walk = (x, y, z) -> fractal_walk_combined(x, y, z) + walk = (x) -> fractal_walk_combined(x, S, T, infoLevel) end + !check_ordering_M(S, T, G) && throw( error( - "The matrices representing the Ordering have to be nxn-matrices with full rank.", + "The matrices representing the monomial order have to be nxn-matrices with full rank.", ), ) R = base_ring(G) - I = Singular.Ideal(R, [R(x) for x in gens(G)]) - - Gb = walk(I, S, T) - + Gb = walk(Singular.Ideal(R, [R(x) for x in gens(G)])) S = change_order(R, T) return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end ############################################################### -#Implementation of the standard walk. +# Implementation of the standard walk. ############################################################### -function standard_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) - println("standard_walk results") - println("Crossed Cones in: ") - Gb = standard_walk(G, S, T, S[1, :], T[1, :]) - println("Cones crossed: ", getCounter()) +function standard_walk( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + infoLevel::Int, +) + if infoLevel >= 1 + println("standard_walk results") + println("Crossed Cones in: ") + end + + Gb = standard_walk(G, S, T, S[1, :], T[1, :], infoLevel) return Gb end @@ -179,32 +160,51 @@ function standard_walk( T::Matrix{Int}, currweight::Vector{Int}, tarweight::Vector{Int}, + infoLevel::Int, ) + counter = 0 terminate = false while !terminate G = standard_step(G, currweight, T) - println(currweight) - global counter = getCounter() + 1 + if infoLevel >= 1 + println(currweight) + if infoLevel == 2 + println(G) + end + end + counter += 1 if currweight == tarweight terminate = true else currweight = next_weight(G, currweight, tarweight) end end + + if infoLevel >= 1 + println("Cones crossed: ", counter) + end return G end +############################################################### +# The standard step is used for the strategies standard and pertubed. +############################################################### + function standard_step(G::Singular.sideal, w::Vector{Int}, T::Matrix{Int}) R = base_ring(G) Rn = 0 Gw = 0 - #check if no entry of w is bigger than In32. If it´s bigger multiply it by 0.1 and round. + #check if no entry of w is bigger than Int32. If it´s bigger multiply it by 0.1 and round. if !checkInt32(w) Gw = initials(R, gens(G), w) w, b = truncw(G, w, Gw) if !b - throw(error("Some entrys of the intermediate weight-vector $w are bigger than int32")) + throw( + error( + "Some entries of the intermediate weight-vector $w are bigger than int32", + ), + ) end Rn = change_order(R, w, T) Gw = [change_ring(x, Rn) for x in Gw] @@ -212,6 +212,7 @@ function standard_step(G::Singular.sideal, w::Vector{Int}, T::Matrix{Int}) Rn = change_order(R, w, T) Gw = initials(Rn, gens(G), w) end + H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) H = lift(G, R, H, Rn) @@ -219,27 +220,44 @@ function standard_step(G::Singular.sideal, w::Vector{Int}, T::Matrix{Int}) end ############################################################### -#Generic-version of the groebner walk by Fukuda et al. (2007) +# Generic-version of the Groebner Walk. ############################################################### -function generic_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) +function generic_walk( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + infoLevel::Int, +) + counter = 0 R = base_ring(G) Rn = change_order(G.base_ring, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] G = [change_ring(x, Rn) for x in gens(G)] v = next_gamma(G, Lm, [0], S, T) - println("generic_walk results") - println("Crossed Cones with facetNormal: ") + if infoLevel >= 1 + println("generic_walk results") + println("Crossed Cones with: ") + end while !isempty(v) - global counter = getCounter() + 1 - println(v) + counter += 1 G, Lm = generic_step(G, Lm, v, Rn) + + if infoLevel >= 1 + println(v) + if infoLevel == 2 + println(G) + end + end + v = next_gamma(G, Lm, v, S, T) end G = Singular.Ideal(Rn, G) G.isGB = true - println("Cones crossed: ", getCounter()) + if infoLevel >= 1 + println("Cones crossed: ", counter) + end return Singular.interreduce(G) end @@ -249,7 +267,6 @@ function generic_step( v::Vector{Int}, Rn::Singular.PolyRing, ) where {L<:Nemo.RingElem} - facet_Generators = facet_initials(G, Lm, v) H = Singular.std( Singular.Ideal(Rn, facet_Generators), @@ -260,24 +277,29 @@ function generic_step( return G, Lm end - ############################################################### -#Pertubed-version of the groebner walk by Amrhein et al. (1997) +#Pertubed-version of the Groebner Walk. ############################################################### + function pertubed_walk( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, p::Int, + infoLevel::Int, ) + if infoLevel >= 1 + println("pertubed_walk results") + println("Crossed Cones in: ") + end + currweight = pertubed_vector(G, S, p) terminate = false - println("pertubed_walk results") - println("Crossed Cones in: ") + while !terminate tarweight = pertubed_vector(G, T, p) Tn = add_weight_vector(tarweight, T) - G = standard_walk(G, S, Tn, currweight, tarweight) + G = standard_walk(G, S, Tn, currweight, tarweight, infoLevel) if same_cone(G, T) terminate = true else @@ -286,18 +308,16 @@ function pertubed_walk( S = Tn end end - println("Cones crossed: ", getCounter()) - return G end ############################################################### -#fractal walk +# The Fractal Walk ############################################################### -########################################## -#Counter for the steps in the fractal_walk -########################################## +########################################### +# Counter for the steps in the Fractal Walk. +########################################### counterFr = 0 function deleteCounterFr() global counterFr @@ -312,22 +332,212 @@ end function raiseCounterFr() global counterFr = getCounterFr() + 1 end - ########################################## -#global weightvectors +# global weightvectors ########################################## pTargetWeights = [] pStartWeights = [] firstStepMode = false -function fractal_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) +############################################################### +# Combined version of the extensions of the Fractal Walk. +# This version +# - checks if the starting weight vector represents the ordering and pertubes it if necessary. +# - analyses the Groebner basis Gw of the initialforms and uses the Buchberger-algorithm if the generators of Gw are binomial or less. +# - skips a step in top level in the last step. +# - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. +############################################################### +function fractal_walk_combined( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + infoLevel::Int, +) + if infoLevel >= 1 + println("fractal_walk_combined results") + println("Crossed Cones in: ") + end + + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] + Gb = fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1, infoLevel) + + if infoLevel >= 1 + println("Cones crossed: ", deleteCounterFr()) + end + return Gb +end + +function fractal_walk_combined( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + currweight::Vector{Int}, + pTargetWeights::Vector{Vector{Int}}, + p::Int, + infoLevel::Int, +) + R = Singular.base_ring(G) + terminate = false + G.isGB = true + + # Handling the weight of the start order. + if (p == 1) + if !ismonomial(initials(R, Singular.gens(G), currweight)) + global pStartWeights = [pertubed_vector(G, S, i) for i = 1:nvars(R)] + global firstStepMode = true + end + end + if firstStepMode + w = pStartWeights[p] + else + w = currweight + end + + # main loop + while !terminate + t = next_weightfr(G, w, pTargetWeights[p]) + + # Handling the final step in the current depth. + # Next_weightfr may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weightfr returns 1 in the last step on every local path. + if t == 1 && p != 1 + if same_cone(G, T) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end + end + return G + end + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", pTargetWeights[p], ".") + end + return G + end + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end + continue + end + + # skip a step for target order lex. + if t == 1 && p == 1 + if infoLevel >= 1 + println("depth $p: recursive call in ", pTargetWeights[p]) + end + return fractal_walk_combined( + G, + S, + T, + w, + pTargetWeights, + p + 1, + infoLevel, + ) + else + w = w + t * (pTargetWeights[p] - w) + w = convert_bounding_vector(w) + Gw = initials(R, gens(G), w) + + # handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. + if !checkInt32(w) + w, b = truncw(G, w, Gw) + if !b + Rn = change_order(R, T) + w = T[1, :] + G = Singular.std( + Singular.Ideal( + Rn, + [change_ring(x, Rn) for x in gens(G)], + ), + complete_reduction = true, + ) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println( + "depth $p: not in cone ", + TargetWeights[p], + ".", + ) + end + end + return G + end + end + Rn = change_order(R, w, T) + + # converting the Groebner basis + if (p == Singular.nvars(R) || isbinomial(Gw)) + H = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), + complete_reduction = true, + ) + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end + raiseCounterFr() + else + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end + H = fractal_walk_combined( + Singular.Ideal(R, Gw), + S, + T, + deepcopy(currweight), + pTargetWeights, + p + 1, + infoLevel, + ) + global firstStepMode = false + end + end + #H = liftGW2(G, R, Gw, H, Rn) + H = lift_fractal_walk(G, H, Rn) + G = interreduce_walk(H) + R = Rn + currweight = w + end + return G +end + +############################################################### +# Plain version of the Fractal Walk. +# This version checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. +############################################################### + +function fractal_walk( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + infoLevel::Int, +) + if infoLevel >= 1 + println("FractalWalk_standard results") + println("Crossed Cones in: ") + end + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println(pTargetWeights) - println("FractalWalk_standard results") - println("Crossed Cones in: ") - Gb = fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1) - println("Cones crossed: ", deleteCounterFr()) + Gb = fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1, infoLevel) + + if infoLevel >= 1 + println("Cones crossed: ", deleteCounterFr()) + end return Gb end @@ -338,6 +548,7 @@ function fractal_recursiv( currweight::Vector{Int}, pTargetWeights::Vector{Vector{Int}}, p::Int, + infoLevel::Int, ) R = base_ring(G) terminate = false @@ -348,49 +559,79 @@ function fractal_recursiv( t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. + # Next_weightfr may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weightfr returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - println(currweight, " in Cone", p) - if !inCone(G, T,pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end end return G end - elseif t == [0] - if p == 1 || inCone(G, T,pTargetWeights, p) - println(pTargetWeights[p], " in Cone", p) + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", TargetWeights[p], ".") + end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end continue end - # Handling the current weight with regards to Int32-entrys. w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) Gw = initials(R, Singular.gens(G), w) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) w, b = truncw(G, w, Gw) if !b + Rn = change_order(R, T) + w = T[1, :] + G = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]), + complete_reduction = true, + ) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end + end return G end end - # Converting the Groebnerbasis + # Converting the Groebner basis Rn = change_order(R, w, T) if p == nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - println(w, " in depth", p) + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end raiseCounterFr() else - println("up in: ", p, " with: ", w) + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end H = fractal_recursiv( Singular.Ideal(R, Gw), S, @@ -398,9 +639,9 @@ function fractal_recursiv( deepcopy(currweight), pTargetWeights, p + 1, + infoLevel, ) end - # Lifting #H = liftGW2(G, R, Gw, H, Rn) H = lift_fractal_walk(G, H, Rn) G = interreduce_walk(H) @@ -410,20 +651,36 @@ function fractal_recursiv( return G end - - +############################################################### +# Extends the plain Fractal Walk by checking the start order. +############################################################### function fractal_walk_start_order( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, + infoLevel::Int, ) + if infoLevel >= 1 + println("fractal_walk_withStartorder results") + println("Crossed Cones in: ") + end + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println("fractal_walk_withStartorder results") - println("Crossed Cones in: ") - Gb = fractal_walk_recursiv_startorder(G, S, T, S[1, :], pTargetWeights, 1) - println("Cones crossed: ", deleteCounterFr()) + Gb = fractal_walk_recursiv_startorder( + G, + S, + T, + S[1, :], + pTargetWeights, + 1, + infoLevel, + ) + + if infoLevel >= 1 + println("Cones crossed: ", deleteCounterFr()) + end return Gb end @@ -434,6 +691,7 @@ function fractal_walk_recursiv_startorder( currweight::Vector{Int}, pTargetWeights::Vector{Vector{Int}}, p::Int, + infoLevel::Int, ) R = Singular.base_ring(G) terminate = false @@ -456,49 +714,79 @@ function fractal_walk_recursiv_startorder( t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. + # Next_weightfr may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weightfr returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - println(currweight, " in Cone", p) - if !inCone(G, T,pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end end return G end - elseif t == [0] - if p == 1 || inCone(G, T,pTargetWeights, p) - println(pTargetWeights[p], " in Cone", p) + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", TargetWeights[p], ".") + end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end continue end - # Handling the current weight with regards to Int32-entrys. w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) Gw = initials(R, gens(G), w) + + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) w, b = truncw(G, w, Gw) if !b - throw(Exception) + Rn = change_order(R, T) + w = T[1, :] + G = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]), + complete_reduction = true, + ) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end + end + return G end end Rn = change_order(R, w, T) - # Converting the Groebnerbasis + # Converting the Groebner basis if p == Singular.nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - println(w, " in depth", p) + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end raiseCounterFr() else - println("up in: ", p, " with: ", w) + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end H = fractal_walk_recursiv_startorder( Singular.Ideal(R, Gw), S, @@ -506,6 +794,7 @@ function fractal_walk_recursiv_startorder( deepcopy(currweight), pTargetWeights, p + 1, + infoLevel, ) global firstStepMode = false end @@ -517,13 +806,37 @@ function fractal_walk_recursiv_startorder( end return G end -function fractal_walk_lex(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) + +############################################################### +# Plain version of the Fractal Walk in case of a lexicographic target order. +############################################################### + +function fractal_walk_lex( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + infoLevel::Int, +) + if infoLevel >= 1 + println("fractal_walk_lex results") + println("Crossed Cones in: ") + end + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - println("fractal_walk_lex results") - println("Crossed Cones in: ") - Gb = fractal_walk_recursive_lex(G, S, T, S[1, :], pTargetWeights, 1) - println("Cones crossed: ", deleteCounterFr()) + Gb = fractal_walk_recursive_lex( + G, + S, + T, + S[1, :], + pTargetWeights, + 1, + infoLevel, + ) + + if infoLevel >= 1 + println("Cones crossed: ", deleteCounterFr()) + end return Gb end @@ -534,48 +847,92 @@ function fractal_walk_recursive_lex( currweight::Vector{Int}, pTargetWeights::Vector{Vector{Int}}, p::Int, + infoLevel::Int, ) R = Singular.base_ring(G) terminate = false G.isGB = true w = currweight + while !terminate t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. + # Handling the final step in the current depth. + # Next_weightfr may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weightfr returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - println(currweight, " in Cone", p) - if !inCone(G, T,pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end end return G end - elseif t == [0] - if p == 1 || inCone(G, T,pTargetWeights, p) - println(pTargetWeights[p], " in Cone", p) + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", TargetWeights[p], ".") + end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end continue end + + # Skipping a step in lex. if t == 1 && p == 1 - return fractal_walk_recursive_lex(G, S, T, w, pTargetWeights, p + 1) + return fractal_walk_recursive_lex( + G, + S, + T, + w, + pTargetWeights, + p + 1, + infoLevel, + ) else - w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) Gw = initials(R, Singular.gens(G), w) - # Handling the current weight with regards to Int32-entrys. + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) w, b = truncw(G, w, Gw) if !b - throw(Exception) + Rn = change_order(R, T) + w = T[1, :] + G = Singular.std( + Singular.Ideal( + Rn, + [change_ring(x, Rn) for x in gens(G)], + ), + complete_reduction = true, + ) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println( + "depth $p: not in cone ", + TargetWeights[p], + ".", + ) + end + end + return G end end Rn = change_order(R, w, T) @@ -586,10 +943,14 @@ function fractal_walk_recursive_lex( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - println(w, " in depth", p) + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end raiseCounterFr() else - println("up in: ", p, " with: ", w) + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end H = fractal_walk_recursive_lex( Singular.Ideal(R, Gw), S, @@ -597,6 +958,7 @@ function fractal_walk_recursive_lex( deepcopy(currweight), pTargetWeights, p + 1, + infoLevel, ) global firstStepMode = false end @@ -609,17 +971,37 @@ function fractal_walk_recursive_lex( end return G end + +############################################################### +# Plain version of the Fractal Walk with look-ahead extension. +############################################################### + function fractal_walk_look_ahead( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, + infoLevel::Int, ) - println("fractal_walk_look_ahead results") - println("Crossed Cones in: ") + if infoLevel >= 1 + println("fractal_walk_look_ahead results") + println("Crossed Cones in: ") + end + global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv(G, S, T, S[1, :], pTargetWeights, 1) - println("Cones crossed: ", deleteCounterFr()) + Gb = fractal_walk_look_ahead_recursiv( + G, + S, + T, + S[1, :], + pTargetWeights, + 1, + infoLevel, + ) + + if infoLevel >= 1 + println("Cones crossed: ", deleteCounterFr()) + end return Gb end @@ -630,6 +1012,7 @@ function fractal_walk_look_ahead_recursiv( currweight::Vector{Int}, pTargetWeights::Vector{Vector{Int}}, p::Int, + infoLevel, ) R = Singular.base_ring(G) terminate = false @@ -640,49 +1023,79 @@ function fractal_walk_look_ahead_recursiv( t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. + # Next_weightfr may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. + # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weightfr returns 1 in the last step on every local path. if t == 1 && p != 1 if t == 1 && p != 1 if same_cone(G, T) - println(currweight, " in Cone", p) - if !inCone(G, T,pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", currweight, ".") + end + + # Check if a target weight of pTargetWeights[p] and pTargetWeights[p-1] lies in the wrong cone. + if !inCone(G, T, pTargetWeights, p) global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end end return G end - elseif t == [0] - if p == 1 || inCone(G, T,pTargetWeights, p) - println(pTargetWeights[p], " in Cone", p) + elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. + if inCone(G, T, pTargetWeights, p) + if infoLevel >= 1 + println("depth $p: in cone ", TargetWeights[p], ".") + end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end continue end + w = w + t * (pTargetWeights[p] - w) w = convert_bounding_vector(w) Gw = initials(R, Singular.gens(G), w) - # Handling the current weight with regards to Int32-entrys. + # Handling the current weight with regards to Int32-entries. If an entry of w is bigger than Int32 use the Buchberger-algorithm. if !checkInt32(w) w, b = truncw(G, w, Gw) if !b - throw(Exception) + Rn = change_order(R, T) + w = T[1, :] + G = Singular.std( + Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]), + complete_reduction = true, + ) + if !inCone(G, T, pTargetWeights, p) + global pTargetWeights = + [pertubed_vector(G, T, i) for i = 1:nvars(R)] + if infoLevel >= 1 + println("depth $p: not in cone ", TargetWeights[p], ".") + end + end + return G end end Rn = change_order(R, w, T) - # Converting the Groebnerbasis + # Converting the Groebner basis if (p == Singular.nvars(R) || isbinomial(Gw)) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), complete_reduction = true, ) - println(w, " in depth", p) + if infoLevel >= 1 + println("depth $p: conversion in ", w, ".") + end raiseCounterFr() else - println("up in: ", p, " with: ", w) + if infoLevel >= 1 + println("depth $p: recursive call in $w.") + end H = fractal_walk_look_ahead_recursiv( Singular.Ideal(R, Gw), S, @@ -690,6 +1103,7 @@ function fractal_walk_look_ahead_recursiv( deepcopy(currweight), pTargetWeights, p + 1, + infoLevel, ) end #H = liftGW2(G, R, Gw, H, Rn) @@ -702,149 +1116,25 @@ function fractal_walk_look_ahead_recursiv( end global time = 0 -function fractal_walk_combined( - G::Singular.sideal, - S::Matrix{Int}, - T::Matrix{Int}, -) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - println("fractal_walk_combined results") - println("Crossed Cones in: ") - Gb = fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1) - println("Cones crossed: ", deleteCounterFr()) - println(time) - return Gb -end +############################################################### +# Tran´s version of the Groebner Walk. +# Returns the intermediate Groebner basis if an entry of an intermediate weight vector is bigger than int32. +############################################################### -function fractal_walk_combined( +function tran_walk( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, - currweight::Vector{Int}, - pTargetWeights::Vector{Vector{Int}}, - p::Int, + infoLevel::Int, ) - R = Singular.base_ring(G) - terminate = false - G.isGB = true - - # Handling the weight of the start ordering. - if (p == 1) - if !ismonomial(initials(R, Singular.gens(G), currweight)) - global pStartWeights = [pertubed_vector(G, S, i) for i = 1:nvars(R)] - println(pStartWeights) - global firstStepMode = true - end + if infoLevel >= 1 + println("tran_walk results") + println("Crossed Cones in: ") end - if firstStepMode - w = pStartWeights[p] - else - w = currweight - end - - while !terminate - t = next_weightfr(G, w, pTargetWeights[p]) - - # Handling the final step in the current depth. - if t == 1 && p != 1 - if same_cone(G, T) - println(currweight, " in Cone", p) - if !inCone(G, T,pTargetWeights, p) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - end - return G - end - elseif t == [0] - if inCone(G, T,pTargetWeights, p) - println(pTargetWeights[p], " in Cone", p) - return G - end - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - continue - end - if t == 1 && p == 1 - println("up in: ", p, " with: t = 1") - return fractal_walk_combined(G, S, T, w, pTargetWeights, p + 1) - else - w = w + t * (pTargetWeights[p] - w) - w = convert_bounding_vector(w) - Gw = initials(R, gens(G), w) - # Handling the current weight with regards to Int32-entrys. Addtionally use Buchberger´s Algorithm to skip a weight>Int32 - if !checkInt32(w) - w, b = truncw(G, w, Gw) - if !b - Rn = change_order(R, T) - w = T[1, :] - G = Singular.std( - Singular.Ideal( - Rn, - [change_ring(x, Rn) for x in gens(G)], - ), - complete_reduction = true, - ) - if !inCone(G, T,pTargetWeights, p) - global pTargetWeights = - [pertubed_vector(G, T, i) for i = 1:nvars(R)] - println("not in Cone ", pTargetWeights) - end - return G - else - Rn = change_order(R, w, T) - end - end - Rn = change_order(R, w, T) - - # Converting the Groebnerbasis - if (p == Singular.nvars(R) || isbinomial(Gw)) - H = Singular.std( - Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), - complete_reduction = true, - ) - println(w, " in depth", p) - raiseCounterFr() - else - println( - "from $(currweight) to $(pTargetWeights[p])", - "up in: ", - p, - " with: ", - w, - ) - H = fractal_walk_combined( - Singular.Ideal(R, Gw), - S, - T, - deepcopy(currweight), - pTargetWeights, - p + 1, - ) - global firstStepMode = false - end - end - #H = liftGW2(G, R, Gw, H, Rn) - H = lift_fractal_walk(G, H, Rn) - G = interreduce_walk(H) - R = Rn - currweight = w - end - return G -end - -############################################################### -#Tran´s version of the groebner walk by Tran (2002). -############################################################### - -function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) + counter = 0 currweight = S[1, :] tarweight = T[1, :] - println("tran_walk results") - println("Crossed Cones in: ") R = base_ring(G) if !ismonomial(initials(R, Singular.gens(G), currweight)) currweight = pertubed_vector(G, S, nvars(R)) @@ -853,7 +1143,8 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) terminate = false while !terminate w = next_weight(G, currweight, tarweight) - println(w) + + # return the Groebner basis if an entry of w is bigger than int32. if !checkInt32(w) w, b = truncw(G, w, initials(R, gens(G), w)) if !b @@ -863,7 +1154,6 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) Rn = change_order(R, w, T) if w == tarweight if same_cone(G, T) - #this checks if in_{<_{cw}}(g)= in_<(in_cw(g)) = in_<<(g) f.a. g in G return G elseif inSeveralCones(initials(base_ring(G), gens(G), tarweight)) tarweight = representation_vector(G, T) @@ -871,16 +1161,24 @@ function tran_walk(G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}) end end G = standard_step_without_int32_check(G, w, T) - global counter = getCounter() + 1 + if infoLevel >= 1 + println(w) + if infoLevel == 2 + println(G) + end + end + counter += 1 R = Rn currweight = w end - println("Cones crossed: ", getCounter()) + if infoLevel >= 1 + println("Cones crossed: ", counter) + end return G end ############################################################### -# Standard_step without the checking of the weight $w$ w.r.t. Int32 +# Standard step without checking of the entries of a given weight vector. ############################################################### function standard_step_without_int32_check( @@ -890,7 +1188,6 @@ function standard_step_without_int32_check( ) R = base_ring(G) Rn = change_order(R, w, T) - Gw = initials(Rn, gens(G), w) H = Singular.std(Singular.Ideal(Rn, Gw), complete_reduction = true) #H = liftGW2(G, R, Gw, H, Rn) @@ -898,11 +1195,16 @@ function standard_step_without_int32_check( return interreduce_walk(H) end +############################################################### +# Generic Walk with a choosable pertubationdegree. This version is not tested yet. +############################################################### + function pgeneric_walk( G::Singular.sideal, S::Matrix{Int}, T::Matrix{Int}, p::Int, + infoLevel::Int, ) R = base_ring(G) Rn = change_order(G.base_ring, T) @@ -930,7 +1232,6 @@ function generic_step( ) where {L<:Nemo.RingElem} Rn = Singular.base_ring(G) - facet_Generators = facet_initials(G, Lm, v) H = Singular.std( Singular.Ideal(Rn, facet_Generators), diff --git a/src/GroebnerWalk/GroebnerWalkUtilitys.jl b/src/GroebnerWalk/GroebnerWalkUtilitys.jl index e93d489cd..69edd4faf 100644 --- a/src/GroebnerWalk/GroebnerWalkUtilitys.jl +++ b/src/GroebnerWalk/GroebnerWalkUtilitys.jl @@ -1,9 +1,8 @@ ############################################################### -#Utilitys for Groebnerwalks +# Several Procedures for the Groebner Walk ############################################################### -#Computes next weight vector. Version used in Cox O´shea and Fukuda et al. -#This Version is used by the standard_walk, pertubed_walk and tran_walk. +# Returns the next intermediate weight vector. function next_weight( G::Singular.sideal, cw::Vector{Int}, @@ -23,36 +22,28 @@ function next_weight( return convert_bounding_vector(cw + BigInt(numerator(tmin))//BigInt(denominator(tmin)) * (tw - cw)) end -function checkInt32(w::Vector{Int}) - for i = 1:length(w) - if tryparse(Int32, string(w[i])) == nothing - #println("int32") - return false - end - end - return true -end +# multiplys every entry of the given weight with 0.1 as long as it stays on the halfspace. function truncw( G::Singular.sideal, w::Vector{Int}, inw::Vector{L}, ) where {L<:Nemo.RingElem} while !checkInt32(w) - println("$w > Int32") R = base_ring(G) for i = 1:length(w) w[i] = round(w[i] * 0.10) end w = convert_bounding_vector(w) if inw != initials(R, gens(G), w) - println("Initials are different - return not rounded weight") + #Initials are different - return not rounded weight return w, false end end - println("Converted to Vector $w of the same face.") + # Converted to Vector w of the same face return w, true end -#Return the initials of polynomials w.r.t. a weight vector. + +#Returns the initialform of G w.r.t. the given weight vector. function initials( R::Singular.PolyRing, G::Vector{L}, @@ -84,8 +75,6 @@ function initials( return inits end -#Return the difference of the exponents of the leading terms (Lm) and the -#exponent vectors of the tail of all polynomials of the ideal. function difference_lead_tail(I::Singular.sideal) v = Vector{Int}[] for g in gens(I) @@ -97,15 +86,7 @@ function difference_lead_tail(I::Singular.sideal) return unique!(v) end -#= -@doc Markdown.doc""" -function pertubed_vector( -G::Singular.sideal, -M::Matrix{Int}, -p::Integer -) -Computes a p-pertubed weight vector of M. -"""=# +# Computes a p-pertubed vector from M function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) m = Int[] n = size(M, 1) @@ -138,15 +119,7 @@ function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) return convert_bounding_vector(w) end -#= -@doc Markdown.doc""" -function inCone( - G::Singular.sideal, - T::Matrix{Int}, - t::Vector{Int}, -) -Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. -"""=# +#Returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) R = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) @@ -159,15 +132,7 @@ function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) return true end -#= -@doc Markdown.doc""" -function inCone( - G::Singular.sideal, - T::Matrix{Int}, - t::Vector{Int}, -) -Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ w.r.t the weighted monomial ordering with weight vector $t$ and the Matrixordering $T$. -"""=# +#Returns 'true' if the leading tems of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and the matrix order T. function inCone(G::Singular.sideal, t::Vector{Int}) cvzip = zip(Singular.gens(G), initials(base_ring(G), Singular.gens(G), t)) for (g, ing) in cvzip @@ -178,15 +143,7 @@ function inCone(G::Singular.sideal, t::Vector{Int}) return true end -#= -@doc Markdown.doc""" -function inCone( - G::Singular.sideal, - T::Matrix{Int}, - t::Vector{Int}, -) -Returns 'true' if the leading tems of $G$ w.r.t the matrixordering $T$ are the same as the leading terms of $G$ with the current ordering. -"""=# +# Returns 'true' if the leading tems of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. function same_cone(G::Singular.sideal, T::Matrix{Int}) R = change_order(G.base_ring, T) for g in gens(G) @@ -197,26 +154,7 @@ function same_cone(G::Singular.sideal, T::Matrix{Int}) return true end -#= -@doc Markdown.doc""" -function isGb( - G::Singular.sideal, - T::Matrix{Int}, -) -"""=# -function isGb(G::Singular.sideal, T::Matrix{Int}) - R = change_order(G.base_ring, T) - for g in Singular.gens(G) - if !isequal( - Singular.leading_term(g), - change_ring(Singular.leading_term(change_ring(g, R)), G.base_ring), - ) - return false - end - end - return true -end -#Fukuda et al +# Lifting step by Fukuda et al. (2005). function lift( G::Singular.sideal, R::Singular.PolyRing, @@ -235,17 +173,7 @@ function lift( return G end -#= -@doc Markdown.doc""" -function lift_fractal_walk( -G::Singular.sideal, -R::Singular.PolyRing, -inG::Vector{spoly{L}}, -H::Singular.sideal, -Rn::Singular.PolyRing, -) -Performs a lifting step in the Groebner Walk proposed by Amrhein et. al. and Cox Little Oshea -"""=# +# lifting step in the Groebner Walk by Collart et al. (1997). function liftGW2( G::Singular.sideal, R::Singular.PolyRing, @@ -271,6 +199,7 @@ function liftGW2( return G end +# divisionalgorithm that returns q with q_1*f_1 + ... + q_s *f_s=p. function division_algorithm( p::spoly{L}, f::Vector{spoly{L}}, @@ -300,11 +229,7 @@ function division_algorithm( return q end -#= -@doc Markdown.doc""" - convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} -Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). -"""=# +# converts a vector wtemp by dividing the entries with gcd(wtemp). function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} w = Vector{Int}() g = gcd(wtemp) @@ -313,11 +238,8 @@ function convert_bounding_vector(wtemp::Vector{T}) where {T<:Rational{BigInt}} end return w end -#= -@doc Markdown.doc""" - convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} -Given a Vector{Number} $v$ this function computes a Vector{Int} w with w = v:gcd(v). -"""=# + +# converts a vector wtemp by dividing the entries with gcd(wtemp). function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} w = Vector{Int}() g = gcd(wtemp) @@ -327,8 +249,7 @@ function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} return w end - -#return a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T) +# returns a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T) function change_order( R::Singular.PolyRing, cw::Array{L,1}, @@ -367,7 +288,7 @@ function change_order( return S end -#return a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T) +# returns a copy of the PolynomialRing I, equipped with the ordering a(w)*a(t)*ordering_M(T) function change_order( R::Singular.PolyRing, w::Vector{Int}, @@ -388,7 +309,7 @@ function change_order( return S end -#return a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) +#returns a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) function change_order( R::Singular.PolyRing, M::Matrix{Int}, @@ -404,6 +325,7 @@ function change_order( return S end +# recreates the polynomials p equipped with ring R. function change_ring(p::Singular.spoly, R::Singular.PolyRing) cvzip = zip(Singular.coefficients(p), Singular.exponent_vectors(p)) M = MPolyBuildCtx(R) @@ -413,15 +335,7 @@ function change_ring(p::Singular.spoly, R::Singular.PolyRing) return finish(M) end - -#= -@doc Markdown.doc""" -function interreduce( - G::Vector{spoly{L}}, - Lm::Vector{spoly{L}}, -) where {L<:Nemo.RingElem} -G represents a Gröbnerbasis. This function interreduces G w.r.t. the leading terms Lm with tail-reduction. -"""=# +# interreduces the Groebner basis G. function interreduce_walk(G::Singular.sideal) where {L<:Nemo.RingElem} Rn = base_ring(G) Generator = collect(gens(G)) diff --git a/src/GroebnerWalk/Helper.jl b/src/GroebnerWalk/Helper.jl index 99269a69e..fb5fad1a6 100644 --- a/src/GroebnerWalk/Helper.jl +++ b/src/GroebnerWalk/Helper.jl @@ -86,12 +86,14 @@ function change_weight_vector(w::Vector{Int}, M::Matrix{Int}) M[2:length(w), :] ] end + function insert_weight_vector(w::Vector{Int}, M::Matrix{Int}) return [ w' M[1:length(w)-1, :] ] end + function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) return [ w' @@ -125,7 +127,6 @@ function ordering_as_matrix(ord::Symbol, nvars::Int) end end - function deg(p::Singular.spoly, n::Int) max = 0 for mon in Singular.monomials(p) @@ -153,3 +154,12 @@ function check_ordering_M(S::Matrix{Int}, T::Matrix{Int}, G::Singular.sideal) rank(S) == nvars(base_ring(G)) ) end + +function checkInt32(w::Vector{Int}) + for i = 1:length(w) + if tryparse(Int32, string(w[i])) == nothing + return false + end + end + return true +end diff --git a/src/GroebnerWalk/Testideals.jl b/src/GroebnerWalk/Testideals.jl index ae84de174..6a639cefa 100644 --- a/src/GroebnerWalk/Testideals.jl +++ b/src/GroebnerWalk/Testideals.jl @@ -145,36 +145,6 @@ using Test end - id = noon8() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int, dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - R2 = change_order(R, StartOrd) - S = change_order(R, TarOrd) - I = Singular.std(id, complete_reduction = true) - - ideals = [] - for i = 2:nvars(S)-3 - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :pertubed, i)) - end - push!(ideals, groebnerwalk(I, :degrevlex, :lex, :standard)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) - - s = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - complete_reduction = true, - ) - - for id in ideals - @test equalitytest( - Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), - s, - ) - end - id = redeco7() R = base_ring(id) dim = nvars(R) diff --git a/src/GroebnerWalk/TranWalkUtilitys.jl b/src/GroebnerWalk/TranWalkUtilitys.jl index c6b2c73bb..8879540fc 100644 --- a/src/GroebnerWalk/TranWalkUtilitys.jl +++ b/src/GroebnerWalk/TranWalkUtilitys.jl @@ -1,6 +1,6 @@ include("GroebnerWalkUtilitys.jl") - +# computes the representation of the matrixorder defined by T. function representation_vector(G::Singular.sideal, T::Matrix{Int}) n = size(T)[1] M = 0 @@ -24,10 +24,10 @@ function representation_vector(G::Singular.sideal, T::Matrix{Int}) for i = 2:n w = w + d^(n - i) * T[i, :] end - println(w) return w end +# checks if Gw is an initialform of an ideal corresponding to a face of the Groebner fan with dimension less than n-1. function inSeveralCones(Gw::Vector{spoly{L}}) where {L<:Nemo.RingElem} counter = 0 for g in Gw diff --git a/src/GroebnerWalk/UnitTests.jl b/src/GroebnerWalk/UnitTests.jl index 57b82ef04..18bd100af 100644 --- a/src/GroebnerWalk/UnitTests.jl +++ b/src/GroebnerWalk/UnitTests.jl @@ -11,7 +11,6 @@ include("Examples.jl") ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), ) - f1 = 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 f2 = y^3 * z + 17 * x^2 * z^2 + 7 * x^2 * y^2 * z^2 + 13 * x^3 * z^2 I = Singular.Ideal(R, [f1, f2]) @@ -46,7 +45,6 @@ include("Examples.jl") @test deg(f1, 3) == 5 - id = trinks1() R = base_ring(id) dim = nvars(R) @@ -64,9 +62,8 @@ include("Examples.jl") @test pertubed_vector(I, TarOrd, 3) == [49, 7, 1, 0, 0, 0] @test pertubed_vector(I, TarOrd, 4) == [1000, 100, 10, 1, 0, 0] - @test inCone(I, StartOrd, [1000, 1000, 1000, 999, 990, 900]) == true - @test inCone(I, StartOrd, [100, 1000, 1000, 999, 990, 900]) == false - + @test inCone(I, [1000, 1000, 1000, 999, 990, 900]) == true + @test inCone(I, [100, 1000, 1000, 999, 990, 900]) == false @test dot([1, 2, 3, 4], [2, 2, 2, 2]) == 20 @@ -89,14 +86,12 @@ include("Examples.jl") f2 = y^3 K = Singular.Ideal(R, [f1, f2]) - @test ismonomial(gens(I)) == false @test ismonomial(gens(J)) == true @test isbinomial(gens(I)) == true @test isbinomial(gens(J)) == true @test isbinomial(gens(K)) == false @test ismonomial(gens(K)) == false - end @testset "Testing GenericWalkUtilitys" begin @@ -106,7 +101,6 @@ include("Examples.jl") ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 2)), ) - f1 = x^2 - y^3 f2 = x^3 - y^2 - x I = Singular.Ideal(R, [f1, f2]) @@ -188,7 +182,6 @@ include("Examples.jl") f3 = R(a^2 * b^4 + c^2 + a^3 * 4 + a * e^3) f4 = R(0) - @test (reduce(f3, I)) == reduce_walk(f3, gens(I), [Singular.leading_term(g) for g in gens(I)]) @test (reduce(f1, I)) == @@ -198,6 +191,7 @@ include("Examples.jl") @test (reduce(f4, I)) == reduce_walk(f4, gens(I), [Singular.leading_term(g) for g in gens(I)]) J = Singular.std(J) + @test equalitytest( Singular.std(J, complete_reduction = true), Singular.Ideal( diff --git a/src/Groebnerwalk.jl b/src/Groebnerwalk.jl index 82b0b24a2..adf601710 100644 --- a/src/Groebnerwalk.jl +++ b/src/Groebnerwalk.jl @@ -1,4 +1 @@ -include("Groebnewalk/GroebnerWalk.jl") -include("Groebnewalk/GroebnerWalkUtils.jl") -include("Groebnewalk/GenWalk.jl") -include("Groebnewalk/StWalk.jl") +include("Groebnerwalk/GroebnerWalk.jl") From 6cb0601fbde4eefd79ee465757a33137242d1b7a Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 24 Mar 2022 10:48:19 +0100 Subject: [PATCH 62/85] fix: tippfehler --- src/GroebnerWalk/GenericWalkUtilitys.jl | 20 ++------ src/GroebnerWalk/GroebnerWalk.jl | 67 +++++++++++++------------ src/GroebnerWalk/Helper.jl | 6 +-- 3 files changed, 41 insertions(+), 52 deletions(-) diff --git a/src/GroebnerWalk/GenericWalkUtilitys.jl b/src/GroebnerWalk/GenericWalkUtilitys.jl index 9d47a6ce0..0e686a08d 100644 --- a/src/GroebnerWalk/GenericWalkUtilitys.jl +++ b/src/GroebnerWalk/GenericWalkUtilitys.jl @@ -91,22 +91,11 @@ function lift_generic( return liftPolys, Newlm end -# returns all v\in V if v>0 w.r.t. the ordering represented by S. -function filter_btz(S::Matrix{Int}, V::Vector{Vector{Int}}) +# returns all v \in V if v<0 w.r.t. the ordering represented by T and v>0 w.r.t the ordering represented by S. +function filter_by_ordering(S::Matrix{Int},T::Matrix{Int}, V::Vector{Vector{Int}}) btz = Set{Vector{Int}}() for v in V - if bigger_than_zero(S, v) - push!(btz, v) - end - end - return btz -end - -# returns all v \in V if v<0 w.r.t. the ordering represented by S. -function filter_ltz(S::Matrix{Int}, V::Set{Vector{Int}}) - btz = Set{Vector{Int}}() - for v in V - if less_than_zero(S, v) + if less_than_zero(T, v) && bigger_than_zero(S, v) push!(btz, v) end end @@ -137,8 +126,7 @@ function next_gamma( S::Matrix{Int}, T::Matrix{Int}, ) where {L<:Nemo.RingElem} - V = filter_btz(S, difference_lead_tail(G, Lm)) - V = filter_ltz(T, V) + V = filter_by_ordering(S, T, difference_lead_tail(G, Lm)) if (w != [0]) V = filter_lf(w, S, T, V) end diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index 1c6b1ee8a..ea0c25579 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -13,14 +13,14 @@ export groebnerwalk ############################################################### #= -Compute a reduced Groebner basis w.r.t. to a monomial ordering by converting it using the Groebner Walk. +Compute a reduced Groebner basis w.r.t. to a monomial order by converting it using the Groebner Walk. The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). One can choose a strategy of: Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little & O´Shea (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda, Lauritzen Thomas (2005). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda, Jensen, Lauritzen & Thomas (2005). Pertubed Walk (:pertubed, with p = degree of the pertubation) computes the Walk like it´s presented in Amrhein, Gloor & Küchlin (1997). Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. +Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target order has to be lex. This version uses the Buchberger Algorithm to skip weight vectors with entries bigger than Int32. Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. #Arguments @@ -50,7 +50,7 @@ function groebnerwalk( ) R = change_order( base_ring(G), - ordering_as_matrix(startOrder, nvars(base_ring(G))), + order_as_matrix(startOrder, nvars(base_ring(G))), ) Gb = std( Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]), @@ -59,8 +59,8 @@ function groebnerwalk( return groebnerwalk( Gb, - ordering_as_matrix(startOrder, nvars(R)), - ordering_as_matrix(targetOrder, nvars(R)), + order_as_matrix(startOrder, nvars(R)), + order_as_matrix(targetOrder, nvars(R)), walktype, pertubationDegree, infoLevel, @@ -68,20 +68,20 @@ function groebnerwalk( end #= -Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial ordering S using the Groebner Walk. +Computes a reduced Groebner basis w.r.t. the monomial order T by converting the reduced Groebner basis G w.r.t. the monomial order S using the Groebner Walk. One can choose a strategy of: Standard Walk (:standard) computes the Walk like it´s presented in Cox et al. (2005). -Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2006). +Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. (2005). Pertubed Walk (:pertubed, with p = degree of the pertubation) computes the Walk like it´s presented in Amrhein et al. (1997). Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. #Arguments -*`G::Singular.sideal`: Gröbnerbasis to convert to the Gröbnerbasis w.r.t. the traget-ordering. -*`S::Matrix{Int}`: The start ordering w.r.t. the Gröbnerbasis I. Note that S has to be a nxn-matrix with rank(S)=n. -*`T::Matrix{Int}`: The target ordering we want to compute a Gröbnerbasis for. Note that T has to be a nxn-matrix with rank(T)=n. -*`grwalktype::Symbol=:standard`: Strategy of the Gröbnerwalk to be used. There are the strategies: +*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the traget-order. +*`S::Matrix{Int}`: The start order w.r.t. the Groebner basis I. Note that S has to be a nxn-matrix with rank(S)=n. +*`T::Matrix{Int}`: The target order we want to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n. +*`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, - `tran`: Tran´s Walk, @@ -122,7 +122,7 @@ function groebnerwalk( walk = (x) -> fractal_walk_combined(x, S, T, infoLevel) end - !check_ordering_M(S, T, G) && throw( + !check_order_M(S, T, G) && throw( error( "The matrices representing the monomial order have to be nxn-matrices with full rank.", ), @@ -258,6 +258,7 @@ function generic_walk( if infoLevel >= 1 println("Cones crossed: ", counter) end + # to generate the same coefficients as Singular.std does. This version of the generic walk computes LC(g)=1 for all g \in G. return Singular.interreduce(G) end @@ -342,7 +343,7 @@ firstStepMode = false ############################################################### # Combined version of the extensions of the Fractal Walk. # This version -# - checks if the starting weight vector represents the ordering and pertubes it if necessary. +# - checks if the starting weight vector represents the order and pertubes it if necessary. # - analyses the Groebner basis Gw of the initialforms and uses the Buchberger-algorithm if the generators of Gw are binomial or less. # - skips a step in top level in the last step. # - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. @@ -412,7 +413,7 @@ function fractal_walk_combined( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -427,7 +428,7 @@ function fractal_walk_combined( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end continue end @@ -470,7 +471,7 @@ function fractal_walk_combined( if infoLevel >= 1 println( "depth $p: not in cone ", - TargetWeights[p], + pTargetWeights[p], ".", ) end @@ -572,7 +573,7 @@ function fractal_recursiv( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -580,14 +581,14 @@ function fractal_recursiv( elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) if infoLevel >= 1 - println("depth $p: in cone ", TargetWeights[p], ".") + println("depth $p: in cone ",pTargetWeights[p], ".") end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end continue end @@ -610,7 +611,7 @@ function fractal_recursiv( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -727,7 +728,7 @@ function fractal_walk_recursiv_startorder( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -735,14 +736,14 @@ function fractal_walk_recursiv_startorder( elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) if infoLevel >= 1 - println("depth $p: in cone ", TargetWeights[p], ".") + println("depth $p: in cone ",pTargetWeights[p], ".") end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end continue end @@ -765,7 +766,7 @@ function fractal_walk_recursiv_startorder( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -872,7 +873,7 @@ function fractal_walk_recursive_lex( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -880,14 +881,14 @@ function fractal_walk_recursive_lex( elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) if infoLevel >= 1 - println("depth $p: in cone ", TargetWeights[p], ".") + println("depth $p: in cone ",pTargetWeights[p], ".") end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end continue end @@ -927,7 +928,7 @@ function fractal_walk_recursive_lex( if infoLevel >= 1 println( "depth $p: not in cone ", - TargetWeights[p], + pTargetWeights[p], ".", ) end @@ -1036,7 +1037,7 @@ function fractal_walk_look_ahead_recursiv( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G @@ -1044,14 +1045,14 @@ function fractal_walk_look_ahead_recursiv( elseif t == [0] # The Groebner basis w.r.t. the target weight and T is already computed. if inCone(G, T, pTargetWeights, p) if infoLevel >= 1 - println("depth $p: in cone ", TargetWeights[p], ".") + println("depth $p: in cone ",pTargetWeights[p], ".") end return G end global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end continue end @@ -1074,7 +1075,7 @@ function fractal_walk_look_ahead_recursiv( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(R)] if infoLevel >= 1 - println("depth $p: not in cone ", TargetWeights[p], ".") + println("depth $p: not in cone ",pTargetWeights[p], ".") end end return G diff --git a/src/GroebnerWalk/Helper.jl b/src/GroebnerWalk/Helper.jl index fb5fad1a6..7f93bf03c 100644 --- a/src/GroebnerWalk/Helper.jl +++ b/src/GroebnerWalk/Helper.jl @@ -47,7 +47,7 @@ function dot(v::Vector{Int}, w::Vector{Int}) return sum end -function ordering_as_matrix(w::Vector{Int}, ord::Symbol) +function order_as_matrix(w::Vector{Int}, ord::Symbol) if length(w) > 2 if ord == :lex return [ @@ -101,7 +101,7 @@ function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) ] end -function ordering_as_matrix(ord::Symbol, nvars::Int) +function order_as_matrix(ord::Symbol, nvars::Int) if ord == :lex return ident_matrix(nvars) end @@ -144,7 +144,7 @@ function deg(p::Singular.spoly, n::Int) return max end -function check_ordering_M(S::Matrix{Int}, T::Matrix{Int}, G::Singular.sideal) +function check_order_M(S::Matrix{Int}, T::Matrix{Int}, G::Singular.sideal) (nrows, ncols) = size(T) return ( (nrows, ncols) == size(S) && From 058b4ab8e641b6165cf8377372d8efdbd3ed52d8 Mon Sep 17 00:00:00 2001 From: welpj Date: Sat, 26 Mar 2022 11:30:50 +0100 Subject: [PATCH 63/85] fix: Tippfehler --- src/GroebnerWalk/FractalWalkUtilitys.jl | 6 +- src/GroebnerWalk/GWtestFinal.jl | 697 ----------------------- src/GroebnerWalk/GenericWalkUtilitys.jl | 2 +- src/GroebnerWalk/GroebnerWalk.jl | 176 +++--- src/GroebnerWalk/GroebnerWalkUtilitys.jl | 28 +- src/GroebnerWalk/Helper.jl | 4 +- src/GroebnerWalk/Testideals.jl | 6 +- 7 files changed, 91 insertions(+), 828 deletions(-) delete mode 100644 src/GroebnerWalk/GWtestFinal.jl diff --git a/src/GroebnerWalk/FractalWalkUtilitys.jl b/src/GroebnerWalk/FractalWalkUtilitys.jl index ae51ba699..eea971b2d 100644 --- a/src/GroebnerWalk/FractalWalkUtilitys.jl +++ b/src/GroebnerWalk/FractalWalkUtilitys.jl @@ -2,10 +2,10 @@ include("GroebnerWalkUtilitys.jl") ################################################################# # Procedures of the fractal walk. -# The fractal walk is proposed by Amrhein & Gloor (1998) +# The fractal walk is proposed by Amrhein & Gloor (1998). ################################################################# -#Performs a lifting step in the Fractal Walk. +# lifts the Groebner basis G to the Groebner basis w.r.t. in the Fractal Walk like it´s done in Fukuda et. al (2005). function lift_fractal_walk( G::Singular.sideal, H::Singular.sideal, @@ -101,7 +101,7 @@ function next_weightfr( return BigInt(numerator(tmin)) // BigInt(denominator(tmin)) end -# returns 'true' if the leading tems of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the Matrixordering T. +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial ordering with weight vector of pvecs[p] (pvecs[p-1]) and the matrixordering T. function inCone( G::Singular.sideal, T::Matrix{Int}, diff --git a/src/GroebnerWalk/GWtestFinal.jl b/src/GroebnerWalk/GWtestFinal.jl deleted file mode 100644 index b034252fd..000000000 --- a/src/GroebnerWalk/GWtestFinal.jl +++ /dev/null @@ -1,697 +0,0 @@ -include("GroebnerWalk.jl") -include("Examples.jl") -function test(case::Int) - - - test_successfull = true - if case == 1 || case == 99 - id = redeco7() - R = base_ring(id) - dim = nvars(R) - ve = ones(Int, dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - R2 = change_order(R, StartOrd) - S = change_order(R, TarOrd) - I = Singular.std( - Singular.Ideal(R2, [change_ring(x, R2) for x in gens(id)]), - complete_reduction = true, - ) - #I = Singular.std(id, complete_reduction = true) - @time T = groebnerwalk( - deepcopy(I), - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_combined, - 2, - ) - - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_combined, - 2, - ) - - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_combined, - ) - - - - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :standard, - 3, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 4, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :generic, - 4, - ) - - #@time T0 = Singular.std( - # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - # complete_reduction = true, - #) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - println("test tran: ", equalitytest(T6, T1)) - println("test fractal: ", equalitytest(T6, T2)) - println("test fractal: ", equalitytest(T6, T3)) - println("test pertubed: ", equalitytest(T5, T6)) - println("test standard: ", equalitytest(T4, T6)) - println("test generic: ", equalitytest(T6, T6)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end - end - if case == 2 || case == 99 - - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - - f1 = 16 + 3 * x^2 + 16 * x^2 * z + 14 * x^2 * y^3 - f2 = 6 + y^3 * z + 17 * x^2 * z^2 + 7 * x * y^2 * z^2 + 13 * x^3 * z^2 - J = Singular.Ideal(R, [f1, f2]) - - I = Singular.std(J, complete_reduction = true) - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :tran, - 3, - ) - - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_start_order, - ) - - - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_combined, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :pertubed, - 2, - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :standard, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :generic, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 3)), - ) - - - T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) - - - - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end - end - - if case == 3 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 6)), - ) - - f1 = y^4 + y * z^2 - u^2 * w - f2 = 2 * x^2 * y + x^3 * w * u^2 + x - f3 = 2 - 3 * x^2 * v * z^4 * w - I = Singular.Ideal(R, [f1, f2, f3]) - I = Singular.std(I, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - - #= @time J = fractal_walk( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - ) =# - - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_combined, - ) - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test tran: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - #println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equal(T4, T0)) - - - if !( - equalitytest(T2, T0) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - end - if case == 4 || case == 99 - R, (q, c, p, d) = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 4)), - ) - - f1 = - 2 * c * d * p * q - 4 * c * d + 2 * p * q + 4 * p * q * c - - 4 * d^2 * q - 2 * d^2 * p * q + p^2 * d^2 - 2 * c^2 * q + - c^2 * q^2 + - 2 * c * d * q - 2 * c * d * q^2 + d^2 * q^2 - 2 * c * d * p - - 8 * p + - c^2 + - 4 * d^2 - 2 * q + - 10 * p^2 + - 2 - f2 = - 2 * d * p * q + 4 * d * p^2 + d * p - 7 * d * p + c * p - - 3 * p * q * c + 4 * c - f3 = -2 * p^2 + 8 * p - 2 - 2 * p * q - 2 * q - f4 = - 4 - 4 * p - 4 * q^2 + 3 * c^2 * q^2 - 6 * c^2 * q + - 3 * c^2 + - 9 * p^2 * d^2 + - 6 * d^2 * p * q - 3d^2 * q^2 - 24 * p * d^2 + - 12 * d^2 + - 4 * p^2 + - 12 * c * d * p + - 12 * c * d * q + - 12 * c * d * p * q - 12 * c * d - I = Singular.Ideal(R, [f1, f2, f3, f4]) - I = Singular.std(I, complete_reduction = true) - - - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :tran, - ) - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :pertubed, - 3 - ) - - @time Fa = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :fractal_combined, - ) - - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :pertubed, - 4, - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :standard, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 4), - ordering_as_matrix(:lex, 4), - :generic, - ) - - - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["q", "c", "p", "d"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 4)), - ) - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Fa)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) - - if !( - equalitytest(T2, T1) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - - end - if case == 5 || case == 99 - R, (x, y, z) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = Singular.ordering_M(ordering_as_matrix(:degrevlex, 3)), - ) - - f1 = x^2 + x * y^2 * z - 2x * y + y^4 + y^2 + z^2 - f2 = -x^3 * y^2 + x * y^2 * z + x * y * z^3 - 2x * y + y^4 - f3 = -2x^2 * y + x * y^4 + y * z^4 - 3 - I = Singular.Ideal(R, [f1, f2, f3]) - - I = Singular.std(I, complete_reduction = true) - - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z"], - ordering = :lex, - ) - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :tran, - ) - @time F = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :fractal_combined, - ) - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :pertubed, - 3 - ) - - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :standard, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :pertubed, - 3, - ) - - - - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 3), - ordering_as_matrix(:lex, 3), - :generic, - ) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - println("test tran: ", equalitytest(T0, T1)) - println("test fractal: ", equalitytest(T0, T2)) - println("test fractal: ", equalitytest(T0, T3)) - println("test pertubed: ", equalitytest(T5, T0)) - println("test standard: ", equalitytest(T4, T0)) - println("test generic: ", equalitytest(T6, T0)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - - end - - - - if case == 6 || case == 99 - R, (x, y, z, u, v, w) = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = :degrevlex, - ) - - - f1 = 2 * w * y + 2 * v * z + u^2 + x^2 + x - f2 = 2 * w * z + 2 * v * u + 2 * y * x + y - f3 = 2 * w * u + v^2 + 2 * z * x + z + y^2 - f4 = 2 * w * v + 2 * u * x + u + 2 * z * y - f5 = w^2 + 2 * v * x + v + 2 * u * y + z^2 - f6 = 2 * w * x + w + 2 * v * y + 2 * u * z - J = Singular.Ideal(R, [f1, f2, f3, f4, f5, f6]) - I = Singular.std(J, complete_reduction = true) - - @time H = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :standard, - ) - #= @time J = fractal_walk_combined( - I, - MonomialOrder( - ordering_as_matrix(:degrevlex, 6), - [1, 1, 1, 1, 1, 1], - [0], - ), - MonomialOrder( - ordering_as_matrix(:lex, 6), - [1, 0, 0, 0, 0, 0], - [1, 0, 0, 0, 0, 0], - ), - )=# - - @time JJ = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_combined, - ) - - @time K = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :pertubed, - 4, - ) - @time L = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :fractal_combined, - ) - @time M = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, 6), - ordering_as_matrix(:lex, 6), - :generic, - ) - S, V = Singular.PolynomialRing( - Singular.QQ, - ["x", "y", "z", "u", "v", "w"], - ordering = Singular.ordering_M(ordering_as_matrix(:lex, 6)), - ) - - @time T0 = Singular.std( - Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - complete_reduction = true, - ) - # T1test(4) = Singular.Ideal(S, [change_ring(x, S) for x in gens(J)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(K)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(L)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(M)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(JJ)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(H)]) - - println("test standard: ", equalitytest(T0, T6)) - println("test fractal2: ", equalitytest(T0, T5)) - #println("test fractal: ", equalitytest(T0, T1)) - println("test pertubed: ", equalitytest(T2, T0)) - println("test standard: ", equalitytest(T3, T0)) - println("test generic: ", equal(T4, T0)) - - if !( - equalitytest(T2, T0) && - equalitytest(T3, T6) && - equalitytest(T0, T5) && - equalitytest(T0, T4) - ) - test_successfull = false - end - - end - - if case == 7 || case == 99 - dim = 4 - ve = [1, 1, 1, 1] - StartOrd = ordering_as_matrix(:degrevlex, dim) - TarOrd = ordering_as_matrix(:lex, dim) - R, (a, b, c, d) = Singular.PolynomialRing( - Singular.N_ZpField(32003), - ["a", "b", "c", "d"], - ordering = Singular.ordering_M(StartOrd), - ) - - S = change_order(R, TarOrd) - I = Singular.Ideal( - R, - [ - 2 * a^2 * b + - 3 * a * b^2 + - 3 * b^3 + - 4 * c^3 + - 4 * a * b * d + - c^2 * d + - 2 * b * d^2 + - 2 * d^3 + - 4 * c^2 + - 2 * c * d + - 2 * c, - 2 * a^2 * b + - 5 * a^2 * c + - 2 * b * c^2 + - c^2 * d + - a * c + - 2 * b * d + - 2 * c * d + - d^2 + - a + - 4 * d, - ], - ) - - - I = Singular.std(I, complete_reduction = true) - - - @time T = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_combined, - 4, - ) - @time F = groebnerwalk( - deepcopy(I), - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_start_order, - ) - @time FA = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 3 - ) - @time St = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :pertubed, - 4, - ) - @time Pe = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :fractal_combined, - 3, - ) - @time Ge = groebnerwalk( - I, - ordering_as_matrix(:degrevlex, dim), - ordering_as_matrix(:lex, dim), - :generic, - ) - - - #@time T6 = Singular.std( - # Singular.Ideal(S, [change_ring(x, S) for x in gens(I)]), - # complete_reduction = true, - # ) - - T1 = Singular.Ideal(S, [change_ring(x, S) for x in gens(T)]) - T2 = Singular.Ideal(S, [change_ring(x, S) for x in gens(F)]) - T3 = Singular.Ideal(S, [change_ring(x, S) for x in gens(FA)]) - T4 = Singular.Ideal(S, [change_ring(x, S) for x in gens(St)]) - T5 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Pe)]) - T6 = Singular.Ideal(S, [change_ring(x, S) for x in gens(Ge)]) - - println("test tran: ", equalitytest(T6, T1)) - println("test fractal: ", equalitytest(T6, T2)) - println("test fractal: ", equalitytest(T6, T3)) - println("test pertubed: ", equalitytest(T5, T6)) - println("test standard: ", equalitytest(T4, T6)) - println("test generic: ", equalitytest(T6, T6)) - if !( - equalitytest(T2, T1) && - equalitytest(T3, T4) && - equalitytest(T6, T5) - ) - test_successfull = false - end - end - println("All tests were: ", test_successfull) -end diff --git a/src/GroebnerWalk/GenericWalkUtilitys.jl b/src/GroebnerWalk/GenericWalkUtilitys.jl index 0e686a08d..ae3a5448f 100644 --- a/src/GroebnerWalk/GenericWalkUtilitys.jl +++ b/src/GroebnerWalk/GenericWalkUtilitys.jl @@ -75,7 +75,7 @@ function isparallel(u::Vector{Int}, v::Vector{Int}) return true end -# performs a lifting step in the Groebner Walk proposed by Fukuda et al. (2005). +# performs the lifting in the generic Walk like it´s proposed by Fukuda et al. (2005). function lift_generic( G::Vector{spoly{L}}, Lm::Vector{Singular.spoly{L}}, diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index ea0c25579..62802dd63 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -20,7 +20,7 @@ Standard Walk (:standard) computes the Walk like it´s presented in Cox, Little Generic Walk (:generic) computes the Walk like it´s presented in Fukuda, Jensen, Lauritzen & Thomas (2005). Pertubed Walk (:pertubed, with p = degree of the pertubation) computes the Walk like it´s presented in Amrhein, Gloor & Küchlin (1997). Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). -Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target order has to be lex. This version uses the Buchberger Algorithm to skip weight vectors with entries bigger than Int32. +Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weight vectors with entries bigger than Int32. Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. #Arguments @@ -33,7 +33,7 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo - `tran`: Tran´s Walk, - `generic`: Generic Walk, - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined Fractal Walk. Target order needs to be lex, + - `fractalcombined`: combined Fractal Walk. Target monomial order needs to be lex, *`pertubationDegree::Int=2`: pertubationdegree for the Pertubed Walk. *'infoLevel::Int=0': -'0': no printout, @@ -50,7 +50,7 @@ function groebnerwalk( ) R = change_order( base_ring(G), - order_as_matrix(startOrder, nvars(base_ring(G))), + ordering_as_matrix(startOrder, nvars(base_ring(G))), ) Gb = std( Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]), @@ -59,8 +59,8 @@ function groebnerwalk( return groebnerwalk( Gb, - order_as_matrix(startOrder, nvars(R)), - order_as_matrix(targetOrder, nvars(R)), + ordering_as_matrix(startOrder, nvars(R)), + ordering_as_matrix(targetOrder, nvars(R)), walktype, pertubationDegree, infoLevel, @@ -75,19 +75,19 @@ Generic Walk (:generic) computes the Walk like it´s presented in Fukuda et al. Pertubed Walk (:pertubed, with p = degree of the pertubation) computes the Walk like it´s presented in Amrhein et al. (1997). Tran´s Walk (:tran) computes the Walk like it´s presented in Tran (2000). Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. -Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. +Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. #Arguments -*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the traget-order. -*`S::Matrix{Int}`: The start order w.r.t. the Groebner basis I. Note that S has to be a nxn-matrix with rank(S)=n. -*`T::Matrix{Int}`: The target order we want to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n. +*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target-order. +*`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis I. Note that S has to be a nxn-matrix with rank(S)=n. +*`T::Matrix{Int}`: The target monomial order we want to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n. *`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, - `tran`: Tran´s Walk, - `generic`: Generic Walk, - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined Fractal Walk. Target order needs to be lex, + - `fractalcombined`: combined Fractal Walk. The target monomial order needs to be lex, *`p::Int=2`: Pertubationdegree for the pertubed Walk. *'infoLevel::Int=0': -'0': no printout, @@ -130,11 +130,32 @@ function groebnerwalk( R = base_ring(G) Gb = walk(Singular.Ideal(R, [R(x) for x in gens(G)])) + + if infoLevel >= 1 + println("Cones crossed: ", delete_counter()) + end + S = change_order(R, T) return Singular.Ideal(S, [change_ring(gen, S) for gen in gens(Gb)]) end - +########################################### +# Counter for the steps in the Fractal Walk. +########################################### +counter = 0 +function delete_counter() + global counter + temp = counter + counter = 0 + return temp +end +function getcounter() + global counter + return counter +end +function raise_counter() + global counter = getcounter() + 1 +end ############################################################### # Implementation of the standard walk. ############################################################### @@ -151,6 +172,7 @@ function standard_walk( end Gb = standard_walk(G, S, T, S[1, :], T[1, :], infoLevel) + return Gb end @@ -162,9 +184,7 @@ function standard_walk( tarweight::Vector{Int}, infoLevel::Int, ) - counter = 0 - terminate = false - while !terminate + while true G = standard_step(G, currweight, T) if infoLevel >= 1 println(currweight) @@ -172,18 +192,13 @@ function standard_walk( println(G) end end - counter += 1 + raise_counter() if currweight == tarweight - terminate = true + return G else currweight = next_weight(G, currweight, tarweight) end end - - if infoLevel >= 1 - println("Cones crossed: ", counter) - end - return G end ############################################################### @@ -229,7 +244,6 @@ function generic_walk( T::Matrix{Int}, infoLevel::Int, ) - counter = 0 R = base_ring(G) Rn = change_order(G.base_ring, T) Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] @@ -241,8 +255,8 @@ function generic_walk( println("Crossed Cones with: ") end while !isempty(v) - counter += 1 G, Lm = generic_step(G, Lm, v, Rn) + raise_counter() if infoLevel >= 1 println(v) @@ -255,9 +269,7 @@ function generic_walk( end G = Singular.Ideal(Rn, G) G.isGB = true - if infoLevel >= 1 - println("Cones crossed: ", counter) - end + # to generate the same coefficients as Singular.std does. This version of the generic walk computes LC(g)=1 for all g \in G. return Singular.interreduce(G) end @@ -295,44 +307,25 @@ function pertubed_walk( end currweight = pertubed_vector(G, S, p) - terminate = false - while !terminate + while true tarweight = pertubed_vector(G, T, p) Tn = add_weight_vector(tarweight, T) G = standard_walk(G, S, Tn, currweight, tarweight, infoLevel) if same_cone(G, T) - terminate = true + return G else p = p - 1 currweight = tarweight S = Tn end end - return G end ############################################################### # The Fractal Walk ############################################################### -########################################### -# Counter for the steps in the Fractal Walk. -########################################### -counterFr = 0 -function deleteCounterFr() - global counterFr - temp = counterFr - counterFr = 0 - return temp -end -function getCounterFr() - global counterFr - return counterFr -end -function raiseCounterFr() - global counterFr = getCounterFr() + 1 -end ########################################## # global weightvectors ########################################## @@ -343,7 +336,7 @@ firstStepMode = false ############################################################### # Combined version of the extensions of the Fractal Walk. # This version -# - checks if the starting weight vector represents the order and pertubes it if necessary. +# - checks if the starting weight vector represents the monomial order and pertubes it if necessary. # - analyses the Groebner basis Gw of the initialforms and uses the Buchberger-algorithm if the generators of Gw are binomial or less. # - skips a step in top level in the last step. # - checks if an entry of an intermediate weight vector is bigger than int32. In case of that the Buchberger-Algorithm is used to compute the Groebner basis of the ideal of the initialforms. @@ -361,12 +354,7 @@ function fractal_walk_combined( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - Gb = fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1, infoLevel) - - if infoLevel >= 1 - println("Cones crossed: ", deleteCounterFr()) - end - return Gb + return fractal_walk_combined(G, S, T, S[1, :], pTargetWeights, 1, infoLevel) end function fractal_walk_combined( @@ -379,7 +367,6 @@ function fractal_walk_combined( infoLevel::Int, ) R = Singular.base_ring(G) - terminate = false G.isGB = true # Handling the weight of the start order. @@ -396,7 +383,7 @@ function fractal_walk_combined( end # main loop - while !terminate + while true t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. @@ -433,7 +420,7 @@ function fractal_walk_combined( continue end - # skip a step for target order lex. + # skip a step for target monomial order lex. if t == 1 && p == 1 if infoLevel >= 1 println("depth $p: recursive call in ", pTargetWeights[p]) @@ -490,7 +477,7 @@ function fractal_walk_combined( if infoLevel >= 1 println("depth $p: conversion in ", w, ".") end - raiseCounterFr() + raise_counter() else if infoLevel >= 1 println("depth $p: recursive call in $w.") @@ -513,7 +500,6 @@ function fractal_walk_combined( R = Rn currweight = w end - return G end ############################################################### @@ -534,12 +520,7 @@ function fractal_walk( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1, infoLevel) - - if infoLevel >= 1 - println("Cones crossed: ", deleteCounterFr()) - end - return Gb + return fractal_recursiv(G, S, T, S[1, :], pTargetWeights, 1, infoLevel) end function fractal_recursiv( @@ -552,11 +533,10 @@ function fractal_recursiv( infoLevel::Int, ) R = base_ring(G) - terminate = false G.isGB = true w = currweight - while !terminate + while true t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. @@ -628,7 +608,7 @@ function fractal_recursiv( if infoLevel >= 1 println("depth $p: conversion in ", w, ".") end - raiseCounterFr() + raise_counter() else if infoLevel >= 1 println("depth $p: recursive call in $w.") @@ -649,7 +629,6 @@ function fractal_recursiv( R = Rn currweight = w end - return G end ############################################################### @@ -669,7 +648,7 @@ function fractal_walk_start_order( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(Singular.base_ring(G))] - Gb = fractal_walk_recursiv_startorder( + return fractal_walk_recursiv_startorder( G, S, T, @@ -678,11 +657,6 @@ function fractal_walk_start_order( 1, infoLevel, ) - - if infoLevel >= 1 - println("Cones crossed: ", deleteCounterFr()) - end - return Gb end function fractal_walk_recursiv_startorder( @@ -695,7 +669,6 @@ function fractal_walk_recursiv_startorder( infoLevel::Int, ) R = Singular.base_ring(G) - terminate = false G.isGB = true # Handling the starting weight. @@ -711,7 +684,7 @@ function fractal_walk_recursiv_startorder( w = currweight end - while !terminate + while true t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. @@ -783,7 +756,7 @@ function fractal_walk_recursiv_startorder( if infoLevel >= 1 println("depth $p: conversion in ", w, ".") end - raiseCounterFr() + raise_counter() else if infoLevel >= 1 println("depth $p: recursive call in $w.") @@ -805,7 +778,6 @@ function fractal_walk_recursiv_startorder( R = Rn currweight = w end - return G end ############################################################### @@ -825,7 +797,7 @@ function fractal_walk_lex( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_recursive_lex( + return fractal_walk_recursive_lex( G, S, T, @@ -834,11 +806,6 @@ function fractal_walk_lex( 1, infoLevel, ) - - if infoLevel >= 1 - println("Cones crossed: ", deleteCounterFr()) - end - return Gb end function fractal_walk_recursive_lex( @@ -851,14 +818,12 @@ function fractal_walk_recursive_lex( infoLevel::Int, ) R = Singular.base_ring(G) - terminate = false G.isGB = true w = currweight - while !terminate + while true t = next_weightfr(G, w, pTargetWeights[p]) - # Handling the final step in the current depth. # Handling the final step in the current depth. # Next_weightfr may return 0 if the target vector does not lie in the cone of T while G already defines the Groebner basis w.r.t. T. # -> Checking if G is already a Groebner basis w.r.t. T solves this problem and reduces computational effort since next_weightfr returns 1 in the last step on every local path. if t == 1 && p != 1 @@ -938,7 +903,7 @@ function fractal_walk_recursive_lex( end Rn = change_order(R, w, T) - # Converting the Groebnerbasis + # Converting the Groebner basis if p == Singular.nvars(R) H = Singular.std( Singular.Ideal(Rn, [change_ring(x, Rn) for x in Gw]), @@ -947,7 +912,7 @@ function fractal_walk_recursive_lex( if infoLevel >= 1 println("depth $p: conversion in ", w, ".") end - raiseCounterFr() + raise_counter() else if infoLevel >= 1 println("depth $p: recursive call in $w.") @@ -970,7 +935,6 @@ function fractal_walk_recursive_lex( R = Rn currweight = w end - return G end ############################################################### @@ -990,7 +954,7 @@ function fractal_walk_look_ahead( global pTargetWeights = [pertubed_vector(G, T, i) for i = 1:nvars(base_ring(G))] - Gb = fractal_walk_look_ahead_recursiv( + return fractal_walk_look_ahead_recursiv( G, S, T, @@ -999,10 +963,6 @@ function fractal_walk_look_ahead( 1, infoLevel, ) - - if infoLevel >= 1 - println("Cones crossed: ", deleteCounterFr()) - end return Gb end @@ -1016,11 +976,10 @@ function fractal_walk_look_ahead_recursiv( infoLevel, ) R = Singular.base_ring(G) - terminate = false G.isGB = true w = currweight - while !terminate + while true t = next_weightfr(G, w, pTargetWeights[p]) # Handling the final step in the current depth. @@ -1092,7 +1051,7 @@ function fractal_walk_look_ahead_recursiv( if infoLevel >= 1 println("depth $p: conversion in ", w, ".") end - raiseCounterFr() + raise_counter() else if infoLevel >= 1 println("depth $p: recursive call in $w.") @@ -1113,9 +1072,7 @@ function fractal_walk_look_ahead_recursiv( R = Rn currweight = w end - return G end -global time = 0 ############################################################### # Tran´s version of the Groebner Walk. @@ -1133,7 +1090,6 @@ function tran_walk( println("Crossed Cones in: ") end - counter = 0 currweight = S[1, :] tarweight = T[1, :] R = base_ring(G) @@ -1141,8 +1097,7 @@ function tran_walk( currweight = pertubed_vector(G, S, nvars(R)) end - terminate = false - while !terminate + while true w = next_weight(G, currweight, tarweight) # return the Groebner basis if an entry of w is bigger than int32. @@ -1155,6 +1110,9 @@ function tran_walk( Rn = change_order(R, w, T) if w == tarweight if same_cone(G, T) + if infoLevel >= 1 + println("Cones crossed: ", counter) + end return G elseif inSeveralCones(initials(base_ring(G), gens(G), tarweight)) tarweight = representation_vector(G, T) @@ -1168,14 +1126,10 @@ function tran_walk( println(G) end end - counter += 1 R = Rn currweight = w + raise_counter() end - if infoLevel >= 1 - println("Cones crossed: ", counter) - end - return G end ############################################################### @@ -1196,8 +1150,9 @@ function standard_step_without_int32_check( return interreduce_walk(H) end +#= ############################################################### -# Generic Walk with a choosable pertubationdegree. This version is not tested yet. +# Generic Walk with choosable dergree of pertubation. This version is not tested yet. ############################################################### function pgeneric_walk( @@ -1244,3 +1199,4 @@ function generic_step( G.isGB = true return G, Lm end +=# diff --git a/src/GroebnerWalk/GroebnerWalkUtilitys.jl b/src/GroebnerWalk/GroebnerWalkUtilitys.jl index 69edd4faf..ba7e226c9 100644 --- a/src/GroebnerWalk/GroebnerWalkUtilitys.jl +++ b/src/GroebnerWalk/GroebnerWalkUtilitys.jl @@ -2,7 +2,7 @@ # Several Procedures for the Groebner Walk ############################################################### -# Returns the next intermediate weight vector. +# returns the next intermediate weight vector. function next_weight( G::Singular.sideal, cw::Vector{Int}, @@ -22,7 +22,7 @@ function next_weight( return convert_bounding_vector(cw + BigInt(numerator(tmin))//BigInt(denominator(tmin)) * (tw - cw)) end -# multiplys every entry of the given weight with 0.1 as long as it stays on the halfspace. +# multiplys every entry of the given weight w with 0.1 as long as it stays on the same halfspace as w. function truncw( G::Singular.sideal, w::Vector{Int}, @@ -35,15 +35,15 @@ function truncw( end w = convert_bounding_vector(w) if inw != initials(R, gens(G), w) - #Initials are different - return not rounded weight + # initials are different - return unrounded weight return w, false end end - # Converted to Vector w of the same face + # converted to Vector w of the same face return w, true end -#Returns the initialform of G w.r.t. the given weight vector. +# returns the initialform of G w.r.t. the given weight vector. function initials( R::Singular.PolyRing, G::Vector{L}, @@ -86,7 +86,7 @@ function difference_lead_tail(I::Singular.sideal) return unique!(v) end -# Computes a p-pertubed vector from M +# computes a p-pertubed vector from the matrix M. function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) m = Int[] n = size(M, 1) @@ -119,7 +119,7 @@ function pertubed_vector(G::Singular.sideal, M::Matrix{Int}, p::Integer) return convert_bounding_vector(w) end -#Returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. +# returns 'true' if the leading terms of G w.r.t the matrixorder T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and matrix T. function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) R = change_order(G.base_ring, T) I = Singular.Ideal(R, [change_ring(x, R) for x in gens(G)]) @@ -132,7 +132,7 @@ function inCone(G::Singular.sideal, T::Matrix{Int}, t::Vector{Int}) return true end -#Returns 'true' if the leading tems of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and the matrix order T. +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G w.r.t the weighted monomial order with weight vector t and the matrix order T. function inCone(G::Singular.sideal, t::Vector{Int}) cvzip = zip(Singular.gens(G), initials(base_ring(G), Singular.gens(G), t)) for (g, ing) in cvzip @@ -143,7 +143,7 @@ function inCone(G::Singular.sideal, t::Vector{Int}) return true end -# Returns 'true' if the leading tems of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. +# returns 'true' if the leading terms of G w.r.t the matrixordering T are the same as the leading terms of G with the current ordering. function same_cone(G::Singular.sideal, T::Matrix{Int}) R = change_order(G.base_ring, T) for g in gens(G) @@ -154,7 +154,7 @@ function same_cone(G::Singular.sideal, T::Matrix{Int}) return true end -# Lifting step by Fukuda et al. (2005). +# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s presented in Fukuda et al. (2005). function lift( G::Singular.sideal, R::Singular.PolyRing, @@ -173,7 +173,7 @@ function lift( return G end -# lifting step in the Groebner Walk by Collart et al. (1997). +# lifts the Groebner basis G to the Groebner basis w.r.t. the Ring Rn like it´s done in Collart et al. (1997). function liftGW2( G::Singular.sideal, R::Singular.PolyRing, @@ -249,7 +249,7 @@ function convert_bounding_vector(wtemp::Vector{T}) where {T<:Number} return w end -# returns a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T) +# returns a copy of the PolynomialRing I, equipped with the ordering a(cw)*ordering_M(T). function change_order( R::Singular.PolyRing, cw::Array{L,1}, @@ -288,7 +288,7 @@ function change_order( return S end -# returns a copy of the PolynomialRing I, equipped with the ordering a(w)*a(t)*ordering_M(T) +# returns a copy of the PolynomialRing I, equipped with the ordering a(w)*a(t)*ordering_M(T). function change_order( R::Singular.PolyRing, w::Vector{Int}, @@ -309,7 +309,7 @@ function change_order( return S end -#returns a copy of the PolynomialRing I, equipped with the ordering ordering_M(T) +# returns a copy of the PolynomialRing I, equipped with the ordering ordering_M(T). function change_order( R::Singular.PolyRing, M::Matrix{Int}, diff --git a/src/GroebnerWalk/Helper.jl b/src/GroebnerWalk/Helper.jl index 7f93bf03c..bf33c5914 100644 --- a/src/GroebnerWalk/Helper.jl +++ b/src/GroebnerWalk/Helper.jl @@ -47,7 +47,7 @@ function dot(v::Vector{Int}, w::Vector{Int}) return sum end -function order_as_matrix(w::Vector{Int}, ord::Symbol) +function ordering_as_matrix(w::Vector{Int}, ord::Symbol) if length(w) > 2 if ord == :lex return [ @@ -101,7 +101,7 @@ function add_weight_vector(w::Vector{Int}, M::Matrix{Int}) ] end -function order_as_matrix(ord::Symbol, nvars::Int) +function ordering_as_matrix(ord::Symbol, nvars::Int) if ord == :lex return ident_matrix(nvars) end diff --git a/src/GroebnerWalk/Testideals.jl b/src/GroebnerWalk/Testideals.jl index 6a639cefa..60237872c 100644 --- a/src/GroebnerWalk/Testideals.jl +++ b/src/GroebnerWalk/Testideals.jl @@ -20,6 +20,7 @@ using Test push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_start_order)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) @@ -55,6 +56,7 @@ using Test push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :standard)) #push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :tran)) push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_start_order)) push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_look_ahead)) push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix([1,3,1,3,1],:lex), ordering_as_matrix([1,0,0,0,2],:lex), :fractal_combined)) @@ -90,6 +92,7 @@ using Test push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_start_order)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) @@ -127,9 +130,10 @@ using Test #push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :tran)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_look_ahead)) + push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_start_order)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_lex)) push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :fractal_combined)) - push!(ideals, groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :generic)) + push!(ideals, groebnerwalk(I, :degrevlex, :lex, :generic)) s = Singular.std( Singular.Ideal(S, [change_ring(x, S) for x in Singular.gens(id)]), From 68a0684854d1c7df2ce6cffb09a5a686124def7e Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 30 Mar 2022 10:16:37 +0200 Subject: [PATCH 64/85] fix: Kommentar --- src/GroebnerWalk/GroebnerWalk.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index 62802dd63..3f296d13a 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -33,7 +33,7 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo - `tran`: Tran´s Walk, - `generic`: Generic Walk, - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined Fractal Walk. Target monomial order needs to be lex, + - `fractalcombined`: combined Version of the Fractal Walk. Target monomial order needs to be lex, *`pertubationDegree::Int=2`: pertubationdegree for the Pertubed Walk. *'infoLevel::Int=0': -'0': no printout, @@ -79,16 +79,16 @@ Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhei #Arguments *`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target-order. -*`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis I. Note that S has to be a nxn-matrix with rank(S)=n. -*`T::Matrix{Int}`: The target monomial order we want to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n. +*`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis I. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. +*`T::Matrix{Int}`: The target monomial order we want to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. *`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, - `tran`: Tran´s Walk, - `generic`: Generic Walk, - `fractal`: standard-version of the Fractal Walk, - - `fractalcombined`: combined Fractal Walk. The target monomial order needs to be lex, -*`p::Int=2`: Pertubationdegree for the pertubed Walk. + - `fractalcombined`: combined version of the Fractal Walk. The target monomial order needs to be lex, +*`p::Int=2`: pertubationdegree for the pertubed Walk. *'infoLevel::Int=0': -'0': no printout, -'1': intermediate weight vectors, From ae63894f40e92cbdcb2f0fa314108f9f74fd8ece Mon Sep 17 00:00:00 2001 From: welpj Date: Mon, 4 Apr 2022 16:33:08 +0200 Subject: [PATCH 65/85] feat: pertubed genericwalk (not tested) --- src/GroebnerWalk/GenericWalkPertubed.jl | 313 ++++++++++++++++++++++++ src/GroebnerWalk/GroebnerWalk.jl | 51 ---- 2 files changed, 313 insertions(+), 51 deletions(-) create mode 100644 src/GroebnerWalk/GenericWalkPertubed.jl diff --git a/src/GroebnerWalk/GenericWalkPertubed.jl b/src/GroebnerWalk/GenericWalkPertubed.jl new file mode 100644 index 000000000..26999f13b --- /dev/null +++ b/src/GroebnerWalk/GenericWalkPertubed.jl @@ -0,0 +1,313 @@ + +############################################################### +# Not tested Version of the Generic Walk with different degree +# of pertubation. This implementation is not verified. +############################################################### + +#= +############################################################### +# Generic Walk with choosable dergree of pertubation. +# This version is not tested yet. +############################################################### + +function pgeneric_walk( + G::Singular.sideal, + S::Matrix{Int}, + T::Matrix{Int}, + p::Int, + infoLevel::Int, +) + R = base_ring(G) + Rn = change_order(G.base_ring, T) + v = next_gamma(G, [0], S, T, p) + Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] + G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) + + println("generic_walk results") + println("Crossed Cones with facetNormal: ") + while !isempty(v) + global counter = getCounter() + 1 + println(v) + G, Lm = generic_step(G, Lm, v, T, R) + v = next_gamma(G, Lm, v, S, T, p) + end + return Singular.interreduce(G) +end + +function generic_step( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + v::Vector{Int}, + T::Matrix{Int}, + R::Singular.PolyRing, +) where {L<:Nemo.RingElem} + + Rn = Singular.base_ring(G) + facet_Generators = facet_initials(G, Lm, v) + H = Singular.std( + Singular.Ideal(Rn, facet_Generators), + complete_reduction = true, + ) + H, Lm = lift_generic(G, Lm, H) + G = interreduce(H, Lm) + G = Singular.Ideal(Rn, G) + G.isGB = true + return G, Lm +end +=# + +############################################################### +# Procedures +############################################################### + +#= +function facet_initials( + G::Singular.sideal, + lm::Vector{spoly{L}}, + v::Vector{Int}, +) where {L<:Nemo.RingElem} + Rn = base_ring(G) + initials = Array{Singular.elem_type(Rn),1}(undef, 0) + count = 1 + for g in Singular.gens(G) + inw = Singular.MPolyBuildCtx(Rn) + el = first(Singular.exponent_vectors(lm[count])) + for (e, c) in + zip(Singular.exponent_vectors(g), Singular.coefficients(g)) + if el == e || isParallel(el - e, v) + Singular.push_term!(inw, c, e) + end + end + h = finish(inw) + push!(initials, h) + count += 1 + end + return initials +end + +function difference_lead_tail( + I::Singular.sideal, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + v = Vector{Int}[] + for i = 1:ngens(I) + ltu = Singular.leading_exponent_vector(Lm[i]) + for e in Singular.exponent_vectors(gens(I)[i]) + if ltu != e + push!(v, ltu .- e) + end + end + end + return unique!(v) +end + +function isParallel(u::Vector{Int}, v::Vector{Int}) + count = 1 + x = 0 + for i = 1:length(u) + if u[i] == 0 + if v[count] == 0 + count += +1 + else + return false + end + else + x = v[count] // u[i] + count += 1 + break + end + end + if count > length(v) + return true + end + for i = count:length(v) + @inbounds if v[i] != x * u[i] + return false + end + end + return true +end + +function lift_generic( + G::Singular.sideal, + Lm::Vector{Singular.spoly{L}}, + H::Singular.sideal, +) where {L<:Nemo.RingElem} + Rn = base_ring(G) + Newlm = Array{Singular.elem_type(Rn),1}(undef, 0) + liftPolys = Array{Singular.elem_type(Rn),1}(undef, 0) + for g in Singular.gens(H) + r = modulo(g, gens(G), Lm) + diff = g - r + if diff != 0 + push!(Newlm, Singular.leading_term(g)) + push!(liftPolys, diff) + end + end + return liftPolys, Newlm +end + +function filter_btz(S::Matrix{Int}, V::Vector{Vector{Int}}) + btz = Set{Vector{Int}}() + for v in V + if bigger_than_zero(S, v) + push!(btz, v) + end + end + return btz +end + +function filter_ltz(S::Matrix{Int}, V::Set{Vector{Int}}) + btz = Set{Vector{Int}}() + for v in V + if less_than_zero(S, v) + push!(btz, v) + end + end + return btz +end +function filter_lf( + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, + V::Set{Vector{Int}}, +) + btz = Set{Vector{Int}}() + for v in V + if less_facet(w, v, S, T) + push!(btz, v) + end + end + return btz +end + +function next_gamma( + G::Singular.sideal, + Lm::Vector{spoly{L}}, + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, + p::Int, +) where {L<:Nemo.RingElem} + V = filter_btz(S, difference_lead_tail(G, Lm)) + V = filter_ltz(T, V) + if (w != [0]) + V = filter_lf(w, S, T, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if less_facet(v, minV, S, T, p) + minV = v + end + end + return minV +end + +function next_gamma( + G::Singular.sideal, + w::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, + p::Int, +) + V = filter_btz(S, difference_lead_tail(G)) + V = filter_ltz(T, V) + if (w != [0]) + V = filter_lf(w, S, T, V) + end + if isempty(V) + return V + end + minV = first(V) + for v in V + if less_facet(v, minV, S, T, p) + minV = v + end + end + return minV +end + +function bigger_than_zero(M::Matrix{Int}, v::Vector{Int}) + nrows, ncols = size(M) + for i = 1:nrows + d = 0 + for j = 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d > 0 + end + end + return false +end + +function less_than_zero(M::Matrix{Int}, v::Vector{Int}) + nrows, ncols = size(M) + for i = 1:nrows + d = 0 + for j = 1:ncols + @inbounds d += M[i, j] * v[j] + end + if d != 0 + return d < 0 + end + end + return false +end + +function less_facet( + u::Vector{Int}, + v::Vector{Int}, + S::Matrix{Int}, + T::Matrix{Int}, + d::Int, +) + for i = 1:d + for j = 1:d + @inbounds Tuv = dot(T[i, :], u) * dot(S[j, :], v) + @inbounds Tvu = dot(T[i, :], v) * dot(S[j, :], u) + if Tuv != Tvu + return Tuv < Tvu + end + end + end + return false +end + +function modulo( + p::Singular.spoly, + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + for i = 1:length(G) + (q, b) = dividesGW(p, Lm[i], parent(p)) + + if b + return modulo(p - (q * G[i]), G, Lm) + end + end + return p +end + +function interreduce( + G::Vector{spoly{L}}, + Lm::Vector{spoly{L}}, +) where {L<:Nemo.RingElem} + Rn = parent(first(G)) + for i = 1:Singular.length(G) + gensrest = Array{Singular.elem_type(Rn),1}(undef, 0) + Lmrest = Array{Singular.elem_type(Rn),1}(undef, 0) + for j = 1:length(G) + if i != j + push!(gensrest, G[j]) + push!(Lmrest, Lm[j]) + end + end + G[i] = modulo(G[i], gensrest, Lmrest) + end + return G +end +=# diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index 3f296d13a..0d70932f8 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -1149,54 +1149,3 @@ function standard_step_without_int32_check( H = lift(G, R, H, Rn) return interreduce_walk(H) end - -#= -############################################################### -# Generic Walk with choosable dergree of pertubation. This version is not tested yet. -############################################################### - -function pgeneric_walk( - G::Singular.sideal, - S::Matrix{Int}, - T::Matrix{Int}, - p::Int, - infoLevel::Int, -) - R = base_ring(G) - Rn = change_order(G.base_ring, T) - v = next_gamma(G, [0], S, T, p) - Lm = [change_ring(Singular.leading_term(g), Rn) for g in gens(G)] - G = Singular.Ideal(Rn, [change_ring(x, Rn) for x in gens(G)]) - - println("generic_walk results") - println("Crossed Cones with facetNormal: ") - while !isempty(v) - global counter = getCounter() + 1 - println(v) - G, Lm = generic_step(G, Lm, v, T, R) - v = next_gamma(G, Lm, v, S, T, p) - end - return Singular.interreduce(G) -end - -function generic_step( - G::Singular.sideal, - Lm::Vector{Singular.spoly{L}}, - v::Vector{Int}, - T::Matrix{Int}, - R::Singular.PolyRing, -) where {L<:Nemo.RingElem} - - Rn = Singular.base_ring(G) - facet_Generators = facet_initials(G, Lm, v) - H = Singular.std( - Singular.Ideal(Rn, facet_Generators), - complete_reduction = true, - ) - H, Lm = lift_generic(G, Lm, H) - G = interreduce(H, Lm) - G = Singular.Ideal(Rn, G) - G.isGB = true - return G, Lm -end -=# From 7bf32c50e09e01c066c8e22e87e5ba8286846842 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 6 Apr 2022 15:45:29 +0200 Subject: [PATCH 66/85] fix: delete not needed integration. --- src/Groebnerwalk.jl | 1 - src/Singular.jl | 2 -- 2 files changed, 3 deletions(-) delete mode 100644 src/Groebnerwalk.jl diff --git a/src/Groebnerwalk.jl b/src/Groebnerwalk.jl deleted file mode 100644 index adf601710..000000000 --- a/src/Groebnerwalk.jl +++ /dev/null @@ -1 +0,0 @@ -include("Groebnerwalk/GroebnerWalk.jl") diff --git a/src/Singular.jl b/src/Singular.jl index 74b0dfffe..f93c40f18 100644 --- a/src/Singular.jl +++ b/src/Singular.jl @@ -217,6 +217,4 @@ include("Map.jl") include("MessyHacks.jl") -include("Groebnerwalk.jl") - end # module From bd912c970e0154439cb5974999cd5511a83f0e00 Mon Sep 17 00:00:00 2001 From: welpj Date: Wed, 6 Apr 2022 16:11:07 +0200 Subject: [PATCH 67/85] fix: Tippfehler --- src/GroebnerWalk/GroebnerWalk.jl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index 0d70932f8..fb8323ee5 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -5,8 +5,6 @@ include("GenericWalkUtilitys.jl") include("TranWalkUtilitys.jl") -export groebnerwalk - ############################################################### # Implementation of different variants of the Groebner Walk. # The Groebner Walk is proposed by Collart, Kalkbrener & Mall (1997). @@ -24,7 +22,7 @@ Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhei Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloor (1998). Pertubes only the target vector. #Arguments -*`I::Singular.sideal`: ideal one wants to compute a Groebner basis for. +*`G::Singular.sideal`: ideal one wants to compute a Groebner basis for. *`startOrder::Symbol=:degrevlex`: monomial order to begin the conversion. *`targetOrder::Symbol=:lex`: monomial order one wants to compute a Groebner basis for. *`walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: @@ -79,8 +77,8 @@ Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhei #Arguments *`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target-order. -*`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis I. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. -*`T::Matrix{Int}`: The target monomial order we want to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. +*`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. +*`T::Matrix{Int}`: The target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. *`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, From 4a9c35ec8db599e7ad958c8eedd2c1a70b037638 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:19:09 +0200 Subject: [PATCH 68/85] Update GroebnerWalk.jl --- src/GroebnerWalk/GroebnerWalk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index fb8323ee5..d347919e5 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -76,7 +76,7 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. #Arguments -*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target-order. +*`G::Singular.sideal`: The Groebner basis to convert to the Groebner basis w.r.t. the target order. G needs to be a Groebner basis w.r.t. the start order S. *`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. *`T::Matrix{Int}`: The target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. *`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: From 40b743a1c2a1bef91ee30a044a4f246f082c4815 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:20:40 +0200 Subject: [PATCH 69/85] Update GroebnerWalk.jl --- src/GroebnerWalk/GroebnerWalk.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index d347919e5..f07ef5fbb 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -76,9 +76,9 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. #Arguments -*`G::Singular.sideal`: The Groebner basis to convert to the Groebner basis w.r.t. the target order. G needs to be a Groebner basis w.r.t. the start order S. -*`S::Matrix{Int}`: The start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. -*`T::Matrix{Int}`: The target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. +*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target order T. G needs to be a Groebner basis w.r.t. the start order S. +*`S::Matrix{Int}`: start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. +*`T::Matrix{Int}`: target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. *`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, From c753ac2ed410c4f107584834520083a159a76dd8 Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 7 Apr 2022 16:26:34 +0200 Subject: [PATCH 70/85] readme --- src/GroebnerWalk/README.md | 35 ++++++++++++++++++++++++++++++++++ src/GroebnerWalk/Testideals.jl | 15 ++------------- 2 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 src/GroebnerWalk/README.md diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md new file mode 100644 index 000000000..c0d01c92f --- /dev/null +++ b/src/GroebnerWalk/README.md @@ -0,0 +1,35 @@ +# GroebnerWalk + +### Usage + +The following function calls perform different versions of the Gröbner Walk by computing the Gröbner basis w.r.t. the monomial order ```julia :degrevlex``` and converting it to the Groebner basis w.r.t. the monomial order ```julia :lex ```. + +```julia +using Singular +using Nemo +include("Examples.jl") +include("GroebnerWalk.jl") + +id = katsura4() +groebnerwalk(id, :degrevlex, :lex ,:standard) +groebnerwalk(id, :degrevlex, :lex ,:pertubed, 2) +groebnerwalk(id, :degrevlex, :lex ,:fractal_combined) +groebnerwalk(id, :degrevlex, :lex ,:generic) +``` + +The following function call performs the standard version of the Gröbner Walk by converting the given Groebner basis w.r.t. the monomial order ```julia :degrevlex ``` to the Groebner basis w.r.t. the monomial order ```julia :lex ```. + +```julia +using Singular +using Nemo +include("Examples.jl") +include("GroebnerWalk.jl") + +id = katsura4() +R = base_ring(id) +dim = nvars(R) +I = Singular.std(id, complete_reduction = true) + +groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard) + +``` diff --git a/src/GroebnerWalk/Testideals.jl b/src/GroebnerWalk/Testideals.jl index 60237872c..a96ef049b 100644 --- a/src/GroebnerWalk/Testideals.jl +++ b/src/GroebnerWalk/Testideals.jl @@ -4,11 +4,9 @@ using Test @testset "Groebnerwalks" begin @testset "Testing Groebnerwalks" begin - let id = katsura6() + let id = katsura5() R = base_ring(id) dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) I = Singular.std(id, complete_reduction = true) @@ -39,10 +37,9 @@ using Test end end - let id = katsura5() + let id = katsura4() R = base_ring(id) dim = nvars(R) - ve=ones(Int64,dim) StartOrd = ordering_as_matrix([1,3,1,3,1],:lex) TarOrd = ordering_as_matrix([1,0,0,0,2],:lex) S = change_order(R, TarOrd) @@ -78,8 +75,6 @@ using Test let id = cyclic4() R = base_ring(id) dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) @@ -115,11 +110,8 @@ using Test let id = ex2() R = base_ring(id) dim = nvars(R) - ve=ones(Int64,dim) - StartOrd = ordering_as_matrix(:degrevlex,dim) TarOrd = ordering_as_matrix(:lex, dim) S = change_order(R, TarOrd) - I = Singular.std(id, complete_reduction = true) ideals = [] @@ -152,10 +144,7 @@ using Test id = redeco7() R = base_ring(id) dim = nvars(R) - ve = ones(Int, dim) - StartOrd = ordering_as_matrix(:degrevlex, dim) TarOrd = ordering_as_matrix(:lex, dim) - R2 = change_order(R, StartOrd) S = change_order(R, TarOrd) I = Singular.std(id, complete_reduction = true) From e44ae6d12f0e47fff2f1070fa2d7bb7d98e3096e Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 7 Apr 2022 16:32:59 +0200 Subject: [PATCH 71/85] update readme --- src/GroebnerWalk/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index c0d01c92f..b6a12d8b0 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -33,3 +33,7 @@ I = Singular.std(id, complete_reduction = true) groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard) ``` + +### Tests + +The tests can be started with **runtests** From 8c16a1be9280a48873f7bdfdc9050eae4a8a01f3 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:34:40 +0200 Subject: [PATCH 72/85] Update README.md --- src/GroebnerWalk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index b6a12d8b0..aa767842c 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -2,7 +2,7 @@ ### Usage -The following function calls perform different versions of the Gröbner Walk by computing the Gröbner basis w.r.t. the monomial order ```julia :degrevlex``` and converting it to the Groebner basis w.r.t. the monomial order ```julia :lex ```. +The following function calls perform different versions of the Gröbner Walk by computing the Gröbner basis w.r.t. the monomial order ```:degrevlex``` and converting it to the Groebner basis w.r.t. the monomial order ```:lex```. ```julia using Singular @@ -17,7 +17,7 @@ groebnerwalk(id, :degrevlex, :lex ,:fractal_combined) groebnerwalk(id, :degrevlex, :lex ,:generic) ``` -The following function call performs the standard version of the Gröbner Walk by converting the given Groebner basis w.r.t. the monomial order ```julia :degrevlex ``` to the Groebner basis w.r.t. the monomial order ```julia :lex ```. +The following function call performs the standard version of the Gröbner Walk by converting the given Groebner basis w.r.t. the monomial order ``` :degrevlex``` to the Groebner basis w.r.t. the monomial order ```:lex```. ```julia using Singular From 63606b389285b7cc2b27924f0c8dfa283f6fdef7 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:36:45 +0200 Subject: [PATCH 73/85] Update README.md --- src/GroebnerWalk/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index aa767842c..1fe119fce 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -36,4 +36,5 @@ groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, di ### Tests -The tests can be started with **runtests** +The tests can be started with **runtests**. + From 768c37a72b74623ad4f466d775e045f926a8fbd8 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:38:52 +0200 Subject: [PATCH 74/85] Update README.md --- src/GroebnerWalk/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index 1fe119fce..eea356134 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -11,6 +11,7 @@ include("Examples.jl") include("GroebnerWalk.jl") id = katsura4() + groebnerwalk(id, :degrevlex, :lex ,:standard) groebnerwalk(id, :degrevlex, :lex ,:pertubed, 2) groebnerwalk(id, :degrevlex, :lex ,:fractal_combined) From aa55ccd3da6a8d994e57f353618445de0700869e Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:53:02 +0200 Subject: [PATCH 75/85] Update README.md --- src/GroebnerWalk/README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index eea356134..3c65cd781 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -11,7 +11,6 @@ include("Examples.jl") include("GroebnerWalk.jl") id = katsura4() - groebnerwalk(id, :degrevlex, :lex ,:standard) groebnerwalk(id, :degrevlex, :lex ,:pertubed, 2) groebnerwalk(id, :degrevlex, :lex ,:fractal_combined) @@ -28,14 +27,12 @@ include("GroebnerWalk.jl") id = katsura4() R = base_ring(id) -dim = nvars(R) I = Singular.std(id, complete_reduction = true) -groebnerwalk(I, ordering_as_matrix(:degrevlex, dim), ordering_as_matrix(:lex, dim), :standard) +groebnerwalk(I, ordering_as_matrix(:degrevlex, nvars(R)), ordering_as_matrix(:lex, nvars(R)), :standard) ``` ### Tests The tests can be started with **runtests**. - From 0b77e81ff885bcdd501d070f2ed2a0f7a9d03c39 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:00:57 +0200 Subject: [PATCH 76/85] Update README.md --- src/GroebnerWalk/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index 3c65cd781..0d5bb288a 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -36,3 +36,7 @@ groebnerwalk(I, ordering_as_matrix(:degrevlex, nvars(R)), ordering_as_matrix(:le ### Tests The tests can be started with **runtests**. + +### Tracing the Walk + +For different infoLevels for the conversions-steps we advise to the documentation in **GroebnerWalk.jl* From 392bbfbf77226eabfc963a800e6f55b5cdebcf23 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:03:39 +0200 Subject: [PATCH 77/85] Update README.md --- src/GroebnerWalk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index 0d5bb288a..9ddec0ddc 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -39,4 +39,4 @@ The tests can be started with **runtests**. ### Tracing the Walk -For different infoLevels for the conversions-steps we advise to the documentation in **GroebnerWalk.jl* +For informations about the conversions-steps use the parameter ```infoLevel```. From ae24c11afec14337c1d9cb31eed61d496f579de5 Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 7 Apr 2022 17:27:21 +0200 Subject: [PATCH 78/85] fix: typos --- src/GroebnerWalk/Examples.jl | 10 +++++----- ...alWalkUtilitys.jl => FractalWalkUtilities.jl} | 2 -- src/GroebnerWalk/GenericWalkPertubed.jl | 2 +- src/GroebnerWalk/GroebnerWalk.jl | 16 ++++++++-------- ...rWalkUtilitys.jl => GroebnerWalkUtilities.jl} | 0 src/GroebnerWalk/StandardWalkUtilitys.jl | 5 +++++ ...{TranWalkUtilitys.jl => TranWalkUtilities.jl} | 0 7 files changed, 19 insertions(+), 16 deletions(-) rename src/GroebnerWalk/{FractalWalkUtilitys.jl => FractalWalkUtilities.jl} (99%) rename src/GroebnerWalk/{GroebnerWalkUtilitys.jl => GroebnerWalkUtilities.jl} (100%) create mode 100644 src/GroebnerWalk/StandardWalkUtilitys.jl rename src/GroebnerWalk/{TranWalkUtilitys.jl => TranWalkUtilities.jl} (100%) diff --git a/src/GroebnerWalk/Examples.jl b/src/GroebnerWalk/Examples.jl index d212d00ac..34103e9bc 100644 --- a/src/GroebnerWalk/Examples.jl +++ b/src/GroebnerWalk/Examples.jl @@ -1,4 +1,4 @@ -function katsura5() +function katsura4() dim = 5 ve = [1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) @@ -18,7 +18,7 @@ end #Katsura6 -function katsura6() +function katsura5() dim = 6 ve = [1, 1, 1, 1, 1, 1] StartOrd = ordering_as_matrix(:degrevlex, dim) @@ -38,7 +38,7 @@ function katsura6() end -function katsura7() +function katsura6() dim = 7 ve = [1, 1, 1, 1, 1, 1,1] StartOrd = ordering_as_matrix(:degrevlex, dim) @@ -60,7 +60,7 @@ end -function katsura8() +function katsura7() dim = 8 ve = [1, 1, 1, 1, 1, 1, 1,1] StartOrd = ordering_as_matrix(:degrevlex, dim) @@ -81,7 +81,7 @@ f8= u0^2+2*u1^2+2*u2^2+2*u3^2+2*u4^2+2*u5^2+2*u6^2+2*u7^2-u0 return Singular.Ideal(R, [f1, f2, f3, f4, f5, f6, f7, f8]) end -function katsura9() +function katsura8() dim = 9 ve = [1, 1, 1, 1, 1, 1,1,1,1] StartOrd = ordering_as_matrix(:degrevlex, dim) diff --git a/src/GroebnerWalk/FractalWalkUtilitys.jl b/src/GroebnerWalk/FractalWalkUtilities.jl similarity index 99% rename from src/GroebnerWalk/FractalWalkUtilitys.jl rename to src/GroebnerWalk/FractalWalkUtilities.jl index eea971b2d..84414492f 100644 --- a/src/GroebnerWalk/FractalWalkUtilitys.jl +++ b/src/GroebnerWalk/FractalWalkUtilities.jl @@ -1,5 +1,3 @@ -include("GroebnerWalkUtilitys.jl") - ################################################################# # Procedures of the fractal walk. # The fractal walk is proposed by Amrhein & Gloor (1998). diff --git a/src/GroebnerWalk/GenericWalkPertubed.jl b/src/GroebnerWalk/GenericWalkPertubed.jl index 26999f13b..c6bbc43d3 100644 --- a/src/GroebnerWalk/GenericWalkPertubed.jl +++ b/src/GroebnerWalk/GenericWalkPertubed.jl @@ -1,6 +1,6 @@ ############################################################### -# Not tested Version of the Generic Walk with different degree +# Not tested version of the Generic Walk with different degree # of pertubation. This implementation is not verified. ############################################################### diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index f07ef5fbb..a07334583 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -1,8 +1,8 @@ include("Helper.jl") -include("GroebnerWalkUtilitys.jl") -include("FractalWalkUtilitys.jl") -include("GenericWalkUtilitys.jl") -include("TranWalkUtilitys.jl") +include("GroebnerWalkUtilities.jl") +include("FractalWalkUtilities.jl") +include("GenericWalkUtilities.jl") +include("TranWalkUtilities.jl") ############################################################### @@ -76,10 +76,10 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. #Arguments -*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target order T. G needs to be a Groebner basis w.r.t. the start order S. -*`S::Matrix{Int}`: start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. -*`T::Matrix{Int}`: target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. -*`grwalktype::Symbol=:standard`: Strategy of the Groebner Walk to be used. There are the strategies: +*`G::Singular.sideal`: ideal one wants to compute a Groebner basis for. +*`startOrder::Symbol=:degrevlex`: monomial order to begin the conversion. +*`targetOrder::Symbol=:lex`: monomial order one wants to compute a Groebner basis for. +*`walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, - `tran`: Tran´s Walk, diff --git a/src/GroebnerWalk/GroebnerWalkUtilitys.jl b/src/GroebnerWalk/GroebnerWalkUtilities.jl similarity index 100% rename from src/GroebnerWalk/GroebnerWalkUtilitys.jl rename to src/GroebnerWalk/GroebnerWalkUtilities.jl diff --git a/src/GroebnerWalk/StandardWalkUtilitys.jl b/src/GroebnerWalk/StandardWalkUtilitys.jl new file mode 100644 index 000000000..97e90e9d4 --- /dev/null +++ b/src/GroebnerWalk/StandardWalkUtilitys.jl @@ -0,0 +1,5 @@ +include("GroebnerWalkUtilitysFinal.jl") + +############################################################### +#Utilitys for standard_walk +############################################################### diff --git a/src/GroebnerWalk/TranWalkUtilitys.jl b/src/GroebnerWalk/TranWalkUtilities.jl similarity index 100% rename from src/GroebnerWalk/TranWalkUtilitys.jl rename to src/GroebnerWalk/TranWalkUtilities.jl From 08c803aa67800ed1788facabf52b5444a2ac5b40 Mon Sep 17 00:00:00 2001 From: welpj Date: Thu, 7 Apr 2022 17:36:03 +0200 Subject: [PATCH 79/85] fix --- src/GroebnerWalk/GroebnerWalk.jl | 6 +++--- src/GroebnerWalk/StandardWalkUtilitys.jl | 5 ----- src/GroebnerWalk/{runtests => runtests.jl} | 0 3 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 src/GroebnerWalk/StandardWalkUtilitys.jl rename src/GroebnerWalk/{runtests => runtests.jl} (100%) diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index a07334583..f4d2d8d17 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -76,9 +76,9 @@ Fractal Walk (:fractal) computes the Walk like it´s presented in Amrhein & Gloo Fractal Walk (:fractalcombined) computes the Walk like it´s presented in Amrhein & Gloor (1998) with multiple extensions. The target monomial order has to be lex. This version uses the Buchberger Algorithm to skip weightvectors with entries bigger than Int32. #Arguments -*`G::Singular.sideal`: ideal one wants to compute a Groebner basis for. -*`startOrder::Symbol=:degrevlex`: monomial order to begin the conversion. -*`targetOrder::Symbol=:lex`: monomial order one wants to compute a Groebner basis for. +*`G::Singular.sideal`: Groebner basis to convert to the Groebner basis w.r.t. the target order T. G needs to be a Groebner basis w.r.t. the start order S. +*`S::Matrix{Int}`: start monomial order w.r.t. the Groebner basis G. Note that S has to be a nxn-matrix with rank(S)=n and its first row needs to have positive entries. +*`T::Matrix{Int}`: target monomial order one wants to compute a Groebner basis for. Note that T has to be a nxn-matrix with rank(T)=n and its first row needs to have positive entries. *`walktype::Symbol=standard`: strategy of the Groebner Walk. One can choose a strategy of: - `standard`: Standard Walk (default), - `pertubed`: Pertubed Walk, diff --git a/src/GroebnerWalk/StandardWalkUtilitys.jl b/src/GroebnerWalk/StandardWalkUtilitys.jl deleted file mode 100644 index 97e90e9d4..000000000 --- a/src/GroebnerWalk/StandardWalkUtilitys.jl +++ /dev/null @@ -1,5 +0,0 @@ -include("GroebnerWalkUtilitysFinal.jl") - -############################################################### -#Utilitys for standard_walk -############################################################### diff --git a/src/GroebnerWalk/runtests b/src/GroebnerWalk/runtests.jl similarity index 100% rename from src/GroebnerWalk/runtests rename to src/GroebnerWalk/runtests.jl From bcf4c2bb751fa8e6665cfaa5b1068b82277eec48 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:41:30 +0200 Subject: [PATCH 80/85] Update README.md --- src/GroebnerWalk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GroebnerWalk/README.md b/src/GroebnerWalk/README.md index 9ddec0ddc..2d228a88b 100644 --- a/src/GroebnerWalk/README.md +++ b/src/GroebnerWalk/README.md @@ -35,7 +35,7 @@ groebnerwalk(I, ordering_as_matrix(:degrevlex, nvars(R)), ordering_as_matrix(:le ### Tests -The tests can be started with **runtests**. +The tests can be started with **runtests.jl**. ### Tracing the Walk From 51aa83b4ce06cf919aba343cbeebad55748a8030 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:50:20 +0200 Subject: [PATCH 81/85] Rename GenericWalkUtilitys.jl to GenericWalkUtilities.jl --- .../{GenericWalkUtilitys.jl => GenericWalkUtilities.jl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/GroebnerWalk/{GenericWalkUtilitys.jl => GenericWalkUtilities.jl} (100%) diff --git a/src/GroebnerWalk/GenericWalkUtilitys.jl b/src/GroebnerWalk/GenericWalkUtilities.jl similarity index 100% rename from src/GroebnerWalk/GenericWalkUtilitys.jl rename to src/GroebnerWalk/GenericWalkUtilities.jl From 24dd96d0584c51e3436bc18eb7ab841ea4d4f702 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:51:43 +0200 Subject: [PATCH 82/85] Update GenericWalkUtilities.jl --- src/GroebnerWalk/GenericWalkUtilities.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/GroebnerWalk/GenericWalkUtilities.jl b/src/GroebnerWalk/GenericWalkUtilities.jl index ae3a5448f..418cd5835 100644 --- a/src/GroebnerWalk/GenericWalkUtilities.jl +++ b/src/GroebnerWalk/GenericWalkUtilities.jl @@ -1,5 +1,3 @@ -include("GroebnerWalkUtilitys.jl") - ################################################################# # Procedures of the generic walk. # The generic walk is proposed by Fukuda, Lauritzen & Thomas (2005). From a426988b72d3c50081a62891a2f94472bdcb6c47 Mon Sep 17 00:00:00 2001 From: welpj <83277957+welpj@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:52:08 +0200 Subject: [PATCH 83/85] Update TranWalkUtilities.jl --- src/GroebnerWalk/TranWalkUtilities.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/GroebnerWalk/TranWalkUtilities.jl b/src/GroebnerWalk/TranWalkUtilities.jl index 8879540fc..e2ebd1600 100644 --- a/src/GroebnerWalk/TranWalkUtilities.jl +++ b/src/GroebnerWalk/TranWalkUtilities.jl @@ -1,5 +1,3 @@ -include("GroebnerWalkUtilitys.jl") - # computes the representation of the matrixorder defined by T. function representation_vector(G::Singular.sideal, T::Matrix{Int}) n = size(T)[1] From c2943e4f65c37255d06a15b04cf07c0dbf7e0c36 Mon Sep 17 00:00:00 2001 From: welpj Date: Sun, 10 Apr 2022 11:28:45 +0200 Subject: [PATCH 84/85] final --- src/GroebnerWalk/GenericWalkPertubed.jl | 1 - src/GroebnerWalk/GroebnerWalk.jl | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/GroebnerWalk/GenericWalkPertubed.jl b/src/GroebnerWalk/GenericWalkPertubed.jl index c6bbc43d3..06617b948 100644 --- a/src/GroebnerWalk/GenericWalkPertubed.jl +++ b/src/GroebnerWalk/GenericWalkPertubed.jl @@ -1,4 +1,3 @@ - ############################################################### # Not tested version of the Generic Walk with different degree # of pertubation. This implementation is not verified. diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index f4d2d8d17..98548ed6d 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -267,9 +267,7 @@ function generic_walk( end G = Singular.Ideal(Rn, G) G.isGB = true - - # to generate the same coefficients as Singular.std does. This version of the generic walk computes LC(g)=1 for all g \in G. - return Singular.interreduce(G) + return G end function generic_step( From e9b30de9f0ab415649468384d8c4c700e9e9a2e3 Mon Sep 17 00:00:00 2001 From: welpj Date: Sun, 10 Apr 2022 20:52:19 +0200 Subject: [PATCH 85/85] fix: counter --- src/GroebnerWalk/GroebnerWalk.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GroebnerWalk/GroebnerWalk.jl b/src/GroebnerWalk/GroebnerWalk.jl index 98548ed6d..75df98acb 100644 --- a/src/GroebnerWalk/GroebnerWalk.jl +++ b/src/GroebnerWalk/GroebnerWalk.jl @@ -120,6 +120,7 @@ function groebnerwalk( walk = (x) -> fractal_walk_combined(x, S, T, infoLevel) end + delete_counter() !check_order_M(S, T, G) && throw( error( "The matrices representing the monomial order have to be nxn-matrices with full rank.",