Skip to content
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
10 changes: 8 additions & 2 deletions src/PolyhedralGeometry/Cone/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,14 @@ julia> f_vector(square)
"""
function f_vector(C::Cone)
pmc = pm_object(C)
ldim = pmc.LINEALITY_DIM
return Vector{ZZRingElem}(vcat(fill(0, ldim), pmc.F_VECTOR))
ld = lineality_dim(C)
fv = ld == dim(C) ? ZZRingElem[] : pmc.F_VECTOR::Polymake.Vector{Polymake.Integer}
v = zeros(ZZRingElem, ld + length(fv))
v[(ld + 1):end] = fv
if ld > 0
v[ld] = 1
end
return v
end

@doc raw"""
Expand Down
3 changes: 2 additions & 1 deletion test/PolyhedralGeometry/cone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
@test isnothing(faces(Cone2, 1))

@test f_vector(Cone5) == [4, 4]
@test f_vector(Cone2) == [0, 2]
@test f_vector(Cone2) == [1, 2]
@test f_vector(positive_hull([0, 0, 0])) == ZZRingElem[]
@test lineality_dim(Cone5) == 0
@test lineality_dim(Cone2) == 1
@test facet_degrees(Cone5) == fill(2, 4)
Expand Down
Loading