From 2de8c94fd905f0201b58f8efd52dcea62af49b2d Mon Sep 17 00:00:00 2001 From: Sebastian Junges <sebastian.junges@gmail.com> Date: Sun, 24 May 2020 11:07:31 -0700 Subject: [PATCH] flatsets to string --- src/storm/storage/BoostTypes.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/storm/storage/BoostTypes.h b/src/storm/storage/BoostTypes.h index 3808f634b..7e4d27f92 100644 --- a/src/storm/storage/BoostTypes.h +++ b/src/storm/storage/BoostTypes.h @@ -2,6 +2,7 @@ #include <boost/container/flat_set.hpp> +#include <sstream> namespace storm { namespace storage { @@ -11,5 +12,26 @@ namespace storm { template<typename Key> using FlatSet = boost::container::flat_set<Key, std::less<Key>, boost::container::new_allocator<Key>>; + /*! + * Output vector as string. + * + * @param vector Vector to output. + * @return String containing the representation of the vector. + */ + template<typename ValueType> + std::string toString(FlatSet<ValueType> const& set) { + std::stringstream stream; + stream << "flatset { "; + if (!set.empty()) { + for(auto const& entry : set) { + stream << entry << " "; + } + } + stream << " }"; + return stream.str(); + } + + + } }