Containment/Redundancy

Containment/Redundancy

Containment

Base.inFunction.
in(p::VRepElement, h::HRepElement)

Returns whether p is in h. If h is an hyperplane, it returns whether $\langle a, x \rangle \approx \beta$. If h is an halfspace, it returns whether $\langle a, x \rangle \le \beta$.

in(p::VRepElement, h::HRep)

Returns whether p is in h, e.g. in all the hyperplanes and halfspaces supporting h.

Base.issubsetFunction.
issubset(p::Rep, h::HRepElement)

Returns whether p is a subset of h, i.e. whether h supports the polyhedron p.

Polyhedra.ininteriorFunction.
ininterior(p::VRepElement, h::HRepElement)

Returns whether p is in the interior of h. If h is an hyperplane, it always returns false. If h is an halfspace $\langle a, x \rangle \leq \beta$, it returns whether p is in the open halfspace $\langle a, x \rangle < \beta$

ininterior(p::VRepElement, h::HRep)

Returns whether p is in the interior of h, e.g. in the interior of all the hyperplanes and halfspaces supporting h.

inrelativeinterior(p::VRepElement, h::HRepElement)

Returns whether p is in the relative interior of h. If h is an hyperplane, it is equivalent to p in h since the relative interior of an hyperplane is itself. If h is an halfspace, it is equivalent to ininterior(p, h).

inrelativeinterior(p::VRepElement, h::HRep)

Returns whether p is in the relative interior of h, e.g. in the relative interior of all the hyperplanes and halfspaces supporting h.

Linearity

detecthlinearity!(p::VRep)

Detects all the hyperplanes contained in the H-representation and remove all redundant hyperplanes.

Examples

The representation

h = HalfSpace([1, 1], 1]) ∩ HalfSpace([-1, -1], -1)

contains the hyperplane HyperPlane([1, 1], 1).

detectvlinearity!(p::VRep)

Detects all the lines contained in the V-representation and remove all redundant lines.

Examples

The representation

v = conichull([1, 1], [-1, -1])

contains the line Line([1, 1]).

Polyhedra.dimFunction.
dim(h::HRep, current=false)

Returns the dimension of the affine hull of the polyhedron. That is the number of non-redundant hyperplanes that define it. If current is true then it simply returns the dimension according the current number of hyperplanes, assuming that the H-linearity has already been detected. Otherwise, it first calls detecthlinearity!.

Duplicates

removeduplicates(rep::Representation)

Removes the duplicates in the Representation.

  • In an H-representation, it removes the redundant hyperplanes and it remove an halfspace when it is equal to another halfspace in the affine hull. For instance, HalfSpace([1, 1], 1) is equal to HalfSpace([1, 0], 0) in the affine hull generated by HyperPlane([0, 1], 1]).
  • In a V-representation, it removes the redundant lines and it remove a point (resp. ray) when it is equal to another point (resp. ray) in the line hull. For instance, in the line hull generated by Line([0, 1]), [1, 1] is equal to [1, 0] and Ray([2, 2]) is equal to Ray([1, 0]).

Redundancy

Polyhedra.isredundantFunction.
isredundant(p::Rep, idx::Index; strongly=false)

Return a Bool indicating whether the element with index idx can be removed without changing the polyhedron represented by p. If strongly is true,

  • if idx is an H-representation element h, it returns true only if no V-representation element of p is in the hyperplane of h.
  • if idx is a V-representation element v, it returns true only if v is in the relative interior of p.
removehredundancy!(p::HRep)

Removes the elements of the H-representation of p that can be removed without changing the polyhedron represented by p. That is, it only keeps the halfspaces corresponding to facets of the polyhedron.

removevredundancy!(p::VRep)

Removes the elements of the V-representation of p that can be removed without changing the polyhedron represented by p. That is, it only keeps the extreme points and rays. This operation is often called "convex hull" as the remaining points are the extreme points of the convex hull of the initial set of points.