-
Notifications
You must be signed in to change notification settings - Fork 312
Add C++ Backend for BFS and Use std::variant for Graph Node Data #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ef7bf11
updated
2b5ff21
Merge branch 'main' into feature/variant-nodes
prex03 b33e290
bug fix
6e01d91
bug fix
0bb8ebb
bug fix
f7ac56e
bug fix
2ac1662
bug fix
c1a2879
bfs
4df2097
bfs complete
b90f161
bug fix
18c2b80
bug fix
6a161bb
bug fix
f0fa262
bug fix
f324d92
bug fix
6d81439
bug fix
de01034
added support for pyobject
d4581b4
tests added
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ typedef struct { | |
} AdjacencyMatrixGraphNode; | ||
|
||
static void AdjacencyMatrixGraphNode_dealloc(AdjacencyMatrixGraphNode* self){ | ||
Py_XDECREF(self->super.data); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is |
||
Py_TYPE(self)->tp_free(reinterpret_cast<PyTypeObject*>(self)); | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
from setuptools import Extension | ||
import os | ||
import sys | ||
|
||
project = 'pydatastructs' | ||
|
||
module = 'utils' | ||
|
||
backend = '_backend' | ||
|
||
cpp = 'cpp' | ||
|
||
nodes = '.'.join([project, module, backend, cpp, '_nodes']) | ||
nodes_sources = ['/'.join([project, module, backend, cpp, | ||
'nodes.cpp'])] | ||
nodes_sources = [os.path.join(project, module, backend, cpp, 'nodes.cpp')] | ||
|
||
graph_utils = '.'.join([project, module, backend, cpp, '_graph_utils']) | ||
graph_utils_sources = ['/'.join([project, module, backend, cpp, | ||
'graph_utils.cpp'])] | ||
graph_utils_sources = [os.path.join(project, module, backend, cpp, 'graph_utils.cpp')] | ||
|
||
extra_compile_args = ["-std=c++17"] | ||
|
||
if sys.platform == "darwin": | ||
extra_compile_args.append("-mmacosx-version-min=10.13") | ||
elif sys.platform == "win32": | ||
extra_compile_args = ["/std:c++17"] | ||
|
||
extensions = [ | ||
Extension(nodes, sources=nodes_sources), | ||
Extension(graph_utils, sources = graph_utils_sources) | ||
Extension(nodes, sources=nodes_sources, language="c++", extra_compile_args=extra_compile_args), | ||
Extension(graph_utils, sources=graph_utils_sources, language="c++", extra_compile_args=extra_compile_args), | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other cases set to normal
PyObject
data type.