AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::spin::MortonBase< CoordType, MortonIndexType, Derived > Struct Template Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/spin/MortonIndex.hpp>

Inheritance diagram for axom::spin::MortonBase< CoordType, MortonIndexType, Derived >:

Public Member Functions

 AXOM_STATIC_ASSERT_MSG (std::is_integral< CoordType >::value, "Coordtype must be integral for Morton indexing")
 
 AXOM_STATIC_ASSERT_MSG (std::is_integral< MortonIndexType >::value, "MortonIndexType must be integral for Morton indexing")
 

Static Public Member Functions

static int maxSetBit (CoordType x)
 Finds the index of the maximum set bit (MSB) in an integral type. More...
 

Static Protected Member Functions

static AXOM_HOST_DEVICE MortonIndexType expandBits (MortonIndexType x)
 Expands bits in bitwise representation of an integral type and zero-fills the holes. More...
 
static AXOM_HOST_DEVICE MortonIndexType contractBits (MortonIndexType x)
 Contracts bits in bitwise representation of x. More...
 

Member Function Documentation

◆ AXOM_STATIC_ASSERT_MSG() [1/2]

template<typename CoordType , typename MortonIndexType , typename Derived >
axom::spin::MortonBase< CoordType, MortonIndexType, Derived >::AXOM_STATIC_ASSERT_MSG ( std::is_integral< CoordType >::value  ,
"Coordtype must be integral for Morton indexing"   
)

◆ AXOM_STATIC_ASSERT_MSG() [2/2]

template<typename CoordType , typename MortonIndexType , typename Derived >
axom::spin::MortonBase< CoordType, MortonIndexType, Derived >::AXOM_STATIC_ASSERT_MSG ( std::is_integral< MortonIndexType >::value  ,
"MortonIndexType must be integral for Morton indexing"   
)

◆ expandBits()

template<typename CoordType , typename MortonIndexType , typename Derived >
static AXOM_HOST_DEVICE MortonIndexType axom::spin::MortonBase< CoordType, MortonIndexType, Derived >::expandBits ( MortonIndexType  x)
inlinestaticprotected

Expands bits in bitwise representation of an integral type and zero-fills the holes.

Parameters
[in]xThe integer type that we are expanding
Returns
A zero-filled expanded MortonIndex In dimension D, it adds (D-1) zeros between each bit, so, e.g. in 2D, 6 == 0b0110 becomes 0b*0*1*1*0 == 0b00010100 == 20

◆ contractBits()

template<typename CoordType , typename MortonIndexType , typename Derived >
static AXOM_HOST_DEVICE MortonIndexType axom::spin::MortonBase< CoordType, MortonIndexType, Derived >::contractBits ( MortonIndexType  x)
inlinestaticprotected

Contracts bits in bitwise representation of x.

Parameters
[in]xThe Morton index that we are contracting
Returns
A contracted MortonIndex

In dimension D, it retains every (D-1) \(^th\) bit, so, e.g. in 2D, 20 = 0b00010100 == 0b*0*1*1*0 becomes 0b0110 = 6

◆ maxSetBit()

template<typename CoordType , typename MortonIndexType , typename Derived >
static int axom::spin::MortonBase< CoordType, MortonIndexType, Derived >::maxSetBit ( CoordType  x)
inlinestatic

Finds the index of the maximum set bit (MSB) in an integral type.


The documentation for this struct was generated from the following file: