FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches
filling_curve_key< DIM, T, DERIVED > Class Template Reference

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

Returns
true if the other key has the same value
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.
 

Detailed Description

template<Dimension DIM, typename T, class DERIVED>
class flecsi::util::filling_curve_key< DIM, T, DERIVED >

Space filling curve keys generator, CRTP base.

Template Parameters
DIMThe spatial dimension for the filling curve (1, 2 or 3 supported)
TThe integer type used to represent the keys. The type is used as a bit-field.
DERIVEDderived class (see below for requirements)

Member Typedef Documentation

◆ int_t

template<Dimension DIM, typename T , class DERIVED >
using int_t = T

Integer type used to represent the key.

Constructor & Destructor Documentation

◆ filling_curve_key() [1/2]

template<Dimension DIM, typename T , class DERIVED >
constexpr filling_curve_key ( )
constexpr

Default constructor: create an invalid key containing only zeros.

◆ filling_curve_key() [2/2]

template<Dimension DIM, typename T , class DERIVED >
constexpr filling_curve_key ( int_t  value)
explicitconstexpr

Construct a key from an integer of type int_t.

Member Function Documentation

◆ max_depth()

template<Dimension DIM, typename T , class DERIVED >
static constexpr std::size_t max_depth ( )
staticconstexpr

Max depth possible for this type of key.

◆ min()

template<Dimension DIM, typename T , class DERIVED >
static constexpr DERIVED min ( )
staticconstexpr

Smallest value possible at max_depth.

◆ max()

template<Dimension DIM, typename T , class DERIVED >
static constexpr DERIVED max ( )
staticconstexpr

Biggest value possible at max_depth.

◆ root()

template<Dimension DIM, typename T , class DERIVED >
static constexpr DERIVED root ( )
staticconstexpr

Get the root key (depth 0)

◆ depth()

template<Dimension DIM, typename T , class DERIVED >
std::size_t depth ( ) const

Find the depth of the current key.

◆ push()

template<Dimension DIM, typename T , class DERIVED >
constexpr auto push ( int_t  bits) const
constexpr

Push bits onto the end of this key.

◆ pop() [1/2]

template<Dimension DIM, typename T , class DERIVED >
int_t pop ( )

Pop last bits and return its value.

◆ last_value()

template<Dimension DIM, typename T , class DERIVED >
int_t last_value ( ) const

Return the last bits of the key.

◆ pop() [2/2]

template<Dimension DIM, typename T , class DERIVED >
void pop ( std::size_t  d)

Pop the depth d bits from the end of this key.

◆ parent()

template<Dimension DIM, typename T , class DERIVED >
constexpr filling_curve_key parent ( ) const
constexpr

Return the parent of this key (depth - 1)

◆ value()

template<Dimension DIM, typename T , class DERIVED >
constexpr int_t value ( ) const
constexpr

Get the value associated to this key.

◆ operator==()

template<Dimension DIM, typename T , class DERIVED >
constexpr bool operator== ( const filling_curve_key< DIM, T, DERIVED > &  bid) const
constexpr

Less than or equal to operator.

Returns
true if this key is less or equal than the other

◆ operator<=()

template<Dimension DIM, typename T , class DERIVED >
constexpr bool operator<= ( const filling_curve_key< DIM, T, DERIVED > &  bid) const
constexpr

Less than or equal to operator.

Returns
true if this key is less or equal than the other

◆ operator>=()

template<Dimension DIM, typename T , class DERIVED >
constexpr bool operator>= ( const filling_curve_key< DIM, T, DERIVED > &  bid) const
constexpr

Greater than or equal to operator.

Returns
true if the other key is less or equal than this

◆ operator>()

template<Dimension DIM, typename T , class DERIVED >
constexpr bool operator> ( const filling_curve_key< DIM, T, DERIVED > &  bid) const
constexpr

Greater than operator.

Returns
true if the other key is less than this

◆ operator<()

template<Dimension DIM, typename T , class DERIVED >
constexpr bool operator< ( const filling_curve_key< DIM, T, DERIVED > &  bid) const
constexpr

Less than operator.

Returns
true if this key is less than the other

◆ operator!=()

template<Dimension DIM, typename T , class DERIVED >
constexpr bool operator!= ( const filling_curve_key< DIM, T, DERIVED > &  bid) const
constexpr

Inequality operator.

Returns
true if the two keys have different values

Friends And Related Symbol Documentation

◆ operator<<

template<Dimension DIM, typename T , class DERIVED >
std::ostream & operator<< ( std::ostream &  ostr,
const filling_curve_key< DIM, T, DERIVED > &  fc 
)
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.

Member Data Documentation

◆ value_

template<Dimension DIM, typename T , class DERIVED >
int_t value_
protected

Value of the filling curve key.

int_t is used as a bit-field to represent the filling curve key.