Space filling curve keys generator, CRTP base. More...
Public Types | |
using | int_t = T |
Integer type used to represent the key. | |
Public Member Functions | |
std::size_t | depth () const |
Find the depth of the current key. | |
constexpr | filling_curve_key () |
Default constructor: create an invalid key containing only zeros. | |
constexpr | filling_curve_key (int_t value) |
Construct a key from an integer of type int_t. | |
int_t | last_value () const |
Return the last bits of the key. | |
constexpr filling_curve_key | parent () const |
Return the parent of this key (depth - 1) | |
int_t | pop () |
Pop last bits and return its value. | |
void | pop (std::size_t d) |
Pop the depth d bits from the end of this key. | |
constexpr auto | push (int_t bits) const |
Push bits onto the end of this key. | |
constexpr int_t | value () const |
Get the value associated to this key. | |
Relational and equality operators | |
Equality operator
| |
constexpr bool | operator== (const filling_curve_key &bid) const |
Less than or equal to operator. | |
constexpr bool | operator<= (const filling_curve_key &bid) const |
Less than or equal to operator. | |
constexpr bool | operator>= (const filling_curve_key &bid) const |
Greater than or equal to operator. | |
constexpr bool | operator> (const filling_curve_key &bid) const |
Greater than operator. | |
constexpr bool | operator< (const filling_curve_key &bid) const |
Less than operator. | |
constexpr bool | operator!= (const filling_curve_key &bid) const |
Inequality operator. | |
Static Public Member Functions | |
static constexpr DERIVED | max () |
Biggest value possible at max_depth. | |
static constexpr std::size_t | max_depth () |
Max depth possible for this type of key. | |
static constexpr DERIVED | min () |
Smallest value possible at max_depth. | |
static constexpr DERIVED | root () |
Get the root key (depth 0) | |
Protected Attributes | |
int_t | value_ |
Value of the filling curve key. | |
Friends | |
std::ostream & | operator<< (std::ostream &ostr, const filling_curve_key &fc) |
Display a key, starting from the root (1), grouping the bits in digits. | |
Space filling curve keys generator, CRTP base.
DIM | The spatial dimension for the filling curve (1, 2 or 3 supported) |
T | The integer type used to represent the keys. The type is used as a bit-field. |
DERIVED | derived class (see below for requirements) |
Integer type used to represent the key.
|
constexpr |
Default constructor: create an invalid key containing only zeros.
|
explicitconstexpr |
Construct a key from an integer of type int_t.
|
staticconstexpr |
Max depth possible for this type of key.
|
staticconstexpr |
Smallest value possible at max_depth.
|
staticconstexpr |
Biggest value possible at max_depth.
|
staticconstexpr |
Get the root key (depth 0)
std::size_t depth | ( | ) | const |
Find the depth of the current key.
|
constexpr |
Push bits onto the end of this key.
Pop last bits and return its value.
Return the last bits of the key.
void pop | ( | std::size_t | d | ) |
Pop the depth d bits from the end of this key.
|
constexpr |
Return the parent of this key (depth - 1)
Get the value associated to this key.
|
constexpr |
Less than or equal to operator.
|
constexpr |
Less than or equal to operator.
|
constexpr |
Greater than or equal to operator.
|
constexpr |
Greater than operator.
|
constexpr |
Less than operator.
|
constexpr |
Inequality operator.
|
friend |
Display a key, starting from the root (1), grouping the bits in digits.
The digits are composed of 1, 2, 3 bits matching the dimension used for the key.