19#ifndef LIBSEMIGROUPS_ADAPTERS_HPP_
20#define LIBSEMIGROUPS_ADAPTERS_HPP_
85 template <
typename... Args>
86 constexpr void operator()(Args...) const noexcept {}
90 template <
typename... Args>
91 [[nodiscard]]
constexpr bool operator()(Args...) const noexcept {
127 template <
typename Element,
typename =
void>
165 template <
typename Element,
typename =
void>
205 template <
typename Element,
typename =
void>
250 template <
typename Element,
typename =
void>
288 template <
typename Element,
typename =
void>
323 template <
typename Element,
typename =
void>
354 template <
typename Element,
typename Po
int,
typename =
void>
396 template <
typename Element,
typename Po
int,
typename =
void>
417 template <
typename Value,
typename =
void>
450 template <
typename Value,
typename =
void>
481 template <
typename T>
512 template <
typename T,
typename Hasher>
523 for (T
const& x : vec) {
524 val ^= Hasher()(x) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
543 template <
typename T,
size_t N>
554 for (T
const& x : ar) {
555 val ^=
Hash<T>()(x) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
575 template <
typename S,
typename T>
586 val ^=
Hash<S>()(x.first) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
587 val ^=
Hash<T>()(x.second) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
603 struct Hash<
std::pair<size_t, size_t>> {
614#if LIBSEMIGROUPS_SIZEOF_VOID_P == 8
615 return (x.first << 32) + x.second;
617 return (x.first << 16) + x.second;
638 template <
typename Value,
typename =
void>
670 template <
typename Value,
typename =
void>
694 template <
typename Element,
699 "the 3rd template parameter is not a container of objects of "
700 "type the 2nd template parameter");
721 Element
const& x)
const {
722 for (
size_t i = 0; i < pt.size(); ++i) {
742 template <
typename Element,
771 Element
const& p)
const {
797 template <
typename Element,
typename =
void>
816 template <
typename Element,
typename =
void>
837 template <
typename Element,
typename Po
int,
typename =
void>
858 template <
typename Element,
typename Po
int,
typename =
void>
881 template <
typename Element,
typename =
void>
892 template <typename T>
932 template <
typename Element,
Base class for states for ranks.
Definition adapters.hpp:882
RankState & operator=(RankState const &)=delete
Deleted.
RankState(RankState const &)=default
Deleted.
RankState & operator=(RankState &&)=delete
Deleted.
void type
Definition adapters.hpp:886
RankState() noexcept=default
Default constructor; does nothing.
RankState(RankState &&)=delete
Deleted.
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
Adapter for the complexity of multiplication.
Definition adapters.hpp:128
Adapter for the degree of an element.
Definition adapters.hpp:166
Adapter for testing equality.
Definition adapters.hpp:418
bool operator()(Value const &x, Value const &y) const
Compare x and y with std::equal_to.
Definition adapters.hpp:428
size_t operator()(std::array< T, N > const &ar) const
Hashes ar.
Definition adapters.hpp:552
size_t operator()(std::pair< S, T > const &x) const noexcept
Hashes x.
Definition adapters.hpp:584
size_t operator()(std::vector< T > const &vec) const
Hashes vec.
Definition adapters.hpp:521
size_t operator()(std::vector< T > const &vec) const
Hashes vec.
Definition adapters.hpp:492
Adapter for hashing.
Definition adapters.hpp:451
size_t operator()(Value const &x) const
Hash x using std::hash.
Definition adapters.hpp:460
Adapter for the value of a left action.
Definition adapters.hpp:355
Adapter for the value of a right action.
Definition adapters.hpp:397
Adapter for increasing the degree of an element.
Definition adapters.hpp:206
Adapter for the inverse of an element.
Definition adapters.hpp:324
Adapter for the action on LambdaValue's.
Definition adapters.hpp:838
Adapter for lambda functions.
Definition adapters.hpp:798
Adapter for comparisons.
Definition adapters.hpp:639
bool operator()(Value const &x, Value const &y) const
Compare if x is less than y.
Definition adapters.hpp:649
Adapter for calculating right actions of each element in a container.
Definition adapters.hpp:745
void operator()(Container &res, Container const &pt, Element const &p) const
Calculate right actions of each element in a container, then sort.
Definition adapters.hpp:769
Adapter for calculating right actions of each element in a container.
Definition adapters.hpp:697
void operator()(Container &res, Container const &pt, Element const &x) const
Calculate right actions of each element in a container.
Definition adapters.hpp:719
Adapter for the identity element of the given type.
Definition adapters.hpp:251
Adapter for the product of two elements.
Definition adapters.hpp:289
Adapter for calculating ranks.
Definition adapters.hpp:935
Adapter for the action on RhoValue's.
Definition adapters.hpp:859
Adapter for rho functions.
Definition adapters.hpp:817
Adapter for swapping.
Definition adapters.hpp:671
void operator()(Value &x, Value &y)
Swap x and y.
Definition adapters.hpp:678