Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::storage::geometry::Polytope< ValueType > Class Template Referenceabstract

#include <Polytope.h>

Inheritance diagram for storm::storage::geometry::Polytope< ValueType >:

Public Types

typedef std::vector< ValueType > Point
 

Public Member Functions

virtual ~Polytope ()
 
virtual std::vector< PointgetVertices () const =0
 Returns the vertices of this polytope.
 
virtual std::vector< PointgetVerticesInClockwiseOrder () 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::VariabledeclareVariables (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::ExpressiongetConstraints (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 ()
 

Detailed Description

template<typename ValueType>
class storm::storage::geometry::Polytope< ValueType >

Definition at line 17 of file Polytope.h.

Member Typedef Documentation

◆ Point

template<typename ValueType >
typedef std::vector<ValueType> storm::storage::geometry::Polytope< ValueType >::Point

Definition at line 19 of file Polytope.h.

Constructor & Destructor Documentation

◆ ~Polytope()

template<typename ValueType >
storm::storage::geometry::Polytope< ValueType >::~Polytope ( )
virtual

Definition at line 97 of file Polytope.cpp.

◆ Polytope()

template<typename ValueType >
storm::storage::geometry::Polytope< ValueType >::Polytope ( )
protected

Definition at line 92 of file Polytope.cpp.

Member Function Documentation

◆ affineTransformation()

template<typename ValueType >
virtual std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::affineTransformation ( std::vector< Point > const &  matrix,
Point const &  vector 
) const
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}

Parameters
matrixthe transformation matrix, given as vector of rows
vectorthe transformation offset

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ clean()

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::clean ( )
virtual

Performs cleaning operations, e.g., deleting redundant halfspaces.

Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.

Definition at line 251 of file Polytope.cpp.

◆ contains() [1/2]

template<typename ValueType >
virtual bool storm::storage::geometry::Polytope< ValueType >::contains ( Point const &  point) const
pure virtual

Returns true iff the given point is inside of the polytope.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ contains() [2/2]

template<typename ValueType >
virtual bool storm::storage::geometry::Polytope< ValueType >::contains ( std::shared_ptr< Polytope< ValueType > > const &  other) const
pure virtual

Returns true iff the given polytope is a subset of this polytope.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ convertNumberRepresentation()

template<typename ValueType >
template<typename TargetType >
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.

◆ convexUnion()

template<typename ValueType >
virtual std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::convexUnion ( std::shared_ptr< Polytope< ValueType > > const &  rhs) const
pure virtual

Returns the convex union of this polytope and rhs.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ create() [1/2]

template<typename ValueType >
static std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::create ( std::vector< Halfspace< ValueType > > const &  halfspaces)
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).

◆ create() [2/2]

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::create ( std::vector< Point > const &  points)
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.

◆ createDownwardClosure()

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::createDownwardClosure ( std::vector< Point > const &  points)
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.

◆ createEmptyPolytope()

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::createEmptyPolytope ( )
static

Creates the empty polytope (i.e., emptyset)

Definition at line 32 of file Polytope.cpp.

◆ createSelectiveDownwardClosure()

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::createSelectiveDownwardClosure ( std::vector< Point > const &  points,
storm::storage::BitVector const &  selectedDimensions 
)
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.

◆ createUniversalPolytope()

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::createUniversalPolytope ( )
static

Creates the universal polytope (i.e., the set R^n)

Definition at line 27 of file Polytope.cpp.

◆ declareVariables()

template<typename ValueType >
std::vector< storm::expressions::Variable > storm::storage::geometry::Polytope< ValueType >::declareVariables ( storm::expressions::ExpressionManager manager,
std::string const &  namePrefix 
) const
virtual

Declares one variable for each dimension and returns the obtained variables.

Parameters
managerThe expression manager that keeps track of the variables
namePrefixThe prefix that is prepanded to the variable index

Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.

Definition at line 202 of file Polytope.cpp.

◆ downwardClosure()

template<typename ValueType >
std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::downwardClosure ( ) const
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.

◆ getConstraints()

template<typename ValueType >
std::vector< storm::expressions::Expression > storm::storage::geometry::Polytope< ValueType >::getConstraints ( storm::expressions::ExpressionManager const &  manager,
std::vector< storm::expressions::Variable > const &  variables 
) const
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.

◆ getHalfspaces()

template<typename ValueType >
virtual std::vector< Halfspace< ValueType > > storm::storage::geometry::Polytope< ValueType >::getHalfspaces ( ) const
pure virtual

Returns the halfspaces of this polytope.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ getVertices()

template<typename ValueType >
virtual std::vector< Point > storm::storage::geometry::Polytope< ValueType >::getVertices ( ) const
pure virtual

Returns the vertices of this polytope.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ getVerticesInClockwiseOrder()

template<typename ValueType >
std::vector< typename Polytope< ValueType >::Point > storm::storage::geometry::Polytope< ValueType >::getVerticesInClockwiseOrder ( ) const
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.

◆ intersection() [1/2]

template<typename ValueType >
virtual std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::intersection ( Halfspace< ValueType > const &  halfspace) const
pure virtual

◆ intersection() [2/2]

template<typename ValueType >
virtual std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::intersection ( std::shared_ptr< Polytope< ValueType > > const &  rhs) const
pure virtual

Intersects this polytope with rhs and returns the result.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ isEmpty()

template<typename ValueType >
virtual bool storm::storage::geometry::Polytope< ValueType >::isEmpty ( ) const
pure virtual

Returns whether this polytope is the empty set.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ isNativePolytope()

template<typename ValueType >
bool storm::storage::geometry::Polytope< ValueType >::isNativePolytope ( ) const
virtual

Reimplemented in storm::storage::geometry::NativePolytope< ValueType >.

Definition at line 246 of file Polytope.cpp.

◆ isUniversal()

template<typename ValueType >
virtual bool storm::storage::geometry::Polytope< ValueType >::isUniversal ( ) const
pure virtual

Returns whether this polytope is universal (i.e., equals R^n).

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ minkowskiSum()

template<typename ValueType >
virtual std::shared_ptr< Polytope< ValueType > > storm::storage::geometry::Polytope< ValueType >::minkowskiSum ( std::shared_ptr< Polytope< ValueType > > const &  rhs) const
pure virtual

Returns the minkowskiSum of this polytope and rhs.

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ optimize()

template<typename ValueType >
virtual std::pair< Point, bool > storm::storage::geometry::Polytope< ValueType >::optimize ( Point const &  direction) const
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:

  • The polytope is empty
  • The polytope is not bounded in the given direction

Implemented in storm::storage::geometry::NativePolytope< ValueType >.

◆ setMinus()

template<typename 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.

◆ shift()

template<typename ValueType >
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}.

Parameters
bthe transformation offset

Definition at line 168 of file Polytope.cpp.

◆ toString()

template<typename ValueType >
std::string storm::storage::geometry::Polytope< ValueType >::toString ( bool  numbersAsDouble = false) const
virtual

Definition at line 235 of file Polytope.cpp.


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