From bf8a22008ce12067ef1b31a81675efd39d7bd6f0 Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Tue, 22 Oct 2024 12:33:43 +0100 Subject: [PATCH] Change Pythonic Ukkonen. to CPP-ic Ukkonen:: --- include/libsemigroups/ukkonen.hpp | 144 +++++++++++++++--------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/include/libsemigroups/ukkonen.hpp b/include/libsemigroups/ukkonen.hpp index 288b5f245..4b76972ea 100644 --- a/include/libsemigroups/ukkonen.hpp +++ b/include/libsemigroups/ukkonen.hpp @@ -422,8 +422,8 @@ namespace libsemigroups { //! word corresponding to \p first and \p last is equal to any of the //! existing unique letters. //! - //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `throw_if_contains_unique_letter(first, last)` throws. void add_word(const_iterator first, const_iterator last) { throw_if_contains_unique_letter(first, last); add_word_no_checks(first, last); @@ -838,8 +838,8 @@ namespace libsemigroups { //! //! See \ref index_no_checks. //! - //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `throw_if_contains_unique_letter(first, last)` throws. template word_index_type index(Iterator first, Iterator last) const { throw_if_contains_unique_letter(first, last); @@ -880,8 +880,8 @@ namespace libsemigroups { //! //! See \ref traverse_no_checks(State&, Iterator, Iterator) const. //! - //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `throw_if_contains_unique_letter(first, last)` throws. template Iterator traverse(State& st, Iterator first, Iterator last) const { throw_if_contains_unique_letter(first, last); @@ -924,8 +924,8 @@ namespace libsemigroups { //! //! See \ref traverse_no_checks(Iterator, Iterator) const. //! - //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `throw_if_contains_unique_letter(first, last)` throws. template std::pair traverse(Iterator first, Iterator last) const { throw_if_contains_unique_letter(first, last); @@ -1007,16 +1007,16 @@ namespace libsemigroups { //! //! This namespace contains helper functions for the Ukkonen class. namespace ukkonen { - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. inline void add_word_no_checks(Ukkonen& u, word_type const& w) { u.add_word_no_checks(w.cbegin(), w.cend()); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. template void add_word_no_checks(Ukkonen& u, Iterator first, Iterator last) { // TODO(later) it'd be better to just convert the values pointed at by the @@ -1025,41 +1025,41 @@ namespace libsemigroups { add_word_no_checks(u, word_type(first, last)); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. template void add_word_no_checks(Ukkonen& u, Word const& w) { add_word_no_checks(u, w.cbegin(), w.cend()); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. inline void add_word_no_checks(Ukkonen& u, char const* w) { add_word_no_checks(u, w, w + std::strlen(w)); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. //! //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(w)` //! throws. //! - //! \sa \ref Ukkonen.throw_if_contains_unique_letter. + //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline void add_word(Ukkonen& u, word_type const& w) { u.add_word(w.cbegin(), w.cend()); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. //! - //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `throw_if_contains_unique_letter(first, last)` throws. //! - //! \sa \ref Ukkonen.throw_if_contains_unique_letter. + //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template void add_word(Ukkonen& u, Iterator first, Iterator last) { // TODO(later) it'd be better to just convert the values pointed at by the @@ -1068,27 +1068,27 @@ namespace libsemigroups { add_word(u, word_type(first, last)); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. //! //! \throws LibsemigroupsException if `throw_if_contains_unique_letter(w)` //! throws. //! - //! \sa \ref Ukkonen.throw_if_contains_unique_letter. + //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template void add_word(Ukkonen& u, Word const& w) { add_word(u, w.cbegin(), w.cend()); } - //! \brief \copybrief Ukkonen.add_word_no_checks + //! \brief \copybrief Ukkonen::add_word_no_checks //! - //! See \ref Ukkonen.add_word_no_checks. + //! See \ref Ukkonen::add_word_no_checks. //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! - //! \sa \ref Ukkonen.throw_if_contains_unique_letter. + //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline void add_word(Ukkonen& u, char const* w) { add_word(u, w, w + std::strlen(w)); } @@ -1208,8 +1208,8 @@ namespace libsemigroups { //! //! See \ref Ukkonen::traverse_no_checks(Iterator, Iterator) const. //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline auto traverse(Ukkonen const& u, char const* w) { @@ -1287,8 +1287,8 @@ namespace libsemigroups { //! See \ref Ukkonen::traverse_no_checks(Ukkonen::State&, Iterator, //! Iterator) const. //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline auto traverse(Ukkonen::State& st, Ukkonen const& u, char const* w) { @@ -1351,8 +1351,8 @@ namespace libsemigroups { //! //! See \ref is_subword_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -1380,8 +1380,8 @@ namespace libsemigroups { //! //! See \ref is_subword_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline bool is_subword(Ukkonen const& u, char const* w) { @@ -1459,8 +1459,8 @@ namespace libsemigroups { //! //! See \ref is_suffix_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -1503,8 +1503,8 @@ namespace libsemigroups { //! //! See \ref is_suffix_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline bool is_suffix(Ukkonen const& u, char const* w) { @@ -1579,8 +1579,8 @@ namespace libsemigroups { //! See \ref maximal_piece_prefix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -1628,8 +1628,8 @@ namespace libsemigroups { //! See \ref maximal_piece_prefix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline char const* maximal_piece_prefix(Ukkonen const& u, char const* w) { @@ -1706,8 +1706,8 @@ namespace libsemigroups { //! See \ref length_maximal_piece_prefix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -1753,8 +1753,8 @@ namespace libsemigroups { //! See \ref length_maximal_piece_prefix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline size_t length_maximal_piece_prefix(Ukkonen const& u, char const* w) { @@ -1816,8 +1816,8 @@ namespace libsemigroups { //! //! See \ref is_piece_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -1854,8 +1854,8 @@ namespace libsemigroups { //! //! See \ref is_piece_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline bool is_piece(Ukkonen const& u, char const* w) { @@ -1932,8 +1932,8 @@ namespace libsemigroups { //! See \ref maximal_piece_suffix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -1981,8 +1981,8 @@ namespace libsemigroups { //! See \ref maximal_piece_suffix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline char const* maximal_piece_suffix(Ukkonen const& u, char const* w) { @@ -2059,8 +2059,8 @@ namespace libsemigroups { //! See \ref length_maximal_piece_suffix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -2106,8 +2106,8 @@ namespace libsemigroups { //! See \ref length_maximal_piece_suffix_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline size_t length_maximal_piece_suffix(Ukkonen const& u, char const* w) { @@ -2179,8 +2179,8 @@ namespace libsemigroups { //! See \ref number_of_pieces_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -2224,8 +2224,8 @@ namespace libsemigroups { //! See \ref number_of_pieces_no_checks(Ukkonen const&, Iterator, //! Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. inline size_t number_of_pieces(Ukkonen const& u, char const* w) { @@ -2302,8 +2302,8 @@ namespace libsemigroups { //! //! See \ref pieces_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(first, - //! last)` throws. + //! \throws LibsemigroupsException if + //! `u.throw_if_contains_unique_letter(first, last)` throws. //! //! \sa \ref Ukkonen::throw_if_contains_unique_letter. template @@ -2345,8 +2345,8 @@ namespace libsemigroups { //! //! See \ref pieces_no_checks(Ukkonen const&, Iterator, Iterator). //! - //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, w + - //! std::strlen(w))` throws. + //! \throws LibsemigroupsException if `u.throw_if_contains_unique_letter(w, + //! w + std::strlen(w))` throws. inline std::vector pieces(Ukkonen const& u, char const* w) { u.throw_if_contains_unique_letter(w, w + std::strlen(w)); return pieces_no_checks(u, w);