Skip to content

Commit

Permalink
Update Types for V3 (libsemigroups#580)
Browse files Browse the repository at this point in the history
* Restructure groups

* Add types group

* Make typedefs brief
  • Loading branch information
Joseph-Edwards authored Aug 6, 2024
1 parent d84e47f commit de07aa5
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 12 deletions.
3 changes: 2 additions & 1 deletion docs/DoxygenLayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
</tab>
<tab type="usergroup" visible="yes" url="@ref misc_group" title="Miscellaneous" >
<tab type="usergroup" visible="yes" url="@ref constants_group" title="Constants" />
<tab type="user" visible="yes" url="@ref libsemigroups::LibsemigroupsException" title="LibsemigroupsException" />
<tab type="user" visible="yes" url="@ref exception_group" title="LibsemigroupsException" />
<tab type="user" visible="yes" url="@ref libsemigroups::Reporter" title="Reporter" />
<tab type="user" visible="yes" url="@ref libsemigroups::Runner" title="Runner" />
<tab type="usergroup" visible="yes" url="@ref types_group" title="Types" />
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
<tab type="user" visible="yes" url="_HEADING_" title="Main Algorithms" />
Expand Down
4 changes: 4 additions & 0 deletions include/libsemigroups/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ namespace libsemigroups {

//! \defgroup constants_group Constants
//!
//! \ingroup misc_group
//!
//! \brief Documentation for constant values.
//!
//! This file contains functionality for various constant values used in
//! ``libsemigroups``.

Expand Down
12 changes: 11 additions & 1 deletion include/libsemigroups/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@
#include "detail/formatters.hpp"

namespace libsemigroups {
//! \defgroup exception_group Exceptions
//!
//! \ingroup misc_group
//!
//! \brief Documentation for exceptions.
//!
//! This file contains functionality for the exceptions used in
//! ``libsemigroups``.
//!

//! \ingroup exception_group
//!
//! \brief Exception class deriving from std::runtime_error.
//!
//! Defined in ``exception.hpp``.
Expand Down Expand Up @@ -75,7 +85,7 @@ namespace libsemigroups {
};
} // namespace libsemigroups

//! \ingroup misc_group
//! \ingroup exception_group
//!
//! \brief Throw a LibsemigroupsException
//!
Expand Down
11 changes: 5 additions & 6 deletions include/libsemigroups/runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ namespace libsemigroups {

//! \defgroup misc_group Miscellaneous
//! In this section we describe some miscellaneous functionality in
//! \c libsemigroups, including:
//! \c libsemigroups.
//!
//! * \ref constants_group
//! * \ref LibsemigroupsException
//! * \ref Reporter
//! * \ref Runner
//! \hidegroupgraph

//! \ingroup misc_group
//! \relates Reporter
//! \brief The time between a given point and now.
//!
//! The time between a given point and now.
//!
//! \param t the time point
//!
//! \returns The nanoseconds between the time point \p t and now.
Expand Down
35 changes: 31 additions & 4 deletions include/libsemigroups/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@
#include <magic_enum/magic_enum.hpp>

namespace libsemigroups {
//! \defgroup types_group Types
//!
//! \ingroup misc_group
//!
//! \brief Documentation for types.
//!
//! This file contains functionality for various types used in
//! ``libsemigroups``.
//!
//! @{

//! \brief Enum to indicate true, false or not currently knowable.
//!
//! The values in this enum can be used to indicate a result is true, false,
//! or not currently knowable.
enum class tril {
Expand All @@ -41,10 +54,22 @@ namespace libsemigroups {
unknown = 2
};

//! \brief Enum to indicate the sided-ness of a congruence.
//!
//! The values in this enum can be used to indicate that a congruence should
//! be 2-sided, left, or right.
enum class congruence_kind { left = 0, right = 1, twosided = 2 };
enum class congruence_kind {
//! Value representing a left congruence.
left = 0,
//! Value representing a right congruence.
right = 1,
//! Value representing a two-sided congruence.
twosided = 2
};

//! \brief Type giving the smallest unsigned integer type that can represent a
//! template.
//!
//! Provides a type giving the smallest unsigned integer type capable of
//! representing the template \c N.
//!
Expand All @@ -63,14 +88,16 @@ namespace libsemigroups {
std::conditional_t<N >= 0x100, uint16_t, uint8_t>>>;
};

//! Type for the index of a generator of a semigroup.
//! \brief Type for the index of a generator of a semigroup.
using letter_type = size_t;

//! Type for a word over the generators of a semigroup.
//! \brief Type for a word over the generators of a semigroup.
using word_type = std::vector<letter_type>;

//! Type for a pair of word_type (a *relation*) of a semigroup.
//! \brief Type for a pair of word_type (a *relation*) of a semigroup.
using relation_type = std::pair<word_type, word_type>;

//! @}
} // namespace libsemigroups

#endif // LIBSEMIGROUPS_TYPES_HPP_

0 comments on commit de07aa5

Please sign in to comment.