-
Notifications
You must be signed in to change notification settings - Fork 242
Graph: Seperate core functions from common API #1222
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
Graph: Seperate core functions from common API #1222
Conversation
24b187d to
b8cb91e
Compare
bernlu
left a comment
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.
one inconsistency I noticed: for some iterator files we define a shorthand (using VLN = VeryLongName) and for others we do not. The ones that are defined are not used that much. Maybe we should just remove them to make everything a bit more consistent and readable? (at least outside of the specific class files: in graph.hpp its not so obvious what EIB is).
|
|
||
| template <> | ||
| void Graph::ASB<Graph::PerNode>::checkPremise() const { | ||
| void ASB<PerNode, Graph>::checkPremise() const { |
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.
these four methods should be defined in a Attributes.cpp and not in Graph.cpp?
|
|
||
| template <> | ||
| void Graph::ASB<Graph::PerEdge>::checkPremise() const { | ||
| void ASB<PerEdge, Graph>::checkPremise() const { |
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.
second ASB method
|
|
||
| template <> | ||
| void Graph::ASB<Graph::PerNode>::indexOK(index n) const { | ||
| void ASB<PerNode, Graph>::indexOK(index n) const { |
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.
third ASB method
|
|
||
| template <> | ||
| void Graph::ASB<Graph::PerEdge>::indexOK(index n) const { | ||
| void ASB<PerEdge, Graph>::indexOK(index n) const { |
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.
fourth ASB method
| } | ||
|
|
||
| template <> | ||
| bool EIB<Graph>::validEdge() const noexcept { |
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.
I think it would be better not to use the shorthand here to make it easier to read for someone who did not read the iterator file yet.
Also, again: this is a method definition for an iterator and should be defined in EdgeIterators.cpp and not in Graph?
| } | ||
|
|
||
| template <> | ||
| Edge EdgeTypeIterator<Graph, Edge>::operator*() const noexcept { |
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.
another non-graph method
| } | ||
|
|
||
| template <> | ||
| WeightedEdge EdgeTypeIterator<Graph, WeightedEdge>::operator*() const noexcept { |
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.
another non-graph method
Currently, the PR is in draft mode. The plan is to extract and move functionality out of the graph data structure, which might be useful for other graph types (e.g. Hypergraphs). The graph type and basic data type (e.g. edge) should be deduced by template.
ToDo: