Clearly separate graphs from the sparsity pattern#123
Conversation
…lying sparsity pattern
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 829 829
=========================================
Hits 829 829 ☔ View full report in Codecov by Sentry. |
amontoison
left a comment
There was a problem hiding this comment.
@gdalle
Excellent PR! I really like this new structure.
I was not a big fan of the Graph with the attribute loops.
Aside from a small comment about the number of edges for AdjacencyGraph, the code looks good to me.
Could I request the name SparsityPatternCSC instead of SparsePatternCSC?
It’s even more explicit from my point of view.
Excellent job!!!
|
It should be easily to remove the allocation of S' here now. |
|
Indeed that was the next step of the plan, I have opened #126 to keep track |
Idea
Create two clearly distinct graph structures (
AdjacencyGraphandBipartiteGraph) and distinguish them from the container for the sparsity pattern.Benefits
Now:
Graph{true}/Graph{false}which wasn't even a graph in the rectangular case.In the future:
Changes
GraphintoSparsePatternCSC, which is exactly aSparseMatrixCSCwithoutnzval. Remove definitions ofneighborsand friends, keep only linear algebra stuff there.AdjacencyGraphbased on oneSparsePatternCSC, put theneighborslogic there. It is the pendant toBipartiteGraph.AdjacencyGraph(divide by two to account for symmetry).adjacency_graphandbipartite_graph.