37 #include "DGtal/arithmetic/LighterSternBrocot.h"
42 using namespace DGtal;
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;
55 int main(
int argc,
char** argv )
65 typedef SB::Fraction Fraction;
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...
void usage(int, char **argv)
int main(int argc, char **argv)
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.