Inverse

template<typename TElementType, typename = void>
struct Inverse

Adapter for the inverse of an element.

Defined in adapters.hpp.

Specialisations of this struct should be stateless trivially default constructible with a call operator of signature TPointType operator()(TElementType const& x) const (possibly noexcept, inline and/or constexpr also).

The call operator should return the inverse of the element x under the assumption that x has an inverse (in the sense of groups). For example, if x is a permutation, then this would return its inverse. If x is a permutation matrix of type BMat8, then this operator would return its transpose.

The second template parameter exists for SFINAE.

Used by:

Example

template <>
struct Inverse<BMat8> {
  inline BMat8 operator()(BMat8 const& x) const noexcept {
    LIBSEMIGROUPS_ASSERT(x * x.transpose() == x.one());
    return x.transpose();
  }
};

Template Parameters

TElementType – the type of the elements of a semigroup.