/* * File: HyperplaneEnumeration.h * Author: tim quatmann * Author: phillip florian * * Created on December 27, 2015, 1:06 PM */ #pragma once #include "../macros.h" #include "../../../datastructures/Hyperplane.h" #include "../../../datastructures/Point.h" namespace hypro{ namespace pterm{ template< typename Number> class HyperplaneEnumeration { public: HyperplaneEnumeration() = default; virtual ~HyperplaneEnumeration() = default; /* * Generates the vertices of the given polytope by enumerating all intersection points generated by subsets of hyperplanes of size hPoly.dimension(). * If the given flag is true, this method will also compute * * the minimal set of hyperplanes which represent the given hPoly (can be used to remove redundant hyperplanes), and * * for each hyperplane, the set of (non-redundant) vertices that lie on that hyperplane. * * Use the provided getter methods to retrieve the results * * @return true iff conversion was successful. */ bool generateVerticesFromHalfspaces(PTermHPolytope const& hPoly, bool generateRelevantHyperplanesAndVertexSets); std::vector>& getResultVertices(); /*! * Returns the set of halfspaces which are not redundant * @note the returned matrix and vector are empty if the corresponding flag was false */ hypro::matrix_t& getRelevantMatrix(); hypro::vector_t& getRelevantVector(); /*! * Returns for each hyperplane the set of vertices that lie on that hyperplane. * A vertex is given as an index in the relevantVertices vector. * @note the returned vector is empty if the corresponding flag was false */ std::vector>& getVertexSets(); /* * Returns true if the hyperplanes with indices of subset and item are all linear independent * Note that this is also used by the hybrid polytope. */ static bool linearDependenciesFilter(std::vector const& subset, std::size_t const& item, hypro::matrix_t const& A); private: std::vector> mResultVertices; hypro::matrix_t mRelevantMatrix; hypro::vector_t mRelevantVector; std::vector> mVertexSets; }; } } #include "HyperplaneEnumeration.tpp"