37#include "DGtal/arithmetic/LighterSternBrocot.h"
46void usage(
int,
char** argv )
48 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <p> <q>" << std::endl;
49 std::cerr <<
"\t - computes the successive convergent of the fraction p / q." << std::endl;
55int main(
int argc,
char** argv )
65 typedef SB::Fraction Fraction;
67 typedef Fraction::Value
Value;
83 std::cout << ( ( it == itbegin ) ?
"[" :
"," )
86 std::cout <<
"]" << std::endl;
94 std::cout <<
"z_" << u.second <<
" = ";
96 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...
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.