Skip to content

Commit

Permalink
Remove add_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph-Edwards committed Jul 2, 2024
1 parent f4122c8 commit a8c97e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions include/libsemigroups/presentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/libsemigroups/presentation.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace libsemigroups {
template <typename Word>
void Presentation<Word>::add_generator(
typename Presentation<Word>::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 "
Expand Down

0 comments on commit a8c97e6

Please sign in to comment.