Skip to content

Commit 87dee31

Browse files
Rename throw_if_letter_out_of_bounds
1 parent d64fa74 commit 87dee31

11 files changed

Lines changed: 38 additions & 37 deletions

include/libsemigroups/cong-class.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ namespace libsemigroups {
576576
}
577577

578578
////////////////////////////////////////////////////////////////////////
579-
// Congruence - interface requirements - throw_if_letter_out_of_bounds
579+
// Congruence - interface requirements - throw_if_letter_not_in_alphabet
580580
////////////////////////////////////////////////////////////////////////
581581

582582
//! \ingroup congruence_class_init_group
@@ -597,7 +597,7 @@ namespace libsemigroups {
597597
//! \throw LibsemigroupsException if any letter in the range from \p first
598598
//! to \p last is out of bounds.
599599
template <typename Iterator1, typename Iterator2>
600-
void throw_if_letter_out_of_bounds(Iterator1 first, Iterator2 last) const;
600+
void throw_if_letter_not_in_alphabet(Iterator1 first, Iterator2 last) const;
601601

602602
//////////////////////////////////////////////////////////////////////////
603603
// Congruence - member functions - public

include/libsemigroups/cong-class.tpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,21 @@ namespace libsemigroups {
161161

162162
template <typename Word>
163163
template <typename Iterator1, typename Iterator2>
164-
void Congruence<Word>::throw_if_letter_out_of_bounds(Iterator1 first,
165-
Iterator2 last) const {
164+
void Congruence<Word>::throw_if_letter_not_in_alphabet(Iterator1 first,
165+
Iterator2 last) const {
166166
if (!_race.empty()) {
167167
size_t index = (finished() ? _race.winner_index() : 0);
168168

169169
if (_runner_kinds[index] == RunnerKind::TC) {
170170
std::static_pointer_cast<ToddCoxeter<Word>>(*_race.begin())
171-
->throw_if_letter_out_of_bounds(first, last);
171+
->throw_if_letter_not_in_alphabet(first, last);
172172
} else if (_runner_kinds[index] == RunnerKind::KB) {
173173
std::static_pointer_cast<KnuthBendix<Word>>(*_race.begin())
174-
->throw_if_letter_out_of_bounds(first, last);
174+
->throw_if_letter_not_in_alphabet(first, last);
175175
} else {
176176
LIBSEMIGROUPS_ASSERT(_runner_kinds[index] == RunnerKind::K);
177177
std::static_pointer_cast<Kambites<Word>>(*_race.begin())
178-
->throw_if_letter_out_of_bounds(first, last);
178+
->throw_if_letter_not_in_alphabet(first, last);
179179
}
180180
return;
181181
}

include/libsemigroups/detail/cong-common-class.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ namespace libsemigroups {
7979
////////////////////////////////////////////////////////////////////////////
8080

8181
template <typename Subclass, typename Iterator1, typename Iterator2>
82-
void throw_if_letter_out_of_bounds(Iterator1 first,
83-
Iterator2 last) const {
84-
static_cast<Subclass const*>(this)->throw_if_letter_out_of_bounds(first,
85-
last);
82+
void throw_if_letter_not_in_alphabet(Iterator1 first,
83+
Iterator2 last) const {
84+
static_cast<Subclass const*>(this)->throw_if_letter_not_in_alphabet(
85+
first, last);
8686
}
8787

8888
public:
@@ -176,8 +176,8 @@ namespace libsemigroups {
176176
Iterator2 last1,
177177
Iterator3 first2,
178178
Iterator4 last2) {
179-
throw_if_letter_out_of_bounds<Subclass>(first1, last1);
180-
throw_if_letter_out_of_bounds<Subclass>(first2, last2);
179+
throw_if_letter_not_in_alphabet<Subclass>(first1, last1);
180+
throw_if_letter_not_in_alphabet<Subclass>(first2, last2);
181181
return contains_no_checks<Subclass>(first1, last1, first2, last2);
182182
}
183183

include/libsemigroups/detail/cong-common-class.tpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ namespace libsemigroups {
3535
Iterator2 last1,
3636
Iterator3 first2,
3737
Iterator4 last2) const {
38-
throw_if_letter_out_of_bounds<Subclass>(first1, last1);
39-
throw_if_letter_out_of_bounds<Subclass>(first2, last2);
38+
throw_if_letter_not_in_alphabet<Subclass>(first1, last1);
39+
throw_if_letter_not_in_alphabet<Subclass>(first2, last2);
4040
return static_cast<Subclass const&>(*this).currently_contains_no_checks(
4141
first1, last1, first2, last2);
4242
}
@@ -87,8 +87,8 @@ namespace libsemigroups {
8787
Iterator3 first2,
8888
Iterator4 last2) {
8989
throw_if_started();
90-
throw_if_letter_out_of_bounds<Subclass>(first1, last1);
91-
throw_if_letter_out_of_bounds<Subclass>(first2, last2);
90+
throw_if_letter_not_in_alphabet<Subclass>(first1, last1);
91+
throw_if_letter_not_in_alphabet<Subclass>(first2, last2);
9292
return static_cast<Subclass&>(*this).add_generating_pair_no_checks(
9393
first1, last1, first2, last2);
9494
}
@@ -100,7 +100,7 @@ namespace libsemigroups {
100100
OutputIterator CongruenceCommon::reduce_no_run(OutputIterator d_first,
101101
Iterator1 first,
102102
Iterator2 last) const {
103-
throw_if_letter_out_of_bounds<Subclass>(first, last);
103+
throw_if_letter_not_in_alphabet<Subclass>(first, last);
104104
if (finished() && !success()) { // for Kambites
105105
LIBSEMIGROUPS_EXCEPTION(
106106
"cannot reduce words, the algorithm failed to finish successfully!")
@@ -116,7 +116,7 @@ namespace libsemigroups {
116116
OutputIterator CongruenceCommon::reduce(OutputIterator d_first,
117117
InputIterator1 first,
118118
InputIterator2 last) {
119-
throw_if_letter_out_of_bounds<Subclass>(first, last);
119+
throw_if_letter_not_in_alphabet<Subclass>(first, last);
120120
run();
121121
if (!success()) { // for Kambites
122122
LIBSEMIGROUPS_EXCEPTION(

include/libsemigroups/detail/knuth-bendix-impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,8 @@ namespace libsemigroups {
731731

732732
// TODO(1) remove
733733
template <typename Iterator1, typename Iterator2>
734-
void throw_if_letter_out_of_bounds(Iterator1 first,
735-
Iterator2 last) const {
734+
void throw_if_letter_not_in_alphabet(Iterator1 first,
735+
Iterator2 last) const {
736736
internal_presentation().throw_if_letter_not_in_alphabet(first, last);
737737
}
738738

include/libsemigroups/detail/todd-coxeter-impl.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,9 @@ namespace libsemigroups {
363363
WordGraph<Node> const& wg);
364364
#endif
365365

366-
// TODO(0) remove?
367366
template <typename Iterator1, typename Iterator2>
368-
void throw_if_letter_out_of_bounds(Iterator1 first,
369-
Iterator2 last) const {
367+
void throw_if_letter_not_in_alphabet(Iterator1 first,
368+
Iterator2 last) const {
370369
internal_presentation().throw_if_letter_not_in_alphabet(first, last);
371370
}
372371

@@ -1496,7 +1495,7 @@ namespace libsemigroups {
14961495
//! \cong_common_throws_if_letters_out_of_bounds
14971496
template <typename Iterator1, typename Iterator2>
14981497
index_type current_index_of(Iterator1 first, Iterator2 last) const {
1499-
throw_if_letter_out_of_bounds(first, last);
1498+
throw_if_letter_not_in_alphabet(first, last);
15001499
return current_index_of_no_checks(first, last);
15011500
}
15021501

@@ -1555,7 +1554,7 @@ namespace libsemigroups {
15551554
//! \cong_common_throws_if_letters_out_of_bounds
15561555
template <typename Iterator1, typename Iterator2>
15571556
index_type index_of(Iterator1 first, Iterator2 last) {
1558-
throw_if_letter_out_of_bounds(first, last);
1557+
throw_if_letter_not_in_alphabet(first, last);
15591558
return index_of_no_checks(first, last);
15601559
}
15611560

include/libsemigroups/kambites-class.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ namespace libsemigroups {
785785
//! \throw LibsemigroupsException if any letter in the range from
786786
//! \p first to \p last is out of bounds.
787787
template <typename Iterator1, typename Iterator2>
788-
void throw_if_letter_out_of_bounds(Iterator1 first, Iterator2 last) const {
788+
void throw_if_letter_not_in_alphabet(Iterator1 first,
789+
Iterator2 last) const {
789790
_presentation.throw_if_letter_not_in_alphabet(first, last);
790791
}
791792

include/libsemigroups/knuth-bendix-class.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ namespace libsemigroups {
262262
//! \p first to \p last is out of bounds.
263263
// TODO(0) remove this
264264
template <typename Iterator1, typename Iterator2>
265-
void throw_if_letter_out_of_bounds(Iterator1 first, Iterator2 last) const {
265+
void throw_if_letter_not_in_alphabet(Iterator1 first,
266+
Iterator2 last) const {
266267
presentation().throw_if_letter_not_in_alphabet(first, last);
267268
}
268269

include/libsemigroups/presentation.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,7 @@ namespace libsemigroups {
715715
}
716716
}
717717

718-
//! \brief throw_if_bad_alphabet_or_rules rules against the alphabet of \p
719-
//! p.
718+
//! \brief Check rules against the alphabet of \p p.
720719
//!
721720
//! Check if every rule of in `[first, last)` consists of letters belonging
722721
//! to the alphabet of \p p.

include/libsemigroups/sims.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ namespace libsemigroups {
881881
//! to \p last is out of bounds.
882882
// TODO(1) rm
883883
template <typename Iterator1, typename Iterator2>
884-
void throw_if_letter_out_of_bounds(Iterator1 first, Iterator2 last) const {
884+
void throw_if_letter_not_in_alphabet(Iterator1 first,
885+
Iterator2 last) const {
885886
presentation().throw_if_letter_not_in_alphabet(first, last);
886887
}
887888

@@ -916,8 +917,8 @@ namespace libsemigroups {
916917
Iterator3 first2,
917918
Iterator4 last2,
918919
std::vector<word_type>& include_or_exclude) {
919-
throw_if_letter_out_of_bounds(first1, last1);
920-
throw_if_letter_out_of_bounds(first2, last2);
920+
throw_if_letter_not_in_alphabet(first1, last1);
921+
throw_if_letter_not_in_alphabet(first2, last2);
921922
return static_cast<Subclass&>(*this).include_exclude_no_checks(
922923
first1, last1, first2, last2, include_or_exclude);
923924
}

0 commit comments

Comments
 (0)