Skip to content

Commit a67b157

Browse files
add small test function
1 parent 5e649f2 commit a67b157

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/siggb/siggb.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,15 @@ function _homogenize(F::Vector{P}) where {P <: MPolyRingElem}
242242
end
243243
return res
244244
end
245+
246+
# test against msolve
247+
function _is_gb(gb::Vector{Tuple{Tuple{Int, P}, P}}) where {P <: MPolyRingElem}
248+
gb_pols = [p[2] for p in gb]
249+
gb_msolve = groebner_basis(Ideal(gb_pols), complete_reduction = true)
250+
251+
lms_gb = (Nemo.leading_monomial).(gb_pols)
252+
lms_msolve = (Nemo.leading_monomial).(gb_msolve)
253+
res1 = all(u -> any(v -> divides(u, v)[1], lms_gb), lms_msolve)
254+
res2 = all(u -> any(v -> divides(u, v)[1], lms_msolve), lms_gb)
255+
return res1 && res2
256+
end

0 commit comments

Comments
 (0)