diff --git a/CMakeLists.txt b/CMakeLists.txt index 87c59ad..e2b9d47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,6 +247,10 @@ if(PIXIE_BENCHMARKS) benchmark benchmark_main ${PIXIE_DIAGNOSTICS_LIBS}) + if(PIXIE_THIRD_PARTY_BACKENDS) + target_include_directories(dfuds_tree_benchmarks + PRIVATE ${sdsl_lite_SOURCE_DIR}/include) + endif() add_executable(alignment_comparison src/benchmarks/alignment_comparison.cpp) diff --git a/include/pixie/dfuds_tree.h b/include/pixie/dfuds_tree.h index 8215b84..a332b54 100644 --- a/include/pixie/dfuds_tree.h +++ b/include/pixie/dfuds_tree.h @@ -12,10 +12,11 @@ namespace pixie { * @brief A tree class based on the depth-first unary degree sequence (DFUDS) * representation */ +template class DFUDSTree { private: const size_t num_bits_; - RmMTree rmm_; + RMMTree rmm_; public: struct Node { @@ -152,12 +153,4 @@ std::vector adj_to_dfuds( return dfuds; } -bool operator==(const AdjListNode& a, const DFUDSTree::Node& b) { - return a.number == b.number; -} - -bool operator==(const DFUDSTree::Node& b, const AdjListNode& a) { - return a.number == b.number; -} - } // namespace pixie diff --git a/src/benchmarks/dfuds_tree_benchmarks.cpp b/src/benchmarks/dfuds_tree_benchmarks.cpp index b4d4202..7eff6fa 100644 --- a/src/benchmarks/dfuds_tree_benchmarks.cpp +++ b/src/benchmarks/dfuds_tree_benchmarks.cpp @@ -4,9 +4,17 @@ #include -using Node = pixie::DFUDSTree::Node; +#ifdef SDSL_SUPPORT +#pragma message("SDSL_SUPPORT enabled") +#include "pixie/rmm_tree_sdsl.h" +using DFUDSTree = pixie::DFUDSTree; +#else +#pragma message("SDSL_SUPPORT disabled") +using DFUDSTree = pixie::DFUDSTree; +#endif + +using Node = DFUDSTree::Node; using pixie::adj_to_dfuds; -using pixie::DFUDSTree; /** * DFS with O(1) extra memory diff --git a/src/tests/dfuds_tree_tests.cpp b/src/tests/dfuds_tree_tests.cpp index 4426250..a83f416 100644 --- a/src/tests/dfuds_tree_tests.cpp +++ b/src/tests/dfuds_tree_tests.cpp @@ -6,9 +6,17 @@ #include #include -using Node = pixie::DFUDSTree::Node; +using DFUDSTree = pixie::DFUDSTree; +using Node = DFUDSTree::Node; using pixie::adj_to_dfuds; -using pixie::DFUDSTree; + +bool operator==(const AdjListNode& a, const DFUDSTree::Node& b) { + return a.number == b.number; +} + +bool operator==(const DFUDSTree::Node& b, const AdjListNode& a) { + return a.number == b.number; +} TEST(DfudsTreeTest, Basic) { std::vector> adj = {{0, 1}, {0, 2}, {1, 3}, {2, 4}, {3}};