#include <iostream>
#include "DGtal/arithmetic/LighterSternBrocot.h"
Go to the source code of this file.
|
void | usage (int, char **argv) |
|
int | main (int argc, char **argv) |
|
- Author
- Jacques-Olivier Lachaud (
jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr
) Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France
- Date
- 2012/02/06
An example file named convergents.
This file is part of the DGtal library.
Definition in file convergents.cpp.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Main.
[convergents-types]
[convergents-types]
[convergents-instantiation]
[convergents-instantiation]
[convergents-cfrac]
[convergents-cfrac]
[convergents-convergents]
[convergents-convergents]
Definition at line 55 of file convergents.cpp.
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)
MyDigitalSurface::ConstIterator ConstIterator
boost::int64_t int64_t
signed 94-bit integer.
References usage().
◆ usage()
void usage |
( |
int |
, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 46 of file convergents.cpp.
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;
Referenced by main().