Browse Source

make storm compile with latest version of carl

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
c46ce03e60
  1. 6
      resources/3rdparty/sylvan/src/storm_wrapper.cpp
  2. 2
      src/storm/storage/expressions/ToRationalNumberVisitor.cpp
  3. 8
      src/storm/utility/constants.cpp

6
resources/3rdparty/sylvan/src/storm_wrapper.cpp

@ -201,8 +201,8 @@ storm_rational_number_ptr storm_rational_number_pow(storm_rational_number_ptr a,
storm::RationalNumber const& srn_a = *(storm::RationalNumber const*)a; storm::RationalNumber const& srn_a = *(storm::RationalNumber const*)a;
storm::RationalNumber const& srn_b = *(storm::RationalNumber const*)b; storm::RationalNumber const& srn_b = *(storm::RationalNumber const*)b;
uint64_t exponentAsInteger = carl::toInt<unsigned long>(srn_b);
carl::uint exponentAsInteger = carl::toInt<carl::uint>(srn_b);
storm::RationalNumber* result_srn = new storm::RationalNumber(carl::pow(srn_a, exponentAsInteger)); storm::RationalNumber* result_srn = new storm::RationalNumber(carl::pow(srn_a, exponentAsInteger));
return (storm_rational_number_ptr)result_srn; return (storm_rational_number_ptr)result_srn;
} }
@ -515,7 +515,7 @@ storm_rational_function_ptr storm_rational_function_pow(storm_rational_function_
storm::RationalFunction const& srf_a = *(storm::RationalFunction const*)a; storm::RationalFunction const& srf_a = *(storm::RationalFunction const*)a;
storm::RationalFunction const& srf_b = *(storm::RationalFunction const*)b; storm::RationalFunction const& srf_b = *(storm::RationalFunction const*)b;
uint64_t exponentAsInteger = carl::toInt<unsigned long>(srf_b.nominatorAsNumber());
carl::uint exponentAsInteger = carl::toInt<carl::uint>(srf_b.nominatorAsNumber());
storm::RationalFunction* result_srf = new storm::RationalFunction(carl::pow(srf_a, exponentAsInteger)); storm::RationalFunction* result_srf = new storm::RationalFunction(carl::pow(srf_a, exponentAsInteger));
return (storm_rational_function_ptr)result_srf; return (storm_rational_function_ptr)result_srf;
} }

2
src/storm/storage/expressions/ToRationalNumberVisitor.cpp

@ -75,7 +75,7 @@ namespace storm {
break; break;
case BinaryNumericalFunctionExpression::OperatorType::Power: case BinaryNumericalFunctionExpression::OperatorType::Power:
STORM_LOG_THROW(storm::utility::isInteger(secondOperandAsRationalNumber), storm::exceptions::InvalidArgumentException, "Exponent of power operator must be a positive integer."); STORM_LOG_THROW(storm::utility::isInteger(secondOperandAsRationalNumber), storm::exceptions::InvalidArgumentException, "Exponent of power operator must be a positive integer.");
uint_fast64_t exponentAsInteger = storm::utility::convertNumber<uint_fast64_t>(secondOperandAsRationalNumber);
uint_fast64_t exponentAsInteger = storm::utility::convertNumber<carl::uint>(secondOperandAsRationalNumber);
result = storm::utility::pow(firstOperandAsRationalNumber, exponentAsInteger); result = storm::utility::pow(firstOperandAsRationalNumber, exponentAsInteger);
return result; return result;
break; break;

8
src/storm/utility/constants.cpp

@ -256,7 +256,7 @@ namespace storm {
template<> template<>
uint_fast64_t convertNumber(ClnRationalNumber const& number) { uint_fast64_t convertNumber(ClnRationalNumber const& number) {
return carl::toInt<unsigned long>(number);
return carl::toInt<carl::uint>(number);
} }
template<> template<>
@ -386,7 +386,7 @@ namespace storm {
template<> template<>
uint_fast64_t convertNumber(GmpRationalNumber const& number){ uint_fast64_t convertNumber(GmpRationalNumber const& number){
return carl::toInt<unsigned long>(number);
return carl::toInt<carl::uint>(number);
} }
template<> template<>
@ -549,8 +549,8 @@ namespace storm {
#endif #endif
template<> template<>
uint_fast64_t convertNumber(RationalFunction const& func) {
return carl::toInt<unsigned long>(convertNumber<RationalFunctionCoefficient>(func));
carl::uint convertNumber(RationalFunction const& func) {
return carl::toInt<carl::uint>(convertNumber<RationalFunctionCoefficient>(func));
} }
template<> template<>

Loading…
Cancel
Save