codac 2.0.0
Loading...
Searching...
No Matches
codac2_Zonotope.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <vector>
13#include "codac2_Vector.h"
14#include "codac2_Matrix.h"
17
18namespace codac2
19{
29 {
30 public:
31
35 Zonotope() { };
36
42
49 Zonotope(const Vector& c, const Matrix& A);
50
58 static Zonotope empty(Index n);
59
65 bool is_empty() const;
66
70 void set_empty();
71
77
78 Index size() const { return c.size(); }
79
86
94 Zonotope proj(const std::vector<Index>& indices) const;
95
103 Zonotope operator+(const Zonotope& zonotope) const;
104
114
124
140 Zonotope reduction(double o, bool invert=false) const;
141
150
159
160
165
170
174 bool empty_flag = false;
175
176 };
177
185 std::ostream& operator<<(std::ostream& str, const Zonotope& z);
186
187}
Class representing a zonotope .
Definition codac2_Zonotope.h:29
Zonotope transform(const IntervalMatrix &mat) const
apply a transformation on A (keeping c) with an IntervalMatrix i.e. enclose { c, MA }...
bool empty_flag
Flag indicating whether the zonotope is empty.
Definition codac2_Zonotope.h:174
Index size() const
Outputs the size of the zonotope.
Definition codac2_Zonotope.h:78
void set_empty()
Sets the zonotope to be empty.
Zonotope operator+(const Zonotope &zonotope) const
Computes the Minkowski sum of this Zonotope with another Zonotope.
Zonotope(const Vector &c, const Matrix &A)
Constructs a n-zonotope object with a given center and shape matrix.
Zonotope & operator&=(const IntervalVector &box)
In-place intersection of a zonotope and a box. Not very precise but may be useful in some case.
bool is_empty() const
Checks if the zonotope is empty.
IntervalVector box() const
Computes the axis-aligned bounding box of the zonotope.
Zonotope operator&(const IntervalVector &box) const
Intersection of a zonotope and a box. Not very precise but may be useful in some case.
static Zonotope empty(Index n)
Constructs an empty n-zonotope.
Zonotope reduction(double o, bool invert=false) const
Create a new zonotope englobing (*this) with at most columns (with the dimension of the zonotope....
Vector c
Center of the zonotope.
Definition codac2_Zonotope.h:164
Zonotope & operator+=(const IntervalVector &box)
Add an IntervalVector to the current zonotope. Create a new generator only if needed.
Zonotope()
Constructs an invalid zonotope, for future assignment.
Definition codac2_Zonotope.h:35
Zonotope(const IntervalVector &box)
Constructs a zonotope from a box.
Zonotope proj(const std::vector< Index > &indices) const
Projects the Zonotope onto the subspace defined by the given indices.
Matrix A
Shape matrix of the zonotope.
Definition codac2_Zonotope.h:169
Definition codac2_OctaSym.h:21
Eigen::Matrix< double,-1, 1 > Vector
Alias for a dynamically-sized column vector of doubles.
Definition codac2_Vector.h:24
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25
std::ostream & operator<<(std::ostream &os, const BoolInterval &x)
Streams out a BoolInterval.
Definition codac2_BoolInterval.h:131
Eigen::Matrix< double,-1,-1 > Matrix
Alias for a dynamic-size matrix of doubles.
Definition codac2_Matrix.h:26
Eigen::Matrix< Interval,-1,-1 > IntervalMatrix
Alias for a dynamic-size matrix of intervals.
Definition codac2_IntervalMatrix.h:25