Skip to content

Commit

Permalink
Merge branch 'ZigRazor:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
yapa-ymtl authored Feb 4, 2025
2 parents 4bfa986 + b7742a9 commit b7c73fe
Show file tree
Hide file tree
Showing 133 changed files with 630 additions and 239 deletions.
7 changes: 5 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Add 'repo' label to any root file changes
repo:
- '*'

- owner:SunHappyboy
name:CXXGraph
labels:
-name:bug
color:ffb4b4
# Add 'test' label to any change to *.spec.js files within the source dir
test:
- test/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Code_Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
working-directory: ${{github.workspace}}/build/test
run: lcov --capture --directory .. --output-file coverage.info

- uses: codecov/codecov-action@v4.5.0
- uses: codecov/codecov-action@v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ${{github.workspace}}/build/test/coverage.info # optional
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
git push origin documentation-update-${{ steps.buildnumber.outputs.build_number }}
- name: Doxygen Action
uses: mattnotmitt/doxygen-action@v1.9.8
uses: mattnotmitt/doxygen-action@v1.12.0
with:
# Working directory
working-directory: 'docs/'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.13.0
uses: jidicula/clang-format-action@v4.14.0
with:
clang-format-version: '16'
check-path: ${{ matrix.path }}
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ jobs:
working-directory: ${{github.workspace}}/build/test
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C
run: ctest

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ build/
# ignore the packaging folder contents from git
packaging/
# ignore vscode files
.vscode
.vscode
.code-workspace
CXXGraph.code-workspace
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ if(DEBUG)
)
endif(DEBUG)

option(SANITIZE "Enable Sanitize" OFF)
if(SANITIZE)
add_compile_options(
-fsanitize=address
-fsanitize=leak
)
add_link_options(
-fsanitize=address
-fsanitize=leak
)
endif(SANITIZE)

# set up CPM.cmake
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM.cmake")
Expand Down
21 changes: 12 additions & 9 deletions benchmark/BFS_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ static void BFS_X(benchmark::State &state) {
g.breadth_first_search(*(range_start->second->getNodePair().first));
}
}
BENCHMARK(BFS_X)->RangeMultiplier(18)->Range((unsigned long)1,
(unsigned long)1 << 18);
BENCHMARK(BFS_X)
->RangeMultiplier(18)
->Range((unsigned long)1, (unsigned long)1 << 18)
->Complexity();

static void BFS_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -28,7 +30,7 @@ static void BFS_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(BFS_FromReadedCitHep);
BENCHMARK(BFS_FromReadedCitHep)->Complexity();

static void PSEUDO_CONCURRENCY_BFS_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -46,7 +48,8 @@ static void PSEUDO_CONCURRENCY_BFS_X(benchmark::State &state) {
}
BENCHMARK(PSEUDO_CONCURRENCY_BFS_X)
->RangeMultiplier(18)
->Range((unsigned long)1, (unsigned long)1 << 18);
->Range((unsigned long)1, (unsigned long)1 << 18)
->Complexity();

static void PSEUDO_CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -56,7 +59,7 @@ static void PSEUDO_CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(PSEUDO_CONCURRENCY_BFS_FromReadedCitHep);
BENCHMARK(PSEUDO_CONCURRENCY_BFS_FromReadedCitHep)->Complexity();

static void CONCURRENCY_BFS_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -72,9 +75,9 @@ static void CONCURRENCY_BFS_X(benchmark::State &state) {
*(range_start->second->getNodePair().first), 8);
}
}
BENCHMARK(CONCURRENCY_BFS_X)
->RangeMultiplier(18)
->Range((unsigned long)1, (unsigned long)1 << 18);
// BENCHMARK(CONCURRENCY_BFS_X)
// ->RangeMultiplier(18)
// ->Range((unsigned long)1, (unsigned long)1 << 18);

