43 #include "DGtal/arithmetic/LighterSternBrocot.h"
48 using namespace DGtal;
54 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <p> <q>" << std::endl;
55 std::cerr <<
"\t - computes the successive convergent of the fraction p / q." << std::endl;
61 int main(
int argc,
char** argv )
68 std::string inputP = argv[ 1 ];
69 std::string inputQ = argv[ 2 ];
75 typedef SB::Fraction Fraction;
93 std::cout << ( ( it == itbegin ) ?
"[" :
"," )
96 std::cout <<
"]" << std::endl;
104 std::cout <<
"z_" << u.second <<
" = ";
106 std::cout << g.p() <<
" / " << g.q() << std::endl;
Aim: The Stern-Brocot tree is the tree of irreducible fractions. This class allows to construct it pr...
void usage(int, char **argv)
int main(int argc, char **argv)
Point::Coordinate Integer
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::int64_t int64_t
signed 94-bit integer.
mpz_class BigInteger
Multi-precision integer with GMP implementation.