Browse Source

adding shift method to polytope interface

main
TimQu 7 years ago
parent
commit
80da98eec5
  1. 10
      src/storm/storage/geometry/Polytope.cpp
  2. 7
      src/storm/storage/geometry/Polytope.h

10
src/storm/storage/geometry/Polytope.cpp

@ -167,6 +167,16 @@ namespace storm {
return std::vector<Point>();
}
template <typename ValueType>
std::shared_ptr<Polytope<ValueType>> Polytope<ValueType>::shift(Point const& b) const {
// perform an affine transformation with identity matrix
std::vector<Point> idMatrix(b.size(), Point(b.size(), storm::utility::zero<ValueType>()));
for (uint64_t i = 0; i < b.size(); ++i) {
idMatrix[i][i] = storm::utility::one<ValueType>();
}
return affineTransformation(idMatrix, b);
}
template <typename ValueType>
std::shared_ptr<Polytope<ValueType>> Polytope<ValueType>::downwardClosure() const {
return createDownwardClosure(this->getVertices());

7
src/storm/storage/geometry/Polytope.h

@ -116,6 +116,13 @@ namespace storm {
*/
virtual std::shared_ptr<Polytope<ValueType>> affineTransformation(std::vector<Point> const& matrix, Point const& vector) const = 0;
/*!
* Returns the Polytope described by the set {x+b | x \in this}
*
* @param b the transformation offset
*/
std::shared_ptr<Polytope<ValueType>> shift(Point const& b) const;
/*!
* Returns the downward closure of this, i.e., the set { x | ex. y \in P : x<=y} where P is this Polytope.
*/

Loading…
Cancel
Save