Skip to content

Commit

Permalink
Fix usage of assure (#2732)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankoboehm authored Dec 22, 2023
1 parent 7843adc commit e818a16
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
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

0 comments on commit e818a16

Please sign in to comment.