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>
252 template <
typename Element,
typename =
void>
290 template <
typename Element,
typename =
void>
325 template <
typename Element,
typename =
void>
356 template <
typename Element,
typename Po
int,
typename =
void>
398 template <
typename Element,
typename Po
int,
typename =
void>
419 template <
typename Value,
typename =
void>
452 template <
typename Value,
typename =
void>
483 template <
typename T>
514 template <
typename T,
typename Hasher>
525 for (T
const& x : vec) {
526 val ^= Hasher()(x) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
545 template <
typename T,
size_t N>
556 for (T
const& x : ar) {
557 val ^=
Hash<T>()(x) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
577 template <
typename S,
typename T>
588 val ^=
Hash<S>()(x.first) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
589 val ^=
Hash<T>()(x.second) + 0x9e3779b97f4a7c16 + (val << 6) + (val >> 2);
605 struct Hash<
std::pair<size_t, size_t>> {
616#if LIBSEMIGROUPS_SIZEOF_VOID_P == 8
617 return (x.first << 32) + x.second;
619 return (x.first << 16) + x.second;
640 template <
typename Value,
typename =
void>
672 template <
typename Value,
typename =
void>
696 template <
typename Element,
701 "the 3rd template parameter is not a container of objects of "
702 "type the 2nd template parameter");
723 Element
const& x)
const {
724 for (
size_t i = 0; i < pt.size(); ++i) {
744 template <
typename Element,
773 Element
const& p)
const {
799 template <
typename Element,
typename =
void>
818 template <
typename Element,
typename =
void>
839 template <
typename Element,
typename Po
int,
typename =
void>
860 template <
typename Element,
typename Po
int,
typename =
void>
883 template <
typename Element,
typename =
void>
894 template <typename T>
934 template <
typename Element,
Base class for states for ranks.
Definition adapters.hpp:884
RankState & operator=(RankState const &)=delete
Deleted.
RankState(RankState const &)=default
Deleted.
RankState & operator=(RankState &&)=delete
Deleted.
void type
Definition adapters.hpp:888
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:420
bool operator()(Value const &x, Value const &y) const
Compare x and y with std::equal_to.
Definition adapters.hpp:430
size_t operator()(std::array< T, N > const &ar) const
Hashes ar.
Definition adapters.hpp:554
size_t operator()(std::pair< S, T > const &x) const noexcept
Hashes x.
Definition adapters.hpp:586
size_t operator()(std::vector< T > const &vec) const
Hashes vec.
Definition adapters.hpp:523
size_t operator()(std::vector< T > const &vec) const
Hashes vec.
Definition adapters.hpp:494
Adapter for hashing.
Definition adapters.hpp:453
size_t operator()(Value const &x) const
Hash x using std::hash.
Definition adapters.hpp:462
Adapter for the value of a left action.
Definition adapters.hpp:357
Adapter for the value of a right action.
Definition adapters.hpp:399
Adapter for increasing the degree of an element.
Definition adapters.hpp:206
Adapter for the inverse of an element.
Definition adapters.hpp:326
Adapter for the action on LambdaValue's.
Definition adapters.hpp:840
Adapter for lambda functions.
Definition adapters.hpp:800
Adapter for comparisons.
Definition adapters.hpp:641
bool operator()(Value const &x, Value const &y) const
Compare if x is less than y.
Definition adapters.hpp:651
Adapter for calculating right actions of each element in a container.
Definition adapters.hpp:747
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:771
Adapter for calculating right actions of each element in a container.
Definition adapters.hpp:699
void operator()(Container &res, Container const &pt, Element const &x) const
Calculate right actions of each element in a container.
Definition adapters.hpp:721
Adapter for the identity element of the given type.
Definition adapters.hpp:253
Adapter for the product of two elements.
Definition adapters.hpp:291
Adapter for calculating ranks.
Definition adapters.hpp:937
Adapter for the action on RhoValue's.
Definition adapters.hpp:861
Adapter for rho functions.
Definition adapters.hpp:819
Adapter for swapping.
Definition adapters.hpp:673
void operator()(Value &x, Value &y)
Swap x and y.
Definition adapters.hpp:680