- Fixes for Doxygen Layouts

- Changed dynarray indexing to use size_t
 - Added groups to optional documentation
This commit is contained in:
2025-08-19 18:05:09 -04:00
parent 4ff739d625
commit 83f0c01e29
9 changed files with 143 additions and 59 deletions

View File

@@ -16,8 +16,9 @@
* [Coding Standards](#coding-standards) * [Coding Standards](#coding-standards)
* [Building from Source](#building-from-source) * [Building from Source](#building-from-source)
* [Building from Terminal](#building-from-terminal) * [Building from Terminal](#building-from-terminal)
* [Debian](#debian) * [Debian](#debian) → `apt`
* [Fedora](#fedora-dnf) → `dnf` * [Arch](#arch) → `pacman`
* [Fedora](#fedora) → `dnf`
* [Building on Windows](#building-on-windows) * [Building on Windows](#building-on-windows)
* [Running the Test Suite](#running-the-test-suite) * [Running the Test Suite](#running-the-test-suite)
* [Usage](#usage) * [Usage](#usage)
@@ -158,7 +159,7 @@ If you wish to build for Windows *and* Linux, your options are WSL or Dual Boot.
On Debian-based distributions, you can install dependencies using the following command: On Debian-based distributions, you can install dependencies using the following command:
```shell ```shell
sudo apt install build-essential cmake ninja-build libglew-dev valgrind sudo apt install build-essential cmake ninja-build libglew-dev valgrind
git submodule update --init --recursive git submodule update --force --init --recursive --remote
``` ```
for Doxygen run: for Doxygen run:
@@ -166,13 +167,27 @@ for Doxygen run:
sudo apt install doxygen graphviz sudo apt install doxygen graphviz
``` ```
<a id="fedora-dnf"></a> <a id="arch"></a>
#### Fedora (`dnf`) #### Arch
On Debian-based distributions, you can install dependencies using the following command: On Arch-based distributions, you can install dependencies using the following command:
```shell
sudo pacman -S base-devel cmake ninja glew valgrind
git submodule update --force --init --recursive --remote
```
for Doxygen run:
```shell
sudo pacman -S doxygen graphviz
```
<a id="fedora"></a>
#### Fedora
On Fedora-based distributions, you can install dependencies using the following command:
```shell ```shell
sudo dnf install build-essential g++ cmake ninja-build glew-devel valgrind sudo dnf install build-essential g++ cmake ninja-build glew-devel valgrind
git submodule update --init --recursive git submodule update --force --init --recursive --remote
``` ```
for Doxygen run: for Doxygen run:

View File

@@ -49,6 +49,7 @@
<includes visible="$SHOW_HEADERFILE"/> <includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="$CLASS_GRAPH"/> <inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="yes"/> <collaborationgraph visible="yes"/>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<nestedclasses visible="yes" title=""/> <nestedclasses visible="yes" title=""/>
<publictypes title=""/> <publictypes title=""/>
@@ -83,7 +84,6 @@
<related title="" subtitle=""/> <related title="" subtitle=""/>
<membergroups visible="yes"/> <membergroups visible="yes"/>
</memberdecl> </memberdecl>
<detaileddescription title=""/>
<memberdef> <memberdef>
<inlineclasses title=""/> <inlineclasses title=""/>
<typedefs title=""/> <typedefs title=""/>
@@ -105,6 +105,7 @@
<!-- Layout definition for a namespace page --> <!-- Layout definition for a namespace page -->
<namespace> <namespace>
<briefdescription visible="yes"/> <briefdescription visible="yes"/>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<nestednamespaces visible="yes" title=""/> <nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/> <constantgroups visible="yes" title=""/>
@@ -121,7 +122,6 @@
<variables title=""/> <variables title=""/>
<membergroups visible="yes"/> <membergroups visible="yes"/>
</memberdecl> </memberdecl>
<detaileddescription title=""/>
<memberdef> <memberdef>
<inlineclasses title=""/> <inlineclasses title=""/>
<typedefs title=""/> <typedefs title=""/>
@@ -150,6 +150,7 @@
<includegraph visible="yes"/> <includegraph visible="yes"/>
<includedbygraph visible="yes"/> <includedbygraph visible="yes"/>
<sourcelink visible="yes"/> <sourcelink visible="yes"/>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<interfaces visible="yes" title=""/> <interfaces visible="yes" title=""/>
<classes visible="yes" title=""/> <classes visible="yes" title=""/>
@@ -167,7 +168,6 @@
<variables title=""/> <variables title=""/>
<membergroups visible="yes"/> <membergroups visible="yes"/>
</memberdecl> </memberdecl>
<detaileddescription title=""/>
<memberdef> <memberdef>
<inlineclasses title=""/> <inlineclasses title=""/>
<defines title=""/> <defines title=""/>
@@ -185,6 +185,7 @@
<group> <group>
<briefdescription visible="yes"/> <briefdescription visible="yes"/>
<groupgraph visible="yes"/> <groupgraph visible="yes"/>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<nestedgroups visible="yes" title=""/> <nestedgroups visible="yes" title=""/>
<modules visible="yes" title=""/> <modules visible="yes" title=""/>
@@ -210,7 +211,6 @@
<friends title=""/> <friends title=""/>
<membergroups visible="yes"/> <membergroups visible="yes"/>
</memberdecl> </memberdecl>
<detaileddescription title=""/>
<memberdef> <memberdef>
<pagedocs/> <pagedocs/>
<inlineclasses title=""/> <inlineclasses title=""/>
@@ -237,6 +237,7 @@
<module> <module>
<briefdescription visible="yes"/> <briefdescription visible="yes"/>
<exportedmodules visible="yes"/> <exportedmodules visible="yes"/>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<concepts visible="yes" title=""/> <concepts visible="yes" title=""/>
<classes visible="yes" title=""/> <classes visible="yes" title=""/>
@@ -246,7 +247,6 @@
<variables title=""/> <variables title=""/>
<membergroups title=""/> <membergroups title=""/>
</memberdecl> </memberdecl>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<files visible="yes"/> <files visible="yes"/>
</memberdecl> </memberdecl>
@@ -256,10 +256,10 @@
<directory> <directory>
<briefdescription visible="yes"/> <briefdescription visible="yes"/>
<directorygraph visible="yes"/> <directorygraph visible="yes"/>
<detaileddescription title=""/>
<memberdecl> <memberdecl>
<dirs visible="yes"/> <dirs visible="yes"/>
<files visible="yes"/> <files visible="yes"/>
</memberdecl> </memberdecl>
<detaileddescription title=""/>
</directory> </directory>
</doxygenlayout> </doxygenlayout>

View File

@@ -287,3 +287,8 @@ html.dark-mode {
td.odd_c { td.odd_c {
background-color: var(--odd-color) background-color: var(--odd-color)
} }
a + h2.groupheader {
display:none;
}

View File

@@ -151,21 +151,29 @@ struct array
/// ///
/// \returns A pointer to the first element of the array /// \returns A pointer to the first element of the array
constexpr ValueT* begin() { return elements; } constexpr ValueT* begin() {
return elements;
}
/// ///
/// \returns A pointer to one after the end of the array /// \returns A pointer to one after the end of the array
constexpr ValueT* end() { return elements + ElemV; } constexpr ValueT* end() {
return elements + ElemV;
}
/// ///
/// \returns A const-qualified pointer to the first element of the array /// \returns A const-qualified pointer to the first element of the array
constexpr const ValueT* begin() const { return elements; } constexpr const ValueT* begin() const {
return elements;
}
/// ///
/// \returns A const-qualified pointer to one after the end of the array /// \returns A const-qualified pointer to one after the end of the array
constexpr const ValueT* end() const { return elements + ElemV; } constexpr const ValueT* end() const {
return elements + ElemV;
}
/// @} /// @}

View File

@@ -236,8 +236,8 @@ public:
/// \brief Array Access Operator /// \brief Array Access Operator
/// \param i The index to access /// \param i The index to access
/// \returns A reference to the element at index `i` /// \returns A reference to the element at index `i`
constexpr TypeT& operator[](int i) { constexpr TypeT& operator[](size_t i) {
assertd(i >= 0 and size_t(i) < _size, "Array Out of Bounds"); assertd(i < _size, "Array Out of Bounds");
return _alloc.data()[i]; return _alloc.data()[i];
} }
@@ -245,8 +245,8 @@ public:
/// \brief Array Access Operator (const) /// \brief Array Access Operator (const)
/// \param i The index to access /// \param i The index to access
/// \returns A const qualified reference to the element at index `i` /// \returns A const qualified reference to the element at index `i`
constexpr const TypeT& operator[](int i) const { constexpr const TypeT& operator[](size_t i) const {
assertd(i >= 0 and size_t(i) < _size, "Array Out of Bounds"); assertd(i < _size, "Array Out of Bounds");
return _alloc.data()[i]; return _alloc.data()[i];
} }

View File

@@ -60,7 +60,19 @@ namespace fennec
/// Graphs contain nodes (sometimes called vertices) and connections. Graphs are either directed /// Graphs contain nodes (sometimes called vertices) and connections. Graphs are either directed
/// or undirected. This structure allows the creation of both directed and undirected connections. As /// or undirected. This structure allows the creation of both directed and undirected connections. As
/// far as what that means; a directed graph means that connections have direction, where there are connections /// far as what that means; a directed graph means that connections have direction, where there are connections
/// that are "to" and "from," rather than "between" which is used in undirected graphs There are . /// that are "to" and "from," rather than "between" which is used in undirected graphs.
///
/// An undirected graph is connected if there is a path between every pair of nodes in the graph.
///
/// A directed graph is weakly connected if replacing all of its directed connections with undirected connections would
/// produce a connected graph. We will call this "disjointed"
///
/// A directed graph is semi-connected if there is a directed path p for `u` &rarr; `v` *or* `v` &rarr; `u` for every
/// pair of nodes `u, v`. We will call this "unilateral"
///
/// A directed graph is strongly-connected if there is a directed path p for `u` &rarr; `v` *and* `v` &rarr; `u` for every pair
/// of nodes `u, v`. We will call this "connected"
///
/// \tparam NodeT The type associated with each node /// \tparam NodeT The type associated with each node
/// \tparam WeightT The type associated with each connection /// \tparam WeightT The type associated with each connection
template<typename NodeT, typename WeightT = nullptr_t> template<typename NodeT, typename WeightT = nullptr_t>
@@ -143,7 +155,7 @@ public:
return num_nodes() == 0; return num_nodes() == 0;
} }
// TODO: connected, disjoint // TODO: connected, disjoint, unilateral
/// @} /// @}
@@ -252,6 +264,9 @@ public:
/// ///
/// \brief Getter for a list of nodes `x` that `node` has a connection to and from `x...` and share the same weight /// \brief Getter for a list of nodes `x` that `node` has a connection to and from `x...` and share the same weight
/// "Joined" connections may also be referred to as "undirected." A joined, or undirected, connection may be
/// turned into a directed connection by changing the weight object associated with the connection, or by
/// removing one of the sub-connections.
/// \param node The id of the node /// \param node The id of the node
/// \returns A list containing all nodes `x` that have symmetric connections with `node` /// \returns A list containing all nodes `x` that have symmetric connections with `node`
list<size_t> joined(size_t node) { list<size_t> joined(size_t node) {
@@ -268,6 +283,18 @@ public:
return res; return res;
} }
///
/// \brief Getter for the internal storage of mapped connections from this node
/// Use this when you want to iterate over connections that start from this node.
/// \param node The id of the node
/// \returns A pointer to a map containing connections mapped from this node
const auto* connections(size_t node) {
if (empty() || node >= _conn_map.size()) {
return nullptr;
}
return &_conn_map[node];
}
/// @} /// @}

View File

@@ -48,6 +48,9 @@ public:
// Constructors ======================================================================================================== // Constructors ========================================================================================================
/// \name Constructors & Destructor
/// @{
/// ///
/// \brief Default Constructor /// \brief Default Constructor
constexpr optional() constexpr optional()
@@ -116,9 +119,34 @@ public:
} }
} }
/// @}
// Properties ==========================================================================================================
/// \name Properties
/// @{
///
/// \brief Implicit Boolean Check, returns `true` when there is a value contained
constexpr operator bool() const {
return _set;
}
///
/// \returns `true` when there is no held value, `false` otherwise.
constexpr bool empty() const {
return not _set;
}
/// @}
// Assignment Operators ================================================================================================ // Assignment Operators ================================================================================================
/// \name Assignment
/// @{
/// ///
/// \brief Fundamental Type Assignment /// \brief Fundamental Type Assignment
/// \param val The value to set with /// \param val The value to set with
@@ -195,34 +223,13 @@ public:
return *this; return *this;
} }
/// /// @}
/// \brief Emplace Assignment
/// \val The optional to move
template<typename...ArgsT>
constexpr T& emplace(ArgsT&&...args) {
if (_set) {
_val = T(fennec::forward<ArgsT>(args)...);
} else {
fennec::construct(&_val, fennec::forward<ArgsT>(args)...);
_set = true;
}
return _val;
}
///
/// \brief Reset the Optional
void reset() {
this->operator=(nullopt);
}
// Operators =========================================================================================================== // Access ==============================================================================================================
/// /// \name Access
/// \brief Implicit Boolean Check, returns `true` when there is a value contained /// @{
constexpr operator bool() const {
return _set;
}
/// ///
/// \returns A pointer to the value, `nullptr` if there is no value /// \returns A pointer to the value, `nullptr` if there is no value
@@ -268,6 +275,35 @@ public:
return _val; return _val;
} }
/// @}
// Modifiers ===========================================================================================================
/// \name Modifiers
/// @{
///
/// \brief Emplace Assignment
/// \val The optional to move
template<typename...ArgsT>
constexpr T& emplace(ArgsT&&...args) {
if (_set) {
_val = T(fennec::forward<ArgsT>(args)...);
} else {
fennec::construct(&_val, fennec::forward<ArgsT>(args)...);
_set = true;
}
return _val;
}
///
/// \brief Reset the Optional
void reset() {
this->operator=(nullopt);
}
/// @}

View File

@@ -36,7 +36,8 @@
/// 2. \ref building-from-source "Building from Source" /// 2. \ref building-from-source "Building from Source"
/// 1. \ref building-from-terminal "Building from Terminal" /// 1. \ref building-from-terminal "Building from Terminal"
/// 1. \ref debian "Debian" /// 1. \ref debian "Debian"
/// 2. \ref fedora-dnf "Fedora" /// 2. \ref arch "Arch"
/// 3. \ref fedora "Fedora"
/// 2. \ref building-on-windows "Building on Windows" /// 2. \ref building-on-windows "Building on Windows"
/// 3. \ref running-the-test-suite "Running the Test Suite" /// 3. \ref running-the-test-suite "Running the Test Suite"
/// 4. \ref usage "Usage" /// 4. \ref usage "Usage"

View File

@@ -56,16 +56,8 @@ denote implementation and testing progress. The symbols are defined below.
|:------:|:------------------------|:----------------------------------------------------------| |:------:|:------------------------|:----------------------------------------------------------|
| ✅ | Completed | Complete implementation and all tests passing. | | ✅ | Completed | Complete implementation and all tests passing. |
| 🚧 | Partial | Partial implementation and all tests implemented passing. | | 🚧 | Partial | Partial implementation and all tests implemented passing. |
| ❓ | Untested | Not tested |
| ⛔ | Unimplemented / Failing | Not implemented or any test is failing. | | ⛔ | Unimplemented / Failing | Not implemented or any test is failing. |
| Implemented / Passed | ✅ | 🚧 | ❓ | ⛔ |
|:--------------------:|--------------------------------------------------------------------|-------------------------------------------------------------------------------|---------|-----------------|
| ✅ | Implemented and Passing | Invalid | Invalid | Not Implemented |
| 🚧 | Implemented and Partial Testing with all implemented tests passing | Partial Implementation and Partial Testing with all implemented tests passing | Invalid | Not Implemented |
| ❓ | Implemented and Untested | Partial Implementation and Untested | Invalid | Not Implemented |
| ⛔ | Implemented and Any Test is Failing | Partial Implementation and any test is Failing | Invalid | Not Implemented |
## Libraries ## Libraries