libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
One< Element, typename >
template<typename Element, typename = void>
struct libsemigroups::One< Element, typename >

Specialisations of this struct should be stateless trivially default constructible with two call operator of signatures:

  1. Element operator()(size_t n) const (possibly noexcept, inline and/or constexpr also) returning a multiplicative identity element for the category Element and with Degree<Element>()(x) equal to the parameter n. For example, if Element is a type of n x n matrices, then this should return the n x n identity matrix.
  2. Element operator()(T const&) const (possibly noexcept, inline and/or constexpr also). This could be implemented as:
    Element operator()(Element const& x) const noexcept {
    return this->operator()(Degree<Element>()(x));
    }
    Adapter for the degree of an element.
    Definition adapters.hpp:159
Template Parameters
Elementthe type of the elements of a semigroup.

The second template parameter exists for SFINAE.

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();
}
};
Adapter for the identity element of the given type.
Definition adapters.hpp:246

The documentation for this struct was generated from the following file: