|
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryOperation = std::plus<T>> |
OutputIterator | exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, BinaryOperation binary_op=BinaryOperation()) |
| Computes an exclusive prefix sum operation using binary_op the range [first, last), using init as the initial value, and writes the results to the range beginning at result. More...
|
|
template<typename ForwardIterator , typename Comparator > |
ForwardIterator | is_sorted_until_cmp (ForwardIterator first, ForwardIterator last, Comparator cmp) |
| Checks if a range is sorted using a three-way Comparator (with memcmp() semantics). More...
|
|
template<typename ForwardIterator , typename Comparator > |
bool | is_sorted_cmp (ForwardIterator first, ForwardIterator last, Comparator cmp) |
| Checks if a range is sorted using a three-way Comparator (with memcmp() semantics). More...
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator > |
OutputIterator | merge_advance_usual (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp) |
| Merge routine being able to merge only the max_size smallest elements. More...
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator > |
OutputIterator | merge_advance_movc (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp) |
| Merge routine being able to merge only the max_size smallest elements. More...
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator > |
OutputIterator | merge_advance (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp) |
| Merge routine being able to merge only the max_size smallest elements. More...
|
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Comparator , typename Combine = std::plus< typename std::iterator_traits<InputIterator1>::value_type>> |
OutputIterator | merge_combine (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Comparator cmp=Comparator(), Combine combine=Combine()) |
| Merge two sorted ranges and add all items comparing equal. More...
|
|
template<typename RanSeqs , typename RankType , typename RankIterator , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RanSeqs> ::value_type::first_type>::value_type>> |
void | multisequence_partition (const RanSeqs &begin_seqs, const RanSeqs &end_seqs, const RankType &rank, RankIterator begin_offsets, Comparator comp=Comparator()) |
| Splits several sorted sequences at a certain global rank, resulting in a splitting point for each sequence. More...
|
|
template<typename ValueType , typename RanSeqs , typename RankType , typename Comparator = std::less<ValueType>> |
ValueType | multisequence_selection (const RanSeqs &begin_seqs, const RanSeqs &end_seqs, const RankType &rank, RankType &offset, Comparator comp=Comparator()) |
| Selects the element at a certain global rank from several sorted sequences. More...
|
|
template<bool Stable, bool Sentinels, typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | multiway_merge_base (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Sequential multi-way merging switch. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Sequential multi-way merge. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Stable sequential multi-way merge. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Sequential multi-way merge with sentinels in sequences. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Stable sequential multi-way merge with sentinels in sequences. More...
|
|
template<bool Stable, typename RandomAccessIteratorIterator , typename Comparator > |
void | multiway_merge_sampling_splitting (const RandomAccessIteratorIterator &seqs_begin, const RandomAccessIteratorIterator &seqs_end, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type total_size, Comparator comp, std::vector< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type > *chunks, const size_t num_threads, const size_t merge_oversampling) |
| Splitting method for parallel multi-way merge routine: use sampling and binary search for in-exact splitting. More...
|
|
template<bool Stable, typename RandomAccessIteratorIterator , typename Comparator > |
void | multiway_merge_exact_splitting (const RandomAccessIteratorIterator &seqs_begin, const RandomAccessIteratorIterator &seqs_end, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type total_size, Comparator comp, std::vector< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type > *chunks, const size_t num_threads) |
| Splitting method for parallel multi-way merge routine: use multisequence selection for exact splitting. More...
|
|
template<bool Stable, typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | parallel_multiway_merge_base (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Parallel multi-way merge routine. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | parallel_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Parallel multi-way merge routine. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_parallel_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Stable parallel multi-way merge routine. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | parallel_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Parallel multi-way merge routine with sentinels. More...
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_parallel_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Stable parallel multi-way merge routine with sentinels. More...
|
|
template<typename RandomAccessIt , typename RandomBits > |
void | random_bipartition_shuffle (RandomAccessIt begin, RandomAccessIt end, size_t size_left_partition, RandomBits &urng) |
| Similar to std::shuffle, but only generates a random bi-partition. More...
|
|
template<typename DataType , unsigned Radix = 8, typename KeyExtract = void> |
auto | make_radix_heap (KeyExtract &&key_extract) -> RadixHeap< DataType, KeyExtract, decltype(key_extract(std::declval< DataType >())), Radix > |
| Helper to easily derive type of RadixHeap for a pre-C++17 compiler. More...
|
|
template<typename Tree , typename Compare > |
bool | splay_check (const Tree *t, const Tree *&out_tmin, const Tree *&out_tmax, const Compare &cmp) |
| check the tree order, recursively calculate min and max elements More...
|
|
template<typename Tree , typename Compare > |
bool | splay_check (const Tree *t, const Compare &cmp) |
| check the tree order More...
|
|
template<typename Key , typename Tree , typename Compare > |
Tree * | splay (const Key &k, Tree *t, const Compare &cmp) |
| Splay using the key i (which may or may not be in the tree.) The starting root is t, and the tree used is defined by rat size fields are maintained. More...
|
|
template<typename Tree , typename Compare > |
Tree * | splay_insert (Tree *nn, Tree *t, const Compare &cmp) |
| Insert key i into the tree t, if it is not already there. More...
|
|
template<typename Key , typename Tree , typename Compare > |
Tree * | splay_erase (const Key &k, Tree *&t, const Compare &cmp) |
| Erases i from the tree if it's there. More...
|
|
template<typename Tree , typename Functor > |
void | splay_traverse_preorder (const Functor &f, const Tree *t) |
| traverse the tree in preorder (left, node, right) More...
|
|
template<typename Tree , typename Functor > |
void | splay_traverse_postorder (const Functor &f, Tree *t) |
| traverse the tree in postorder (left, right, node) More...
|
|
static bool | operator== (const std::string &a, const StringView &b) noexcept |
| Equality operator to compare a std::string with a StringView. More...
|
|
static bool | operator!= (const std::string &a, const StringView &b) noexcept |
| Inequality operator to compare a std::string with a StringView. More...
|
|
static bool | operator< (const std::string &a, const StringView &b) noexcept |
| Less operator to compare a std::string with a StringView lexicographically. More...
|
|
template<typename Type , typename... Args> |
CountingPtr< Type > | make_counting (Args &&... args) |
| method analogous to std::make_shared and std::make_unique. More...
|
|
template<typename A , typename D > |
void | swap (CountingPtr< A, D > &a1, CountingPtr< A, D > &a2) noexcept |
| swap enclosed object with another counting pointer (no reference counts need change) More...
|
|
template<typename A , typename D > |
std::ostream & | operator<< (std::ostream &os, const CountingPtr< A, D > &c) |
| print pointer More...
|
|
template<class C , typename R , typename... A> |
Delegate< R(A...)> | make_delegate (C *const object_ptr, R(C::*const method_ptr)(A...)) noexcept |
| constructor for wrapping a class::method with object pointer. More...
|
|
template<class C , typename R , typename... A> |
Delegate< R(A...)> | make_delegate (C &object_ptr, R(C::*const method_ptr)(A...)) noexcept |
| constructor for wrapping a class::method with object reference. More...
|
|
template<class C , typename R , typename... A> |
Delegate< R(A...)> | make_delegate (C const &object_ptr, R(C::*const method_ptr)(A...) const) noexcept |
| constructor for wrapping a const class::method with object reference. More...
|
|
void | die_with_message (const std::string &msg) |
| die with message - either throw an exception or die via std::terminate() More...
|
|
void | die_with_message (const char *msg, const char *file, size_t line) |
| die with message - either throw an exception or die via std::terminate() More...
|
|
void | die_with_message (const std::string &msg, const char *file, size_t line) |
| die with message - either throw an exception or die via std::terminate() More...
|
|
bool | set_die_with_exception (bool b) |
| Switch between dying via std::terminate() and throwing an exception. More...
|
|
template<typename TypeA , typename TypeB > |
bool | die_equal_compare (TypeA a, TypeB b) |
| helper method to compare two values in die_unequal() More...
|
|
template<> |
bool | die_equal_compare (const char *a, const char *b) |
|
template<> |
bool | die_equal_compare (float a, float b) |
|
template<> |
bool | die_equal_compare (double a, double b) |
|
template<typename Type > |
Type | die_unequal_eps_abs (const Type &t) |
| simple replacement for std::abs More...
|
|
template<typename TypeA , typename TypeB > |
bool | die_equal_eps_compare (TypeA x, TypeB y, double eps) |
| helper method to compare two values in die_unequal_eps() More...
|
|
std::string | md5_hex (const void *data, uint32_t size) |
| process data and return 16 byte (128 bit) digest hex encoded More...
|
|
std::string | md5_hex (const std::string &str) |
| process data and return 16 byte (128 bit) digest hex encoded More...
|
|
std::string | md5_hex_uc (const void *data, uint32_t size) |
| process data and return 16 byte (128 bit) digest upper-case hex encoded More...
|
|
std::string | md5_hex_uc (const std::string &str) |
| process data and return 16 byte (128 bit) digest upper-case hex encoded More...
|
|
std::string | sha1_hex (const void *data, uint32_t size) |
| process data and return 20 byte (160 bit) digest hex encoded More...
|
|
std::string | sha1_hex (const std::string &str) |
| process data and return 20 byte (160 bit) digest hex encoded More...
|
|
std::string | sha1_hex_uc (const void *data, uint32_t size) |
| process data and return 20 byte (160 bit) digest upper-case hex encoded More...
|
|
std::string | sha1_hex_uc (const std::string &str) |
| process data and return 20 byte (160 bit) digest upper-case hex encoded More...
|
|
std::string | sha256_hex (const void *data, uint32_t size) |
| process data and return 32 byte (256 bit) digest hex encoded More...
|
|
std::string | sha256_hex (const std::string &str) |
| process data and return 32 byte (256 bit) digest hex encoded More...
|
|
std::string | sha256_hex_uc (const void *data, uint32_t size) |
| process data and return 32 byte (256 bit) digest upper-case hex encoded More...
|
|
std::string | sha256_hex_uc (const std::string &str) |
| process data and return 32 byte (256 bit) digest upper-case hex encoded More...
|
|
std::string | sha512_hex (const void *data, uint32_t size) |
| process data and return 64 byte (512 bit) digest hex encoded More...
|
|
std::string | sha512_hex (const std::string &str) |
| process data and return 64 byte (512 bit) digest hex encoded More...
|
|
std::string | sha512_hex_uc (const void *data, uint32_t size) |
| process data and return 64 byte (512 bit) digest upper-case hex encoded More...
|
|
std::string | sha512_hex_uc (const std::string &str) |
| process data and return 64 byte (512 bit) digest upper-case hex encoded More...
|
|
LoggerOutputHook * | set_logger_output_hook (LoggerOutputHook *hook) |
| set new LoggerOutputHook instance to receive global log lines. More...
|
|
LoggerOutputHook * | set_logger_to_stderr () |
| install default logger to cerr / stderr instead of stdout. More...
|
|
LoggerPrefixHook * | set_logger_prefix_hook (LoggerPrefixHook *hook) |
| Set new LoggerPrefixHook instance to prefix global log lines. More...
|
|
template<typename Type > |
enable_if<!has_ostream_operator< Type >::value, const char * >::type | wrap_unprintable (Type, const char *instead="<unprintable>") |
| SFINAE magic to return "<unprintable>" instead if the value HAS NO ostream operator << available. More...
|
|
template<typename Type > |
enable_if< has_ostream_operator< Type >::value, Type >::type | wrap_unprintable (Type value, const char *=nullptr) |
| SFINAE magic to return the value if the value HAS a ostream operator << available. More...
|
|
template<typename Type > |
enable_if<!has_ostream_operator< Type >::value, const char * >::type | wrap_unp (Type, const char *instead="<unprintable>") |
| SFINAE magic to return "<unprintable>" instead if the value HAS NO ostream operator << available. More...
|
|
template<typename Type > |
enable_if< has_ostream_operator< Type >::value, Type >::type | wrap_unp (Type value, const char *=nullptr) |
| SFINAE magic to return the value if the value HAS a ostream operator << available. More...
|
|
template<typename T > |
T | abs_diff (const T &a, const T &b) |
| absolute difference, which also works for unsigned types More...
|
|
static uint16_t | bswap16_generic (const uint16_t &x) |
| bswap16 - generic implementation More...
|
|
static uint16_t | bswap16 (const uint16_t &v) |
| bswap16 - generic More...
|
|
static uint32_t | bswap32_generic (const uint32_t &x) |
| bswap32 - generic implementation More...
|
|
static uint32_t | bswap32 (const uint32_t &v) |
| bswap32 - generic More...
|
|
static uint64_t | bswap64_generic (const uint64_t &x) |
| bswap64 - generic implementation More...
|
|
static uint64_t | bswap64 (const uint64_t &v) |
| bswap64 - generic More...
|
|
template<typename Integral > |
static unsigned | clz_template (Integral x) |
| clz (count leading zeros) - generic implementation More...
|
|
template<typename Integral > |
unsigned | clz (Integral x) |
|
template<> |
unsigned | clz< int > (int i) |
| clz (count leading zeros) More...
|
|
template<> |
unsigned | clz< unsigned > (unsigned i) |
| clz (count leading zeros) More...
|
|
template<> |
unsigned | clz< long > (long i) |
| clz (count leading zeros) More...
|
|
template<> |
unsigned | clz< unsigned long > (unsigned long i) |
| clz (count leading zeros) More...
|
|
template<> |
unsigned | clz< long long > (long long i) |
| clz (count leading zeros) More...
|
|
template<> |
unsigned | clz< unsigned long long > (unsigned long long i) |
| clz (count leading zeros) More...
|
|
template<typename Integral > |
static unsigned | ctz_template (Integral x) |
| ctz (count trailing zeros) - generic implementation More...
|
|
template<typename Integral > |
unsigned | ctz (Integral x) |
|
template<> |
unsigned | ctz< int > (int i) |
| ctz (count trailing zeros) More...
|
|
template<> |
unsigned | ctz< unsigned > (unsigned i) |
| ctz (count trailing zeros) More...
|
|
template<> |
unsigned | ctz< long > (long i) |
| ctz (count trailing zeros) More...
|
|
template<> |
unsigned | ctz< unsigned long > (unsigned long i) |
| ctz (count trailing zeros) More...
|
|
template<> |
unsigned | ctz< long long > (long long i) |
| ctz (count trailing zeros) More...
|
|
template<> |
unsigned | ctz< unsigned long long > (unsigned long long i) |
| ctz (count trailing zeros) More...
|
|
template<typename IntegralN , typename IntegralK > |
static constexpr auto | div_ceil (const IntegralN &n, const IntegralK &k) -> decltype(n+k) |
| calculate n div k with rounding up, for n and k positive! More...
|
|
template<typename Integral > |
static unsigned | ffs_template (Integral x) |
| ffs (find first set bit) - generic implementation More...
|
|
static unsigned | ffs (int i) |
| find first set bit in integer, or zero if none are set. More...
|
|
static unsigned | ffs (unsigned int i) |
| find first set bit in integer, or zero if none are set. More...
|
|
static unsigned | ffs (long i) |
| find first set bit in integer, or zero if none are set. More...
|
|
static unsigned | ffs (unsigned long i) |
| find first set bit in integer, or zero if none are set. More...
|
|
static unsigned | ffs (long long i) |
| find first set bit in integer, or zero if none are set. More...
|
|
static unsigned | ffs (unsigned long long i) |
| find first set bit in integer, or zero if none are set. More...
|
|
template<typename IntegerType > |
static unsigned | integer_log2_floor_template (IntegerType i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_floor (int i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_floor (unsigned int i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_floor (long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_floor (unsigned long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_floor (long long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_floor (unsigned long long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_ceil (int i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_ceil (unsigned int i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_ceil (long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_ceil (unsigned long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_ceil (long long i) |
| calculate the log2 floor of an integer type More...
|
|
static unsigned | integer_log2_ceil (unsigned long long i) |
| calculate the log2 floor of an integer type More...
|
|
template<typename Integral > |
static bool | is_power_of_two_template (Integral i) |
|
static bool | is_power_of_two (int i) |
| does what it says: true if i is a power of two More...
|
|
static bool | is_power_of_two (unsigned int i) |
| does what it says: true if i is a power of two More...
|
|
static bool | is_power_of_two (long i) |
| does what it says: true if i is a power of two More...
|
|
static bool | is_power_of_two (unsigned long i) |
| does what it says: true if i is a power of two More...
|
|
static bool | is_power_of_two (long long i) |
| does what it says: true if i is a power of two More...
|
|
static bool | is_power_of_two (unsigned long long i) |
| does what it says: true if i is a power of two More...
|
|
static unsigned | popcount_generic8 (uint8_t x) |
| popcount (count one bits) - generic SWAR implementation More...
|
|
static unsigned | popcount_generic16 (uint16_t x) |
| popcount (count one bits) - generic SWAR implementation More...
|
|
static unsigned | popcount_generic32 (uint32_t x) |
| popcount (count one bits) - generic SWAR implementation from https://stackoverflow.com/questions/109023 More...
|
|
static unsigned | popcount_generic64 (uint64_t x) |
| popcount (count one bits) - generic SWAR implementation More...
|
|
template<typename Integral > |
unsigned | popcount (Integral i) |
| popcount (count one bits) More...
|
|
static size_t | popcount (const void *data, size_t size) |
|
template<unsigned D, typename T > |
static constexpr T | power_to_the (T x) |
| power_to_the<D>(x) More...
|
|
static uint32_t | rol32_generic (const uint32_t &x, int i) |
| rol32 - generic implementation More...
|
|
static uint32_t | rol32 (const uint32_t &x, int i) |
| rol32 - generic More...
|
|
static uint64_t | rol64_generic (const uint64_t &x, int i) |
| rol64 - generic implementation More...
|
|
static uint64_t | rol64 (const uint64_t &x, int i) |
| rol64 - generic More...
|
|
static uint32_t | ror32_generic (const uint32_t &x, int i) |
| ror32 - generic implementation More...
|
|
static uint32_t | ror32 (const uint32_t &x, int i) |
| ror32 - generic More...
|
|
static uint64_t | ror64_generic (const uint64_t &x, int i) |
| ror64 - generic implementation More...
|
|
static uint64_t | ror64 (const uint64_t &x, int i) |
| ror64 - generic More...
|
|
template<typename Integral > |
static Integral | round_up_to_power_of_two_template (Integral n) |
|
static int | round_up_to_power_of_two (int i) |
| does what it says: round up to next power of two More...
|
|
static unsigned int | round_up_to_power_of_two (unsigned int i) |
| does what it says: round up to next power of two More...
|
|
static long | round_up_to_power_of_two (long i) |
| does what it says: round up to next power of two More...
|
|
static unsigned long | round_up_to_power_of_two (unsigned long i) |
| does what it says: round up to next power of two More...
|
|
static long long | round_up_to_power_of_two (long long i) |
| does what it says: round up to next power of two More...
|
|
static unsigned long long | round_up_to_power_of_two (unsigned long long i) |
| does what it says: round up to next power of two More...
|
|
static int | round_down_to_power_of_two (int i) |
| does what it says: round down to next power of two More...
|
|
static unsigned int | round_down_to_power_of_two (unsigned int i) |
| does what it says: round down to next power of two More...
|
|
static long | round_down_to_power_of_two (long i) |
| does what it says: round down to next power of two More...
|
|
static unsigned long | round_down_to_power_of_two (unsigned long i) |
| does what it says: round down to next power of two More...
|
|
static long long | round_down_to_power_of_two (long long i) |
| does what it says: round down to next power of two More...
|
|
static unsigned long long | round_down_to_power_of_two (unsigned long long i) |
| does what it says: round down to next power of two More...
|
|
template<typename IntegralN , typename IntegralK > |
static constexpr auto | round_up (const IntegralN &n, const IntegralK &k) -> decltype(n+k) |
| round n up to the next multiple of k, for n and k positive! More...
|
|
template<typename T > |
int | sgn (const T &val) |
| sgn() - signum More...
|
|
template<typename Functor , typename Tuple > |
auto | apply_tuple (Functor &&f, Tuple &&t) |
| Call the functor f with the contents of t as arguments. More...
|
|
template<size_t Size, typename Functor > |
void | call_for_range (Functor &&f) |
| Call a generic functor (like a generic lambda) for the integers [0,Size). More...
|
|
template<size_t Begin, size_t End, typename Functor > |
void | call_for_range (Functor &&f) |
| Call a generic functor (like a generic lambda) for the integers [Begin,End). More...
|
|
template<typename Functor , typename... Args> |
void | call_foreach (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument. More...
|
|
template<typename Functor , typename Tuple > |
void | call_foreach_tuple (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) to each components of a tuple together with its zero-based index. More...
|
|
template<typename Functor , typename Tuple > |
void | call_foreach_tuple_with_index (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) to each components of a tuple together with its zero-based index. More...
|
|
template<typename Functor , typename... Args> |
void | call_foreach_with_index (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument together with its zero-based index. More...
|
|
template<typename Reduce , typename Initial , typename... Args> |
auto | fold_left (Reduce &&r, Initial &&init, Args &&... args) |
| Implements fold_left() – ((a * b) * c) – with a binary Reduce operation and initial value. More...
|
|
template<typename Reduce , typename Initial , typename Tuple > |
auto | fold_left_tuple (Reduce &&r, Initial &&init, Tuple &&t) |
| Implements fold_left() – ((a * b) * c) – with a binary Reduce operation and initial value on a tuple. More...
|
|
template<typename Reduce , typename Initial , typename... Args> |
auto | fold_right (Reduce &&r, Initial &&init, Args &&... args) |
| Implements fold_right() – (a * (b * c)) – with a binary Reduce operation and initial value. More...
|
|
template<typename Reduce , typename Initial , typename Tuple > |
auto | fold_right_tuple (Reduce &&r, Initial &&init, Tuple &&t) |
| Implements fold_right() – (a * (b * c)) – with a binary Reduce operation and initial value on a tuple. More...
|
|
template<typename Functor > |
static auto | make_function_chain (const Functor &functor) |
| Functor chain maker. Can also be called with a lambda function. More...
|
|
static auto | make_function_chain () |
| Construct and empty function chain. More...
|
|
template<typename Input , typename Functor > |
static auto | make_function_stack (const Functor &functor) |
| Function-style construction of a FunctionStack. More...
|
|
template<typename... Types> |
void | vexpand (Types &&...) |
|
template<size_t Size, typename Functor > |
auto | vmap_for_range (Functor &&f) |
| Vmap a generic functor (like a generic lambda) for the integers [0,Size). More...
|
|
template<size_t Begin, size_t End, typename Functor > |
auto | vmap_for_range (Functor &&f) |
| Vmap a generic functor (like a generic lambda) for the integers [Begin,End). More...
|
|
template<typename Functor , typename... Args> |
auto | vmap_foreach (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument. More...
|
|
template<typename Functor , typename Tuple > |
auto | vmap_foreach_tuple (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) for each variadic template argument and collect the result in a std::tuple<>. More...
|
|
template<typename Functor , typename Tuple > |
auto | vmap_foreach_tuple_with_index (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) for each variadic template argument and collect the result in a std::tuple<>. More...
|
|
template<typename Functor , typename... Args> |
auto | vmap_foreach_with_index (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument together with its zero-based index. More...
|
|
int | setenv (const char *name, const char *value, int overwrite) |
| setenv - change or add an environment variable. More...
|
|
static uint64_t | siphash_plain (const uint8_t key[16], const uint8_t *m, size_t len) |
|
static uint64_t | siphash (const uint8_t key[16], const uint8_t *msg, size_t size) |
|
static uint64_t | siphash (const uint8_t *msg, size_t size) |
|
static uint64_t | siphash (const char *msg, size_t size) |
|
static uint64_t | siphash (const std::string &str) |
|
template<typename Type > |
static uint64_t | siphash (const Type &value) |
|
std::istream & | appendline (std::istream &is, std::string &str, char delim='\n') |
| like std::getline(istream, string, delim) except that it appends to the string, possibly reusing buffer capacity. More...
|
|
int | compare_icase (const char *a, const char *b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
|
|
int | compare_icase (const char *a, const std::string &b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
|
|
int | compare_icase (const std::string &a, const char *b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
|
|
int | compare_icase (const std::string &a, const std::string &b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case More...
|
|
bool | contains (const std::string &str, const std::string &pattern) |
| Tests of string contains pattern. More...
|
|
bool | contains (const std::string &str, const char *pattern) |
| Tests of string contains pattern. More...
|
|
bool | contains (const std::string &str, const char ch) |
| Tests of string contains character. More...
|
|
static bool | is_white (char c) |
|
bool | contains_word (const std::string &str, const char *word) |
| Search the given string for a whitespace-delimited word. More...
|
|
bool | contains_word (const std::string &str, const std::string &word) |
| Search the given string for a whitespace-delimited word. More...
|
|
bool | ends_with (const char *str, const char *match) |
| Checks if the given match string is located at the end of this string. More...
|
|
bool | ends_with (const char *str, const std::string &match) |
| Checks if the given match string is located at the end of this string. More...
|
|
bool | ends_with (const std::string &str, const char *match) |
| Checks if the given match string is located at the end of this string. More...
|
|
bool | ends_with (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the end of this string. More...
|
|
bool | ends_with_icase (const char *str, const char *match) |
|
bool | ends_with_icase (const char *str, const std::string &match) |
|
bool | ends_with_icase (const std::string &str, const char *match) |
|
bool | ends_with_icase (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the end of this string. More...
|
|
bool | equal_icase (const char *a, const char *b) |
| returns true if a == b without regard for letter case More...
|
|
bool | equal_icase (const char *a, const std::string &b) |
| returns true if a == b without regard for letter case More...
|
|
bool | equal_icase (const std::string &a, const char *b) |
| returns true if a == b without regard for letter case More...
|
|
bool | equal_icase (const std::string &a, const std::string &b) |
| returns true if a == b without regard for letter case More...
|
|
std::string & | erase_all (std::string *str, char drop=' ') |
| Remove all occurrences of the given character in-place. More...
|
|
std::string & | erase_all (std::string *str, const char *drop) |
| Remove all occurrences of the given characters in-place. More...
|
|
std::string & | erase_all (std::string *str, const std::string &drop) |
| Remove all occurrences of the given characters in-place. More...
|
|
std::string | erase_all (const std::string &str, char drop=' ') |
| Remove all occurrences of the given character, return copy of string. More...
|
|
std::string | erase_all (const std::string &str, const char *drop) |
| Remove all occurrences of the given characters, return copy of string. More...
|
|
std::string | erase_all (const std::string &str, const std::string &drop) |
| Remove all occurrences of the given characters, return copy of string. More...
|
|
std::string | escape_html (const std::string &str) |
| Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities. More...
|
|
std::string | escape_html (const char *str) |
| Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities. More...
|
|
std::string | escape_uri (const std::string &str) |
| Escape a string into a URI-encoding. More...
|
|
std::string | escape_uri (const char *str) |
| Escape a string into a URI-encoding. More...
|
|
std::string & | expand_environment_variables (std::string *s) |
| Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
|
|
std::string | expand_environment_variables (const std::string &s) |
| Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
|
|
std::string | expand_environment_variables (const char *s) |
| Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables. More...
|
|
template<typename Separator1 , typename Separator2 > |
static std::string | extract_between_template (const std::string &str, const Separator1 &sep1, size_t sep1_size, const Separator2 &sep2) |
|
std::string | extract_between (const std::string &str, const char *sep1, const char *sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found. More...
|
|
std::string | extract_between (const std::string &str, const char *sep1, const std::string &sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found. More...
|
|
std::string | extract_between (const std::string &str, const std::string &sep1, const char *sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found. More...
|
|
std::string | extract_between (const std::string &str, const std::string &sep1, const std::string &sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found. More...
|
|
std::string | format_iec_units (uint64_t number, int precision=3) |
| Format a byte size using IEC (Ki, Mi, Gi, Ti) suffixes (powers of two). More...
|
|
std::string | format_si_units (uint64_t number, int precision) |
| Format number as something like 1 TB. More...
|
|
static uint32_t | hash_djb2 (const unsigned char *str) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_djb2 (const char *str) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_djb2 (const unsigned char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_djb2 (const char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_djb2 (const std::string &str) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_sdbm (const unsigned char *str) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_sdbm (const char *str) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_sdbm (const unsigned char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_sdbm (const char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
static uint32_t | hash_sdbm (const std::string &str) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html. More...
|
|
size_t | index_of (const std::vector< std::string > &list, const char *str) |
| Attempts to find str in the list and return the index. More...
|
|
size_t | index_of (const std::vector< std::string > &list, const std::string &str) |
| Attempts to find str in the list and return the index. More...
|
|
size_t | index_of_icase (const std::vector< std::string > &list, const char *str) |
| Attempts to find str in the list and return the index using case-insensitive comparisons. More...
|
|
size_t | index_of_icase (const std::vector< std::string > &list, const std::string &str) |
| Attempts to find str in the list and return the index using case-insensitive comparisons. More...
|
|
bool | less_icase (const char *a, const char *b) |
| returns true if a < b without regard for letter case More...
|
|
bool | less_icase (const char *a, const std::string &b) |
| returns true if a < b without regard for letter case More...
|
|
bool | less_icase (const std::string &a, const char *b) |
| returns true if a < b without regard for letter case More...
|
|
bool | less_icase (const std::string &a, const std::string &b) |
| returns true if a < b without regard for letter case More...
|
|
template<typename Param > |
static size_t | levenshtein_algorithm (const char *a, size_t a_size, const char *b, size_t b_size) |
| Computes the Levenshtein string distance also called edit distance between two strings. More...
|
|
static size_t | levenshtein (const char *a, const char *b) |
| Computes the Levenshtein string distance between two strings. More...
|
|
static size_t | levenshtein_icase (const char *a, const char *b) |
| Computes the Levenshtein string distance between two strings. More...
|
|
static size_t | levenshtein (const std::string &a, const std::string &b) |
| Computes the Levenshtein string distance between two strings. More...
|
|
static size_t | levenshtein_icase (const std::string &a, const std::string &b) |
| Computes the Levenshtein string distance between two strings. More...
|
|
std::string | pad (const std::string &s, size_t len, char pad_char=' ') |
| Truncate or pad string to exactly len characters. More...
|
|
bool | parse_si_iec_units (const char *str, uint64_t *out_size, char default_unit=0) |
| Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. More...
|
|
bool | parse_si_iec_units (const std::string &str, uint64_t *out_size, char default_unit=0) |
| Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes. More...
|
|
static std::vector< std::string > & | split (std::vector< std::string > *into, const char *sep, size_t sep_size, const std::string &str, std::string::size_type limit) |
|
std::vector< std::string > | split_words (const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string by whitespaces into distinct words. More...
|
|
std::string | ssprintf (const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(1 |
| Helper for return the result of a sprintf() call inside a std::string. More...
|
|
std::string | ssnprintf (size_t max_size, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(2 |
| Helper for return the result of a snprintf() call inside a std::string. More...
|
|
template<typename String = std::string> |
String | ssprintf_generic (const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(1 |
| Helper for return the result of a sprintf() call inside a string object. More...
|
|
template<typename String > |
String String | ssprintf_generic (const char *fmt,...) |
|
template<typename String = std::string> |
String | ssnprintf_generic (size_t max_size, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(2 |
| Helper for return the result of a snprintf() call inside a string object. More...
|
|
template<typename String > |
String String | ssnprintf_generic (size_t max_size, const char *fmt,...) |
|
bool | starts_with (const char *str, const char *match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with (const char *str, const std::string &match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with (const std::string &str, const char *match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with_icase (const char *str, const char *match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with_icase (const char *str, const std::string &match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with_icase (const std::string &str, const char *match) |
| Checks if the given match string is located at the start of this string. More...
|
|
bool | starts_with_icase (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the start of this string. More...
|
|
char | to_lower (char ch) |
| Transform the given character to lower case without any localization. More...
|
|
std::string & | to_lower (std::string *str) |
| Transforms the given string to lowercase and returns a reference to it. More...
|
|
std::string | to_lower (const std::string &str) |
| Returns a copy of the given string converted to lowercase. More...
|
|
char | to_upper (char ch) |
| Transform the given character to upper case without any localization. More...
|
|
std::string & | to_upper (std::string *str) |
| Transforms the given string to uppercase and returns a reference to it. More...
|
|
std::string | to_upper (const std::string &str) |
| Returns a copy of the given string converted to uppercase. More...
|
|
std::string | union_words (const std::string &wordsA, const std::string &wordsB) |
| Return union of two keyword sets. More...
|
|
bool | is_space (char ch) |
|
std::string | word_wrap (const std::string &str, unsigned int wrap=80) |
| Try to wrap a string to 80 columns without split words. More...
|
|
double | timestamp () |
| Returns number of seconds since the epoch, currently microsecond resolution. More...
|
|
template<typename... Types> |
void | unused (Types &&...) |
|
template<typename Type > |
void | vector_free (std::vector< Type > &v) |
| Simple method to free the underlying memory in a vector, because .clear() need not do it. More...
|
|