15std::pair<IntegerType, IntegerType>
findRational(IntegerType
const& alpha, IntegerType
const& beta, IntegerType
const& gamma, IntegerType
const& delta) {
19 if (alphaDivBetaPair.first == gammaDivDeltaPair.first && !
storm::utility::isZero(alphaDivBetaPair.second)) {
20 std::pair<IntegerType, IntegerType> subresult =
findRational(delta, gammaDivDeltaPair.second, beta, alphaDivBetaPair.second);
21 std::pair<IntegerType, IntegerType> result(alphaDivBetaPair.first * subresult.first + subresult.second, subresult.first);
25 std::pair<IntegerType, IntegerType> result(
26 storm::utility::isZero(alphaDivBetaPair.second) ? alphaDivBetaPair.first : alphaDivBetaPair.first + storm::utility::one<IntegerType>(),
27 storm::utility::one<IntegerType>());
56RationalType
findRational(uint64_t precision, ImpreciseType
const& value) {
59 std::pair<IntegerType, IntegerType> truncatedFraction = truncateToRational<RationalType>(value, precision);
60 std::pair<IntegerType, IntegerType> result = findRational<IntegerType>(
61 truncatedFraction.first, truncatedFraction.second, truncatedFraction.first + storm::utility::one<IntegerType>(), truncatedFraction.second);
64 return storm::utility::convertNumber<RationalType>(result.first) / result.second;
76void sharpen(uint64_t precision, std::vector<ImpreciseType>
const& input, std::vector<RationalType>& output) {
77 for (uint64_t index = 0; index < input.size(); ++index) {
78 output[index] = sharpen<RationalType, ImpreciseType>(precision, input[index]);
85template void sharpen(uint64_t precision, std::vector<double>
const& input, std::vector<storm::RationalNumber>& output);
86template void sharpen(uint64_t precision, std::vector<storm::RationalNumber>
const& input, std::vector<storm::RationalNumber>& output);