Storm
A Modern Probabilistic Model Checker
|
#include <Polytope.h>
Public Types | |
typedef std::vector< ValueType > | Point |
Public Member Functions | |
virtual | ~Polytope () |
virtual std::vector< Point > | getVertices () const =0 |
Returns the vertices of this polytope. | |
virtual std::vector< Point > | getVerticesInClockwiseOrder () const |
Returns the vertices of this 2D-polytope in clockwise order. | |
virtual std::vector< Halfspace< ValueType > > | getHalfspaces () const =0 |
Returns the halfspaces of this polytope. | |
virtual bool | isEmpty () const =0 |
Returns whether this polytope is the empty set. | |
virtual bool | isUniversal () const =0 |
Returns whether this polytope is universal (i.e., equals R^n). | |
virtual bool | contains (Point const &point) const =0 |
Returns true iff the given point is inside of the polytope. | |
virtual bool | contains (std::shared_ptr< Polytope< ValueType > > const &other) const =0 |
Returns true iff the given polytope is a subset of this polytope. | |
virtual std::shared_ptr< Polytope< ValueType > > | intersection (std::shared_ptr< Polytope< ValueType > > const &rhs) const =0 |
Intersects this polytope with rhs and returns the result. | |
virtual std::shared_ptr< Polytope< ValueType > > | intersection (Halfspace< ValueType > const &halfspace) const =0 |
virtual std::shared_ptr< Polytope< ValueType > > | convexUnion (std::shared_ptr< Polytope< ValueType > > const &rhs) const =0 |
Returns the convex union of this polytope and rhs. | |
virtual std::shared_ptr< Polytope< ValueType > > | minkowskiSum (std::shared_ptr< Polytope< ValueType > > const &rhs) const =0 |
Returns the minkowskiSum of this polytope and rhs. | |
virtual std::shared_ptr< Polytope< ValueType > > | affineTransformation (std::vector< Point > const &matrix, Point const &vector) const =0 |
Returns the affine transformation of this polytope P w.r.t. | |
std::shared_ptr< Polytope< ValueType > > | shift (Point const &b) const |
Returns the Polytope described by the set {x+b | x \in this}. | |
virtual std::shared_ptr< Polytope< ValueType > > | downwardClosure () const |
Returns the downward closure of this, i.e., the set { x | ex. | |
std::vector< std::shared_ptr< Polytope< ValueType > > > | setMinus (std::shared_ptr< Polytope< ValueType > > const &rhs) const |
Computes the set {x \in this | x \notin rhs}. | |
virtual std::pair< Point, bool > | optimize (Point const &direction) const =0 |
Finds an optimal point inside this polytope w.r.t. | |
virtual std::vector< storm::expressions::Variable > | declareVariables (storm::expressions::ExpressionManager &manager, std::string const &namePrefix) const |
Declares one variable for each dimension and returns the obtained variables. | |
virtual std::vector< storm::expressions::Expression > | getConstraints (storm::expressions::ExpressionManager const &manager, std::vector< storm::expressions::Variable > const &variables) const |
Returns the constrains defined by this polytope as an expression over the given variables. | |
template<typename TargetType > | |
std::shared_ptr< Polytope< TargetType > > | convertNumberRepresentation () const |
converts the intern number representation of the polytope to the given target type | |
virtual std::shared_ptr< Polytope< ValueType > > | clean () |
Performs cleaning operations, e.g., deleting redundant halfspaces. | |
virtual std::string | toString (bool numbersAsDouble=false) const |
virtual bool | isNativePolytope () const |
Static Public Member Functions | |
static std::shared_ptr< Polytope< ValueType > > | create (std::vector< Halfspace< ValueType > > const &halfspaces) |
Creates a polytope from the given halfspaces. | |
static std::shared_ptr< Polytope< ValueType > > | create (std::vector< Point > const &points) |
Creates a polytope from the given points (i.e., the convex hull of the points). | |
static std::shared_ptr< Polytope< ValueType > > | createUniversalPolytope () |
Creates the universal polytope (i.e., the set R^n) | |
static std::shared_ptr< Polytope< ValueType > > | createEmptyPolytope () |
Creates the empty polytope (i.e., emptyset) | |
static std::shared_ptr< Polytope< ValueType > > | createDownwardClosure (std::vector< Point > const &points) |
Creates the downward closure of the given points (i.e., the set { x | ex. | |
static std::shared_ptr< Polytope< ValueType > > | createSelectiveDownwardClosure (std::vector< Point > const &points, storm::storage::BitVector const &selectedDimensions) |
Creates the downward closure of the given points but only with respect to the selected dimensions, (i.e., the set { x | ex. | |
Protected Member Functions | |
Polytope () | |
Definition at line 17 of file Polytope.h.
typedef std::vector<ValueType> storm::storage::geometry::Polytope< ValueType >::Point |
Definition at line 19 of file Polytope.h.
|
virtual |
Definition at line 97 of file Polytope.cpp.
|
protected |
Definition at line 92 of file Polytope.cpp.
|
pure virtual |
Returns the affine transformation of this polytope P w.r.t.
the given matrix A and vector b. The result is the set {A*x+b | x \in P}
matrix | the transformation matrix, given as vector of rows |
vector | the transformation offset |
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
virtual |
Performs cleaning operations, e.g., deleting redundant halfspaces.
Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.
Definition at line 251 of file Polytope.cpp.
|
pure virtual |
Returns true iff the given point is inside of the polytope.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
pure virtual |
Returns true iff the given polytope is a subset of this polytope.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
template std::shared_ptr< Polytope< double > > storm::storage::geometry::Polytope< ValueType >::convertNumberRepresentation | ( | ) | const |
converts the intern number representation of the polytope to the given target type
Definition at line 219 of file Polytope.cpp.
|
pure virtual |
Returns the convex union of this polytope and rhs.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
static |
Creates a polytope from the given halfspaces.
If the given vector of halfspaces is empty, the resulting polytope is universal (i.e., equals R^n).
|
static |
Creates a polytope from the given points (i.e., the convex hull of the points).
If the vector of points is empty, the resulting polytope be empty.
Definition at line 22 of file Polytope.cpp.
|
static |
Creates the downward closure of the given points (i.e., the set { x | ex.
y \in conv(points) : x<=y } If the vector of points is empty, the resulting polytope is empty.
Definition at line 43 of file Polytope.cpp.
|
static |
Creates the empty polytope (i.e., emptyset)
Definition at line 32 of file Polytope.cpp.
|
static |
Creates the downward closure of the given points but only with respect to the selected dimensions, (i.e., the set { x | ex.
y \in conv(points) : (x_i<=y_i if i in selectedDim) and (x_i==y_i if i not in selectedDim } If the vector of points is empty, the resulting polytope is empty.
Definition at line 54 of file Polytope.cpp.
|
static |
Creates the universal polytope (i.e., the set R^n)
Definition at line 27 of file Polytope.cpp.
|
virtual |
Declares one variable for each dimension and returns the obtained variables.
manager | The expression manager that keeps track of the variables |
namePrefix | The prefix that is prepanded to the variable index |
Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.
Definition at line 202 of file Polytope.cpp.
|
virtual |
Returns the downward closure of this, i.e., the set { x | ex.
y \in P : x<=y} where P is this Polytope.
Definition at line 197 of file Polytope.cpp.
|
virtual |
Returns the constrains defined by this polytope as an expression over the given variables.
Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.
Definition at line 210 of file Polytope.cpp.
|
pure virtual |
Returns the halfspaces of this polytope.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
pure virtual |
Returns the vertices of this polytope.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
virtual |
Returns the vertices of this 2D-polytope in clockwise order.
An Exception is thrown if the dimension of this polytope is not two.
Definition at line 160 of file Polytope.cpp.
|
pure virtual |
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
pure virtual |
Intersects this polytope with rhs and returns the result.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
pure virtual |
Returns whether this polytope is the empty set.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
virtual |
Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.
Definition at line 246 of file Polytope.cpp.
|
pure virtual |
Returns whether this polytope is universal (i.e., equals R^n).
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
pure virtual |
Returns the minkowskiSum of this polytope and rhs.
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
|
pure virtual |
Finds an optimal point inside this polytope w.r.t.
the given direction, i.e., a point that maximizes dotPorduct(point, direction). If such a point does not exist, the returned bool is false. There are two reasons for this:
Implemented in storm::storage::geometry::NativePolytope< ValueType >.
std::vector< std::shared_ptr< Polytope< ValueType > > > storm::storage::geometry::Polytope< ValueType >::setMinus | ( | std::shared_ptr< Polytope< ValueType > > const & | rhs | ) | const |
Computes the set {x \in this | x \notin rhs}.
As this set is not necessarily convex, it is represented as the union of the returned polytopes. The returned polytopes are disjoint and non-empty. If the resulting set is empty, an empty vector is returned.
Definition at line 178 of file Polytope.cpp.
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::shift | ( | Point const & | b | ) | const |
Returns the Polytope described by the set {x+b | x \in this}.
b | the transformation offset |
Definition at line 168 of file Polytope.cpp.
|
virtual |
Definition at line 235 of file Polytope.cpp.