Skip to content

Commit 592880e

Browse files
committed
init hgl groups + first hgl doc comments
1 parent 444ca03 commit 592880e

10 files changed

Lines changed: 233 additions & 27 deletions

File tree

docs/config/groups.dox

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444

4545
/// @defgroup GL-IO I/O Utility
4646
/// @ingroup GL
47-
/// @brief Comprehensive I/O stream support, parsing algorithms, and range-based formatting.
47+
/// @brief I/O stream operations, formatting, and serialization of graph data.
4848
///
4949
/// This group provides the necessary infrastructure to seamlessly serialize, deserialize, and
50-
/// visualize complex graph structures. By offering a robust set of stream manipulators, formatting
51-
/// traits, and configuration options, it allows users to easily translate in-memory graphs to
52-
/// and from standard streams, files, or custom string representations.
50+
/// visualize complex graph structures. By offering a robust set of stream manipulators, range
51+
/// formatting utilities, and configuration options, it allows users to easily translate
52+
/// in-memory graphs to and from standard streams, files, or custom string representations.
5353

5454
/// @defgroup GL-Traits Traits & Concepts
5555
/// @ingroup GL
@@ -83,3 +83,78 @@
8383
/// operations, these utilities are completely independent of graph theory semantics. They provide
8484
/// a curated set of highly reusable, general-purpose tools that can smoothly integrate into any
8585
/// modern C++ codebase.
86+
87+
/// @defgroup HGL Hypergraph Library (HGL)
88+
/// @brief The top-level module defining the general-purpose C++ template hypergraph library.
89+
///
90+
/// This module provides a comprehensive suite of memory-efficient hypergraph representations,
91+
/// highly customizable algorithms, and robust I/O facilities. Designed strictly around modern
92+
/// C++ paradigms, the library leverages templates and concepts to deliver an API that is fast,
93+
/// generic, and type-safe. It supports both undirected hypergraphs and backward-forward (bf)
94+
/// directed hypergraphs.
95+
96+
/// @defgroup HGL-Core Core Hypergraph Components
97+
/// @ingroup HGL
98+
/// @brief Fundamental hypergraph data structures, element descriptors, and configuration tags.
99+
///
100+
/// This group establishes the primary user interface for the HGL module, centered around the highly
101+
/// configurable @ref hgl::hypergraph "hypergraph" class. It provides the core data types, such as vertex
102+
/// and hyperedge descriptors, required to safely navigate and manipulate graph elements.
103+
///
104+
/// Furthermore, this module defines the declarative tags (e.g., directedness and backend
105+
/// implementation types) that dictate both the behavioral semantics and the underlying memory
106+
/// layout of the instantiated hypergraphs.
107+
108+
/// @defgroup HGL-Algorithm Hypergraph Algorithms
109+
/// @ingroup HGL
110+
/// @brief Generic hypergraph algorithms, search templates, and related utilities.
111+
///
112+
/// This module provides hypergraph-specific algorithmic templates and implementations
113+
/// (such as forward and backward searches) designed to natively navigate the complex,
114+
/// high-order structure of hyperedges.
115+
116+
/// @defgroup HGL-IO I/O Utility
117+
/// @ingroup HGL
118+
/// @brief I/O stream operations, formatting, and serialization of hypergraph data.
119+
///
120+
/// Provides the necessary infrastructure to seamlessly serialize, deserialize, and visualize
121+
/// complex hypergraph structures. It utilizes shared stream manipulation options and range
122+
/// formatting utilities to easily translate in-memory hypergraphs to and from standard
123+
/// streams and files.
124+
125+
/// @defgroup HGL-Traits Traits & Concepts
126+
/// @ingroup HGL
127+
/// @brief Type traits, template constraints, and compile-time metaprogramming utilities.
128+
///
129+
/// These components form the strict conceptual backbone of the HGL module, used extensively
130+
/// to ensure internal type safety and correctness, while also constraining user-defined types
131+
/// to required structural contracts.
132+
///
133+
/// @section concepts_link Detailed Concept Specifications
134+
/// For a detailed list of all HGL module's concepts and their formal requirements, please refer to
135+
/// the [HGL Concepts Documentation](hgl_concepts.md#hgl-concepts-documentation) page.
136+
///
137+
/// > [!NOTE]
138+
/// >
139+
/// > Because hypergraphs share the same underlying implementation design and mechanisms as standard
140+
/// > graphs, they seamlessly reuse the same fundamental C++20 concepts. Therefore the HGL module
141+
/// > pulls in all standard graph traits, concept checkers, and metaprogramming utilities from the
142+
/// > GL module. To get an overview of these traits and concepts, please refer to the GL module's
143+
/// > @ref GL-Traits documentation page.
144+
145+
/// @defgroup HGL-Types Generic Types
146+
/// @ingroup HGL
147+
/// @brief Independent, high-performance data structures and utility types.
148+
///
149+
/// This module houses a variety of general-purpose data structures and types. Though they are
150+
/// utilized natively by hypergraph implementations, these components are carefully decoupled
151+
/// from specific hypergraph logic, they can be seamlessly extracted and utilized in broader
152+
/// contexts.
153+
154+
/// @defgroup HGL-Util General Utilities
155+
/// @ingroup HGL
156+
/// @brief Practical, domain-agnostic C++ helpers, mathematical functions, and polyfills.
157+
///
158+
/// These utilities provide a curated set of general-purpose tools that support the
159+
/// library's internal algorithms and hypergraph modeling operations, completely
160+
/// independent of strict hypergraph theory semantics.

