32 #include "DGtal/base/Common.h" 34 #include "DGtal/kernel/NumberTraits.h" 35 #include "DGtal/geometry/tools/determinant/C2x2DetComputer.h" 36 #include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.h" 37 #include "DGtal/geometry/tools/determinant/SimpleIncremental2x2DetComputer.h" 38 #include "DGtal/geometry/tools/determinant/AvnaimEtAl2x2DetSignComputer.h" 39 #include "DGtal/geometry/tools/determinant/Filtered2x2DetComputer.h" 43 using namespace DGtal;
55 template<
typename DetComputer>
59 typedef typename DetComputer::Integer Integer;
62 unsigned int nbok = 0;
77 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
82 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
87 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
94 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
99 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
104 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
107 aComputer.init(-a,-b);
111 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
116 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
121 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
124 aComputer.init(a,-b);
128 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
133 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
138 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
158 template <
typename I1,
typename I2>
192 return ((rand() % 2) ? x : -x);
204 template<
typename DetComputer>
210 TrueComputer trueComputer;
213 trace.
info() << trueComputer <<
" vs " << aComputer << endl;
220 for (
int i = 0; ( (i < n)&&(isOk) ); ++i)
226 trueComputer.init(a, b);
227 aComputer.init(a, b);
245 int main(
int argc,
char** argv )
249 for (
int i = 0; i < argc; ++i )
259 #ifdef WITH_BIGINTEGER 264 #ifdef WITH_BIGINTEGER 273 #ifdef WITH_BIGINTEGER 281 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
DGtal::int32_t randomBelow2exp15()
Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 ...
int main(int argc, char **argv)
Aim: Small class useful to compute the determinant of a 2x2 matrix from its four coefficients, ie. .
Aim: The traits class for all models of Cinteger.
DGtal is the top-level namespace which contains all DGtal functions and types.
bool hasTheSameSign(I1 x1, I2 x2)
bool randomTest2x2DetComputer(DetComputer aComputer)
Aim: Class that provides a way of computing the sign of the determinant of a 2x2 matrix from its four...
Aim: Small class useful to compute, in an incremental way, the determinant of a 2x2 matrix from its f...
boost::int32_t int32_t
signed 32-bit integer.
bool simpleTest2x2DetComputer(DetComputer aComputer)
DGtal::int32_t adHocRandom()