Browse Source

Compatibility with recent hypro version

Former-commit-id: d5d9e12b47
tempestpy_adaptions
TimQu 8 years ago
parent
commit
80d9e6bb4e
  1. 8
      src/adapters/HyproAdapter.h
  2. 2
      src/modelchecker/multiobjective/helper/SparseMultiObjectivePostprocessor.cpp
  3. 6
      src/storage/geometry/HyproPolytope.cpp
  4. 4
      src/storage/geometry/HyproPolytope.h
  5. 2
      src/storage/geometry/Polytope.cpp
  6. 4
      src/storage/geometry/Polytope.h

8
src/adapters/HyproAdapter.h

@ -6,10 +6,10 @@
#ifdef STORM_HAVE_HYPRO
#include <lib/datastructures/Halfspace.h>
#include <lib/typedefs.h>
#include <lib/representations/conversion/Converter.h>
#include <lib/representations/Polytopes/HPolytope/HPolytope.h>
#include <hypro/datastructures/Halfspace.h>
#include <hypro/types.h>
#include <hypro/representations/GeometricObject.h>
#include <hypro/representations/Polytopes/HPolytope/HPolytope.h>
#include "src/adapters/CarlAdapter.h"
#include "src/storage/geometry/HalfSpace.h"

2
src/modelchecker/multiobjective/helper/SparseMultiObjectivePostprocessor.cpp

@ -207,7 +207,7 @@ namespace storm {
transformationMatrix[objIndex][objIndex] = storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[objIndex].toOriginalValueTransformationFactor);
transformationVector.push_back(storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[objIndex].toOriginalValueTransformationOffset));
}
return polytope->linearTransformation(transformationMatrix, transformationVector);
return polytope->affineTransformation(transformationMatrix, transformationVector);
}

6
src/storage/geometry/HyproPolytope.cpp

@ -145,13 +145,13 @@ namespace storm {
}
template <typename ValueType>
std::shared_ptr<Polytope<ValueType>> HyproPolytope<ValueType>::linearTransformation(std::vector<Point> const& matrix, Point const& vector) const{
STORM_LOG_THROW(!matrix.empty(), storm::exceptions::InvalidArgumentException, "Invoked linear transformation with a matrix without rows.");
std::shared_ptr<Polytope<ValueType>> HyproPolytope<ValueType>::affineTransformation(std::vector<Point> const& matrix, Point const& vector) const{
STORM_LOG_THROW(!matrix.empty(), storm::exceptions::InvalidArgumentException, "Invoked affine transformation with a matrix without rows.");
hypro::matrix_t<ValueType> hyproMatrix(matrix.size(), matrix.front().size());
for(uint_fast64_t row = 0; row < matrix.size(); ++row) {
hyproMatrix.row(row) = storm::adapters::toHypro(matrix[row]);
}
return std::make_shared<HyproPolytope<ValueType>>(internPolytope.linearTransformation(std::move(hyproMatrix), storm::adapters::toHypro(vector)));
return std::make_shared<HyproPolytope<ValueType>>(internPolytope.affineTransformation(std::move(hyproMatrix), storm::adapters::toHypro(vector)));
}
template <typename ValueType>

4
src/storage/geometry/HyproPolytope.h

@ -98,13 +98,13 @@ namespace storm {
virtual std::shared_ptr<Polytope<ValueType>> minkowskiSum(std::shared_ptr<Polytope<ValueType>> const& rhs) const override;
/*!
* Returns the linear transformation of this polytope P w.r.t. the given matrix A and vector b.
* 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}
*
* @param matrix the transformation matrix, given as vector of rows
* @param vector the transformation offset
*/
virtual std::shared_ptr<Polytope<ValueType>> linearTransformation(std::vector<Point> const& matrix, Point const& vector) const override;
virtual std::shared_ptr<Polytope<ValueType>> affineTransformation(std::vector<Point> const& matrix, Point const& vector) const override;
/*!
* Finds an optimal point inside this polytope w.r.t. the given direction, i.e.,

2
src/storage/geometry/Polytope.cpp

@ -216,7 +216,7 @@ namespace storm {
}
template <typename ValueType>
std::shared_ptr<Polytope<ValueType>> Polytope<ValueType>::linearTransformation(std::vector<Point> const& matrix, Point const& vector) const {
std::shared_ptr<Polytope<ValueType>> Polytope<ValueType>::affineTransformation(std::vector<Point> const& matrix, Point const& vector) const {
STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Functionality not implemented.");
return nullptr;
}

4
src/storage/geometry/Polytope.h

@ -100,13 +100,13 @@ namespace storm {
virtual std::shared_ptr<Polytope<ValueType>> minkowskiSum(std::shared_ptr<Polytope<ValueType>> const& rhs) const;
/*!
* Returns the linear transformation of this polytope P w.r.t. the given matrix A and vector b.
* 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}
*
* @param matrix the transformation matrix, given as vector of rows
* @param vector the transformation offset
*/
virtual std::shared_ptr<Polytope<ValueType>> linearTransformation(std::vector<Point> const& matrix, Point const& vector) const;
virtual std::shared_ptr<Polytope<ValueType>> affineTransformation(std::vector<Point> const& matrix, Point const& vector) 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