Skip to content

Commit bd95a76

Browse files
Merge branch 'ZigRazor:master' into master
2 parents 1804b50 + 60eaec4 commit bd95a76

44 files changed

Lines changed: 408 additions & 113 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/Code_Coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
working-directory: ${{github.workspace}}/build/test
5050
run: lcov --capture --directory .. --output-file coverage.info
5151

52-
- uses: codecov/codecov-action@v5.3.1
52+
- uses: codecov/codecov-action@v5.4.3
5353
with:
5454
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
5555
file: ${{github.workspace}}/build/test/coverage.info # optional

.github/workflows/clang_format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222
- name: Run clang-format style check
23-
uses: jidicula/clang-format-action@v4.14.0
23+
uses: jidicula/clang-format-action@v4.15.0
2424
with:
2525
clang-format-version: '16'
2626
check-path: ${{ matrix.path }}

.github/workflows/cmake.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8-
98
env:
109
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1110
BUILD_TYPE: Release
@@ -39,9 +38,12 @@ jobs:
3938
- name: Configure CMake
4039
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
4140
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
41+
42+
# The macro ${{github.workspace}} results in windows file seprators, (\) which CMake often cannot parse.
43+
# To get around this use a relative path instead.
4244
run: |
4345
if [ ${{ matrix.os }} == 'windows-latest' ]; then
44-
cmake -DTEST=ON -Dgtest_disable_pthreads=ON -B ${{github.workspace}}/build
46+
cmake -DTEST=ON -Dgtest_disable_pthreads=ON -B ./build
4547
else
4648
cmake -DTEST=ON -B ${{github.workspace}}/build
4749
fi;

.github/workflows/codeql.yml

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,75 +9,86 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "CodeQL Advanced"
1313

1414
on:
1515
push:
1616
branches: [ "master" ]
1717
pull_request:
18-
# The branches below must be a subset of the branches above
1918
branches: [ "master" ]
2019
schedule:
21-
- cron: '44 9 * * 6'
20+
- cron: '24 4 * * 6'
2221

2322
jobs:
2423
analyze:
25-
name: Analyze
26-
runs-on: ubuntu-latest
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
2731
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
2839
actions: read
2940
contents: read
30-
security-events: write
3141

3242
strategy:
3343
fail-fast: false
3444
matrix:
35-
language: [ 'cpp' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37-
# Use only 'java' to analyze code written in Java, Kotlin or both
38-
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
39-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40-
45+
include:
46+
- language: actions
47+
build-mode: none
48+
- language: c-cpp
49+
build-mode: manual
50+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4158
steps:
4259
- name: Checkout repository
4360
uses: actions/checkout@v4
4461

62+
# Add any setup steps before running the `github/codeql-action/init` action.
63+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
64+
# or others). This is typically only required for manual builds.
65+
# - name: Setup runtime (example)
66+
# uses: actions/setup-example@v1
67+
4568
# Initializes the CodeQL tools for scanning.
4669
- name: Initialize CodeQL
4770
uses: github/codeql-action/init@v3
4871
with:
4972
languages: ${{ matrix.language }}
73+
build-mode: ${{ matrix.build-mode }}
5074
# If you wish to specify custom queries, you can do so here or in a config file.
5175
# By default, queries listed here will override any specified in a config file.
5276
# Prefix the list here with "+" to use these queries and those in the config file.
5377

54-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
78+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5579
# queries: security-extended,security-and-quality
5680

57-
58-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59-
# If this step fails, then you should remove it and run the build manually (see below)
60-
#- name: Autobuild
61-
# uses: github/codeql-action/autobuild@v2
62-
63-
- name: Configure CMake
64-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
65-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
66-
run: cmake -DTEST=ON -DEXAMPLES=ON -DBENCHMARK=ON -B ${{github.workspace}}/build
67-
68-
- name: Build
69-
# Build your program with the given configuration
70-
run: cmake --build ${{github.workspace}}/build
71-
81+
# If the analyze step fails for one of the languages you are analyzing with
82+
# "We were unable to automatically build your code", modify the matrix above
83+
# to set the build mode to "manual" for that language. Then modify this step
84+
# to build your code.
7285
# ℹ️ Command-line programs to run using the OS shell.
7386
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
74-
75-
# If the Autobuild fails above, remove it and uncomment the following three lines.
76-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
77-
78-
# - run: |
79-
# echo "Run, Build Application using script"
80-
# ./location_of_script_within_repo/buildscript.sh
87+
- if: matrix.build-mode == 'manual'
88+
shell: bash
89+
run: |
90+
cmake -DTEST=ON -DEXAMPLES=ON -DBENCHMARK=ON -B ${{github.workspace}}/build
91+
cmake --build ${{github.workspace}}/build
8192
8293
- name: Perform CodeQL Analysis
8394
uses: github/codeql-action/analyze@v3

.github/workflows/gitlab_sync.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: GitlabSync
2+
3+
on:
4+
- push
5+
- delete
6+
7+
jobs:
8+
sync:
9+
runs-on: ubuntu-latest
10+
name: Git Repo Sync
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- uses: action-pack/gitlab-sync@v3.03
16+
with:
17+
# GitLab repo URL
18+
url: ${{ secrets.GITLAB_TARGET_URL }}
19+
# GitLab username
20+
username: ${{ secrets.GITLAB_TARGET_USERNAME }}
21+
# GitLab token
22+
token: ${{ secrets.GITLAB_TARGET_TOKEN }}

CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ if(DEBUG)
1919
)
2020
endif(DEBUG)
2121

