diff --git a/src/storm/storage/geometry/Polytope.cpp b/src/storm/storage/geometry/Polytope.cpp index e7befab70..756abbfd0 100644 --- a/src/storm/storage/geometry/Polytope.cpp +++ b/src/storm/storage/geometry/Polytope.cpp @@ -167,6 +167,16 @@ namespace storm { return std::vector(); } + template + std::shared_ptr> Polytope::shift(Point const& b) const { + // perform an affine transformation with identity matrix + std::vector idMatrix(b.size(), Point(b.size(), storm::utility::zero())); + for (uint64_t i = 0; i < b.size(); ++i) { + idMatrix[i][i] = storm::utility::one(); + } + return affineTransformation(idMatrix, b); + } + template std::shared_ptr> Polytope::downwardClosure() const { return createDownwardClosure(this->getVertices()); diff --git a/src/storm/storage/geometry/Polytope.h b/src/storm/storage/geometry/Polytope.h index 06b6f26ae..5d7ff858a 100644 --- a/src/storm/storage/geometry/Polytope.h +++ b/src/storm/storage/geometry/Polytope.h @@ -116,6 +116,13 @@ namespace storm { */ virtual std::shared_ptr> affineTransformation(std::vector 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> 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. */