tlx
|
Compute the rank of an integer x (i.e. More...
#include <radix_heap.hpp>
Public Types | |
using | int_type = Int |
using | rank_type = typename std::make_unsigned< int_type >::type |
Static Public Member Functions | |
static constexpr rank_type | rank_of_int (int_type i) |
Maps value i to its rank in int_type. More... | |
static constexpr int_type | int_at_rank (rank_type r) |
Returns the r-th smallest number of int_r. More... | |
Static Private Attributes | |
static constexpr bool | use_identity_ |
static constexpr rank_type | sign_bit_ |
Compute the rank of an integer x (i.e.
the number of elements smaller than x that are representable using type Int) and vice versa. If Int is an unsigned integral type, all computations yield identity. If Int is a signed integrals, the smallest (negative) number is mapped to rank zero, the next larger value to one and so on.
The implementation assumes negative numbers are implemented as Two's complement and contains static_asserts failing if this is not the case.
Definition at line 42 of file radix_heap.hpp.
using int_type = Int |
Definition at line 48 of file radix_heap.hpp.
Definition at line 49 of file radix_heap.hpp.
Returns the r-th smallest number of int_r.
It is the inverse of rank_of_int, i.e. int_at_rank(rank_of_int(i)) == i for all i.
Definition at line 61 of file radix_heap.hpp.
Maps value i to its rank in int_type.
For any pair T x < y the invariant IntegerRank<T>::rank_of_int(x) < IntegerRank<T>::rank_of_int(y) holds.
Definition at line 53 of file radix_heap.hpp.
|
staticprivate |
Definition at line 71 of file radix_heap.hpp.
|
staticprivate |
Definition at line 68 of file radix_heap.hpp.