22-
option(SANITIZE "Enable Sanitize" OFF)
23-
if(SANITIZE)
24-
add_compile_options(
25-
-fsanitize=address
26-
-fsanitize=leak
27-
)
28-
add_link_options(
29-
-fsanitize=address
30-
-fsanitize=leak
31-
)
32-
endif(SANITIZE)
22+
if (NOT MSVC)
23+
option(SANITIZE "Enable Sanitize" OFF)
24+
if(SANITIZE)
25+
add_compile_options(
26+
-fsanitize=address
27+
-fsanitize=leak
28+
)
29+
add_link_options(
30+
-fsanitize=address
31+
-fsanitize=leak
32+
)
33+
endif(SANITIZE)
34+
endif(NOT MSVC)
3335

3436
# set up CPM.cmake
3537
if(CPM_SOURCE_CACHE)
@@ -52,5 +54,4 @@ add_subdirectory(test)
5254
add_subdirectory(benchmark)
5355
add_subdirectory(examples)
5456

55-
#install(FILES include/Graph.hpp DESTINATION /usr/include)
5657
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include)

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img style="float: right;" align="left" src="https://raw.github.com/ZigRazor/CXXGraph/master/logos/CXXGraph.gif">
1+
<img style="float: right;" align="left" src="https://raw.github.com/ZigRazor/CXXGraph/master/logos/CXXBanner.png">
22

33
# CXXGraph
44

