Template Class DenseBlockHash

Class Documentation

template<typename CellDataT, int dim, unsigned cells_per_side>
class DenseBlockHash

Public Types

using Block = DenseGrid<CellDataT, dim, cells_per_side>
using BlockHashMap = SpatialHash<Block, kDim>
using Cell = CellDataT

Public Functions

inline explicit DenseBlockHash(CellDataT default_value = {})
inline bool empty() const
inline size_t size() const
inline void clear()
inline Index<dim> getMinBlockIndex() const
inline Index<dim> getMaxBlockIndex() const
bool hasBlock(const Index<dim> &block_index) const
bool eraseBlock(const Index<dim> &block_index)
template<typename IndexedBlockVisitor>
void eraseBlockIf(IndexedBlockVisitor indicator_fn)
inline Block *getBlock(const Index<dim> &block_index)
inline const Block *getBlock(const Index<dim> &block_index) const
inline Block &getOrAllocateBlock(const Index<dim> &block_index)
bool hasValue(const Index<dim> &index) const
CellDataT *getValue(const Index<dim> &index)
const CellDataT *getValue(const Index<dim> &index) const
inline CellDataT &getOrAllocateValue(const Index<dim> &index)
const CellDataT &getValueOrDefault(const Index<dim> &index) const
inline const CellDataT &getDefaultValue() const
bool equalsDefaultValue(const CellDataT &value) const
inline auto &getHashMap()
inline const auto &getHashMap() const
template<typename IndexedBlockVisitor>
void forEachBlock(IndexedBlockVisitor visitor_fn)
template<typename IndexedBlockVisitor>
void forEachBlock(IndexedBlockVisitor visitor_fn) const
template<typename IndexedLeafVisitorFunction>
void forEachLeaf(IndexedLeafVisitorFunction visitor_fn)
template<typename IndexedLeafVisitorFunction>
void forEachLeaf(IndexedLeafVisitorFunction visitor_fn) const

Public Static Functions

static inline Index<dim> indexToBlockIndex(const Index<dim> &index)
static inline Index<dim> indexToCellIndex(const Index<dim> &index)
static inline Index<dim> cellAndBlockIndexToIndex(const Index<dim> &block_index, const Index<dim> &cell_index)

Public Static Attributes

static constexpr IndexElement kCellsPerSide = cells_per_side
static constexpr IndexElement kCellsPerSideLog2 = int_math::log2_floor(cells_per_side)
static constexpr IndexElement kDim = dim

Protected Attributes

const CellDataT default_value_
BlockHashMap block_map_