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

minimal_nonfaces: fix column number of IncidenceMatrix #1441

Merged
merged 1 commit into from
Jul 6, 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
9 changes: 7 additions & 2 deletions src/Combinatorics/SimplicialComplexes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,13 @@ function minimal_nonfaces(::Type{Vector{Set{Int}}}, K::SimplicialComplex)
end
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
nv = nvertices(K)
m = pm_object(K).MINIMAL_NON_FACES
# fix column number (see #1440) until this is fixed in polymake
if size(m, 2) < nv
resize!(m, size(m, 1), nv)
end
return m
end

@doc Markdown.doc"""
Expand Down
5 changes: 4 additions & 1 deletion test/Combinatorics/SimplicialComplexes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
R, _ = PolynomialRing(ZZ, ["a", "x", "i_7", "n"])
@test stanley_reisner_ideal(R, sphere) == ideal([R([1], [[1, 1, 1, 1]])])
@test is_isomorphic(fundamental_group(sphere), free_group())


# from #1440, make sure empty columns at the end are kept
sc = SimplicialComplex([[1, 2, 4], [2, 3, 4]])
@test size(minimal_nonfaces(IncidenceMatrix, sc)) == (1, 4)
end

@testset "standard examples" begin
Expand Down