Objects

pypolycontain has the following polytopic objects.

H-polytope

class pypolycontain.objects.H_polytope(H, h, symbolic=False, color='red')

An H-polytope is a set defined as follows:

\[\mathbb{P}=\{x \in \mathbb{R}^n | H x \le h \},\]

where

Attributes:
  • \(H \in \mathbb{R}^{q \times n}\): numpy.ndarray[float[[q,n]]
  • \(h\in \mathbb{R}^q\) : numpy.ndarray[float[[q,1]]

define the hyperplanes. The inequality is interpreted element-wise and q is the number of hyperplanes.

V-polytope

class pypolycontain.objects.V_polytope(list_of_vertices)

V-polytopes are a convex hull of vertices.

\[\mathbb{V}= \{ x \in \mathbb{R}^n | x = \sum_{i=1}^N \lambda_i v_i, \sum_{i=1}^N \lambda_i=1, \lambda_i \ge 0, i=1,\cdots,N \}\]

where each \(v_i, i=1,\cdots,N\) is a point (some or all are effectively vertices).

Attributes:
  • list_of_vertices= list of numpy.ndarray[float[n,1]].

AH-polytope

class pypolycontain.objects.AH_polytope(t, T, P, color='blue')

An AH_polytope is an affine transformation of an H-polytope and is defined as:

\[\mathbb{Q}=\{t+Tx | x \in \mathbb{R}^p, H x \le h \}\]
Attributes:
  • P: The underlying H-polytope \(P:\{x \in \mathbb{R}^p | Hx \le h\}\)
  • T: \(\mathbb{R}^{n \times p}\) matrix: linear transformation
  • t: \(\mathbb{R}^{n}\) vector: translation

Zonotope

class pypolycontain.objects.zonotope(G, x=None, name=None, color='green')

A Zonotope is a set defined as follows:

\[\mathbb{Z}=\langle x,G \rangle = \{x + G p | p \in [-1,1]^q \},\]

where

Attributes:
  • \(G \in \mathbb{R}^{n \times q}\): numpy.ndarray[float[[n,q]] is the zonotope generator.
  • \(x\in \mathbb{R}^n\): numpy.ndarray[float[[n,1]] is the zonotope centroid. Default is zero vector.

The order of the zonotope is defined as \(\frac{q}{n}\).

pypolycontain.objects.zonotope.volume(self)

Computes the volume of the zonotope in \(\mathbb{n}\) dimensions. The formula is based on the paper in [Gover2002]

[Gover2002]Gover, Eugene, and Nishan Krikorian. “Determinants and the volumes of parallelotopes and zonotopes.” Linear Algebra and its Applications 433, no. 1 (2010): 28-40.

Unitbox

class pypolycontain.objects.unitbox(N)

A unitbox in \(\mathbb{R}^n\) is \([-1,1]^n\).