Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RationalNumberForward.h
Go to the documentation of this file.
1#pragma once
2
3#include "storm-config.h"
4
5#if defined(STORM_HAVE_GMP)
6// The small gmp.h header is always included.
7#include <gmp.h>
8template<typename U, typename V>
9class __gmp_expr; // NOLINT(bugprone-reserved-identifier)
10#endif
11
12#if defined(STORM_HAVE_CLN)
13namespace cln {
14class cl_RA;
15class cl_I;
16} // namespace cln
17#endif
18
19namespace storm {
20#if defined(STORM_HAVE_CLN)
21typedef cln::cl_RA ClnRationalNumber;
22typedef cln::cl_I ClnIntegerNumber;
23#endif
24#if defined(STORM_HAVE_GMP)
25// Silence clang-tidy warnings. We cannot use the typedefs here, because they are only defined in gmpxx.h
26// NOLINTBEGIN(bugprone-reserved-identifier)
27typedef __gmp_expr<mpq_t, mpq_t> GmpRationalNumber; // corresponds to mpq_class
28typedef __gmp_expr<mpz_t, mpz_t> GmpIntegerNumber; // corresponds to mpz_class
29// NOLINTEND(bugprone-reserved-identifier)
30#endif
31
32#if defined(STORM_HAVE_CLN) && defined(STORM_USE_CLN_EA)
33typedef ClnRationalNumber RationalNumber;
34static constexpr bool RationalNumberDenominatorAlwaysPositive = true; // See https://www.ginac.de/CLN/cln.html#Exact-numbers
35#elif defined(STORM_HAVE_GMP) && !defined(STORM_USE_CLN_EA)
36typedef GmpRationalNumber RationalNumber;
37static constexpr bool RationalNumberDenominatorAlwaysPositive = true; // See https://gmplib.org/manual/Rational-Number-Functions
38#elif defined(STORM_USE_CLN_EA)
39#error CLN is to be used, but is not available.
40#else
41#error GMP is to be used, but is not available.
42#endif
43} // namespace storm