Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of assure #2732

Merged
merged 3 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Preferences = "1"
Random = "1.6"
RandomExtensions = "0.4.3"
Serialization = "1.6"
Singular = "0.21.0"
Singular = "0.21.1"
TOPCOM_jll = "0.17.8"
UUIDs = "1.6"
cohomCalg_jll = "0.32.0"
Expand Down
16 changes: 8 additions & 8 deletions src/Rings/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ degrevlex([x, y])
"""
function _compute_standard_basis(B::IdealGens, ordering::MonomialOrdering, complete_reduction::Bool = false)
# incorrect one
singular_assure(B, ordering)
R = B.Sx
I = Singular.Ideal(R, gens(B.S)...)
i = Singular.std(I, complete_reduction = complete_reduction)
BA = IdealGens(B.Ox, i, complete_reduction)
# correct one (segfaults)
#gensSord = singular_generators(B, ordering)
#i = Singular.std(gensSord, complete_reduction = complete_reduction)
#singular_assure(B, ordering)
#R = B.Sx
#I = Singular.Ideal(R, gens(B.S)...)
#i = Singular.std(I, complete_reduction = complete_reduction)
#BA = IdealGens(B.Ox, i, complete_reduction)
# correct one (segfaults)
gensSord = singular_generators(B, ordering)
i = Singular.std(gensSord, complete_reduction = complete_reduction)
BA = IdealGens(B.Ox, i, complete_reduction)
BA.isGB = true
BA.ord = ordering
if isdefined(BA, :S)
Expand Down
19 changes: 19 additions & 0 deletions test/Rings/MPolyAnyMap/MPolyQuo.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
@testset "MPolyAnyMap/MPolyQuoRing no segfault" begin
Qix, (x, y) = QQ["x", "y"]
I = ideal(Qix, elem_type(Qix)[])
Qix, = quo(Qix, I)
x = Qix(x)
y = Qix(y)
f = hom(Qix, Qix, [x^2, y^2])
end

@testset "MPolyAnyMap/MPolyQuoRing segfault" begin
Qi, i = quadratic_field(-1)
Qix, (x, y) = Qi["x", "y"]
I = ideal(Qix, elem_type(Qix)[])
Qix, = quo(Qix, I)
x = Qix(x)
y = Qix(y)
f = hom(Qix, Qix, [x^2, y^2])
end

@testset "MPolyAnyMap/MPolyQuoRing" begin
Qsqrt2, = quadratic_field(-1)
Zx, _ = ZZ["x"]
Expand Down
Loading