Pyrogenesis  trunk
Classes | Public Member Functions | Public Attributes | List of all members
JumpPointCache::RowTree Struct Reference

Classes

struct  Interval
 Represents an interval [u15 x0, u16 x1) with a boolean obstruction flag, packed into a single u32. More...
 

Public Member Functions

size_t GetMemoryUsage () const
 
 RowTree (int length)
 
void SetRange (int x0, int x1, bool obstruction)
 
void ConstructTree (std::vector< Interval > &tree, size_t x0, size_t pivot, size_t x1, size_t idx_tree)
 Recursive helper function for Finish(). More...
 
void Finish ()
 
void Get (int x, int &xp, bool &obstruction)
 

Public Attributes

std::vector< Intervaldata
 

Constructor & Destructor Documentation

JumpPointCache::RowTree::RowTree ( int  length)
inline

Member Function Documentation

void JumpPointCache::RowTree::ConstructTree ( std::vector< Interval > &  tree,
size_t  x0,
size_t  pivot,
size_t  x1,
size_t  idx_tree 
)
inline

Recursive helper function for Finish().

Given two ranges [x0, pivot) and [pivot, x1) in the sorted array 'data', the pivot element is added onto the binary tree (stored flattened in an array), and then each range is split into two sub-ranges with a pivot in the middle (to ensure the tree remains balanced) and ConstructTree recurses.

void JumpPointCache::RowTree::Finish ( )
inline
void JumpPointCache::RowTree::Get ( int  x,
int &  xp,
bool &  obstruction 
)
inline
size_t JumpPointCache::RowTree::GetMemoryUsage ( ) const
inline
void JumpPointCache::RowTree::SetRange ( int  x0,
int  x1,
bool  obstruction 
)
inline

Member Data Documentation

std::vector<Interval> JumpPointCache::RowTree::data

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