Skip to content

Commit 0483aa2

Browse files
committed
Redefined benchmarksfor for new interfaces
1 parent 2e92379 commit 0483aa2

11 files changed

Lines changed: 770 additions & 135 deletions

test/performance/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ add_executable(sbg-benchmark benchmark_main.cpp)
44
target_sources(sbg-benchmark
55
PRIVATE
66
benchmark_main.cpp
7-
dom_ord_pwmap_bm.cpp
8-
ord_set_bm.cpp)
7+
#dom_ord_pwmap_bm.cpp
8+
#unord_set_bm.cpp
9+
unord_pwmap_bm.cpp)
910

1011
set_target_properties(sbg-benchmark PROPERTIES
1112
RUNTIME_OUTPUT_DIRECTORY
@@ -24,6 +25,6 @@ target_link_libraries(sbg-benchmark
2425
sbg-dev
2526
sbg-eval-lib)
2627

27-
add_subdirectory(boost)
28+
#add_subdirectory(boost)
2829
add_subdirectory(matching)
2930
add_subdirectory(scc)

test/performance/boost/ordinary_graph_builder.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1818
******************************************************************************/
1919

20+
#include "sbg/multidim_inter.hpp"
2021
#include "test/performance/boost/ordinary_graph_builder.hpp"
2122
#include "util/time_profiler.hpp"
2223

@@ -26,24 +27,25 @@ namespace OG {
2627
// Auxiliary functions ---------------------------------------------------------
2728
////////////////////////////////////////////////////////////////////////////////
2829

29-
static SBG::LIB::MD_NAT nextElem(SBG::LIB::MD_NAT curr, SBG::LIB::SetPiece mdi)
30+
static SBG::LIB::MD_NAT nextElem(SBG::LIB::MD_NAT curr
31+
, SBG::LIB::detail::MultiDimInter mdi)
3032
{
3133
SBG::LIB::MD_NAT min = mdi.minElem();
3234
SBG::LIB::MD_NAT max = mdi.maxElem();
33-
SBG::LIB::MD_NAT res;
35+
SBG::LIB::MD_NAT result;
3436
for (unsigned int j = 0; j < mdi.arity(); ++j) {
3537
if (curr[j] == max[j]) {
36-
res.emplaceBack(min[j]);
38+
result.pushBack(min[j]);
3739
} else {
38-
res.emplaceBack(curr[j] + 1);
40+
result.pushBack(curr[j] + 1);
3941
for (unsigned int k = 1; k < mdi.arity() - j; ++k) {
40-
res.emplaceBack(curr[j + k]);
42+
result.pushBack(curr[j + k]);
4143
}
4244
break;
4345
}
4446
}
4547

46-
return res;
48+
return result;
4749
}
4850

4951
////////////////////////////////////////////////////////////////////////////////
@@ -75,7 +77,8 @@ void OrdinaryGraphBuilder::translateVertices()
7577
SBG::LIB::Set X = _bsbg.X();
7678
SBG::LIB::NAT count = 0;
7779
for (const SBG::LIB::SetPiece& mdi : V) {
78-
SBG::LIB::MD_NAT begin = mdi.minElem(), end = mdi.maxElem();
80+
SBG::LIB::MD_NAT begin = mdi.minElem();
81+
SBG::LIB::MD_NAT end = mdi.maxElem();
7982
for (auto it = begin; it != end; it = nextElem(it, mdi)) {
8083
_vertex_map[it] = count;
8184
_partition.emplace_back(
@@ -98,7 +101,8 @@ EdgeVector OrdinaryGraphBuilder::getEdgeList()
98101
const SBG::LIB::PWMap& map1 = _bsbg.map1();
99102
const SBG::LIB::PWMap& map2 = _bsbg.map2();
100103
for (const SBG::LIB::SetPiece& mdi : E) {
101-
SBG::LIB::MD_NAT begin = mdi.minElem(), end = mdi.maxElem();
104+
SBG::LIB::MD_NAT begin = mdi.minElem();
105+
SBG::LIB::MD_NAT end = mdi.maxElem();
102106
for (auto it = begin; it != end; it = nextElem(it, mdi)) {
103107
// Get endings of edge
104108
SBG::LIB::SetPiece it_mdi(it);

test/performance/boost/ordinary_graph_builder.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,21 @@
2525
2626
******************************************************************************/
2727

28-
#ifndef PERF_ORDINARY_BUILDER_HPP
29-
#define PERF_ORDINARY_BUILDER_HPP
28+
#ifndef SBGRAPH_TEST_PERFORMANCE_BOOST_ORDINARY_GRAPH_BUILDER_HPP_
29+
#define SBGRAPH_TEST_PERFORMANCE_BOOST_ORDINARY_GRAPH_BUILDER_HPP_
3030

31-
#include <map>
32-
33-
#include "test/performance/boost/ordinary_graph.hpp"
3431
#include "sbg/bipartite_sbg.hpp"
32+
#include "sbg/natural.hpp"
33+
#include "test/performance/boost/ordinary_graph.hpp"
3534
#include "util/logger.hpp"
3635

36+
#include <map>
37+
#include <vector>
38+
3739
namespace OG {
3840

3941
class OrdinaryGraphBuilder {
40-
public:
42+
public:
4143
OrdinaryGraphBuilder(SBG::LIB::BipartiteSBG bsbg);
4244

4345
BipartiteGraph build();
@@ -46,7 +48,7 @@ class OrdinaryGraphBuilder {
4648
void translateVertices();
4749
EdgeVector getEdgeList();
4850

49-
private:
51+
private:
5052
const SBG::LIB::BipartiteSBG _bsbg; ///< Input bipartite SBG to convert
5153
std::map<SBG::LIB::MD_NAT, Vertex> _vertex_map;
5254
///< Map from SBG vertex identifier to Graph element
@@ -55,4 +57,4 @@ class OrdinaryGraphBuilder {
5557

5658
} // namespace OG
5759

58-
#endif
60+
#endif // SBGRAPH_TEST_PERFORMANCE_BOOST_ORRDINARY_GRAPH_BUILDER_HPP_

test/performance/matching/custom_match_bm.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929

3030
#include <benchmark/benchmark.h>
3131

32+
#include "algorithms/matching/matching.hpp"
33+
#include "algorithms/matching/matching_fact.hpp"
3234
#include "eval/user_impl_map.hpp"
35+
#include "sbg/directed_sbg.hpp"
3336
#include "test/performance/utils.hpp"
3437

3538
namespace Test {

test/performance/matching/match_bm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
* execution time when the repetitive patterns increase its size.
2525
*/
2626

27-
#include <benchmark/benchmark.h>
28-
27+
#include "algorithms/matching/matching.hpp"
28+
#include "algorithms/matching/matching_fact.hpp"
2929
#include "eval/user_impl_map.hpp"
3030
#include "test/performance/utils.hpp"
3131

32+
#include <benchmark/benchmark.h>
33+
3234
namespace Test {
3335

3436
namespace Internal {

0 commit comments

Comments
 (0)