From 9d3de84122f5b23d6b7fa3d06b87218934a41f7a Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Fri, 31 Jul 2020 16:24:15 +0200 Subject: [PATCH] MaximalEndComponent: Added size() method. --- src/storm/storage/MaximalEndComponent.cpp | 4 ++++ src/storm/storage/MaximalEndComponent.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/storm/storage/MaximalEndComponent.cpp b/src/storm/storage/MaximalEndComponent.cpp index d6e080583..68e8eda99 100644 --- a/src/storm/storage/MaximalEndComponent.cpp +++ b/src/storm/storage/MaximalEndComponent.cpp @@ -36,6 +36,10 @@ namespace storm { stateToChoicesMapping.emplace(state, std::move(choices)); } + std::size_t MaximalEndComponent::size() const { + return stateToChoicesMapping.size(); + } + MaximalEndComponent::set_type const& MaximalEndComponent::getChoicesForState(uint_fast64_t state) const { auto stateChoicePair = stateToChoicesMapping.find(state); diff --git a/src/storm/storage/MaximalEndComponent.h b/src/storm/storage/MaximalEndComponent.h index c46a4c0d6..b40da6455 100644 --- a/src/storm/storage/MaximalEndComponent.h +++ b/src/storm/storage/MaximalEndComponent.h @@ -68,6 +68,11 @@ namespace storm { */ void addState(uint_fast64_t state, set_type&& choices); + /*! + * @return The number of states in this mec. + */ + std::size_t size() const; + /*! * Retrieves the choices for the given state that are contained in this MEC under the assumption that the * state is in the MEC.