Skip to content

Commit 136f948

Browse files
Format
1 parent 2fb1e23 commit 136f948

13 files changed

+166
-166
lines changed

.clang-format

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AccessModifierOffset: -1
44
AlignAfterOpenBracket: Align
55
AlignConsecutiveAssignments: true
66
AlignConsecutiveDeclarations: true
7-
AlignEscapedNewlinesLeft: true
7+
AlignEscapedNewlinesLeft: true
88
AlignOperands: true
99
AlignTrailingComments: true
1010
AllowAllParametersOfDeclarationOnNextLine: false
@@ -18,7 +18,7 @@ AlwaysBreakBeforeMultilineStrings: false
1818
AlwaysBreakTemplateDeclarations: true
1919
BinPackArguments: false
2020
BinPackParameters: false
21-
BraceWrapping:
21+
BraceWrapping:
2222
AfterClass: false
2323
AfterControlStatement: false
2424
AfterEnum: false
@@ -44,13 +44,14 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
4444
ConstructorInitializerIndentWidth: 4
4545
ContinuationIndentWidth: 4
4646
Cpp11BracedListStyle: true
47-
DerivePointerAlignment: true
47+
DerivePointerAlignment: false
48+
PointerAlignment: PAS_Left
4849
DisableFormat: false
4950
ExperimentalAutoDetectBinPacking: false
5051
FixNamespaceComments: true
5152
ForEachMacros: ['RANGES_FOR', 'FOREACH']
5253
IncludeBlocks: Preserve
53-
IncludeCategories:
54+
IncludeCategories:
5455
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
5556
Priority: 2
5657
- Regex: '^(<|"(gtest|isl|json)/)'

