forked from ZigRazor/CXXGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDial_BM.cpp
More file actions
36 lines (31 loc) · 1.01 KB
/
Copy pathDial_BM.cpp
File metadata and controls
36 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <benchmark/benchmark.h>
#include <unordered_map>
#include "CXXGraph/CXXGraph.hpp"
#include "Utilities.hpp"
static void Dial_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
auto range_start = edges.begin();
auto range_end = edges.find(state.range(0));
std::unordered_map<unsigned long, CXXGraph::Edge<int> *> edgesX;
edgesX.insert(range_start, range_end);
for (auto e : edgesX) {
g.addEdge(&(*e.second));
}
for (auto _ : state) {
auto &result = g.dial(*(range_start->second->getNodePair().first), 1);
}
state.SetComplexityN(state.range(0));
}
BENCHMARK(Dial_X)
->RangeMultiplier(2)
->Range((unsigned long)1, (unsigned long)1 << 18)
->Complexity();
static void Dial_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
for (auto _ : state) {
auto &result =
cit_graph_ptr->dial(*((*(edgeSet.begin()))->getNodePair().first), 1);
}
state.SetComplexityN(state.range(0));
}
// BENCHMARK(Dial_FromReadedCitHep)->Complexity();