Skip to content

Commit

Permalink
Polytopes: No non_redundant when constructing from inequalities
Browse files Browse the repository at this point in the history
- Resolve issue #715
- User that want to give non-redundant input have to do so projectively,
  via Polymake.jl
  • Loading branch information
lkastner committed Oct 18, 2021
1 parent da878dc commit 4d671e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/Polytopes/Polyhedron/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ A polyhedron in ambient dimension 2
"""
Polyhedron(A::Union{Oscar.MatElem,AbstractMatrix}, b) = Polyhedron((A, b))

function Polyhedron(I::Union{HalfspaceIterator, Tuple{<:Union{Oscar.MatElem, AbstractMatrix}, Any}}, E::Union{Nothing, HalfspaceIterator, Tuple{<:Union{Oscar.MatElem, AbstractMatrix}, Any}} = nothing; non_redundant::Bool = false)
function Polyhedron(I::Union{HalfspaceIterator, Tuple{<:Union{Oscar.MatElem, AbstractMatrix}, Any}}, E::Union{Nothing, HalfspaceIterator, Tuple{<:Union{Oscar.MatElem, AbstractMatrix}, Any}} = nothing)
IM = -affine_matrix_for_polymake(I)
EM = isnothing(E) || _isempty_halfspace(E) ? Polymake.Matrix{Polymake.Rational}(undef, 0, size(IM, 2)) : affine_matrix_for_polymake(E)

if non_redundant
return Polyhedron(Polymake.polytope.Polytope{Polymake.Rational}(FACETS = IM, AFFINE_HULL = EM))
else
return Polyhedron(Polymake.polytope.Polytope{Polymake.Rational}(INEQUALITIES = remove_zero_rows(IM), EQUATIONS = remove_zero_rows(EM)))
end
return Polyhedron(Polymake.polytope.Polytope{Polymake.Rational}(INEQUALITIES = remove_zero_rows(IM), EQUATIONS = remove_zero_rows(EM)))
end

"""
Expand Down
2 changes: 0 additions & 2 deletions test/Polytopes/Polyhedron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
square = cube(2)
C1 = cube(2, 0, 1)
Pos = Polyhedron([-1 0 0; 0 -1 0; 0 0 -1], [0,0,0])
# TODO
# @test Polyhedron(([-1 0 0; 0 -1 0; 0 0 -1], [0,0,0]); non_redundant = true) == Pos
L = Polyhedron([-1 0 0; 0 -1 0], [0,0])
point = convex_hull([0 1 0])
s = simplex(2)
Expand Down

0 comments on commit 4d671e4

Please sign in to comment.