29 #ifndef GUM_RATIONAL_H 30 #define GUM_RATIONAL_H 41 typedef __int64 int64_t;
42 typedef unsigned __int64 uint64_t;
58 template <
typename GUM_SCALAR >
83 static void farey(int64_t& numerator,
85 const GUM_SCALAR& number,
86 const int64_t& den_max = 1000000L,
87 const GUM_SCALAR& zero = 1e-6);
111 int64_t& denominator,
112 const GUM_SCALAR& number,
113 const double& zero = 1e-6);
132 int64_t& denominator,
133 const GUM_SCALAR& number,
134 const int64_t& den_max = 1000000);
142 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 143 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 147 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 148 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 157 #endif // GUM_RATIONAL_H Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.