Browse Source

Added utility function for rounding.

tempestpy_adaptions
Tim Quatmann 6 years ago
parent
commit
a34037bff4
  1. 17
      src/storm/utility/constants.cpp
  2. 3
      src/storm/utility/constants.h

17
src/storm/utility/constants.cpp

@ -256,6 +256,11 @@ namespace storm {
return std::ceil(number);
}
template<typename ValueType>
ValueType round(ValueType const& number) {
return std::round(number);
}
template<typename ValueType>
ValueType log(ValueType const& number) {
return std::log(number);
@ -417,6 +422,11 @@ namespace storm {
return carl::ceil(number);
}
template<>
ClnRationalNumber round(storm::ClnRationalNumber const& number) {
return carl::round(number);
}
template<>
ClnRationalNumber log(ClnRationalNumber const& number) {
return carl::log(number);
@ -610,6 +620,11 @@ namespace storm {
return carl::ceil(number);
}
template<>
GmpRationalNumber round(storm::GmpRationalNumber const& number) {
return carl::round(number);
}
template<>
GmpRationalNumber log(GmpRationalNumber const& number) {
return carl::log(number);
@ -886,6 +901,7 @@ namespace storm {
template double abs(double const& number);
template double floor(double const& number);
template double ceil(double const& number);
template double round(double const& number);
template double log(double const& number);
template double log10(double const& number);
template typename NumberTraits<double>::IntegerType trunc(double const& number);
@ -918,6 +934,7 @@ namespace storm {
template float abs(float const& number);
template float floor(float const& number);
template float ceil(float const& number);
template float round(float const& number);
template float log(float const& number);
template std::string to_string(float const& value);

3
src/storm/utility/constants.h

@ -155,6 +155,9 @@ namespace storm {
template<typename ValueType>
ValueType ceil(ValueType const& number);
template<typename ValueType>
ValueType round(ValueType const& number);
template<typename ValueType>
ValueType log(ValueType const& number);

Loading…
Cancel
Save