#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include "DGtal/arithmetic/LighterSternBrocot.h"
#include "DGtal/arithmetic/Pattern.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 pattern.
This file is part of the DGtal library.
Definition in file pattern.cpp.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Main.
[pattern-types]
[pattern-types]
[pattern-instantiation]
[pattern-instantiation]
[pattern-process]
[pattern-process]
Definition at line 59 of file pattern.cpp.
71 typedef SB::Fraction Fraction;
78 MyPattern pattern( p, q );
82 bool sub = ( argc > 3 ) && ( std::string( argv[ 3 ] ) ==
"SUB" );
83 std::cout << ( ! sub ? pattern.rE() : pattern.rEs(
"(|)" ) ) << std::endl;
Aim: The Stern-Brocot tree is the tree of irreducible fractions. This class allows to construct it pr...
Point::Coordinate Integer
boost::int32_t int32_t
signed 32-bit integer.
void usage(int, char **argv)
References usage().
◆ usage()
void usage |
( |
int |
, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 49 of file pattern.cpp.
51 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <p> <q> [SUB]" << std::endl;
52 std::cerr <<
"\t - computes the pattern of slope p / q and displays it." << std::endl;
53 std::cerr <<
"\t - the optional [SUB] parameter displays the pattern with its recursive Berstel decomposition." << std::endl;
Referenced by main().