codac 2.0.5
Loading...
Searching...
No Matches
codac2::Parallelepiped Class Reference

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

#include <codac2_Parallelepiped.h>

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

Public Member Functions

 Parallelepiped (const Vector &c, const Matrix &A)
 Constructs a n-parallelepiped object with a given center and shape matrix.
std::vector< Vectorvertices () const
 Computes the vertices of the parallelepiped.
BoolInterval contains (const Vector &v) const
 Checks if a given point is contained within the parallelepiped. The matrix A has to be square and invertible.
BoolInterval is_superset (const IntervalVector &x) const
 Checks if a given box is contained within the parallelepiped. The matrix A has to be square and invertible.
Parallelepiped operator& (const IntervalVector &x) const
 Computes the intersection of the parallelepiped with a given box. The matrix A has to be square and invertible.
Public Member Functions inherited from codac2::Zonotope
 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)
 Computes the Minkowski sum of this Zonotope with another Zonotope.

Static Public Member Functions

static Parallelepiped empty (Index n)
 Constructs an empty n-parallelepiped.
Static Public Member Functions inherited from codac2::Zonotope
static Zonotope empty (Index n)
 Constructs an empty n-zonotope.

Additional Inherited Members

Public Attributes inherited from codac2::Zonotope
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 parallelepiped \(\mathbf{c} + \mathbf{A}\cdot[-1,1]^m\).

This class represents a parallelepiped in n-dimensional space, defined by a center point \(\mathbf{c}\) 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\).

Constructor & Destructor Documentation

◆ Parallelepiped()

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

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

Parameters
cCenter of the parallelepiped (n-dimensional vector)
AShape matrix of the parallelepiped ( \(n\times m\) matrix with \(m \leqslant n\))

Member Function Documentation

◆ empty()

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

Constructs an empty n-parallelepiped.

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

◆ vertices()

std::vector< Vector > codac2::Parallelepiped::vertices ( ) const

Computes the vertices of the parallelepiped.

Returns
A vector containing the unsorted vertices of the parallelepiped

◆ contains()

BoolInterval codac2::Parallelepiped::contains ( const Vector & v) const

Checks if a given point is contained within the parallelepiped. The matrix A has to be square and invertible.

Parameters
vThe point to check
Returns
BoolInterval true if the point is inside the parallelepiped, false if is outside, and unknown otherwise

◆ is_superset()

BoolInterval codac2::Parallelepiped::is_superset ( const IntervalVector & x) const

Checks if a given box is contained within the parallelepiped. The matrix A has to be square and invertible.

Parameters
xThe box to check
Returns
BoolInterval true if the box is inside the parallelepiped, false if is outside, and unknown otherwise

◆ operator&()

Parallelepiped codac2::Parallelepiped::operator& ( const IntervalVector & x) const

Computes the intersection of the parallelepiped with a given box. The matrix A has to be square and invertible.

Parameters
xThe box to intersect with
Returns
A new Parallelepiped representing the intersection of the original parallelepiped with the box.

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