12std::pair<IntegerType, IntegerType>
findRational(IntegerType
const& alpha, IntegerType
const& beta, IntegerType
const& gamma, IntegerType
const& delta) {
16 if (alphaDivBetaPair.first == gammaDivDeltaPair.first && !
storm::utility::isZero(alphaDivBetaPair.second)) {
17 std::pair<IntegerType, IntegerType> subresult =
findRational(delta, gammaDivDeltaPair.second, beta, alphaDivBetaPair.second);
18 std::pair<IntegerType, IntegerType> result(alphaDivBetaPair.first * subresult.first + subresult.second, subresult.first);
22 std::pair<IntegerType, IntegerType> result(
23 storm::utility::isZero(alphaDivBetaPair.second) ? alphaDivBetaPair.first : alphaDivBetaPair.first + storm::utility::one<IntegerType>(),
24 storm::utility::one<IntegerType>());
53RationalType
findRational(uint64_t precision, ImpreciseType
const& value) {
56 std::pair<IntegerType, IntegerType> truncatedFraction = truncateToRational<RationalType>(value, precision);
57 std::pair<IntegerType, IntegerType> result = findRational<IntegerType>(
58 truncatedFraction.first, truncatedFraction.second, truncatedFraction.first + storm::utility::one<IntegerType>(), truncatedFraction.second);
61 return storm::utility::convertNumber<RationalType>(result.first) / result.second;
73void sharpen(uint64_t precision, std::vector<ImpreciseType>
const& input, std::vector<RationalType>& output) {
74 for (uint64_t index = 0; index < input.size(); ++index) {
75 output[index] = sharpen<RationalType, ImpreciseType>(precision, input[index]);
82template void sharpen(uint64_t precision, std::vector<double>
const& input, std::vector<storm::RationalNumber>& output);
83template void sharpen(uint64_t precision, std::vector<storm::RationalNumber>
const& input, std::vector<storm::RationalNumber>& output);