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

This is a traits class for use with Action, LeftAction, and RightAction.

Template Parameters
Elementthe type of the elements.
Pointthe type of the points acted on.
See also
Action.

Public Types

using EqualTo = ::libsemigroups::EqualTo<Point>
 Adapter for testing equality.
 
using Hash = ::libsemigroups::Hash<Point>
 Adapter for hashing.
 
using One = ::libsemigroups::One<Element>
 Adapter for the identity element of the given type.
 
using Product = ::libsemigroups::Product<Element>
 Adapter for the product of two elements.
 
using Swap = ::libsemigroups::Swap<Element>
 Adapter for swapping.
 

Member Typedef Documentation

◆ EqualTo

template<typename Element, typename Point>
using EqualTo = ::libsemigroups::EqualTo<Point>

Defined in adapters.hpp.

This type should be a stateless trivially default constructible with a call operator of signature bool operator()(Value const&, Value const&) (possibly noexcept, inline and/or constexpr also) for use with, for example, std::unordered_map.

Template Parameters
Valuethe type of objects to compare.

The second template parameter exists for SFINAE.

Used by:

◆ Hash

template<typename Element, typename Point>
using Hash = ::libsemigroups::Hash<Point>

Defined in adapters.hpp.

This type should be a stateless trivially default constructible with a call operator of signature size_t operator()(Value const&) for use with, for example, std::unordered_map.

Template Parameters
Valuethe type of objects to compare.

The second template parameter exists for SFINAE.

Used by:

◆ One

template<typename Element, typename Point>
using One = ::libsemigroups::One<Element>

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();
}
};
::libsemigroups::One< Element > One
Adapter for the identity element of the given type.
Definition action.hpp:857

◆ Product

template<typename Element, typename Point>
using Product = ::libsemigroups::Product<Element>

Defined in adapters.hpp.

Specialisations of this struct should be stateless trivially default constructible with a call operator of signature void operator()(Element&, Element const&, Element const&, size_t = 0) (possibly noexcept, inline and/or constexpr also).

The call operator should change xy in-place to be the product of x and y. 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 of x and y. 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.

Template Parameters
Elementthe type of the elements of a semigroup.

The second template parameter exists for SFINAE.

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;
}
};
::libsemigroups::Product< Element > Product
Adapter for the product of two elements.
Definition action.hpp:859

◆ Swap

template<typename Element, typename Point>
using Swap = ::libsemigroups::Swap<Element>

Defined in adapters.hpp.

This type should be a stateless trivially default constructible with a call operator of signature void operator()(Value&, Value&) (possibly noexcept, inline and/or constexpr also) which swaps its arguments.

Template Parameters
Valuethe type of objects to swap.

The second template parameter exists for SFINAE.

Used by:

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