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 )
135 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: Implements the binary Morton code construction in nD.
void interleaveBits(const Point &aPoint, HashKey &output) const
void childrenKeys(const HashKey key, HashKey *result) const
void coordinatesFromKey(const HashKey key, Point &coordinates) const
HashKey keyFromCoordinates(const std::size_t treeDepth, const Point &coordinates) const
Aim: Implements basic operations that will be used in Point and Vector classes.
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::uint64_t uint64_t
unsigned 64-bit integer.
int main(int argc, char **argv)