Adapters¶
-
using libsemigroups::KoniecznyTraits::Degree = ::libsemigroups::Degree<element_type>¶
Adapter for the degree of an element.
Defined in
adapters.hpp.Specialisations of this struct should be stateless trivially default constructible with a call operator of signature
size_t operator()(TElementType const& x) const(possiblynoexcept,inlineand/orconstexpralso).The return value of the call operator ought to indicate the degree of a
TElementTypeinstance which may or may not depend on the parameterx. The degree of a permutation, for instance, would be the the number of points it acts on, the degree of a matrix is its dimension, and so on. This is used, for example, by SchreierSimsTraits in some member functions to determine whether it is known a priori that a permutation does not belong to the object, because it acts on too many points.- Used by:
- Example
template <> struct Degree<BMat8> { constexpr inline size_t operator()(BMat8 const&) const noexcept { return 8; } };
- Template Parameters:
TElementType – the type of the elements of a semigroup.
TSfinae – this template parameter can be used for SFINAE.
-
using libsemigroups::KoniecznyTraits::ElementHash = ::libsemigroups::Hash<element_type>¶
Adapter for hashing.
Defined in
adapters.hpp.This type should be a stateless trivially default constructible with a call operator of signature
size_t operator()(TValueType const&)for use with, for example, std::unordered_map.- Template Parameters:
TValueType – the type of objects to compare.
TSfinae – this template parameter can be used for SFINAE.
-
using libsemigroups::KoniecznyTraits::EqualTo = ::libsemigroups::EqualTo<element_type>¶
Adapter for testing equality.
Defined in
adapters.hpp.This type should be a stateless trivially default constructible with a call operator of signature
bool operator()(TValueType const&, TValueType const&)(possiblynoexcept,inlineand/orconstexpralso) for use with, for example, std::unordered_map.- Template Parameters:
TValueType – the type of objects to compare.
TSfinae – this template parameter can be used for SFINAE.
-
using libsemigroups::KoniecznyTraits::Lambda = ::libsemigroups::Lambda<element_type, lambda_value_type>¶
Adapter for the action on LambdaValue’s.
Defined in
adapters.hpp.This type should be a stateless trivially default constructible with an operator of signature
void operator()(TPointType&, TElementType const&), which should modify the first argument in-place to contain the lambda value of the second argument. The kernel of the lambda function should be Green’s \(\mathscr{L}\)-relation on the semigroup in question.- Used by:
- Template Parameters:
TElementType – the type of elements.
TPointType – the type of the lambda points.
-
using libsemigroups::KoniecznyTraits::Less = ::libsemigroups::Less<element_type>¶
Adapter for comparisons.
Defined in
adapters.hpp.This type should be a stateless trivially default constructible with a call operator of signature
bool operator()(TValueType const&, TValueType const&)(possiblynoexcept,inlineand/orconstexpralso) which defines a linear order on the objects of type TValueType- Used by:
- Template Parameters:
TValueType – the type of objects to compare.
TSfinae – this template parameter can be used for SFINAE.
-
using libsemigroups::KoniecznyTraits::One = ::libsemigroups::One<element_type>¶
Adapter for the identity element of the given type.
Specialisations of this struct should be stateless trivially default constructible with two call operator of signatures:
TElementType operator()(size_t n) const(possiblynoexcept,inlineand/orconstexpralso) returning a multiplicative identity element for the categoryTElementTypeand withDegree<TElementType>()(x)equal to the parametern. For example, ifTElementTypeis a type of n x n matrices, then this should return the n x n identity matrix.TElementType operator()(T const&) const(possiblynoexcept,inlineand/orconstexpralso). This could be implemented as:TElementType operator()(TElementType const& x) const noexcept { return this->operator()(Degree<TElementType>()(x)); }
- Used by:
- Example
template <typename T> struct One< T, typename std::enable_if<std::is_base_of<PTransf16, T>::value>::type> { T operator()(size_t = 0) const noexcept { return T::one(); } T operator()(T const&) const noexcept { return T::one(); } };
- Template Parameters:
TElementType – the type of the elements of a semigroup.
TSfinae – this template parameter can be used for SFINAE.
-
using libsemigroups::KoniecznyTraits::Product = ::libsemigroups::Product<element_type>¶
Adapter for the product of two elements.
Defined in
adapters.hpp.Specialisations of this struct should be stateless trivially default constructible with a call operator of signature
void operator()(TElementType& xy, TElementType const& x, TElementType const& y, size_t = 0)(possiblynoexcept,inlineand/orconstexpralso).The call operator should change
xyin-place to be the product ofxandy. The 4th parameter is optional and it can be used as an index for static thread local storage, that might be required for forming the product ofxandy. The purpose of the 1st parameter is to avoid repeated allocations of memory to hold temporary products that are discarded soon after they are created.- Used by:
- Example
template <> struct Product<size_t> { void operator()(size_t& xy, size_t x, size_t y, size_t = 0) const noexcept { xy = x * y; } };
- Template Parameters:
TElementType – the type of the elements of a semigroup.
TSfinae – this template parameter can be used for SFINAE.
-
using libsemigroups::KoniecznyTraits::Rank = ::libsemigroups::Rank<element_type, rank_state_type>¶
Adapter for calculating ranks.
Defined in
adapters.hpp.This type should be default constructible and a call operator of signature
size_t operator()(TElementType const&)if no additional data is required to compute the rank, or a call operator of signaturesize_t operator()(TStateType<TElementType> const&, TElementType const&)if additional data is required.The call operator should return the rank of the element given as argument. This must satisfy the following properties:
\(\operatorname{rank}\) should agree with the \(D\)-order on the semigroup; that is, if \(D_x \leq D_y\), then \(\operatorname{rank}(x) \leq \operatorname{rank}(y)\),
if \(D_x \leq D_y\) and \(\operatorname{rank}(x) = \operatorname{rank}(y)\), then \(D_x = D_y\).
- Used by:
- Template Parameters:
TElementType – the type of elements.
TStateType – the type of the data required to compute ranks of TElementTypes; defaults to
RankState<TElementType>.
-
using libsemigroups::KoniecznyTraits::Rho = ::libsemigroups::Rho<element_type, rho_value_type>¶
Adapter for the action on RhoValue’s.
Defined in
adapters.hpp.This type should be a stateless trivially default constructible with an operator of signature
void operator()(TPointType&, TElementType const&), which should modify the first argument in-place to contain the rho value of the second argument. The kernel of the rho function should be Green’s \(\mathscr{R}\)-relation on the semigroup in question.- Used by:
- Template Parameters:
TElementType – the type of elements.
TPointType – the type of the rho points.
-
using libsemigroups::KoniecznyTraits::Swap = ::libsemigroups::Swap<element_type>¶
Adapter for swapping.
Defined in
adapters.hpp.This type should be a stateless trivially default constructible with a call operator of signature
void operator()(TValueType const&, TValueType const&)(possiblynoexcept,inlineand/orconstexpralso) which swaps its arguments.- Template Parameters:
TValueType – the type of objects to compare.
TSfinae – this template parameter can be used for SFINAE.