Zonotopes

Main author: Maël Godard

The following classes represent zonotopes.

Zonotope

class Zonotope

Class representing a zonotope \(\mathbf{z} + \mathbf{A}\cdot[-1,1]^m\).

This class represents a zonotope in n-dimensional space, defined by a center point \(\mathbf{z}\) and a shape matrix \(\mathbf{A}\).

The vector \(\mathbf{z}\) and each column of the matrix \(\mathbf{A}\) must have the same dimension \(n\), but the matrix \(\mathbf{A}\) can have any number of columns \(m\).

Subclassed by codac2::Parallelepiped

Public Functions

Zonotope(const Vector &z, const Matrix &A)

Constructs a n-zonotope object with a given center and shape matrix.

Parameters:
  • z – Center of the zonotope (n-dimensional vector)

  • A – Shape matrix of the zonotope ( \(n\times m\) matrix)

Public Members

Vector z

Center of the zonotope.

Matrix A

Shape matrix of the zonotope.

Parallelepiped

class Parallelepiped : public codac2::Zonotope

Class representing a parallelepiped \(\mathbf{z} + \mathbf{A}\cdot[-1,1]^m\).

This class represents a parallelepiped in n-dimensional space, defined by a center point \(\mathbf{z}\) and a shape matrix \(\mathbf{A}\).

A parallelepiped is a special case of a zonotope where the shape matrix \(\mathbf{A}\) has \(m\) columns with \(m \leqslant n\).

Public Functions

Parallelepiped(const Vector &z, const Matrix &A)

Constructs a n-parallelepiped object with a given center and shape matrix.

Parameters:
  • z – Center of the parallelepiped (n-dimensional vector)

  • A – Shape matrix of the parallelepiped ( \(n\times m\) matrix with \(m \leqslant n\))

Zonotope proj(const std::vector<Index> &indices) const

Projects the parallelepiped onto the subspace defined by the given indices.

Parameters:

indices – Vector of indices of the dimensions to project onto

Returns:

A new Zonotope object representing the projection of the parallelepiped onto the specified subspace

std::vector<Vector> vertices() const

Computes the vertices of the parallelepiped.

Returns:

A vector containing the unsorted vertices of the parallelepiped

IntervalVector box() const

Computes the axis-aligned bounding box of the parallelepiped.

Returns:

An IntervalVector representing the axis-aligned bounding box of the parallelepiped