static void CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -84,4 +87,4 @@ static void CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(CONCURRENCY_BFS_FromReadedCitHep);
// BENCHMARK(CONCURRENCY_BFS_FromReadedCitHep);
5 changes: 3 additions & 2 deletions benchmark/BellmanFord_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ static void BellmanFord_X(benchmark::State &state) {
}
BENCHMARK(BellmanFord_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void BellmanFord_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -30,4 +31,4 @@ static void BellmanFord_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(BellmanFord_FromReadedCitHep);
BENCHMARK(BellmanFord_FromReadedCitHep)->Complexity();
8 changes: 5 additions & 3 deletions benchmark/Boruvka_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ static void Boruvka_X(benchmark::State &state) {
auto &result = g.boruvka();
}
}
BENCHMARK(Boruvka_X)->RangeMultiplier(16)->Range((unsigned long)1,
(unsigned long)1 << 16);
BENCHMARK(Boruvka_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void Boruvka_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -26,4 +28,4 @@ static void Boruvka_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(Boruvka_FromReadedCitHep);
BENCHMARK(Boruvka_FromReadedCitHep)->Complexity();
10 changes: 6 additions & 4 deletions benchmark/Connectivity_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ static void Connectivity_X(benchmark::State &state) {
}
BENCHMARK(Connectivity_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void Connectivity_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -27,7 +28,7 @@ static void Connectivity_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(Connectivity_FromReadedCitHep);
BENCHMARK(Connectivity_FromReadedCitHep)->Complexity();

static void StrongConnectivity_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -44,7 +45,8 @@ static void StrongConnectivity_X(benchmark::State &state) {
}
BENCHMARK(StrongConnectivity_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void StrongConnectivity_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -53,4 +55,4 @@ static void StrongConnectivity_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(StrongConnectivity_FromReadedCitHep);
BENCHMARK(StrongConnectivity_FromReadedCitHep)->Complexity();
10 changes: 6 additions & 4 deletions benchmark/CycleCheck_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ static void CycleCheckBFS_X(benchmark::State &state) {
}
BENCHMARK(CycleCheckBFS_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void CycleCheckBFS_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -27,7 +28,7 @@ static void CycleCheckBFS_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(CycleCheckBFS_FromReadedCitHep);
BENCHMARK(CycleCheckBFS_FromReadedCitHep)->Complexity();

static void CycleCheckDFS_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -44,7 +45,8 @@ static void CycleCheckDFS_X(benchmark::State &state) {
}
BENCHMARK(CycleCheckDFS_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void CycleCheckDFS_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -53,4 +55,4 @@ static void CycleCheckDFS_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(CycleCheckDFS_FromReadedCitHep);
BENCHMARK(CycleCheckDFS_FromReadedCitHep)->Complexity();
8 changes: 5 additions & 3 deletions benchmark/DFS_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ static void DFS_X(benchmark::State &state) {
}
}

BENCHMARK(DFS_X)->RangeMultiplier(16)->Range((unsigned long)1,
(unsigned long)1 << 16);
BENCHMARK(DFS_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void DFS_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -29,4 +31,4 @@ static void DFS_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(DFS_FromReadedCitHep);
BENCHMARK(DFS_FromReadedCitHep)->Complexity();
8 changes: 5 additions & 3 deletions benchmark/Dial_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ static void Dial_X(benchmark::State &state) {
auto &result = g.dial(*(range_start->second->getNodePair().first), 1);
}
}
BENCHMARK(Dial_X)->RangeMultiplier(16)->Range((unsigned long)1,
(unsigned long)1 << 16);
BENCHMARK(Dial_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void Dial_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -27,4 +29,4 @@ static void Dial_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(Dial_FromReadedCitHep);
BENCHMARK(Dial_FromReadedCitHep)->Complexity();
5 changes: 3 additions & 2 deletions benchmark/Dijkstra_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ static void Dijkstra_X(benchmark::State &state) {
}
BENCHMARK(Dijkstra_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void Dijkstra_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -30,4 +31,4 @@ static void Dijkstra_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(Dijkstra_FromReadedCitHep);
BENCHMARK(Dijkstra_FromReadedCitHep)->Complexity();
8 changes: 4 additions & 4 deletions benchmark/Edge_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void BM_EdgeCreation(benchmark::State &state) {
}
}

BENCHMARK(BM_EdgeCreation);
BENCHMARK(BM_EdgeCreation)->Complexity();

static void EdgeCreationDestruction_new_delete(benchmark::State &state) {
auto nodes = generateRandomNodes(2, 2);
Expand All @@ -25,7 +25,7 @@ static void EdgeCreationDestruction_new_delete(benchmark::State &state) {
}
}

BENCHMARK(EdgeCreationDestruction_new_delete);
BENCHMARK(EdgeCreationDestruction_new_delete)->Complexity();

static void EdgeGetId(benchmark::State &state) {
auto nodes = generateRandomNodes(2, 2);
Expand All @@ -36,7 +36,7 @@ static void EdgeGetId(benchmark::State &state) {
e.getId();
}
}
BENCHMARK(EdgeGetId);
BENCHMARK(EdgeGetId)->Complexity();

static void NodeGetNodePair(benchmark::State &state) {
auto nodes = generateRandomNodes(2, 2);
Expand All @@ -47,4 +47,4 @@ static void NodeGetNodePair(benchmark::State &state) {
e.getNodePair();
}
}
BENCHMARK(NodeGetNodePair);
BENCHMARK(NodeGetNodePair)->Complexity();
3 changes: 2 additions & 1 deletion benchmark/EulerPath_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ static void EulerPath_X(benchmark::State &state) {
}
BENCHMARK(EulerPath_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();
8 changes: 4 additions & 4 deletions benchmark/FloydWarshall_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void BM_FWDirected(benchmark::State &state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
}
BENCHMARK(BM_FWDirected);
BENCHMARK(BM_FWDirected)->Complexity();

// a graph with negative cycle
static void BM_FWNegCycle(benchmark::State &state) {
Expand All @@ -51,7 +51,7 @@ static void BM_FWNegCycle(benchmark::State &state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
}
BENCHMARK(BM_FWNegCycle);
BENCHMARK(BM_FWNegCycle)->Complexity();

static void BM_FWUndirectedWeighted(benchmark::State &state) {
CXXGraph::Node<int> node1("1", 1);
Expand All @@ -71,7 +71,7 @@ static void BM_FWUndirectedWeighted(benchmark::State &state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
}
BENCHMARK(BM_FWUndirectedWeighted);
BENCHMARK(BM_FWUndirectedWeighted)->Complexity();

static void BM_FWNoWeighted(benchmark::State &state) {
CXXGraph::Node<int> node1("1", 1);
Expand All @@ -92,4 +92,4 @@ static void BM_FWNoWeighted(benchmark::State &state) {
}
}

BENCHMARK(BM_FWNoWeighted);
BENCHMARK(BM_FWNoWeighted)->Complexity();
5 changes: 3 additions & 2 deletions benchmark/FordFulkerson_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ static void FordFulkerson_X(benchmark::State &state) {
}
BENCHMARK(FordFulkerson_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 16);
->Range((unsigned long)1, (unsigned long)1 << 16)
->Complexity();

static void FordFulkerson_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
Expand All @@ -31,4 +32,4 @@ static void FordFulkerson_FromReadedCitHep(benchmark::State &state) {
}
}

BENCHMARK(FordFulkerson_FromReadedCitHep);
BENCHMARK(FordFulkerson_FromReadedCitHep)->Complexity();
3 changes: 2 additions & 1 deletion benchmark/GraphSlicing_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ static void GraphSlicing_X(benchmark::State &state) {
}
BENCHMARK(GraphSlicing_X)
->RangeMultiplier(16)
->Range((unsigned long)1, (unsigned long)1 << 8);
->Range((unsigned long)1, (unsigned long)1 << 8)
->Complexity();
Loading

0 comments on commit b7c73fe

Please sign in to comment.