Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Handling of matrices has been streamlined after this PR was started.

Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
  • Loading branch information
lkastner and benlorenz committed Jan 28, 2022
1 parent c450572 commit 59be9b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/src/PolyhedralGeometry/Polyhedra/auxiliary.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ project_full(P::Polyhedron)
print_constraints(A::AnyVecOrMat, b::AbstractVector; trivial::Bool = false)
print_constraints(P::Polyhedron; trivial::Bool = false)
regular_triangulations
secondary_polytope
solve_ineq(A::fmpz_mat, b::fmpz_mat)
solve_mixed(A::fmpz_mat, b::fmpz_mat, C::fmpz_mat, d::fmpz_mat)
solve_mixed(A::fmpz_mat, b::fmpz_mat, C::fmpz_mat)
Expand Down
16 changes: 8 additions & 8 deletions src/PolyhedralGeometry/triangulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ julia> V = vertices(c)
[0, 1]
[1, 1]
julia> all_triangulations(point_matrix(V))
julia> all_triangulations(V)
2-element Vector{Vector{Vector{Int64}}}:
[[1, 2, 3], [2, 3, 4]]
[[1, 2, 4], [1, 3, 4]]
```
"""
function all_triangulations(pts::AnyVecOrMat)
input = homogenize(pts)
function all_triangulations(pts::Union{SubObjectIterator{<:PointVector}, AbstractMatrix, Oscar.MatElem})
input = homogenized_matrix(pts, 1)
PC = Polymake.polytope.PointConfiguration(POINTS=input)
triangs = Polymake.polytope.topcom_all_triangulations(PC)
result = [[[e for e in simplex] for simplex in triang] for triang in triangs]
Expand Down Expand Up @@ -59,7 +59,7 @@ julia> all_triangulations(c)
[[1, 2, 4], [1, 3, 4]]
```
"""
all_triangulations(P::Polyhedron) = all_triangulations(point_matrix(vertices(P)))
all_triangulations(P::Polyhedron) = all_triangulations(vertices(P))


@doc Markdown.doc"""
Expand Down Expand Up @@ -90,14 +90,14 @@ julia> V = vertices(c)
[0, 1]
[1, 1]
julia> regular_triangulations(point_matrix(V))
julia> regular_triangulations(V)
2-element Vector{Vector{Vector{Int64}}}:
[[1, 2, 3], [2, 3, 4]]
[[1, 3, 4], [1, 2, 4]]
```
"""
function regular_triangulations(pts::AnyVecOrMat)
input = homogenize(pts)
function regular_triangulations(pts::Union{SubObjectIterator{<:PointVector}, AbstractMatrix, Oscar.MatElem})
input = homogenized_matrix(pts, 1)
PC = Polymake.polytope.PointConfiguration(POINTS=input)
triangs = Polymake.polytope.topcom_regular_triangulations(PC)
result = [[[e for e in simplex] for simplex in triang] for triang in triangs]
Expand Down Expand Up @@ -133,7 +133,7 @@ julia> regular_triangulations(c)
[[1, 3, 4], [1, 2, 4]]
```
"""
regular_triangulations(P::Polyhedron) = regular_triangulations(point_matrix(vertices(P)))
regular_triangulations(P::Polyhedron) = regular_triangulations(vertices(P))


@doc Markdown.doc"""
Expand Down

0 comments on commit 59be9b9

Please sign in to comment.