Skip to content

Commit 04ac782

Browse files
Format and lint
1 parent 5b65d02 commit 04ac782

19 files changed

Lines changed: 67 additions & 58 deletions

include/libsemigroups/detail/aho-corasick-impl.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ namespace libsemigroups {
163163
_value = value;
164164
return *this;
165165
}
166-
167166
}; // class Node
168167

169168
// TODO(1) if we store pointers here instead of Nodes, then inside the

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ namespace libsemigroups {
831831

832832
bool finished_impl() const override;
833833
}; // class KnuthBendixImpl
834-
} // namespace detail
834+
} // namespace detail
835835

836836
////////////////////////////////////////////////////////////////////////
837837
// global functions - to_human_readable_repr

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace libsemigroups {
3939
class KnuthBendixNormalFormRange : public Paths<uint32_t> {
4040
using Paths_ = Paths<uint32_t>;
4141

42-
mutable Word _current;
42+
mutable Word _current;
4343
KnuthBendix<Word, RewritingSystem, ReductionOrder>* _kb;
4444

4545
public:
@@ -113,14 +113,14 @@ namespace libsemigroups {
113113

114114
template <typename Word, typename RewritingSystem, typename ReductionOrder>
115115
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>&
116-
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>::operator=(
117-
KnuthBendixNormalFormRange const&)
116+
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>::
117+
operator=(KnuthBendixNormalFormRange const&)
118118
= default;
119119

120120
template <typename Word, typename RewritingSystem, typename ReductionOrder>
121121
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>&
122-
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>::operator=(
123-
KnuthBendixNormalFormRange&&)
122+
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>::
123+
operator=(KnuthBendixNormalFormRange&&)
124124
= default;
125125

126126
template <typename Word, typename RewritingSystem, typename ReductionOrder>

include/libsemigroups/detail/overlap-iterators.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ namespace libsemigroups::detail {
8787
_suffix_descendent_index(),
8888
_overlap(),
8989
_trie(nullptr),
90-
_index_stack(){};
90+
_index_stack() {}
9191

9292
// TODO: Use an init rather than setting default values?
93-
OverlapIteratorTrie(Trie const& trie)
93+
explicit OverlapIteratorTrie(Trie const& trie)
9494
: _current_word_iterator(trie.cbegin_terminal_nodes()),
9595
_last_word_iterator(trie.cend_terminal_nodes()),
9696
_word_index(Trie::root),
@@ -225,4 +225,4 @@ namespace libsemigroups::detail {
225225
}; // class OverlapIteratorTrie
226226
} // namespace libsemigroups::detail
227227

228-
#endif
228+
#endif // LIBSEMIGROUPS_DETAIL_OVERLAP_ITERATORS_HPP_

include/libsemigroups/detail/rewriters.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ namespace libsemigroups {
172172
virtual void report_reducing_rules(
173173
std::atomic_uint64_t const&,
174174
std::chrono::high_resolution_clock::time_point const&) const {}
175-
176175
}; // class RewritingSystemBase
177176

178177
////////////////////////////////////////////////////////////////////////

include/libsemigroups/detail/rules.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,4 @@ namespace libsemigroups {
274274

275275
} // namespace detail
276276
} // namespace libsemigroups
277-
#endif
277+
#endif // LIBSEMIGROUPS_DETAIL_RULES_HPP_

include/libsemigroups/knuth-bendix-helpers.hpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ namespace libsemigroups {
6464
//! This function triggers a full enumeration of \p kb.
6565
//!
6666
//! \tparam Word the type of the words contained in the output range.
67-
//! \tparam RewritingSystem the first template parameter for \ref_knuth_bendix.
68-
//! \tparam ReductionOrder the second template parameter for
69-
//! \ref_knuth_bendix.
67+
//! \tparam RewritingSystem the first template parameter for
68+
//! \ref_knuth_bendix. \tparam ReductionOrder the second template parameter
69+
//! for \ref_knuth_bendix.
7070
//!
7171
//! \param kb the \ref_knuth_bendix instance.
7272
//!
@@ -79,8 +79,8 @@ namespace libsemigroups {
7979
template <typename Word, typename RewritingSystem, typename ReductionOrder>
8080
[[nodiscard]] auto
8181
normal_forms(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb) {
82-
return detail::KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>(
83-
kb);
82+
return detail::
83+
KnuthBendixNormalFormRange<Word, RewritingSystem, ReductionOrder>(kb);
8484
}
8585

8686
////////////////////////////////////////////////////////////////////////
@@ -106,9 +106,9 @@ namespace libsemigroups {
106106
//!
107107
//! \tparam Word the type of the words contained in the output range
108108
//! (default: std::string).
109-
//! \tparam RewritingSystem the first template parameter for \ref_knuth_bendix.
110-
//! \tparam ReductionOrder the second template parameter for
111-
//! \ref_knuth_bendix.
109+
//! \tparam RewritingSystem the first template parameter for
110+
//! \ref_knuth_bendix. \tparam ReductionOrder the second template parameter
111+
//! for \ref_knuth_bendix.
112112
//!
113113
//! \param kb1 the first \ref_knuth_bendix instance.
114114
//! \param kb2 the second \ref_knuth_bendix instance.
@@ -128,9 +128,9 @@ namespace libsemigroups {
128128
//!
129129
//! \cong_common_warn_undecidable{Knuth-Bendix}.
130130
template <typename Word, typename RewritingSystem, typename ReductionOrder>
131-
[[nodiscard]] std::vector<std::vector<Word>>
132-
non_trivial_classes(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb1,
133-
KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb2);
131+
[[nodiscard]] std::vector<std::vector<Word>> non_trivial_classes(
132+
KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb1,
133+
KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb2);
134134

135135
} // namespace congruence_common
136136

@@ -174,9 +174,9 @@ namespace libsemigroups {
174174
//!
175175
//! \tparam Word the type of the words in the
176176
//! \ref KnuthBendix::presentation.
177-
//! \tparam RewritingSystem the first template parameter for \ref_knuth_bendix.
178-
//! \tparam ReductionOrder the second template parameter for
179-
//! \ref_knuth_bendix.
177+
//! \tparam RewritingSystem the first template parameter for
178+
//! \ref_knuth_bendix. \tparam ReductionOrder the second template parameter
179+
//! for \ref_knuth_bendix.
180180
//!
181181
//! \param kb the \ref_knuth_bendix instance.
182182
//!
@@ -188,7 +188,8 @@ namespace libsemigroups {
188188
//!
189189
//! \sa KnuthBendix::run.
190190
template <typename Word, typename RewritingSystem, typename ReductionOrder>
191-
void by_overlap_length(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb);
191+
void
192+
by_overlap_length(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb);
192193

193194
//! \ingroup knuth_bendix_helpers_group
194195
//!
@@ -198,9 +199,9 @@ namespace libsemigroups {
198199
//!
199200
//! \tparam Word the type of the words in the
200201
//! \ref KnuthBendix::presentation.
201-
//! \tparam RewritingSystem the first template parameter for \ref_knuth_bendix.
202-
//! \tparam ReductionOrder the second template parameter for
203-
//! \ref_knuth_bendix.
202+
//! \tparam RewritingSystem the first template parameter for
203+
//! \ref_knuth_bendix. \tparam ReductionOrder the second template parameter
204+
//! for \ref_knuth_bendix.
204205
//!
205206
//! \param kb the \ref_knuth_bendix instance defining the rules that are to
206207
//! be checked for being reduced.

include/libsemigroups/obvinf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ namespace libsemigroups {
649649
//! \note If this function returns \c false, it is still possible that the
650650
//! quotient defined by the \ref_knuth_bendix object \p kb is infinite.
651651
template <typename RewritingSystem, typename ReductionOrder>
652-
bool
653-
is_obviously_infinite(detail::KnuthBendixImpl<RewritingSystem, ReductionOrder>& kb) {
652+
bool is_obviously_infinite(
653+
detail::KnuthBendixImpl<RewritingSystem, ReductionOrder>& kb) {
654654
if (kb.finished()) {
655655
return !v4::word_graph::is_acyclic(kb.gilman_graph());
656656
}

include/libsemigroups/to-froidure-pin.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ namespace libsemigroups {
167167
//! \p kb.
168168
//!
169169
//! \tparam Thing used for SFINAE should be FroidurePin.
170-
//! \tparam RewritingSystem the second template parameter for \ref_knuth_bendix.
171-
//! \tparam ReductionOrder the third template parameter for \ref_knuth_bendix.
170+
//! \tparam RewritingSystem the second template parameter for
171+
//! \ref_knuth_bendix. \tparam ReductionOrder the third template parameter for
172+
//! \ref_knuth_bendix.
172173
//!
173174
//! \param kb the \ref_knuth_bendix instance to convert.
174175
//!
@@ -180,9 +181,11 @@ namespace libsemigroups {
180181
typename Word,
181182
typename RewritingSystem,
182183
typename ReductionOrder>
183-
auto to(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb) -> std::enable_if_t<
184-
std::is_same_v<Thing<int>, FroidurePin<int>>,
185-
FroidurePin<detail::KBE<KnuthBendix<Word, RewritingSystem, ReductionOrder>>>>;
184+
auto to(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb)
185+
-> std::enable_if_t<
186+
std::is_same_v<Thing<int>, FroidurePin<int>>,
187+
FroidurePin<
188+
detail::KBE<KnuthBendix<Word, RewritingSystem, ReductionOrder>>>>;
186189

187190
//! \ingroup to_froidure_pin_group
188191
//!

include/libsemigroups/to-froidure-pin.tpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace libsemigroups {
2727

2828
template <typename Word, typename RewritingSystem, typename ReductionOrder>
2929
FroidurePin(KnuthBendix<Word, RewritingSystem, ReductionOrder> const&)
30-
-> FroidurePin<detail::KBE<KnuthBendix<Word, RewritingSystem, ReductionOrder>>>;
30+
-> FroidurePin<
31+
detail::KBE<KnuthBendix<Word, RewritingSystem, ReductionOrder>>>;
3132

3233
FroidurePin(detail::ToddCoxeterImpl const&)->FroidurePin<detail::TCE>;
3334

@@ -89,9 +90,11 @@ namespace libsemigroups {
8990
typename Word,
9091
typename RewritingSystem,
9192
typename ReductionOrder>
92-
auto to(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb) -> std::enable_if_t<
93-
std::is_same_v<Thing<int>, FroidurePin<int>>,
94-
FroidurePin<detail::KBE<KnuthBendix<Word, RewritingSystem, ReductionOrder>>>> {
93+
auto to(KnuthBendix<Word, RewritingSystem, ReductionOrder>& kb)
94+
-> std::enable_if_t<
95+
std::is_same_v<Thing<int>, FroidurePin<int>>,
96+
FroidurePin<detail::KBE<
97+
KnuthBendix<Word, RewritingSystem, ReductionOrder>>>> {
9598
size_t const n = kb.presentation().alphabet().size();
9699

97100
if (n == 0) {

0 commit comments

Comments
 (0)