One

template<>
using libsemigroups::ActionTraits<TElementType, TPointType>::One = libsemigroups::One<TElementType>

Defined in adapters.hpp.

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

  1. TElementType operator()(size_t n) const (possibly noexcept, inline and/or constexpr also) returning a multiplicative identity element for the category TElementType and with Degree<TElementType>()(x) equal to the parameter n. For example, if TElementType is a type of n x n matrices, then this should return the n x n identity matrix.

  2. TElementType operator()(T const&) const (possibly noexcept, inline and/or constexpr also). This could be implemented as:

    TElementType operator()(TElementType const& x) const noexcept {
      return this->operator()(Degree<TElementType>()(x));
    }
    

The second template parameter exists for SFINAE in overload resolution.

Template Parameters
  • TElementType: the type of the elements of a semigroup.

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();
  }
};