|
libhatchet
|
Go to the source code of this file.
Classes | |
| class | hxrange< iterator_t_ > |
Functions | |
| template<hxrandom_range_concept_ range_t_, typename value_t_, typename less_t_> | |
| HX_NS_BEGIN_ constexpr auto | hxlower_bound (range_t_ &&range_, const value_t_ &value_, const less_t_ &less_) -> decltype(range_.begin()) |
| template<typename iterator_t_> | |
| constexpr hxrange< iterator_t_ > | hxmake_range (iterator_t_ begin_, iterator_t_ end_) |
| template<typename T, size_t N_> | |
| constexpr hxrange< T * > | hxmake_range (T(&array_)[N_]) |
| template<hxrange_concept_ range_t_, typename callable_t_> | |
| constexpr bool | hxall_of (range_t_ &&range_, callable_t_ &&callable_) |
| template<hxrange_concept_ range_t_, typename callable_t_> | |
| constexpr bool | hxany_of (range_t_ &&range_, callable_t_ &&callable_) |
| template<hxrandom_iterator_concept_ iterator_t_, typename value_t_, typename less_t_> | |
| constexpr iterator_t_ | hxbinary_search (iterator_t_ begin_, iterator_t_ end_, const value_t_ &value_, const less_t_ &less_) |
| template<hxrandom_range_concept_ range_t_, typename value_t_, typename less_t_> | |
| constexpr auto | hxbinary_search (range_t_ &&range_, const value_t_ &value_, const less_t_ &less_) -> decltype(range_.begin()) |
| template<hxsorted_range_concept_ range_t_, typename value_t_> | |
| constexpr auto | hxbinary_search (range_t_ &&range_, const value_t_ &value_) -> decltype(range_.begin()) |
| template<hxrange_concept_ range_t_, typename callable_t_> | |
| constexpr hxsize_t | hxcount_if (range_t_ &&range_, callable_t_ &&callable_) |
| template<hxrange_concept_ range0_t_, hxrange_concept_ range1_t_, typename equal_t_> | |
| constexpr bool | hxequal_range (range0_t_ &&range0_, range1_t_ &&range1_, const equal_t_ &equal_) |
| template<hxrange_concept_ range0_t_, hxrange_concept_ range1_t_> | |
| constexpr bool | hxequal_range (range0_t_ &&range0_, range1_t_ &&range1_) |
| template<typename T, typename... args_t_> | |
| constexpr T | hxexchange (T &obj_, args_t_ &&... args_) noexcept |
| template<hxrange_concept_ range_t_, typename callable_t_> | |
| constexpr auto | hxfind_if (range_t_ &&range_, callable_t_ &&callable_) -> decltype(range_.begin()) |
| template<hxrange_concept_ range_t_, typename callable_t_> | |
| constexpr callable_t_ | hxfor_each (range_t_ &&range_, callable_t_ &&callable_) |
| template<hxrange_concept_ range0_t_, hxrange_concept_ range1_t_, typename equal_t_, typename less_t_> | |
| constexpr bool | hxless_range (range0_t_ &&range0_, range1_t_ &&range1_, const equal_t_ &equal_, const less_t_ &less_) |
| template<hxrange_concept_ range0_t_, hxrange_concept_ range1_t_> | |
| constexpr bool | hxless_range (range0_t_ &&range0_, range1_t_ &&range1_) |
| template<hxrandom_range_concept_ range_t_, typename value_t_, typename less_t_> | |
| constexpr auto | hxlower_bound (range_t_ &&range_, const value_t_ &value_, const less_t_ &less_) -> decltype(range_.begin()) |
| template<hxrandom_range_concept_ range_t_, typename value_t_> | |
| constexpr auto | hxlower_bound (range_t_ &&range_, const value_t_ &value_) -> decltype(range_.begin()) |
| template<hxrandom_range_concept_ range_t_, typename value_t_, typename less_t_> | |
| constexpr auto | hxupper_bound (range_t_ &&range_, const value_t_ &value_, const less_t_ &less_) -> decltype(range_.begin()) |
| template<hxrandom_range_concept_ range_t_, typename value_t_> | |
| constexpr auto | hxupper_bound (range_t_ &&range_, const value_t_ &value_) -> decltype(range_.begin()) |
Read-only range utilities for libhatchet.
Includes support for callables when defining custom key operations. Otherwise T::operator<(const T&) and T::operator==(const T&) are used. The other relational operators are not used.
See hxset_algorithms.hpp for iterator based set algorithms. See hxsort.hpp for sorting algorithms including hxinsertion_sort, hxheapsort and hxsort.
All the hxrestrict_t sprinkled around has measurable benefits in certain cases. Clang is better at utilizing that hint.
|
inlineconstexpr |
hxall_of - Returns true if the predicate callable returns true for every element of range.
Returns true for an empty range. Requires a forward-iterator.
|
inlineconstexpr |
hxany_of - Returns true if the predicate callable returns true for at least one element of range.
Returns false for an empty range. Requires a forward-iterator.
|
inlineconstexpr |
hxbinary_search - Performs a binary search for value in the sorted range [begin, end).
Returns end if the value is not found. Unsorted data will lead to errors. The first of non-unique values is returned. The less callable returns true if the first argument is ordered before (i.e., is less than) the second. Requires a random-iterator.
|
inlineconstexpr |
hxbinary_search (specialization) - An overload of hxbinary_search that searches for value in the sorted range using hxkey_less.
Requires a sorted-iterator.
|
inlineconstexpr |
hxbinary_search - An overload of hxbinary_search over range.
Requires a random-iterator.
|
inlineconstexpr |
hxcount_if - Returns the number of elements of range for which the predicate callable returns true.
Requires a forward-iterator.
|
inlineconstexpr |
hxequal_range (specialization) - An overload of hxequal_range that uses hxkey_equal over range0 and range1.
Requires a forward-iterator.
|
inlineconstexpr |
hxequal_range - Returns true if range0 and range1 have the same length and equal returns true for every pair of elements at corresponding positions.
Requires a forward-iterator.
|
inlineconstexprnoexcept |
hxexchange - Replaces obj with a T constructed from args and returns the old value of obj.
T must be move-constructible. Useful in constructor initialization lists.
|
inlineconstexpr |
hxfind_if - Returns an iterator to the first element of range for which the predicate callable returns true.
Returns range.end() if no element matches. Requires a forward-iterator.
|
inlineconstexpr |
hxfor_each - Applies the callable to each element of range in order.
Returns the callable after it has been applied to every element. Requires a forward-iterator.
|
inlineconstexpr |
hxless_range (specialization) - An overload of hxless_range that uses hxkey_equal and hxkey_less over range0 and range1.
Requires a forward-iterator.
|
inlineconstexpr |
hxless_range - Returns true if range0 is lexicographically less than range1, using equal to detect matching elements and less to order the first pair that differs.
A range that is a proper prefix of the other is less than the other. Costs one equal call and, at the deciding position only, one less call per element. Requires a forward-iterator.
|
inlineconstexpr |
hxlower_bound (specialization) - An overload of hxlower_bound over range that uses hxkey_less.
Requires a random-iterator.
|
inlineconstexpr |
hxlower_bound - Returns the first position in the sorted range where value could be inserted without violating the ordering.
Returns range.end() if no element is ordered after or equivalent to value. Unsorted data will lead to errors. The less callable returns true if the first argument is ordered before (i.e., is less than) the second. Requires a random-iterator.
|
inlineconstexpr |
hxlower_bound - Returns the first position in the sorted range where value could be inserted without violating the ordering.
Returns range.end() if no element is ordered after or equivalent to value. Unsorted data will lead to errors. The less callable returns true if the first argument is ordered before (i.e., is less than) the second. Requires a random-iterator.
|
inlineconstexpr |
hxmake_range - Returns an hxrange deduced from the iterator pair [begin, end).
|
inlineconstexpr |
|
inlineconstexpr |
hxupper_bound (specialization) - An overload of hxupper_bound over range that uses hxkey_less.
Requires a random-iterator.
|
inlineconstexpr |
hxupper_bound - Returns the first position in the sorted range whose element is ordered after value.
Returns range.end() if no such element exists. Unsorted data will lead to errors. The less callable returns true if the first argument is ordered before (i.e., is less than) the second. Requires a random-iterator.