32 #include "DGtal/base/Common.h"
33 #include "DGtal/io/boards/Board2D.h"
34 #include "DGtal/kernel/SpaceND.h"
35 #include "DGtal/geometry/curves/ArithmeticalDSS.h"
36 #include "DGtal/geometry/curves/FreemanChain.h"
37 #include "DGtal/geometry/curves/GreedySegmentation.h"
38 #include "DGtal/kernel/domains/HyperRectDomain.h"
39 #include "DGtal/images/ImageContainerBySTLVector.h"
44 using namespace DGtal;
53 bool testDGtalBIGINTEGER()
55 unsigned int nbok = 0;
60 DGtal::BigInteger a, b, c;
68 nbok += (
abs(c)==4444) ? 1 : 0;
70 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
71 <<
"true == true" << std::endl;
82 bool testBIGINTEGERSpace()
84 unsigned int nbok = 0;
91 typedef Space2::Point
Point;
92 typedef Space2::Point::Coordinate Coordinate;
95 DGtal::BigInteger a, b, c;
106 std::stringstream ss(stringstream::in | stringstream::out);
107 ss <<
"31 16 11121212121212212121212212122122222322323233323333333323333323303330330030300000100010010010001000101010101111" << endl;
108 Contour theContour( ss );
110 Decomposition theDecomposition( theContour.begin(),theContour.end(),DSS4() );
111 Decomposition::SegmentComputerIterator i = theDecomposition.begin();
117 trace.
info() <<
"p2.norm()= "<< p2.norm()<<endl;
119 Domain domain( p1, p2 );
121 aBoard <<
SetMode( domain.className(),
"Grid" )
126 aBoard.
saveSVG(
"testgmpcontour.svg");
129 nbok +=
true ? 1 : 0;
131 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
132 <<
"true == true" << std::endl;
141 int main(
int argc,
char** argv )
145 for (
int i = 0; i < argc; ++i )
149 bool res = testDGtalBIGINTEGER() && testBIGINTEGERSpace();
150 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;