Static member functions¶
-
inline PPerm libsemigroups::PPerm::identity() const¶
Returns the identity partial perm on degree() points.
This function returns a newly constructed partial perm with degree equal to the degree of
thisthat fixes every value from0to degree().- Parameters
(None)
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
A value of type
PPerm.
-
static inline PPerm libsemigroups::PPerm::identity(size_t M)¶
Returns the identity partial perm on the given number of points.
This function returns a newly constructed partial perm with degree equal to
Mthat fixes every value from0toM.- Complexity
Linear in
M.
- Parameters:
M – the degree.
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
A value of type
PPerm.
-
template<typename T>
static inline PPerm libsemigroups::PPerm::make(T &&cont)¶ Construct from image list and validate
Constructs a partial perm \(f\) of degree
Msuch that \(f(i) = cont[i]\) for every value in the range \([0, M)\) where \(M\) iscont.size()- Complexity
Linear in the size of
cont.
- Parameters:
cont – list of images or UNDEFINED
- Throws:
LibsemigroupsException – if any of the following fail to hold:
the size of
contis incompatible with container_type.any value in
contexceedscont.size()and is not equal to UNDEFINED.there are repeated values in
cont.
-
static inline PPerm libsemigroups::PPerm::make(std::initializer_list<value_type> &&cont)¶
Construct from image list and validate
Constructs a partial perm \(f\) of degree
Msuch that \(f(i) = cont[i]\) for every value in the range \([0, M)\) where \(M\) iscont.size()- Complexity
Linear in the size of
cont.
- Parameters:
cont – list of images or UNDEFINED
- Throws:
LibsemigroupsException – if any of the following fail to hold:
the size of
contis incompatible with container_type.any value in
contexceedscont.size()and is not equal to UNDEFINED.there are repeated values in
cont.
-
static inline PPerm libsemigroups::PPerm::make(std::vector<value_type> const &dom, std::vector<value_type> const &ran, size_t const M)¶
Construct from domain, range, and degree, and validate
Constructs a partial perm of degree
Msuch that(dom[i])f = ran[i]for alliand which is UNDEFINED on every other value in the range \([0, M)\).- Complexity
Linear in the size of
dom.
- Parameters:
dom – the domain
ran – the range
M – the degree
- Throws:
LibsemigroupsException – if any of the following fail to hold:
the value
Mis not compatible with the template parameterNdomandrando not have the same sizeany value in
domorranis greater thanMthere are repeated entries in
domorran.