23#ifndef LIBSEMIGROUPS_ORDER_HPP_
24#define LIBSEMIGROUPS_ORDER_HPP_
95 template <
typename T,
typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>>
98 x.cbegin(), x.cend(), y.cbegin(), y.cend());
128 template <
typename T>
131 x->cbegin(), x->cend(), y->cbegin(), y->cend());
167 template <
typename T>
191 template <
typename T>
221 template <
typename T>
222 bool operator()(T first1, T last1, T first2, T last2)
const {
266 template <
typename T,
typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>>
271 return (last1 - first1) < (last2 - first2)
272 || ((last1 - first1) == (last2 - first2)
305 template <
typename T,
typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>>
339 template <
typename T>
375 template <
typename T>
416 template <
typename T,
typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>>
421 bool lastmoved =
false;
425 if (last1 < first1) {
426 if (last2 < first2) {
431 if (last2 < first2) {
434 if (*last1 == *last2) {
437 }
else if (*last1 < *last2) {
440 }
else if (*last2 < *last1) {
473 template <
typename T,
typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>>
505 template <
typename T>
508 x->cbegin(), x->cend(), y->cbegin(), y->cend());
541 template <
typename T>
bool shortlex_compare(T const &first1, T const &last1, T const &first2, T const &last2)
Compare two objects of the same type using the short-lex reduction ordering.
Definition order.hpp:267
bool lexicographical_compare(T const &x, T const &y)
Compare two objects of the same type using std::lexicographical_compare.
Definition order.hpp:96
Order
The possible orderings of words and strings.
Definition order.hpp:48
bool recursive_path_compare(T const &first1, T last1, T const &first2, T last2) noexcept
Compare two objects of the same type using the recursive path comparison.
Definition order.hpp:417
@ none
No ordering.
Definition order.hpp:50
@ shortlex
Definition order.hpp:54
@ lex
Definition order.hpp:59
@ recursive
Definition order.hpp:63
T lexicographical_compare(T... args)
Namespace for everything in the libsemigroups library.
Definition action.hpp:44
A stateless struct with binary call operator using std::lexicographical_compare.
Definition order.hpp:147
bool operator()(std::initializer_list< T > x, std::initializer_list< T > y) const
Call operator that compares x and y given initializer lists using std::lexicographical_compare.
Definition order.hpp:192
bool operator()(T const &x, T const &y) const
Call operator that compares x and y using std::lexicographical_compare.
Definition order.hpp:168
bool operator()(T first1, T last1, T first2, T last2) const
Call operator that compares iterators using std::lexicographical_compare.
Definition order.hpp:222
A stateless struct with binary call operator using recursive_path_compare.
Definition order.hpp:524
bool operator()(T const &x, T const &y) const noexcept
Call operator that compares x and y using recursive_path_compare.
Definition order.hpp:542
A stateless struct with binary call operator using shortlex_compare.
Definition order.hpp:356
bool operator()(T const &x, T const &y) const
Call operator that compares x and y using shortlex_compare.
Definition order.hpp:376