32#include "DGtal/base/Common.h"
34#include "DGtal/geometry/curves/ArithmeticalDSLKernel.h"
53template <
typename Coordinate,
typename Integer,
unsigned short adj>
56 unsigned int nbok = 0;
64 trace.
info() <<
" step1: " << steps.first << std::endl;
65 trace.
info() <<
" step2: " << steps.second << std::endl;
70 trace.
info() <<
" shift: " << shift << std::endl;
72 if ( (steps.first - steps.second) == shift )
76 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
93template <
typename Coordinate,
typename Integer,
unsigned short adj>
96 unsigned int nbok = 0;
101 trace.
info() <<
" a " << a <<
" b " << b << std::endl;
106 trace.
info() <<
" step1: " << steps.first << std::endl;
107 trace.
info() <<
" step2: " << steps.second << std::endl;
113 trace.
info() <<
" shift: " << shift << std::endl;
115 if ( (a == 0) && (b == 0) )
117 if ( (steps.first ==
Vector(0,0))
118 && (steps.second ==
Vector(0,0))
119 && (shift ==
Vector(0,0)))
125 if ( (a == 0)||(b == 0) )
127 if ( (steps.first !=
Vector(0,0))
128 && (steps.second ==
Vector(0,0))
129 && (shift !=
Vector(0,0)))
136 &&( (a == b)||(a == -b) ) )
138 if ( (steps.first !=
Vector(0,0))
139 && (steps.second ==
Vector(0,0))
140 && (shift !=
Vector(0,0)) )
146 if ( (steps.first !=
Vector(0,0))
147 && (steps.second !=
Vector(0,0))
148 && (shift !=
Vector(0,0)) )
154 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
166int main(
int argc,
char** argv )
170 for (
int i = 0; i < argc; ++i )
229#ifdef WITH_BIGINTEGER
236 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
DigitalPlane::Point Vector
Point::Coordinate Integer
DGtal is the top-level namespace which contains all DGtal functions and types.
static Vector shift(const TInteger &a, const TInteger &b)
std::pair< Vector, Vector > Steps
static Steps steps(const TInteger &a, const TInteger &b)
bool specialCases(const Integer &a, const Integer &b)
bool test(const Integer &a, const Integer &b)