27 #ifndef GUM_RATIONAL_H 28 #define GUM_RATIONAL_H 39 typedef __int64 int64_t;
40 typedef unsigned __int64 uint64_t;
56 template <
typename GUM_SCALAR >
81 static void farey(int64_t& numerator,
83 const GUM_SCALAR& number,
84 const int64_t& den_max = 1000000L,
85 const GUM_SCALAR& zero = 1e-6);
109 int64_t& denominator,
110 const GUM_SCALAR& number,
111 const double& zero = 1e-6);
130 int64_t& denominator,
131 const GUM_SCALAR& number,
132 const int64_t& den_max = 1000000);
140 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 141 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 145 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 146 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 155 #endif // GUM_RATIONAL_H
gum is the global namespace for all aGrUM entities
static void continuedFracBest(int64_t &numerator, int64_t &denominator, const GUM_SCALAR &number, const int64_t &den_max=1000000)
Find the best rational approximation.
Class template used to approximate decimal numbers by rationals.
static void farey(int64_t &numerator, int64_t &denominator, const GUM_SCALAR &number, const int64_t &den_max=1000000L, const GUM_SCALAR &zero=1e-6)
Find the rational close enough to a given ( decimal ) number in [-1,1] and whose denominator is not h...
static void continuedFracFirst(int64_t &numerator, int64_t &denominator, const GUM_SCALAR &number, const double &zero=1e-6)
Find the first best rational approximation.
Class template used to approximate decimal numbers by rationals.