From cf340bed521791cad3c5aa8e596f70487884d09b Mon Sep 17 00:00:00 2001 From: TimQu Date: Wed, 5 Apr 2017 15:18:21 +0200 Subject: [PATCH] cleaned up some utility functions --- src/storm/utility/ModelInstantiator.cpp | 4 ++-- src/storm/utility/constants.cpp | 11 ----------- src/storm/utility/parametric.cpp | 5 ----- src/storm/utility/parametric.h | 6 ------ 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/storm/utility/ModelInstantiator.cpp b/src/storm/utility/ModelInstantiator.cpp index ccbb8bda8..5403d6228 100644 --- a/src/storm/utility/ModelInstantiator.cpp +++ b/src/storm/utility/ModelInstantiator.cpp @@ -93,7 +93,7 @@ namespace storm { STORM_LOG_ASSERT(parametricEntryIt->getColumn() == constantEntryIt->getColumn(), "Entries of parametric and constant matrix are not at the same position"); if(storm::utility::isConstant(parametricEntryIt->getValue())){ //Constant entries can be inserted directly - constantEntryIt->setValue(storm::utility::convertNumber(storm::utility::parametric::getConstantPart(parametricEntryIt->getValue()))); + constantEntryIt->setValue(storm::utility::convertNumber(parametricEntryIt->getValue())); } else { //insert the new function and store that the current constantMatrix entry needs to be set to the value of this function auto functionsIt = functions.insert(std::make_pair(parametricEntryIt->getValue(), dummyValue)).first; @@ -118,7 +118,7 @@ namespace storm { while(parametricEntryIt != parametricVector.end()){ if(storm::utility::isConstant(storm::utility::simplify(*parametricEntryIt))){ //Constant entries can be inserted directly - *constantEntryIt = storm::utility::convertNumber(storm::utility::parametric::getConstantPart(*parametricEntryIt)); + *constantEntryIt = storm::utility::convertNumber(*parametricEntryIt); } else { //insert the new function and store that the current constantVector entry needs to be set to the value of this function auto functionsIt = functions.insert(std::make_pair(*parametricEntryIt, dummyValue)).first; diff --git a/src/storm/utility/constants.cpp b/src/storm/utility/constants.cpp index 17a3e00df..e4e3ee1c9 100644 --- a/src/storm/utility/constants.cpp +++ b/src/storm/utility/constants.cpp @@ -476,11 +476,6 @@ namespace storm { return a.isOne(); } - template<> - double convertNumber(RationalFunction const& number){ - return carl::toDouble(number.constantPart()); - } - template<> bool isOne(storm::Polynomial const& a) { return a.isOne(); @@ -496,12 +491,6 @@ namespace storm { return a.isZero(); } - template<> - RationalNumber convertNumber(RationalFunction const& number) { - STORM_LOG_ASSERT(isConstant(number), "Tried to convert a non-constant number to a constant type."); - return number.constantPart(); - } - template<> bool isConstant(storm::RationalFunction const& a) { return a.isConstant(); diff --git a/src/storm/utility/parametric.cpp b/src/storm/utility/parametric.cpp index c96d71d58..78bb0b880 100644 --- a/src/storm/utility/parametric.cpp +++ b/src/storm/utility/parametric.cpp @@ -22,11 +22,6 @@ namespace storm { return function.evaluate(valuation); } - template<> - typename CoefficientType::type getConstantPart(storm::RationalFunction const& function){ - return function.constantPart(); - } - template<> void gatherOccurringVariables(storm::RationalFunction const& function, std::set::type>& variableSet){ function.gatherVariables(variableSet); diff --git a/src/storm/utility/parametric.h b/src/storm/utility/parametric.h index a8967cd40..7d51bf1ee 100644 --- a/src/storm/utility/parametric.h +++ b/src/storm/utility/parametric.h @@ -36,12 +36,6 @@ namespace storm { template typename CoefficientType::type evaluate(FunctionType const& function, Valuation const& valuation); - /*! - * Retrieves the constant part of the given function. - */ - template - typename CoefficientType::type getConstantPart(FunctionType const& function); - /*! * Add all variables that occur in the given function to the the given set */