From a8c97e6426ec8b39725cc084a0489011e6b85cfe Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Tue, 2 Jul 2024 11:59:23 +0100 Subject: [PATCH] Remove add_generator --- include/libsemigroups/presentation.hpp | 18 ------------------ include/libsemigroups/presentation.tpp | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/include/libsemigroups/presentation.hpp b/include/libsemigroups/presentation.hpp index e97b1fed5..d7fedf3fa 100644 --- a/include/libsemigroups/presentation.hpp +++ b/include/libsemigroups/presentation.hpp @@ -440,24 +440,6 @@ namespace libsemigroups { //! \throws LibsemigroupsException if \p x is in `p.alphabet()`. void add_generator(letter_type x); - //! \brief Return whether \p x is a generator. - //! - //! Returns \c true if \p x is a generator (i.e. is contained in the - //! alphabet) and \c false otherwise. - //! - //! \param x the letter to check. - //! - //! \returns A value of type `bool`. - //! - //! \exceptions - //! \no_libsemigroups_except - //! - //! \complexity - //! Logarithmic in the size of the alphabet. - [[nodiscard]] bool contains_generator(letter_type x) const { - return _alphabet_map.find(x) != _alphabet_map.cend(); - } - //! \brief Return whether the empty word is a valid relation word. //! //! Returns \c true if the empty word is a valid relation word, and \c false diff --git a/include/libsemigroups/presentation.tpp b/include/libsemigroups/presentation.tpp index fa7951761..448e3a9ce 100644 --- a/include/libsemigroups/presentation.tpp +++ b/include/libsemigroups/presentation.tpp @@ -168,7 +168,7 @@ namespace libsemigroups { template void Presentation::add_generator( typename Presentation::letter_type x) { - if (!contains_generator(x)) { + if (!in_alphabet(x)) { add_generator_no_checks(x); } else { LIBSEMIGROUPS_EXCEPTION("the argument {} already belongs to the alphabet "