32#include <benchmark/benchmark.h>
33#include <unordered_set>
35#include "DGtal/base/Common.h"
36#include "DGtal/kernel/domains/CDomainArchetype.h"
37#include "DGtal/kernel/sets/DigitalSetBySTLVector.h"
38#include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
39#include "DGtal/kernel/sets/DigitalSetByAssociativeContainer.h"
40#include "DGtal/kernel/sets/DigitalSetFromMap.h"
42#include "DGtal/kernel/PointHashFunctions.h"
44#include "DGtal/helpers/StdDefs.h"
65 while (state.KeepRunning())
68 typename Q::Domain dom(
typename Q::Point().diagonal(0),
69 typename Q::Point().diagonal((
typename Q::Domain::Space::Integer)state.range(0)));
85 Q myset(
typename Q::Domain( Q::Point::diagonal(0), Q::Point::diagonal(2048) ));
86 while (state.KeepRunning())
90 for(
unsigned int j=0; j < Q::Point::dimension; j++)
109 Q myset(
typename Q::Domain( Q::Point::diagonal(0), Q::Point::diagonal(2048) ));
110 for(
unsigned int i= 0; i < state.range(0); ++i)
113 for(
unsigned int j=0; j < Q::Point::dimension; j++)
114 p[j] = rand() % 2048;
117 while (state.KeepRunning())
119 for(
typename Q::ConstIterator it= myset.begin(), itend=myset.end(); it != itend;
121 benchmark::DoNotOptimize(it);
135int main(
int argc,
char**argv )
137 benchmark::Initialize(&argc, argv);
139 benchmark::RunSpecifiedBenchmarks();
DGtal::DigitalSetBySTLVector< Z3i::Domain > FromVector3
static void BM_insert(benchmark::State &state)
DGtal::DigitalSetBySTLSet< Z2i::Domain > FromSet
static void BM_Constructor(benchmark::State &state)
static void BM_iterate(benchmark::State &state)
DGtal::DigitalSetBySTLSet< Z3i::Domain > FromSet3
DGtal::DigitalSetByAssociativeContainer< Z3i::Domain, std::unordered_set< Z3i::Point > > FromUnordered3
DGtal::DigitalSetBySTLVector< Z2i::Domain > FromVector
BENCHMARK_TEMPLATE(BM_Constructor, FromVector) -> Range(1<< 3, 1<< 8)
DGtal::DigitalSetByAssociativeContainer< Z2i::Domain, std::unordered_set< Z2i::Point > > FromUnordered
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: A container class for storing sets of digital points within some given domain.
Aim: Realizes the concept CDigitalSet by using the STL container std::vector.
DGtal is the top-level namespace which contains all DGtal functions and types.