OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
SkipHeapAddressing< blocking > Struct Template Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/MutablePriorityQueue.hpp>

Static Public Member Functions

static std::size_t child_of (std::size_t node_no) noexcept
static std::size_t parent_of (std::size_t node_no) noexcept
static bool is_block_leaf (std::size_t node_no) noexcept
static bool is_padding (std::size_t node_no) noexcept
static bool is_block_root (std::size_t node_no) noexcept
static std::size_t block_offset (std::size_t node_no) noexcept
static std::size_t block_base (std::size_t node_no) noexcept
static std::size_t child_no (std::size_t node_no) noexcept

Static Public Attributes

static const constexpr std::size_t block_size = blocking
static const constexpr std::size_t block_mask = block_size - 1

Detailed Description

template<std::size_t blocking>
struct SkipHeapAddressing< blocking >

Member Function Documentation

◆ block_base()

template<std::size_t blocking>
std::size_t SkipHeapAddressing< blocking >::block_base ( std::size_t node_no)
inlinestaticnoexcept
252{ return node_no & ~block_mask; }
Definition MutablePriorityQueue.hpp:208
static const constexpr std::size_t block_mask
Definition MutablePriorityQueue.hpp:211

References block_mask.

Referenced by child_of(), and parent_of().

Here is the caller graph for this function:

◆ block_offset()

template<std::size_t blocking>
std::size_t SkipHeapAddressing< blocking >::block_offset ( std::size_t node_no)
inlinestaticnoexcept
250{ return node_no & block_mask; }

References block_mask.

Referenced by child_of(), is_block_root(), is_padding(), and parent_of().

Here is the caller graph for this function:

◆ child_no()

template<std::size_t blocking>
std::size_t SkipHeapAddressing< blocking >::child_no ( std::size_t node_no)
inlinestaticnoexcept
254{ assert(is_block_leaf(node_no)); return node_no & (block_mask >> 1); }
static bool is_block_leaf(std::size_t node_no) noexcept
Definition MutablePriorityQueue.hpp:242

References block_mask, and is_block_leaf().

Referenced by child_of().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ child_of()

template<std::size_t blocking>
std::size_t SkipHeapAddressing< blocking >::child_of ( std::size_t node_no)
inlinestaticnoexcept
214 {
215 if (! is_block_leaf(node_no))
216 // If not a leaf, then it is sufficient to just traverse down inside a miniheap.
217 // The following line is equivalent to, but quicker than
218 // return block_base(node_no) + 2 * block_offset(node_no);
219 return node_no + block_offset(node_no);
220 // Otherwise skip to a root of a child miniheap.
221 return (block_base(node_no) + 1 + child_no(node_no) * 2) * block_size + 1;
222 }
static const constexpr std::size_t block_size
Definition MutablePriorityQueue.hpp:210
static std::size_t block_base(std::size_t node_no) noexcept
Definition MutablePriorityQueue.hpp:252
static std::size_t block_offset(std::size_t node_no) noexcept
Definition MutablePriorityQueue.hpp:250
static std::size_t child_no(std::size_t node_no) noexcept
Definition MutablePriorityQueue.hpp:254

References block_base(), block_offset(), block_size, child_no(), and is_block_leaf().

Referenced by MutableSkipHeapPriorityQueue< T, IndexSetter, LessPredicate, blocking, ResetIndexWhenRemoved >::update_heap_down().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_block_leaf()

template<std::size_t blocking>
bool SkipHeapAddressing< blocking >::is_block_leaf ( std::size_t node_no)
inlinestaticnoexcept
242{ return (node_no & (block_size >> 1)) != 0U; }

References block_size.

Referenced by child_no(), child_of(), and MutableSkipHeapPriorityQueue< T, IndexSetter, LessPredicate, blocking, ResetIndexWhenRemoved >::update_heap_down().

Here is the caller graph for this function:

◆ is_block_root()

template<std::size_t blocking>
bool SkipHeapAddressing< blocking >::is_block_root ( std::size_t node_no)
inlinestaticnoexcept
248{ return block_offset(node_no) == 1U; }

References block_offset().

Referenced by parent_of().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_padding()

template<std::size_t blocking>
bool SkipHeapAddressing< blocking >::is_padding ( std::size_t node_no)
inlinestaticnoexcept

◆ parent_of()

template<std::size_t blocking>
std::size_t SkipHeapAddressing< blocking >::parent_of ( std::size_t node_no)
inlinestaticnoexcept
224 {
225 auto const node_root = block_base(node_no); // 16
226 if (! is_block_root(node_no))
227 // If not a block (miniheap) root, then it is sufficient to just traverse up inside a miniheap.
228 return node_root + block_offset(node_no) / 2;
229 // Otherwise skipping from a root of one miniheap into leaf of another miniheap.
230 // Address of a parent miniheap block. One miniheap branches at (block_size / 2) leaves to (block_size) miniheaps.
231 auto const parent_base = block_base(node_root / block_size - 1); // 0
232 // Index of a leaf of a parent miniheap, which is a parent of node_no.
233 auto const child = ((node_no - block_size) / block_size - parent_base) / 2;
234 return
235 // Address of a parent miniheap
236 parent_base +
237 // Address of a leaf of a parent miniheap
238 block_size / 2 + child; // 30
239 }
static bool is_block_root(std::size_t node_no) noexcept
Definition MutablePriorityQueue.hpp:248

References block_base(), block_offset(), block_size, and is_block_root().

Referenced by MutableSkipHeapPriorityQueue< T, IndexSetter, LessPredicate, blocking, ResetIndexWhenRemoved >::update_heap_up().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ block_mask

template<std::size_t blocking>
const constexpr std::size_t SkipHeapAddressing< blocking >::block_mask = block_size - 1
staticconstexpr

Referenced by block_base(), block_offset(), and child_no().

◆ block_size


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