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

test/ToricVarieties: fix+improve test for Stanley Reisner ideal #1086

Merged
merged 2 commits into from
Feb 16, 2022
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
8 changes: 6 additions & 2 deletions src/Combinatorics/SimplicialComplexes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,14 @@ julia> minimal_nonfaces(K)
"""
minimal_nonfaces(K::SimplicialComplex) = minimal_nonfaces(Vector{Set{Int}}, K)
function minimal_nonfaces(::Type{Vector{Set{Int}}}, K::SimplicialComplex)
I = pm_object(K).MINIMAL_NON_FACES
I = minimal_nonfaces(IncidenceMatrix, K)
return Vector{Set{Int}}([Polymake.row(I,i) for i in 1:Polymake.nrows(I)])
end
minimal_nonfaces(::Type{IncidenceMatrix}, K::SimplicialComplex) = pm_object(K).MINIMAL_NON_FACES
function minimal_nonfaces(::Type{IncidenceMatrix}, K::SimplicialComplex)
# the following line must stay to ensure polymake uses the correct algorithm for the non-faces
nvertices(K)
return pm_object(K).MINIMAL_NON_FACES
end

@doc Markdown.doc"""
alexander_dual(K::SimplicialComplex)
Expand Down
8 changes: 5 additions & 3 deletions test/ToricVarieties/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ end

P = polarize(Polyhedron(Polymake.polytope.rand_sphere(5,60; seed=42)))
big_variety = NormalToricVariety(P)
big_variety2 = NormalToricVariety(P)
set_coefficient_ring(big_variety2, GF(13))
set_coefficient_ring(big_variety, GF(13))

@testset "Additional test for Stanley-Reisner ideal" begin
@test ngens(stanley_reisner_ideal(big_variety)) == ngens(stanley_reisner_ideal(big_variety2))
# this should run in a few seconds at most
duration = @elapsed stanley_reisner_ideal(big_variety)
@test duration < 10
@test ngens(stanley_reisner_ideal(big_variety)) == 1648
end

D=ToricDivisor(H5, [0,0,0,0])
Expand Down