32 #include "DGtal/base/Common.h"
33 #include "DGtal/kernel/PointVector.h"
34 #include "DGtal/images/Morton.h"
35 #include "DGtal/base/Bits.h"
40 using namespace DGtal;
51 unsigned int nbok = 0;
68 trace.
info() << p << h <<
" = "<< Bits::bitString( h )<<endl;
70 nbok += (h == 0) ? 1 : 0;
74 trace.
info() <<
"Point from code= "<<pbis<<endl;
75 nbok += (p == pbis) ? 1 : 0;
82 trace.
info() << p2<<
" "<< h <<
" = "<< Bits::bitString( h )<<endl;
84 nbok += (h == 14) ? 1 : 0;
88 trace.
info() <<
"Point from code= "<<pbis<<endl;
89 nbok += (p2 == pbis) ? 1 : 0;
95 for(
unsigned int k=0; k<4;k++)
96 trace.
info()<<
"child["<<k<<
"]= "<<children[k]<<
" "<< Bits::bitString( children[k])<<endl;
103 for(
unsigned int k=0; k < 1000000 ;k++)
113 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
114 <<
"true == true" << std::endl;
126 int main(
int argc,
char** argv )
130 for (
int i = 0; i < argc; ++i )
134 bool res = testMorton();
135 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;