YT-CPPHGL-9: Introduce storage layout tags to define the layout of incidence list and matrix representation models#67
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces storage layout tags (vertex_major_t and hyperedge_major_t) to parameterize hypergraph implementation models, enabling unified handling of different storage layouts for incidence lists and matrices.
Key Changes:
- Introduced layout tag infrastructure with
vertex_major_tandhyperedge_major_tproviding utility methods for layout-aware element access - Unified
undirected_hyperedge_listandundirected_vertex_listinto a single templateundirected_incidence_list<LayoutTag> - Updated
undirected_incidence_matrixwith layout tag parameterization for flexible row/column orientation
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| include/hgl/impl/layout_tags.hpp | Defines new vertex_major_t and hyperedge_major_t layout tags with utility methods |
| include/hgl/impl/impl_tags.hpp | Updates implementation tags to template-based list_t and matrix_t parameterized by layout tags |
| include/hgl/impl/incidence_list.hpp | New unified incidence list implementation replacing separate vertex and hyperedge list classes |
| include/hgl/impl/incidence_matrix.hpp | Updated incidence matrix with layout tag template parameter and layout-dependent operations |
| include/hgl/hypergraph_traits.hpp | Updated traits aliases to use new parameterized implementation tags |
| tests/source/hgl/test_incidence_list.cpp | New test file for unified incidence list implementation covering both layout variants |
| tests/source/hgl/test_incidence_matrix.cpp | Extended tests to cover both vertex-major and hyperedge-major matrix layouts |
| tests/source/hgl/test_hypergraph.cpp | Updated test instantiations to include all layout and implementation combinations |
| tests/source/hgl/test_vertex_list.cpp | Removed (functionality merged into test_incidence_list.cpp) |
| tests/source/hgl/test_hyperedge_list.cpp | Removed (functionality merged into test_incidence_list.cpp) |
| include/hgl/impl/vertex_list.hpp | Removed (replaced by incidence_list.hpp) |
| include/hgl/impl/hyperedge_list.hpp | Removed (replaced by incidence_list.hpp) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| hgl::types::name_property, | ||
| hgl::types::name_property>, // undirected hyperedge list | ||
| hgl::hyperedge_list_hg_traits< | ||
| hgl::types::name_property>, // undirected hyperedge-major incicence list |
There was a problem hiding this comment.
Spelling error: "incicence" should be "incidence"
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
vertex_major_tandhyperedge_major_timplementation layout tags with utility methods for retrieving the major and minor elementslist_tandmatrix_ttags parametrized with a storage layout tagundirected_hyperedge_listandundirected_vertex_listclasses into a single template classundirected_incidence_list<LayoutTag>LayoutTagtemplate parameter to theunidrected_incidence_matrixclass and aligned its implementation to use layout-dependent behaviourhypergraph_traitstype and related utility to use the new tags