From 652aeb75624cddc7e0b37f5edd2b13ef789dae27 Mon Sep 17 00:00:00 2001 From: Mavo Date: Fri, 11 Mar 2016 14:01:59 +0100 Subject: [PATCH] Fixed compile error with CarlRationalNumber instead of RationalNumber Former-commit-id: 0fbb4ad1c102926aaa92b1b0ce049a2953b1fef9 --- src/utility/constants.cpp | 14 ++++---- src/utility/parametric.h | 2 +- .../utility/ModelInstantiatorTest.cpp | 34 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/utility/constants.cpp b/src/utility/constants.cpp index 6b3bb296b..06c934864 100644 --- a/src/utility/constants.cpp +++ b/src/utility/constants.cpp @@ -133,13 +133,13 @@ namespace storm { } template<> - double convertNumber(RationalNumber const& number){ + double convertNumber(CarlRationalNumber const& number){ return carl::toDouble(number); } template<> - RationalNumber convertNumber(double const& number){ - return carl::rationalize(number); + CarlRationalNumber convertNumber(double const& number){ + return carl::rationalize(number); } #endif @@ -241,7 +241,7 @@ namespace storm { template RationalFunction& simplify(RationalFunction& value); template RationalFunction&& simplify(RationalFunction&& value); - /*template Polynomial one(); + template Polynomial one(); template Polynomial zero(); template bool isOne(CarlRationalNumber const& value); @@ -249,10 +249,10 @@ namespace storm { template bool isConstant(CarlRationalNumber const& value); template CarlRationalNumber one(); - template CarlRationalNumber zero();*/ + template CarlRationalNumber zero(); - template double convertNumber(RationalNumber const& number); - template RationalNumber convertNumber(double const& number); + template double convertNumber(CarlRationalNumber const& number); + template CarlRationalNumber convertNumber(double const& number); template bool isOne(Interval const& value); template bool isZero(Interval const& value); diff --git a/src/utility/parametric.h b/src/utility/parametric.h index 2ebf1e18c..ec2c9aa84 100644 --- a/src/utility/parametric.h +++ b/src/utility/parametric.h @@ -30,7 +30,7 @@ namespace storm { template<> struct VariableType { typedef storm::Variable type; }; template<> - struct CoefficientType { typedef storm::RationalNumber type; }; + struct CoefficientType { typedef storm::CarlRationalNumber type; }; #endif /*! diff --git a/test/functional/utility/ModelInstantiatorTest.cpp b/test/functional/utility/ModelInstantiatorTest.cpp index af8f5b8d2..0bf692a60 100644 --- a/test/functional/utility/ModelInstantiatorTest.cpp +++ b/test/functional/utility/ModelInstantiatorTest.cpp @@ -39,13 +39,13 @@ TEST(ModelInstantiatorTest, Brp_Prob) { EXPECT_FALSE(dtmc->hasRewardModel()); { - std::map valuation; + std::map valuation; storm::Variable const& pL = carl::VariablePool::getInstance().findVariableWithName("pL"); ASSERT_NE(pL, carl::Variable::NO_VARIABLE); storm::Variable const& pK = carl::VariablePool::getInstance().findVariableWithName("pK"); ASSERT_NE(pK, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(pL,carl::rationalize(0.8))); - valuation.insert(std::make_pair(pK,carl::rationalize(0.9))); + valuation.insert(std::make_pair(pL,carl::rationalize(0.8))); + valuation.insert(std::make_pair(pK,carl::rationalize(0.9))); storm::models::sparse::Dtmc const& instantiated(modelInstantiator.instantiate(valuation)); @@ -72,13 +72,13 @@ TEST(ModelInstantiatorTest, Brp_Prob) { } { - std::map valuation; + std::map valuation; storm::Variable const& pL = carl::VariablePool::getInstance().findVariableWithName("pL"); ASSERT_NE(pL, carl::Variable::NO_VARIABLE); storm::Variable const& pK = carl::VariablePool::getInstance().findVariableWithName("pK"); ASSERT_NE(pK, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(pL,carl::rationalize(1))); - valuation.insert(std::make_pair(pK,carl::rationalize(1))); + valuation.insert(std::make_pair(pL,carl::rationalize(1))); + valuation.insert(std::make_pair(pK,carl::rationalize(1))); storm::models::sparse::Dtmc const& instantiated(modelInstantiator.instantiate(valuation)); @@ -105,13 +105,13 @@ TEST(ModelInstantiatorTest, Brp_Prob) { } { - std::map valuation; + std::map valuation; storm::Variable const& pL = carl::VariablePool::getInstance().findVariableWithName("pL"); ASSERT_NE(pL, carl::Variable::NO_VARIABLE); storm::Variable const& pK = carl::VariablePool::getInstance().findVariableWithName("pK"); ASSERT_NE(pK, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(pL,carl::rationalize(1))); - valuation.insert(std::make_pair(pK,carl::rationalize(0.9))); + valuation.insert(std::make_pair(pL,carl::rationalize(1))); + valuation.insert(std::make_pair(pK,carl::rationalize(0.9))); storm::models::sparse::Dtmc const& instantiated(modelInstantiator.instantiate(valuation)); @@ -159,7 +159,7 @@ TEST(ModelInstantiatorTest, Brp_Rew) { storm::utility::ModelInstantiator, storm::models::sparse::Dtmc> modelInstantiator(*dtmc); { - std::map valuation; + std::map valuation; storm::Variable const& pL = carl::VariablePool::getInstance().findVariableWithName("pL"); ASSERT_NE(pL, carl::Variable::NO_VARIABLE); storm::Variable const& pK = carl::VariablePool::getInstance().findVariableWithName("pK"); @@ -168,10 +168,10 @@ TEST(ModelInstantiatorTest, Brp_Rew) { ASSERT_NE(pK, carl::Variable::NO_VARIABLE); storm::Variable const& TOAck = carl::VariablePool::getInstance().findVariableWithName("TOAck"); ASSERT_NE(pK, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(pL,carl::rationalize(0.9))); - valuation.insert(std::make_pair(pK,carl::rationalize(0.3))); - valuation.insert(std::make_pair(TOMsg,carl::rationalize(0.3))); - valuation.insert(std::make_pair(TOAck,carl::rationalize(0.5))); + valuation.insert(std::make_pair(pL,carl::rationalize(0.9))); + valuation.insert(std::make_pair(pK,carl::rationalize(0.3))); + valuation.insert(std::make_pair(TOMsg,carl::rationalize(0.3))); + valuation.insert(std::make_pair(TOAck,carl::rationalize(0.5))); storm::models::sparse::Dtmc const& instantiated(modelInstantiator.instantiate(valuation)); @@ -231,13 +231,13 @@ TEST(ModelInstantiatorTest, consensus) { storm::utility::ModelInstantiator, storm::models::sparse::Mdp> modelInstantiator(*mdp); - std::map valuation; + std::map valuation; storm::Variable const& p1 = carl::VariablePool::getInstance().findVariableWithName("p1"); ASSERT_NE(p1, carl::Variable::NO_VARIABLE); storm::Variable const& p2 = carl::VariablePool::getInstance().findVariableWithName("p2"); ASSERT_NE(p2, carl::Variable::NO_VARIABLE); - valuation.insert(std::make_pair(p1,carl::rationalize(0.51))); - valuation.insert(std::make_pair(p2,carl::rationalize(0.49))); + valuation.insert(std::make_pair(p1,carl::rationalize(0.51))); + valuation.insert(std::make_pair(p2,carl::rationalize(0.49))); storm::models::sparse::Mdp const& instantiated(modelInstantiator.instantiate(valuation)); ASSERT_EQ(mdp->getTransitionMatrix().getRowGroupIndices(), instantiated.getTransitionMatrix().getRowGroupIndices());