32#include "DGtal/base/Common.h"
33#include "DGtal/helpers/StdDefs.h"
34#include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
35#include "DGtal/geometry/volumes/distance/InexactPredicateLpSeparableMetric.h"
36#include <boost/lexical_cast.hpp>
51 double sum=0.0, d=0,d2=0, MSE=0;
52 std::string txt =
"Testing Exponent" + boost::lexical_cast<string>(p);
58 for(
unsigned int i=0; i< maxTest; ++i)
62 sum += exactMetric(P,Q);
68 for(
unsigned int i=0; i< maxTest; ++i)
72 sum += approxMetric(P,Q);
78 for(
unsigned int i=0; i< maxTest; ++i)
83 d2 = approxMetric(P,Q);
87 trace.
info() <<
"Mean Square Error = "<<MSE<<std::endl;
97int main(
int argc,
char** argv )
101 for (
int i = 0; i < argc; ++i )
105 bool res = runATest<2>(1000000) &&
106 runATest<4>(10000000);
107 runATest<6>(1000000);
108 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: implements separable l_p metrics with exact predicates.
Aim: implements separable l_p metrics with approximated predicates.
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
bool runATest(unsigned int maxTest)