From a63cda69f56f4586e5b7ec10ce3599d85a14042a Mon Sep 17 00:00:00 2001 From: dehnert Date: Sun, 23 Mar 2014 13:09:36 +0100 Subject: [PATCH] Added function to retrieve range DD for meta variable. Former-commit-id: 32ef6715f429172331027fd8b9919e0934a0fa1e --- src/storage/dd/CuddDdManager.cpp | 10 ++++++++++ src/storage/dd/CuddDdManager.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/storage/dd/CuddDdManager.cpp b/src/storage/dd/CuddDdManager.cpp index cce1edbfe..15f51a3b7 100644 --- a/src/storage/dd/CuddDdManager.cpp +++ b/src/storage/dd/CuddDdManager.cpp @@ -39,6 +39,16 @@ namespace storm { return result; } + + Dd DdManager::getRange(std::string const metaVariableName) { + storm::dd::DdMetaVariable const& metaVariable = this->getMetaVariable(metaVariableName); + + Dd result = this->getZero(); + for (int_fast64_t value = metaVariable.getLow(); value <= metaVariable.getHigh(); ++value) { + result.setValue(metaVariableName, value - metaVariable.getLow(), static_cast(value)); + } + return result; + } void DdManager::addMetaVariable(std::string const& name, int_fast64_t low, int_fast64_t high) { if (high == low) { diff --git a/src/storage/dd/CuddDdManager.h b/src/storage/dd/CuddDdManager.h index 1d061b504..b826cce35 100644 --- a/src/storage/dd/CuddDdManager.h +++ b/src/storage/dd/CuddDdManager.h @@ -62,6 +62,15 @@ namespace storm { */ Dd getEncoding(std::string const& metaVariableName, int_fast64_t value); + /*! + * Retrieves the DD representing the range of the meta variable, i.e., a function that maps all legal values + * of the range of the meta variable to one. + * + * @param metaVariableName The name of the meta variable whose range to retrieve. + * @return The range of the meta variable + */ + Dd getRange(std::string const metaVariableName); + /*! * Adds a meta variable with the given name and range. *