@@ -42,22 +42,9 @@ namespace libsemigroups {
42
42
R"pbdoc(
43
43
Adapter for computing the image of a point under a right action.
44
44
45
- :Keyword Arguments:
46
- * *Element* -- the type of the elements in the action
47
- * *Point* -- the type of the points acted on
48
-
49
- This class provides call operators of the following signatures:
50
-
51
- 1. ``(res: Point, pt: Point, x: Element)``
52
- 2. ``(pt: Point, x: Element)``
53
-
54
- In form (1): the call operator changes *res* in-place to contain the
55
- image of the point *pt* under the right action of the element *x*. The
56
- purpose of the 1st parameter is to avoid repeated allocations of memory to hold
57
- temporary points that are discarded soon after they are created.
58
-
59
- In form (2): the call operator returns the image of the point *pt* under the
60
- right action of the element *x*.
45
+ This class provides a call operator with signature ``(pt: Point, x: Element) ->
46
+ Point``, returning the image of the point *pt* under the right action of the
47
+ element *x*.
61
48
62
49
.. doctest::
63
50
@@ -78,6 +65,7 @@ right action of the element *x*.
78
65
>>> func(_, x)
79
66
PPerm([], [], 10)
80
67
)pbdoc" )
68
+ // The next constructor isn't available in python so no doc.
81
69
.def (py::init<>())
82
70
// The following doesn't yet work because mostly it's not possible to
83
71
// change <res> in place.
@@ -86,15 +74,42 @@ right action of the element *x*.
86
74
// Point& res,
87
75
// Point const& pt,
88
76
// Element const& x) -> void { self(res, pt, x); })
89
- .def (" __call__" ,
90
- [](ImageRightAction_ const & self,
91
- Point const & pt,
92
- Element const & x) -> Point {
93
- // Copy pt, to ensure that pt and res have the same degree
94
- Point res = pt;
95
- self (res, pt, x);
96
- return res;
97
- });
77
+ .def (
78
+ " __call__" ,
79
+ [](ImageRightAction_ const & self,
80
+ Point const & pt,
81
+ Element const & x) -> Point {
82
+ // Copy pt, to ensure that pt and res have the same degree
83
+ Point res = pt;
84
+ self (res, pt, x);
85
+ return res;
86
+ },
87
+ py::arg (" pt" ),
88
+ py::arg (" x" ),
89
+ R"pbdoc(
90
+ :sig=(self: ImageRightAction, pt: Point, x: Element) -> Point:
91
+
92
+ Return the image of a point acted on by an element.
93
+
94
+ This call operator returns the image of *pt* acted on by *x*.
95
+
96
+ :param pt: the point on which to act.
97
+ :type pt: Point
98
+
99
+ :param x: the element doing the acting.
100
+ :type x: Element
101
+
102
+ :returns: The image of *pt* acted on by *x*.
103
+ :rtype: Point
104
+
105
+ :raises TypeError:
106
+ If the wrapped C++ type of the sample objects passed via *element* and
107
+ *point* are not the same as the wrapped types of the arguments in any
108
+ invocation of the call operator. For example, if *point* is ``PPerm([], [],
109
+ 256)``, then the underlying C++ type uses 8-bit integers to store image
110
+ values. So, any partial permutation passed as the 1st argument to the
111
+ call operator must be of degree at most ``256``.
112
+ )pbdoc" );
98
113
} // bind_imagerightaction
99
114
100
115
template <typename Element, typename Point>
@@ -106,22 +121,9 @@ right action of the element *x*.
106
121
R"pbdoc(
107
122
Adapter for computing the image of a point under a left action.
108
123
109
- :Keyword Arguments:
110
- * *Element* -- the type of the elements in the action
111
- * *Point* -- the type of the points acted on
112
-
113
- This class provides call operators of the following signatures:
114
-
115
- 1. ``(res: Point, pt: Point, x: Element)``
116
- 2. ``(pt: Point, x: Element)``
117
-
118
- In form (1): the call operator changes *res* in-place to contain the
119
- image of the point *pt* under the left action of the element *x*. The
120
- purpose of the 1st parameter is to avoid repeated allocations of memory to hold
121
- temporary points that are discarded soon after they are created.
122
-
123
- In form (2): the call operator returns the image of the point *pt* under the
124
- left action of the element *x*.
124
+ This class provides a call operator with signature ``(pt: Point, x: Element) ->
125
+ Point``, returning the image of the point *pt* under the left action of the
126
+ element *x*.
125
127
126
128
.. doctest::
127
129
@@ -132,6 +134,7 @@ left action of the element *x*.
132
134
>>> func(pt, x)
133
135
PPerm([2, 3, 6, 9], [2, 3, 6, 9], 10)
134
136
)pbdoc" )
137
+ // The next constructor isn't available in python so no doc.
135
138
.def (py::init<>())
136
139
// The following doesn't yet work because mostly it's not possible to
137
140
// change <res> in place.
@@ -140,15 +143,42 @@ left action of the element *x*.
140
143
// Point& res,
141
144
// Point const& pt,
142
145
// Element const& x) { self(res, pt, x); })
143
- .def (" __call__" ,
144
- [](ImageLeftAction_ const & self,
145
- Point const & pt,
146
- Element const & x) {
147
- // Copy pt, to ensure that pt and res have the same degree
148
- Point res = pt;
149
- self (res, pt, x);
150
- return res;
151
- });
146
+ .def (
147
+ " __call__" ,
148
+ [](ImageLeftAction_ const & self,
149
+ Point const & pt,
150
+ Element const & x) {
151
+ // Copy pt, to ensure that pt and res have the same degree
152
+ Point res = pt;
153
+ self (res, pt, x);
154
+ return res;
155
+ },
156
+ py::arg (" pt" ),
157
+ py::arg (" x" ),
158
+ R"pbdoc(
159
+ :sig=(self: ImageLeftAction, pt: Point, x: Element) -> Point:
160
+
161
+ Return the image of a point acted on by an element.
162
+
163
+ This call operator returns the image of *pt* acted on by *x*.
164
+
165
+ :param pt: the point on which to act.
166
+ :type pt: Point
167
+
168
+ :param x: the element doing the acting.
169
+ :type x: Element
170
+
171
+ :returns: The image of *pt* acted on by *x*.
172
+ :rtype: Point
173
+
174
+ :raises TypeError:
175
+ If the wrapped C++ type of the sample objects passed via *element* and
176
+ *point* are not the same as the wrapped types of the arguments in any
177
+ invocation of the call operator. For example, if *point* is ``PPerm([], [],
178
+ 256)``, then the underlying C++ type uses 8-bit integers to store image
179
+ values. So, any partial permutation passed as the 1st argument to the
180
+ call operator must be of degree at most ``256``.
181
+ )pbdoc" );
152
182
} // bind_imageleftaction
153
183
154
184
} // namespace
0 commit comments