@@ -11,16 +11,12 @@
1111
[![codecov](https://codecov.io/gh/ZigRazor/CXXGraph/branch/master/graph/badge.svg?token=773AQ2H9RQ)](https://codecov.io/gh/ZigRazor/CXXGraph)
1212
[![CodeFactor](https://www.codefactor.io/repository/github/zigrazor/cxxgraph/badge)](https://www.codefactor.io/repository/github/zigrazor/cxxgraph)
1313

14-
[![GitHub license](https://img.shields.io/github/license/ZigRazor/CXXGraph.svg)](https://github.com/ZigRazor/CXXGraph/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/ZigRazor/CXXGraph.svg)](https://GitHub.com/ZigRazor/CXXGraph/releases/)
14+
[![GitHub license](https://img.shields.io/github/license/ZigRazor/CXXGraph.svg)](https://github.com/ZigRazor/CXXGraph/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/ZigRazor/CXXGraph.svg)](https://GitHub.com/ZigRazor/CXXGraph/releases/) [![Conan Center](https://img.shields.io/conan/v/cxxgraph)](https://conan.io/center/recipes/cxxgraph)
1515

16-
[![Generic badge](https://img.shields.io/badge/Required-G++7.3.0-Green.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/required-C++17-Green.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Required-CMake3.9-Green.svg)](https://shields.io/)
16+
[![Generic badge](https://img.shields.io/badge/Required-G++7.3.0-Green.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/required-C++17-Green.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Required-CMake3.9-Green.svg)](https://shields.io/)
1717

1818
[![Generic badge](https://img.shields.io/badge/Build-Passed-Green.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/UnitTest-Passed-Green.svg)](https://shields.io/)
1919

20-
<br/><br/>
21-
<br/><br/>
22-
<br/><br/>
23-
2420
## Introduction
2521
**CXXGraph** is a comprehensive C++ library that manages graph algorithms. This header-only library serves as an alternative to the [Boost Graph Library (BGL)](https://www.boost.org/doc/libs/1_77_0/libs/graph/doc/index.html).
2622

@@ -609,6 +605,10 @@ Thank you to all the people who have already contributed to CXXGraph!
609605

610606
[![Contributors](https://contrib.rocks/image?repo=zigrazor/CXXGraph)](https://github.com/ZigRazor/CXXGraph/graphs/contributors)
611607

608+
## Cited By
609+
610+
- Ruizhe Wang, Meng Xu, and N. Asokan. 2024. SeMalloc: Semantics-Informed Memory Allocator. In Proceedings of the 2024 on ACM SIGSAC Conference on Computer and Communications Security (CCS '24). Association for Computing Machinery, New York, NY, USA, 1375–1389. https://doi.org/10.1145/3658644.3670363
611+
612612
## Cite Us
613613

614614
If you use this software please follow the [CITATION](https://github.com/ZigRazor/CXXGraph/blob/master/CITATION) instructions.
@@ -635,4 +635,3 @@ View the [Estimated Value of the Project](https://www.openhub.net/p/CXXGraph/est
635635
| [<img src="https://avatars0.githubusercontent.com/u/6591180?s=460&v=4" width="100"><br><sub>@ZigRazor</sub>](https://github.com/ZigRazor) |
636636
|:----:|
637637

638-
![footer](https://raw.github.com/ZigRazor/CXXGraph/master/logos/CXXGraph_footer.gif)

benchmark/BFS_BM.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static void BFS_X(benchmark::State &state) {
1616
auto &result =
1717
g.breadth_first_search(*(range_start->second->getNodePair().first));
1818
}
19+
state.SetComplexityN(2);
1920
}
2021
BENCHMARK(BFS_X)
2122
->RangeMultiplier(18)
@@ -28,9 +29,11 @@ static void BFS_FromReadedCitHep(benchmark::State &state) {
2829
auto &result = cit_graph_ptr->breadth_first_search(
2930
*((*(edgeSet.begin()))->getNodePair().first));
3031
}
32+
state.SetComplexityN(2);
3133
}
3234

33-
BENCHMARK(BFS_FromReadedCitHep)->Complexity();
35+
// In Error
36+
// BENCHMARK(BFS_FromReadedCitHep)->Complexity();
3437

3538
static void PSEUDO_CONCURRENCY_BFS_X(benchmark::State &state) {
3639
CXXGraph::Graph<int> g;
@@ -45,6 +48,7 @@ static void PSEUDO_CONCURRENCY_BFS_X(benchmark::State &state) {
4548
auto &result = g.concurrency_breadth_first_search(
4649
*(range_start->second->getNodePair().first), 1);
4750
}
51+
state.SetComplexityN(2);
4852
}
4953
BENCHMARK(PSEUDO_CONCURRENCY_BFS_X)
5054
->RangeMultiplier(18)
@@ -57,9 +61,10 @@ static void PSEUDO_CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
5761
auto &result = cit_graph_ptr->concurrency_breadth_first_search(
5862
*((*(edgeSet.begin()))->getNodePair().first), 1);
5963
}
64+
state.SetComplexityN(2);
6065
}
6166

62-
BENCHMARK(PSEUDO_CONCURRENCY_BFS_FromReadedCitHep)->Complexity();
67+
// BENCHMARK(PSEUDO_CONCURRENCY_BFS_FromReadedCitHep)->Complexity();
6368

6469
static void CONCURRENCY_BFS_X(benchmark::State &state) {
6570
CXXGraph::Graph<int> g;
@@ -74,6 +79,7 @@ static void CONCURRENCY_BFS_X(benchmark::State &state) {
7479
auto &result = g.concurrency_breadth_first_search(
7580
*(range_start->second->getNodePair().first), 8);
7681
}
82+
state.SetComplexityN(2);
7783
}
7884
// BENCHMARK(CONCURRENCY_BFS_X)
7985
// ->RangeMultiplier(18)
@@ -85,6 +91,7 @@ static void CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
8591
auto &result = cit_graph_ptr->concurrency_breadth_first_search(
8692
*((*(edgeSet.begin()))->getNodePair().first), 8);
8793
}
94+
state.SetComplexityN(2);
8895
}
8996

9097
// BENCHMARK(CONCURRENCY_BFS_FromReadedCitHep);

benchmark/BellmanFord_BM.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static void BellmanFord_X(benchmark::State &state) {
1616
auto &result = g.bellmanford(*(range_start->second->getNodePair().first),
1717
*(range_end->second->getNodePair().second));
1818
}
19+
state.SetComplexityN(2);
1920
}
2021
BENCHMARK(BellmanFord_X)
2122
->RangeMultiplier(16)
@@ -29,6 +30,7 @@ static void BellmanFord_FromReadedCitHep(benchmark::State &state) {
2930
*((*(edgeSet.begin()))->getNodePair().first),
3031
*((*(++edgeSet.begin()))->getNodePair().second));
3132
}
33+
state.SetComplexityN(2);
3234
}
3335

34-
BENCHMARK(BellmanFord_FromReadedCitHep)->Complexity();
36+
// BENCHMARK(BellmanFord_FromReadedCitHep)->Complexity();

benchmark/Boruvka_BM.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ static void Boruvka_X(benchmark::State &state) {
1515
for (auto _ : state) {
1616
auto &result = g.boruvka();
1717
}
18+
state.SetComplexityN(2);
1819
}
1920
BENCHMARK(Boruvka_X)
2021
->RangeMultiplier(16)

0 commit comments

Comments
 (0)