Skip to content

Commit 9375654

Browse files
committed
gl: impl tags -> repr tags
1 parent 5b0fbc4 commit 9375654

31 files changed

Lines changed: 301 additions & 299 deletions

docs/gl/architecture.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ The [**gl::graph_traits**](../cpp-gl/structgl_1_1graph__traits.md) struct config
2323
1. **Directionality**: Directed vs. Undirected.
2424
2. **Vertex Properties**: The data payload attached to each vertex.
2525
3. **Edge Properties**: The data payload attached to each edge.
26-
4. **Implementation Tag**: The underlying memory layout (e.g., Adjacency List).
26+
4. **Representation Tag**: The underlying memory layout (e.g., Adjacency List).
2727
5. **ID Type**: The integer type used for internal indexing (defaults to `std::uint32_t`).
2828

2929
To reduce boilerplate, the library provides several generic type aliases for the most common configurations:
3030

3131
- Based on the directional tag:
3232

33-
- [**gl::directed_graph<VP, EP, Impl, IdType>**](../cpp-gl/group__GL-Core.md#typedef-directed_graph)
34-
- [**gl::undirected_graph<VP, EP, Impl, IdType>**](../cpp-gl/group__GL-Core.md#typedef-undirected_graph)
33+
- [**gl::directed_graph<VP, EP, ReprTag, IdType>**](../cpp-gl/group__GL-Core.md#typedef-directed_graph)
34+
- [**gl::undirected_graph<VP, EP, ReprTag, IdType>**](../cpp-gl/group__GL-Core.md#typedef-undirected_graph)
3535

36-
- Based on the implementation tag:
36+
- Based on the representation tag:
3737

3838
- [**gl::list_graph<Dir, VP, EP, IdType>**](../cpp-gl/group__GL-Core.md#typedef-list_graph)
3939
- [**gl::flat_list_graph<Dir, VP, EP, IdType>**](../cpp-gl/group__GL-Core.md#typedef-flat_list_graph)
@@ -139,7 +139,7 @@ for (auto neighbor_id : graph.neighbor_ids(source_id)) { // (3)!
139139
140140
## Graph Representation Models
141141
142-
Choosing the correct memory layout is critical for algorithmic performance. CPP-GL abstracts this choice entirely behind the `ImplTag`, allowing you to swap layouts without altering a single line of traversal code.
142+
Choosing the correct memory layout is critical for algorithmic performance. CPP-GL abstracts this choice entirely behind the `ReprTag`, allowing you to swap layouts without altering a single line of traversal code.
143143
144144
### Fundamental Representations
145145
@@ -161,21 +161,21 @@ Consider the following graph:
161161
162162
CPP-GL currently categorizes its memory layouts into two primary families based on their underlying memory allocation strategy.
163163
164-
> [!NOTE] All representation model tag types are defined in the `gl::impl` namespace.
164+
> [!NOTE] All representation model tag types are defined in the `gl::repr` namespace.
165165
166166
#### Standard Models
167167
168168
Heap-allocated, nested structures that prioritize flexibility and dynamic structural modification.
169169
170-
- [**list_t**](../cpp-gl/structgl_1_1impl_1_1list__t.md): A standard Adjacency List model implemented using traditional nested containers (e.g., `std::vector<std::vector<T>>`).
171-
- [**matrix_t**](../cpp-gl/structgl_1_1impl_1_1matrix__t.md): A standard Adjacency Matrix model implemented using traditional nested containers.
170+
- [**list_t**](../cpp-gl/structgl_1_1repr_1_1list__t.md): A standard Adjacency List model implemented using traditional nested containers (e.g., `std::vector<std::vector<T>>`).
171+
- [**matrix_t**](../cpp-gl/structgl_1_1repr_1_1matrix__t.md): A standard Adjacency Matrix model implemented using traditional nested containers.
172172
173173
### Flat Models
174174
175175
Contiguous 1D memory blocks that prioritize cache locality and maximum traversal speed over modification speed.
176176
177-
- [**flat_list_t**](../cpp-gl/structgl_1_1impl_1_1flat__list__t.md): A flattened Adjacency List model implemented using the generic [**flat_jagged_vector**](../cpp-gl/classgl_1_1flat__jagged__vector.md) data structure.
178-
- [**flat_matrix_t**](../cpp-gl/structgl_1_1impl_1_1flat__matrix__t.md): A flattened Adjacency Matrix model implemented using the generic [**flat_matrix**](../cpp-gl/classgl_1_1flat__matrix.md) data structure.
177+
- [**flat_list_t**](../cpp-gl/structgl_1_1repr_1_1flat__list__t.md): A flattened Adjacency List model implemented using the generic [**flat_jagged_vector**](../cpp-gl/classgl_1_1flat__jagged__vector.md) data structure.
178+
- [**flat_matrix_t**](../cpp-gl/structgl_1_1repr_1_1flat__matrix__t.md): A flattened Adjacency Matrix model implemented using the generic [**flat_matrix**](../cpp-gl/classgl_1_1flat__matrix.md) data structure.
179179
180180
### Topology Support: Simple Graphs and Multigraphs
181181
@@ -204,7 +204,7 @@ Being "edge-aware" means that the internal representation stores the specific `e
204204
205205
#### Standard Memory Models
206206
207-
The standard implementations utilize traditional, nested 2D containers (e.g., `std::vector<std::vector<T>>`).
207+
The standard model implementations utilize traditional, nested 2D containers (e.g., `std::vector<std::vector<T>>`).
208208
209209
These models are highly flexible. Because the inner containers can grow independently, they handle structural modifications, like adding vertices or edges, gracefully. The trade-off is that the memory is fragmented across the heap, which can lead to cache misses during heavy graph traversals.
210210
@@ -250,11 +250,11 @@ Depending on the chosen representation model, the computational complexity of st
250250
251251
### Choosing the Layout
252252
253-
Selecting the right `ImplTag` is a balance of your specific operational needs - use:
253+
Selecting the right `ReprTag` is a balance of your specific operational needs - use:
254254
255-
- [**list_t**](../cpp-gl/structgl_1_1impl_1_1list__t.md) for highly dynamic, sparse graphs where the topology changes frequently.
256-
- [**flat_list_t**](../cpp-gl/structgl_1_1impl_1_1flat__list__t.md) for static, sparse graphs where traversal speed and cache locality are paramount.
257-
- [**matrix_t**](../cpp-gl/structgl_1_1impl_1_1matrix__t.md) (or [**flat_matrix_t**](../cpp-gl/structgl_1_1impl_1_1flat__matrix__t.md) if structure is entirely static) for highly dense graphs (where $\vert E \vert \approx \vert V \vert^2$) when instant $O(1)$ edge lookups are strictly required and memory footprint is not a bottleneck.
255+
- [**list_t**](../cpp-gl/structgl_1_1repr_1_1list__t.md) for highly dynamic, sparse graphs where the topology changes frequently.
256+
- [**flat_list_t**](../cpp-gl/structgl_1_1repr_1_1flat__list__t.md) for static, sparse graphs where traversal speed and cache locality are paramount.
257+
- [**matrix_t**](../cpp-gl/structgl_1_1repr_1_1matrix__t.md) (or [**flat_matrix_t**](../cpp-gl/structgl_1_1repr_1_1flat__matrix__t.md) if structure is entirely static) for highly dense graphs (where $\vert E \vert \approx \vert V \vert^2$) when instant $O(1)$ edge lookups are strictly required and memory footprint is not a bottleneck.
258258
259259
---
260260

docs/gl/quick_start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main() {
2323
gl::directed_t,
2424
gl::empty_properties,
2525
gl::weight_property<int>,
26-
gl::impl::list_t>;
26+
gl::repr::list_t>;
2727

2828
gl::graph<traits_t> graph(5); // (3)!
2929

include/gl/algorithm/pathfinding/dijkstra.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ struct dijkstra_search_node {
105105
/// >
106106
/// > The time complexity depends on the underlying representation of `GraphType` and the priority queue overhead:
107107
/// > - **Adjacency List Representations**: \f$O((|V| + |E|) \log |V|)\f$
108-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
108+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
109109
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2 + |E| \log |V|)\f$
110-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
110+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
111111
/// > - *Note:* Iterating over adjacent vertices requires scanning the entire \f$|V|\f$-length matrix row.
112112
///
113113
/// ### Template Parameters

include/gl/algorithm/spanning_tree/prim_mst.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ struct mst_descriptor {
5959
/// >
6060
/// > The time complexity depends on the underlying representation of `GraphType` and the queue overhead:
6161
/// > - **Adjacency List Representations**: \f$O(|E| \log |E|)\f$
62-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
62+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
6363
/// > - *Note:* In simple graphs, this simplifies to \f$O(|E| \log |V|)\f$. However, because list models allow multigraphs, the queue size and operations scale strictly with \f$|E|\f$.
6464
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2 + |E| \log |V|)\f$
65-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
65+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
6666
/// > - *Note:* Iterating over incident edges requires scanning the entire \f$|V|\f$-length matrix row. Since matrices represent simple graphs, the heap operations safely simplify to \f$O(\log |V|)\f$.
6767
///
6868
/// ### Template Parameters

include/gl/algorithm/topology/coloring.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ using bicoloring_type = std::vector<binary_color>;
4040
/// >
4141
/// > The time complexity depends entirely on the underlying representation of `GraphType`:
4242
/// > - **Adjacency List Representations**: \f$O(|V| + |E|)\f$
43-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
43+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
4444
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2)\f$
45-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
45+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
4646
/// > - *Note:* Iterating over adjacent vertices requires scanning the entire \f$|V|\f$-length matrix row.
4747
///
4848
/// ### Template Parameters

include/gl/algorithm/topology/topological_sort.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ namespace gl::algorithm {
4242
/// >
4343
/// > The time complexity depends entirely on the underlying representation of `GraphType`:
4444
/// > - **Adjacency List Representations**: \f$O(|V| + |E|)\f$
45-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
45+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
4646
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2)\f$
47-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
47+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
4848
/// > - *Note:* Iterating over adjacent vertices requires scanning the entire \f$|V|\f$-length matrix row.
4949
///
5050
/// ### Template Parameters

include/gl/algorithm/traversal/breadth_first_search.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ namespace gl::algorithm {
4848
/// >
4949
/// > The time complexity depends entirely on the underlying representation of `GraphType`:
5050
/// > - **Adjacency List Representations**: \f$O(|V| + |E|)\f$
51-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
51+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
5252
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2)\f$
53-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
53+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
5454
/// > - *Note:* Iterating over adjacent vertices requires scanning the entire \f$|V|\f$-length matrix row.
5555
///
5656
/// ### Template Parameters

include/gl/algorithm/traversal/depth_first_search.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ namespace gl::algorithm {
5656
/// >
5757
/// > The time complexity depends entirely on the underlying representation of `GraphType`:
5858
/// > - **Adjacency List Representations**: \f$O(|V| + |E|)\f$
59-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
59+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
6060
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2)\f$
61-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
61+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
6262
/// > - *Note:* Iterating over adjacent vertices requires scanning the entire \f$|V|\f$-length matrix row.
6363
///
6464
/// ### Template Parameters
@@ -156,9 +156,9 @@ result_type<Result, predecessors_map<G>> depth_first_search(
156156
/// >
157157
/// > The time complexity depends entirely on the underlying representation of `GraphType`:
158158
/// > - **Adjacency List Representations**: \f$O(|V| + |E|)\f$
159-
/// > - *Includes:* @ref gl::impl::list_t "list_t" and @ref gl::impl::flat_list_t "flat_list_t".
159+
/// > - *Includes:* @ref gl::repr::list_t "list_t" and @ref gl::repr::flat_list_t "flat_list_t".
160160
/// > - **Adjacency Matrix Representations**: \f$O(|V|^2)\f$
161-
/// > - *Includes:* @ref gl::impl::matrix_t "matrix_t" and @ref gl::impl::flat_matrix_t "flat_matrix_t".
161+
/// > - *Includes:* @ref gl::repr::matrix_t "matrix_t" and @ref gl::repr::flat_matrix_t "flat_matrix_t".
162162
/// > - *Note:* Iterating over adjacent vertices requires scanning the entire \f$|V|\f$-length matrix row.
163163
///
164164
/// ### Template Parameters

0 commit comments

Comments
 (0)