src/bipart.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace py = pybind11;
4040
namespace libsemigroups {
4141
// TODO(later) implement Blocks and uncomment the def's below.
4242

43-
void init_bipart(py::module &m) {
43+
void init_bipart(py::module& m) {
4444
py::class_<Bipartition>(m,
4545
"Bipartition",
4646
R"pbdoc(
@@ -49,7 +49,7 @@ namespace libsemigroups {
4949
documentation <https://semigroups.github.io/Semigroups/doc/chap3_mj.html>`_
5050
for more details.
5151
)pbdoc")
52-
.def(py::init<Bipartition const &>())
52+
.def(py::init<Bipartition const&>())
5353
.def_static("make_identity",
5454
py::overload_cast<size_t>(&Bipartition::identity),
5555
py::arg("n"),
@@ -70,7 +70,7 @@ namespace libsemigroups {
7070
:Returns: A newly constructed ``Bipartition``.
7171
)pbdoc")
7272
.def_static("make",
73-
&Bipartition::make<std::vector<uint32_t> const &>,
73+
&Bipartition::make<std::vector<uint32_t> const&>,
7474
R"pbdoc(
7575
Validates the arguments, constructs a bipartition and
7676
validates it.
@@ -95,7 +95,7 @@ namespace libsemigroups {
9595
)pbdoc")
9696
.def(
9797
"__getitem__",
98-
[](const Bipartition &a, size_t b) -> uint32_t { return a.at(b); },
98+
[](const Bipartition& a, size_t b) -> uint32_t { return a.at(b); },
9999
py::arg("i"),
100100
py::is_operator(),
101101
R"pbdoc(
@@ -207,7 +207,7 @@ namespace libsemigroups {
207207
)pbdoc")
208208
.def(
209209
"lookup",
210-
[](Bipartition &x) {
210+
[](Bipartition& x) {
211211
// TODO(later) because cbegin_lookup points to a std::vector<bool>
212212
// I couldn't figure out how to use an make_iterator here
213213
return std::vector<bool>(x.cbegin_lookup(), x.cend_lookup());
@@ -221,7 +221,7 @@ namespace libsemigroups {
221221
)pbdoc")
222222
.def(
223223
"left_blocks",
224-
[](Bipartition const &x) {
224+
[](Bipartition const& x) {
225225
return py::make_iterator(x.cbegin_left_blocks(),
226226
x.cend_left_blocks());
227227
},
@@ -234,7 +234,7 @@ namespace libsemigroups {
234234
)pbdoc")
235235
.def(
236236
"right_blocks",
237-
[](Bipartition const &x) {
237+
[](Bipartition const& x) {
238238
return py::make_iterator(x.cbegin_right_blocks(),
239239
x.cend_right_blocks());
240240
},

src/bmat8.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
namespace py = pybind11;
4040

4141
namespace libsemigroups {
42-
void init_bmat8(py::module &m) {
42+
void init_bmat8(py::module& m) {
4343
py::class_<BMat8>(m, "BMat8")
4444
.def(py::init<>(), R"pbdoc(
4545
Returns an uninitalised BMat8.
4646
)pbdoc")
4747
.def(py::init<uint64_t>())
48-
.def(py::init<BMat8 const &>())
49-
.def(py::init<std::vector<std::vector<bool>> const &>())
48+
.def(py::init<BMat8 const&>())
49+
.def(py::init<std::vector<std::vector<bool>> const&>())
5050
.def("__eq__", &BMat8::operator==)
5151
.def("__lt__", &BMat8::operator<) // NOLINT(whitespace/operators)
5252
.def("get",

src/cong.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace libsemigroups {
5050
namespace py = pybind11;
5151

5252
namespace libsemigroups {
53-
void init_cong(py::module &m) {
53+
void init_cong(py::module& m) {
5454
py::class_<Congruence>(m, "Congruence")
5555
.def(py::init<congruence_kind>(),
5656
py::arg("kind"),
@@ -85,7 +85,7 @@ namespace libsemigroups {
8585
8686
:Complexity: Linear in the size of ``S``.
8787
)pbdoc")
88-
.def(py::init<congruence_kind, FpSemigroup &>(),
88+
.def(py::init<congruence_kind, FpSemigroup&>(),
8989
py::arg("kind"),
9090
py::arg("S"),
9191
R"pbdoc(
@@ -110,7 +110,7 @@ namespace libsemigroups {
110110
&Congruence::number_of_generators,
111111
cong_intf_doc_strings::number_of_generators)
112112
.def("add_pair",
113-
py::overload_cast<word_type const &, word_type const &>(
113+
py::overload_cast<word_type const&, word_type const&>(
114114
&Congruence::add_pair),
115115
py::arg("u"),
116116
py::arg("v"),
@@ -142,8 +142,7 @@ namespace libsemigroups {
142142
py::arg("t"),
143143
runner_doc_strings::run_for)
144144
.def("run_until",
145-
(void (Congruence::*)(std::function<bool()> &))
146-
& Runner::run_until,
145+
(void (Congruence::*)(std::function<bool()>&)) & Runner::run_until,
147146
py::arg("func"),
148147
runner_doc_strings::run_until)
149148
.def("less",
@@ -169,7 +168,7 @@ namespace libsemigroups {
169168
cong_intf_doc_strings::number_of_non_trivial_classes)
170169
.def(
171170
"non_trivial_classes",
172-
[](Congruence &C, size_t i) {
171+
[](Congruence& C, size_t i) {
173172
return C.non_trivial_classes()->at(i);
174173
},
175174
py::arg("i"),
@@ -245,7 +244,7 @@ namespace libsemigroups {
245244
runner_doc_strings::stopped_by_predicate)
246245
.def(
247246
"generating_pairs",
248-
[](Congruence const &c) {
247+
[](Congruence const& c) {
249248
return py::make_iterator(c.cbegin_generating_pairs(),
250249
c.cend_generating_pairs());
251250
},

src/forest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
namespace py = pybind11;
3535

3636
namespace libsemigroups {
37-
void init_forest(py::module &m) {
37+
void init_forest(py::module& m) {
3838
py::class_<Forest>(m, "Forest")
3939
.def(py::init<size_t>(), R"pbdoc(
4040
Constructs a forest with 0 nodes.
@@ -44,7 +44,7 @@ namespace libsemigroups {
4444
4545
:Parameters: None.
4646
)pbdoc")
47-
.def(py::init<Forest const &>(),
47+
.def(py::init<Forest const&>(),
4848
py::arg("that"),
4949
R"pbdoc(
5050
Copy constructor.
@@ -117,7 +117,7 @@ namespace libsemigroups {
117117
)pbdoc")
118118
.def(
119119
"parent_iterator",
120-
[](Forest const &f) {
120+
[](Forest const& f) {
121121
return py::make_iterator(f.cbegin_parent(), f.cend_parent());
122122
},
123123
R"pbdoc(

src/fpsemi.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ namespace py = pybind11;
5151

5252
namespace libsemigroups {
5353
using rule_type = FpSemigroupInterface::rule_type;
54-
void init_fpsemi(py::module &m) {
54+
void init_fpsemi(py::module& m) {
5555
py::class_<FpSemigroup>(m, "FpSemigroup")
5656
.def(py::init<>())
5757
.def(py::init<std::shared_ptr<FroidurePinBase>>())
58-
.def(py::init<FpSemigroup const &>())
58+
.def(py::init<FpSemigroup const&>())
5959
.def("validate_letter",
6060
py::overload_cast<char>(&FpSemigroup::validate_letter, py::const_),
6161
py::arg("c"),
@@ -78,8 +78,8 @@ namespace libsemigroups {
7878
:Returns: (None)
7979
)pbdoc")
8080
.def("validate_word",
81-
py::overload_cast<word_type const &>(&FpSemigroup::validate_word,
82-
py::const_),
81+
py::overload_cast<word_type const&>(&FpSemigroup::validate_word,
82+
py::const_),
8383
py::arg("w"),
8484
R"pbdoc(
8585
Validates a word.
@@ -89,8 +89,8 @@ namespace libsemigroups {
8989
:Returns: (None)
9090
)pbdoc")
9191
.def("validate_word",
92-
py::overload_cast<std::string const &>(&FpSemigroup::validate_word,
93-
py::const_),
92+
py::overload_cast<std::string const&>(&FpSemigroup::validate_word,
93+
py::const_),
9494
py::arg("w"),
9595
R"pbdoc(
9696
Validates a word.
@@ -110,7 +110,7 @@ namespace libsemigroups {
110110
:Returns: (None)
111111
)pbdoc")
112112
.def("set_alphabet",
113-
py::overload_cast<std::string const &>(&FpSemigroup::set_alphabet),
113+
py::overload_cast<std::string const&>(&FpSemigroup::set_alphabet),
114114
py::arg("a"),
115115
R"pbdoc(
116116
Set the alphabet of the finitely presented semigroup.
@@ -152,7 +152,7 @@ namespace libsemigroups {
152152
:Returns: (None)
153153
)pbdoc")
154154
.def("set_identity",
155-
py::overload_cast<std::string const &>(&FpSemigroup::set_identity),
155+
py::overload_cast<std::string const&>(&FpSemigroup::set_identity),
156156
py::arg("id"),
157157
R"pbdoc(
158158
Set a string of length 1 belonging to
@@ -210,7 +210,7 @@ namespace libsemigroups {
210210
:Returns: (None)
211211
)pbdoc")
212212
.def("add_rule",
213-
py::overload_cast<std::string const &, std::string const &>(
213+
py::overload_cast<std::string const&, std::string const&>(
214214
&FpSemigroup::add_rule),
215215
py::arg("u"),
216216
py::arg("v"),
@@ -223,7 +223,7 @@ namespace libsemigroups {
223223
:Returns: (None)
224224
)pbdoc")
225225
.def("add_rule",
226-
py::overload_cast<word_type const &, word_type const &>(
226+
py::overload_cast<word_type const&, word_type const&>(
227227
&FpSemigroup::add_rule),
228228
py::arg("u"),
229229
py::arg("v"),
@@ -236,7 +236,7 @@ namespace libsemigroups {
236236
:Returns: (None)
237237
)pbdoc")
238238
.def("add_rules",
239-
py::overload_cast<FroidurePinBase &>(&FpSemigroup::add_rules),
239+
py::overload_cast<FroidurePinBase&>(&FpSemigroup::add_rules),
240240
py::arg("S"),
241241
R"pbdoc(
242242
Add the rules of a finite presentation for S to this.
@@ -246,7 +246,7 @@ namespace libsemigroups {
246246
:Returns: (None)
247247
)pbdoc")
248248
.def("add_rules",
249-
py::overload_cast<std::vector<rule_type> const &>(
249+
py::overload_cast<std::vector<rule_type> const&>(
250250
&FpSemigroup::add_rules),
251251
py::arg("rels"),
252252
R"pbdoc(
@@ -259,7 +259,7 @@ namespace libsemigroups {
259259
)pbdoc")
260260
.def(
261261
"number_of_rules",
262-
[](FpSemigroup const &fp) { return fp.number_of_rules(); },
262+
[](FpSemigroup const& fp) { return fp.number_of_rules(); },
263263
R"pbdoc(
264264
Returns the number of rules currently used to define the
265265
finitely presented semigroups.
@@ -317,7 +317,7 @@ namespace libsemigroups {
317317
:Returns: (None)
318318
)pbdoc")
319319
.def("run_until",
320-
(void (FpSemigroup::*)(std::function<bool()> &))
320+
(void (FpSemigroup::*)(std::function<bool()>&))
321321
& Runner::run_until,
322322
py::arg("func"),
323323
R"pbdoc(
@@ -366,7 +366,7 @@ namespace libsemigroups {
366366
)pbdoc")
367367
.def(
368368
"running",
369-
[](FpSemigroup const &fp) { return fp.running(); },
369+
[](FpSemigroup const& fp) { return fp.running(); },
370370
R"pbdoc(
371371
Check if the algorithm is currently running.
372372
@@ -382,7 +382,7 @@ namespace libsemigroups {
382382
:return: A ``bool``.
383383
)pbdoc")
384384
.def("normal_form",
385-
py::overload_cast<std::string const &>(&FpSemigroup::normal_form),
385+
py::overload_cast<std::string const&>(&FpSemigroup::normal_form),
386386
py::arg("w"),
387387
R"pbdoc(
388388
Returns a normal form for a string.
@@ -392,7 +392,7 @@ namespace libsemigroups {
392392
:Returns: A string.
393393
)pbdoc")
394394
.def("normal_form",
395-
py::overload_cast<word_type const &>(&FpSemigroup::normal_form),
395+
py::overload_cast<word_type const&>(&FpSemigroup::normal_form),
396396
py::arg("w"),
397397
R"pbdoc(
398398
Returns a normal form for a list of integers.
@@ -402,7 +402,7 @@ namespace libsemigroups {
402402
:Returns: A list of integers.
403403
)pbdoc")
404404
.def("equal_to",
405-
py::overload_cast<std::string const &, std::string const &>(
405+
py::overload_cast<std::string const&, std::string const&>(
406406
&FpSemigroup::equal_to),
407407
py::arg("u"),
408408
py::arg("v"),
@@ -415,7 +415,7 @@ namespace libsemigroups {
415415
:Returns: ``True`` if the strings ``u`` and ``v`` represent the same element of the finitely presented semigroup, and ``False`` otherwise.
416416
)pbdoc")
417417
.def("equal_to",
418-
py::overload_cast<word_type const &, word_type const &>(
418+
py::overload_cast<word_type const&, word_type const&>(
419419
&FpSemigroup::equal_to),
420420
py::arg("u"),
421421
py::arg("v"),
@@ -477,7 +477,7 @@ namespace libsemigroups {
477477
)pbdoc")
478478
.def(
479479
"has_froidure_pin",
480-
[](FpSemigroup const &x) { return x.has_froidure_pin(); },
480+
[](FpSemigroup const& x) { return x.has_froidure_pin(); },
481481
R"pbdoc(
482482
Returns True if a ``FroidurePin`` instance isomorphic to the
483483
finitely presented semigroup has already been
@@ -487,7 +487,7 @@ namespace libsemigroups {
487487
)pbdoc")
488488
.def(
489489
"froidure_pin",
490-
[](FpSemigroup &x) { return x.froidure_pin(); },
490+
[](FpSemigroup& x) { return x.froidure_pin(); },
491491
R"pbdoc(
492492
Returns a ``FroidurePin`` instance isomorphic to the finitely
493493
presented semigroup.
@@ -554,7 +554,7 @@ namespace libsemigroups {
554554
)pbdoc")
555555
.def(
556556
"rules",
557-
[](FpSemigroup const &fp) {
557+
[](FpSemigroup const& fp) {
558558
return py::make_iterator(fp.cbegin_rules(), fp.cend_rules());
559559
},
560560
R"pbdoc(

0 commit comments

Comments
 (0)