Skip to content

Commit

Permalink
tests pass once again, hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
sumiya11 committed Oct 14, 2024
1 parent 1072de6 commit b9d05c1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/groebner/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ function groebner2(

if params.homogenize
ring, gb_monoms, gb_coeffs = dehomogenize_generators!(ring, gb_monoms, gb_coeffs, params)
if params.reduced
gb_monoms, gb_coeffs = _groebner2(ring, gb_monoms, gb_coeffs, params)
end
end

gb_monoms, gb_coeffs
Expand Down
3 changes: 3 additions & 0 deletions src/groebner/groebner_with_change_matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function groebner_with_change_matrix2(ring, monoms, coeffs, params)

if params.homogenize
ring, gb_monoms, gb_coeffs = dehomogenize_generators!(ring, gb_monoms, gb_coeffs, params)
if params.reduced
gb_monoms, gb_coeffs = groebner2(ring, gb_monoms, gb_coeffs, params)
end
end

if !isempty(zero_indices)
Expand Down
1 change: 0 additions & 1 deletion src/groebner/homogenization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function dehomogenize_generators!(
new_ring = PolyRing(new_nvars, new_ord, ring_desat.ch)
sort_input_terms_to_change_ordering!(new_monoms, coeffs, new_ord)
params.target_ord = new_ring.ord
new_monoms, coeffs = autoreduce2(new_ring, new_monoms, coeffs, params)
new_ring, new_monoms, coeffs
end

Expand Down
6 changes: 6 additions & 0 deletions src/groebner/learn_apply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ function groebner_learn2(

if params.homogenize
ring, gb_monoms, gb_coeffs = dehomogenize_generators!(ring, gb_monoms, gb_coeffs, params)
if params.reduced
gb_monoms, gb_coeffs = autoreduce2(ring, gb_monoms, gb_coeffs, params)
end
trace.term_homogenizing_permutations = term_homogenizing_permutation
end

Expand Down Expand Up @@ -269,6 +272,9 @@ function _groebner_apply2!(trace, params)
gb_monoms, gb_coeffs = basis_export_data(trace.gb_basis, trace.hashtable)
ring, gb_monoms, gb_coeffs =
dehomogenize_generators!(trace.ring, gb_monoms, gb_coeffs, params)
if params.reduced
gb_monoms, gb_coeffs = autoreduce2(ring, gb_monoms, gb_coeffs, params)
end
end

flag, ring, gb_coeffs
Expand Down
5 changes: 4 additions & 1 deletion test/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,9 @@ function test_params(
for k in grounds
for ord in orderings
for cf in coeffssize
if ord == :lex
md = min(2, md)
end
set = Groebner.Examples.random_generating_set(
rng,
k,
Expand Down Expand Up @@ -1325,7 +1328,7 @@ end
nterms = [1, 2, 4]
npolys = [1, 4, 100]
grounds = [GF(1031), GF(2^50 + 55), AbstractAlgebra.QQ]
coeffssize = [3, 1000, 2^31 - 1, BigInt(2)^100]
coeffssize = [3, 1000, 2^31 - 1, BigInt(2)^80]
orderings = [:degrevlex, :lex, :deglex]
linalgs = [:deterministic, :randomized]
monoms = [:auto, :dense, :packed]
Expand Down

0 comments on commit b9d05c1

Please sign in to comment.