codac 2.0.0
Loading...
Searching...
No Matches
codac2::Zonotope Class Reference

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

#include <codac2_Zonotope.h>

Inheritance diagram for codac2::Zonotope:
codac2::Parallelepiped

Public Member Functions

 Zonotope ()
 Constructs an invalid zonotope, for future assignment.
 Zonotope (const IntervalVector &box)
 Constructs a zonotope from a box.
 Zonotope (const Vector &c, const Matrix &A)
 Constructs a n-zonotope object with a given center and shape matrix.
bool is_empty () const
 Checks if the zonotope is empty.
void set_empty ()
 Sets the zonotope to be empty.
Index size () const
 Outputs the size of the zonotope.
IntervalVector box () const
 Computes the axis-aligned bounding box of the zonotope.
Zonotope proj (const std::vector< Index > &indices) const
 Projects the Zonotope onto the subspace defined by the given indices.
Zonotope operator+ (const Zonotope &zonotope) const
 Computes the Minkowski sum of this Zonotope with another Zonotope.
Zonotope & operator+= (const IntervalVector &box)
 Add an IntervalVector to the current zonotope. Create a new generator only if needed.
Zonotope transform (const IntervalMatrix &mat) const
 apply a transformation on A (keeping c) with an IntervalMatrix i.e. enclose { c, MA }.
Zonotope reduction (double o, bool invert=false) const
 Create a new zonotope englobing (*this) with at most \(n\times o\) columns (with \(n\) the dimension of the zonotope. Return a copy if the number of columns is already less than or equal to \(n\times o\). Note that \(o\) must be at least 1 (returns a parallelotope if \(o=1\)). The method is rather coarse and use a full pivot LU decomposition to determine the columns which are kept rather than more complex computations).
Zonotope & operator&= (const IntervalVector &box)
 In-place intersection of a zonotope and a box. Not very precise but may be useful in some case.
Zonotope operator& (const IntervalVector &box) const
 Intersection of a zonotope and a box. Not very precise but may be useful in some case.

Static Public Member Functions

static Zonotope empty (Index n)
 Constructs an empty n-zonotope.

Public Attributes

Vector c
 Center of the zonotope.
Matrix A
 Shape matrix of the zonotope.
bool empty_flag = false
 Flag indicating whether the zonotope is empty.

Detailed Description

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

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

The vector \(\mathbf{c}\) 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\).

Constructor & Destructor Documentation

◆ Zonotope() [1/2]

codac2::Zonotope::Zonotope ( const IntervalVector & box)

Constructs a zonotope from a box.

Parameters
boxThe box

◆ Zonotope() [2/2]

codac2::Zonotope::Zonotope ( const Vector & c,
const Matrix & A )

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

Parameters
cCenter of the zonotope (n-dimensional vector)
AShape matrix of the zonotope ( \(n\times m\) matrix)

Member Function Documentation

◆ empty()

Zonotope codac2::Zonotope::empty ( Index n)
static

Constructs an empty n-zonotope.

Parameters
nDimension of the zonotope
Returns
A new Zonotope object representing an empty zonotope in n-dimensional space

◆ is_empty()

bool codac2::Zonotope::is_empty ( ) const

Checks if the zonotope is empty.

Returns
True if the zonotope is empty, false otherwise

◆ size()

Index codac2::Zonotope::size ( ) const
inline

Outputs the size of the zonotope.

Returns
The size of the zonotope, defined as the size of its center vector
78{ return c.size(); }
Vector c
Center of the zonotope.
Definition codac2_Zonotope.h:164

◆ box()

IntervalVector codac2::Zonotope::box ( ) const

Computes the axis-aligned bounding box of the zonotope.

Returns
An IntervalVector representing the axis-aligned bounding box of the zonotope

◆ proj()

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

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

Parameters
indicesVector of indices of the dimensions to project onto
Returns
A new Zonotope object representing the projection of the Zonotope onto the specified subspace

◆ operator+()

Zonotope codac2::Zonotope::operator+ ( const Zonotope & zonotope) const

Computes the Minkowski sum of this Zonotope with another Zonotope.

Parameters
zonotopeThe other Zonotope to add to this one
Returns
A new Zonotope object representing the Minkowski sum of the two Zonotopes

◆ operator+=()

Zonotope & codac2::Zonotope::operator+= ( const IntervalVector & box)

Add an IntervalVector to the current zonotope. Create a new generator only if needed.

Parameters
boxThe other Zonotope to add to this one
Returns
*(this)

◆ transform()

Zonotope codac2::Zonotope::transform ( const IntervalMatrix & mat) const

apply a transformation on A (keeping c) with an IntervalMatrix i.e. enclose { c, MA }.

Parameters
matThe matrix of interval vectors
Returns
a new Zonotope

◆ reduction()

Zonotope codac2::Zonotope::reduction ( double o,
bool invert = false ) const

Create a new zonotope englobing (*this) with at most \(n\times o\) columns (with \(n\) the dimension of the zonotope. Return a copy if the number of columns is already less than or equal to \(n\times o\). Note that \(o\) must be at least 1 (returns a parallelotope if \(o=1\)). The method is rather coarse and use a full pivot LU decomposition to determine the columns which are kept rather than more complex computations).

Parameters
othe new maximum order (i.e. \(m/n\)) of the zonotope.
invertif true, the zonotope created is at least a parallelotope (i.e. the matrix is full rank).
Returns
a new zonotope.

◆ operator&=()

Zonotope & codac2::Zonotope::operator&= ( const IntervalVector & box)

In-place intersection of a zonotope and a box. Not very precise but may be useful in some case.

Parameters
boxthe box to be intersected
Returns
(*this)

◆ operator&()

Zonotope codac2::Zonotope::operator& ( const IntervalVector & box) const

Intersection of a zonotope and a box. Not very precise but may be useful in some case.

Parameters
boxthe box to be intersected
Returns
a new zonotope

The documentation for this class was generated from the following file: