One¶
-
template<>
usinglibsemigroups::FroidurePinTraits<TElementType, TStateType>
::
One
= libsemigroups::One<element_type>¶ Defined in
adapters.hpp
.Specialisations of this struct should be stateless trivially default constructible with two call operator of signatures:
TElementType operator()(size_t n) const
(possiblynoexcept
,inline
and/orconstexpr
also) returning a multiplicative identity element for the categoryTElementType
and withDegree<TElementType>()(x)
equal to the parametern
. For example, ifTElementType
is a type of n x n matrices, then this should return the n x n identity matrix.TElementType operator()(T const&) const
(possiblynoexcept
,inline
and/orconstexpr
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(); } };