include/gl/constants.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct initial_id_t {
3838
};
3939

4040
/// @ingroup GL GL-Core
41-
/// @brief A constant instance of `initial_id_t` that can be used to represent the initial ID value of 0 for graph elements in a type-safe manner.
41+
/// @brief An `initial_id_t` tag constant that can be used to represent the initial ID value of 0 for graph elements in a type-safe manner.
4242
///
4343
/// ### Example Usage
4444
/// ```cpp
@@ -96,7 +96,7 @@ struct invalid_id_t {
9696
};
9797

9898
/// @ingroup GL GL-Core
99-
/// @brief A constant instance of `invalid_id_t` that can be used to represent the invalid ID value for graph elements in a type-safe manner.
99+
/// @brief An `invalid_id_t` tag constant that can be used to represent the invalid ID value for graph elements in a type-safe manner.
100100
///
101101
/// ### Example Usage
102102
/// ```cpp

include/gl/types/properties.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
namespace gl {
1818

1919
/// @ingroup GL GL-Core
20-
/// @brief A tag struct representing no user-defined properties.
20+
/// @brief A stateless, empty structural tag representing an absence of properties.
2121
///
2222
/// > [!IMPORTANT]
2323
/// >
2424
/// > This type is used as a default `properties_type` for graph components that do not require any user-defined data.
25-
/// > It serves as a marker to indicate that the component is "property-less" and can be optimized accordingly.
25+
/// > It serves as a marker to indicate that the component is *property-less* and can be optimized accordingly.
2626
struct empty_properties {};
2727

2828
/// @ingroup GL GL-Core
29-
/// @brief A tag struct representing an empty property map.
29+
/// @brief A stateless, empty structural tag indicating that the absence of a property map container.
3030
///
3131
/// > [!NOTE]
3232
/// >

include/gl/util/ranges.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace gl::util {
1414

1515
/// @ingroup GL GL-Util
16-
/// @brief Returns the size of a range.
16+
/// @brief Safely determines the size of a range.
1717
///
1818
/// This function returns the size of a range if it is a sized range, otherwise it computes the
1919
/// distance between the beginning and end of the range. Note that computing the distance for

include/hgl/constants.hpp

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,44 @@
22
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
33
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
44

5+
/// @file hgl/constants.hpp
6+
/// @brief Defines common constant values and types used across the HGL module.
7+
58
#pragma once
69

710
#include "gl/constants.hpp"
811
#include "hgl/traits.hpp"
912

1013
namespace hgl {
1114

12-
using gl::initial_id;
13-
using gl::initial_id_t;
15+
/// @ingroup HGL-Core
16+
/// @brief A constant representing the initial ID value of 0 for hypergraph elements.
17+
/// @see gl::initial_id_v
1418
using gl::initial_id_v;
1519

16-
using gl::invalid_id;
17-
using gl::invalid_id_t;
20+
/// @ingroup HGL-Core
21+
/// @brief A helper type that can be implicitly converted to the initial ID value of 0 for any valid ID type.
22+
/// @see gl::initial_id_t
23+
using gl::initial_id_t;
24+
25+
/// @ingroup HGL-Core
26+
/// @brief An `initial_id_t` tag constant that can be used to represent the initial ID value of 0 for hypergraph elements in a type-safe manner.
27+
/// @see gl::initial_id
28+
using gl::initial_id;
29+
30+
/// @ingroup HGL-Core
31+
/// @brief A constant representing the invalid ID value for hypergraph elements, defined as the maximum value of the specified ID type.
32+
/// @see gl::invalid_id_v
1833
using gl::invalid_id_v;
1934

35+
/// @ingroup HGL-Core
36+
/// @brief A helper type that can be implicitly converted to the invalid ID value for any valid ID type.
37+
/// @see gl::invalid_id_t
38+
using gl::invalid_id_t;
39+
40+
/// @ingroup HGL-Core
41+
/// @brief An `invalid_id_t` tag constant that can be used to represent the invalid ID value for hypergraph elements in a type-safe manner.
42+
/// @see gl::invalid_id
43+
using gl::invalid_id;
44+
2045
} // namespace hgl

include/hgl/conversion.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ template <traits::c_hypergraph_impl_tag TargetImplTag, traits::c_hypergraph Hype
231231

232232
template <gl::traits::c_undirected_graph G>
233233
[[nodiscard]] G projection(const traits::c_undirected_hypergraph auto& h) {
234-
using edge_vertices = hgl::homogeneous_pair<typename G::id_type>;
234+
using edge_vertices = homogeneous_pair<typename G::id_type>;
235235
std::vector<edge_vertices> edges;
236236

237237
for (const auto eid : h.hyperedge_ids()) {
@@ -263,7 +263,7 @@ requires std::same_as<typename G::traits_type::implementation_tag, gl::impl::fla
263263

264264
template <gl::traits::c_directed_graph G>
265265
[[nodiscard]] G projection(const traits::c_bf_directed_hypergraph auto& h) {
266-
using edge_vertices = hgl::homogeneous_pair<typename G::id_type>;
266+
using edge_vertices = homogeneous_pair<typename G::id_type>;
267267
std::vector<edge_vertices> edges;
268268

269269
for (const auto eid : h.hyperedge_ids()) {

include/hgl/traits.hpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,27 @@
22
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
33
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
44

5+
/// @file hgl/traits.hpp
6+
/// @brief Contains C++20 concepts and type traits used to constrain hypergraph library templates.
7+
58
#pragma once
69

710
#include "gl/traits.hpp"
811
#include "hgl/types.hpp"
912

10-
namespace hgl::traits {
13+
namespace hgl {
14+
15+
/// @ingroup HGL-Traits
16+
/// @brief Traits and concepts for the HGL module.
17+
///
18+
/// This namespace contains the definitions of all hypergraph-specifc concepts and type traits
19+
/// used to constrain library types and pulls in all standard graph traits, concept checkers,
20+
/// and metaprogramming utilities from `gl::traits`. Because hypergraphs share the same underlying
21+
/// implementation design and mechanisms as standard graphs, they seamlessly reuse the same
22+
/// fundamental C++20 concepts.
23+
namespace traits {
1124

1225
using namespace gl::traits;
1326

14-
} // namespace hgl::traits
27+
} // namespace traits
28+
} // namespace hgl

include/hgl/types.hpp

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
33
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
44

5+
/// @file hgl/types.hpp
6+
/// @brief Core type definitions, generic data structures, and properties for the HGL module.
7+
58
#pragma once
69

710
#include "gl/types/core.hpp"
@@ -13,27 +16,81 @@ namespace hgl {
1316

1417
// --- core types ---
1518

16-
using gl::default_id_type;
19+
/// @ingroup HGL-Types
20+
/// @brief @copybrief gl::size_type
21+
///
22+
/// Used primarily for indices, counts, and sizes of hypergraph components.
23+
/// @see gl::size_type
1724
using gl::size_type;
1825

19-
using gl::to_diff;
26+
/// @ingroup HGL-Types
27+
/// @brief The default unsigned integer type used for vertex and hyperedge identifiers.
28+
/// @see gl::default_id_type
29+
using gl::default_id_type;
30+
31+
/// @ingroup HGL-Types
32+
/// @brief @copybrief gl::to_idx
33+
/// @see gl::to_idx
2034
using gl::to_idx;
2135

36+
/// @ingroup HGL-Types
37+
/// @brief @copybrief gl::to_diff
38+
/// @see gl::to_diff
39+
using gl::to_diff;
40+
2241
// --- generic data structures ---
2342

43+
/// @ingroup HGL-Types
44+
/// @brief @copybrief gl::flat_jagged_vector
45+
/// @see gl::flat_jagged_vector
2446
using gl::flat_jagged_vector;
47+
48+
/// @ingroup HGL-Types
49+
/// @brief @copybrief gl::flat_matrix
50+
/// @see gl::flat_matrix
2551
using gl::flat_matrix;
52+
53+
/// @ingroup HGL-Types
54+
/// @brief @copybrief gl::homogeneous_pair
55+
/// @see gl::homogeneous_pair
2656
using gl::homogeneous_pair;
2757

2858
// --- property types ---
2959

30-
using gl::bin_color_value;
31-
using gl::binary_color;
32-
using gl::binary_color_property;
33-
using gl::dynamic_properties;
60+
/// @ingroup HGL-Core
61+
/// @brief @copybrief gl::empty_properties
62+
///
63+
/// > [!IMPORTANT]
64+
/// >
65+
/// > This type is used as a default `properties_type` for hypergraph components that do not require any user-defined data.
66+
/// > It serves as a marker to indicate that the component is *property-less* and can be optimized accordingly.
67+
///
68+
/// @see gl::empty_properties
3469
using gl::empty_properties;
70+
71+
/// @ingroup HGL-Core
72+
/// @brief @copybrief gl::empty_properties_map
73+
///
74+
/// > [!NOTE]
75+
/// >
76+
/// > This type is used internally by the library to optimize storage for hypergraph components that have no properties.
77+
///
78+
/// @see gl::empty_properties_map
3579
using gl::empty_properties_map;
80+
81+
/// @ingroup HGL-Core
82+
/// @brief @copybrief gl::name_property
83+
/// @see gl::name_property
3684
using gl::name_property;
85+
86+
/// @ingroup HGL-Core
87+
/// @brief @copybrief gl::dynamic_properties
88+
/// @see gl::dynamic_properties
89+
using gl::dynamic_properties;
90+
91+
/// @ingroup HGL-Core
92+
/// @brief A property struct providing arithmetic weight for hyperedges or vertices.
93+
/// @see gl::weight_property
3794
using gl::weight_property;
3895

3996
} // namespace hgl

include/hgl/util.hpp

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,43 @@
22
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
33
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
44

5+
/// @file hgl/util.hpp
6+
/// @brief Defines utility functions and views for working with C++20 ranges in the HGL module.
7+
58
#pragma once
69

710
#include "gl/util/ranges.hpp"
811

912
namespace hgl::util {
1013

14+
/// @ingroup HGL-Util
15+
/// @brief @copybrief gl::util::range_size
16+
/// @see gl::util::range_size
17+
using gl::util::range_size;
18+
19+
/// @ingroup HGL-Util
20+
/// @brief @copybrief gl::util::is_constant
21+
/// @see gl::util::is_constant
22+
using gl::util::is_constant;
23+
24+
/// @ingroup HGL-Util
25+
/// @brief @copybrief gl::util::all_equal
26+
/// @see gl::util::all_equal
1127
using gl::util::all_equal;
12-
using gl::util::concat;
28+
29+
/// @ingroup HGL-Util
30+
/// @brief @copybrief gl::util::concat_view
31+
/// @see gl::util::concat_view
1332
using gl::util::concat_view;
14-
using gl::util::is_constant;
15-
using gl::util::range_size;
33+
34+
/// @ingroup HGL-Util
35+
/// @brief @copybrief gl::util::concat_fn
36+
/// @see gl::util::concat_fn
37+
using gl::util::concat_fn;
38+
39+
/// @ingroup HGL-Util
40+
/// @brief @copybrief gl::util::concat
41+
/// @see gl::util::concat
42+
using gl::util::concat;
1643

1744
} // namespace hgl::util

mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ nav:
3636
- Generic Templates: hgl/algorithms/templates.md
3737
- Concrete Traversals: hgl/algorithms/traversal.md
3838
- I/O Utility: hgl/io.md
39+
- API Reference:
40+
- Overview: cpp-gl/group__HGL.md
41+
- Core Components: cpp-gl/group__HGL-Core.md
42+
- Algorithms: cpp-gl/group__HGL-Algorithm.md
43+
- I/O Utility: cpp-gl/group__HGL-IO.md
44+
- Traits & Concepts: cpp-gl/group__HGL-Traits.md
45+
- Generic Types: cpp-gl/group__HGL-Types.md
46+
- General Utilities: cpp-gl/group__HGL-Util.md
3947
- API Index:
4048
- Modules: cpp-gl/modules.md
4149
- Classes & Structs: cpp-gl/annotated.md

0 commit comments

Comments
 (0)