Space-efficient geometric algorithms and data structures

By Ilya Katz and Hervé Brönnimann    

inplaceds::explicit_tree_heap< Geometry, BSTCompare, PQCompare > Class Template Reference

#include <explicit_tree_heap.hpp>

Collaboration diagram for inplaceds::explicit_tree_heap< Geometry, BSTCompare, PQCompare >:

Collaboration graph
[legend]

Detailed Description

template<typename Geometry, typename BSTCompare, typename PQCompare>
class inplaceds::explicit_tree_heap< Geometry, BSTCompare, PQCompare >

Definition at line 80 of file explicit_tree_heap.hpp.

Public Types

typedef Geometry::coord_type coord_type
typedef explicit_tree_node<
Geometry
TNode
typedef TNode::point_type point_type
typedef TNode::nodePtr nodePtr
typedef TNode::Data Data
typedef Data::line_type line_type

Public Member Functions

 explicit_tree_heap ()
 Constructs an empty tree/heap.
 explicit_tree_heap (BSTCompare &b, PQCompare &p)
 Constructs an empty tree/heap with funtors that define order in priority queue and the binary search tree.
 ~explicit_tree_heap ()
bool empty ()
 Returns true if the tree/heap is empty, and false otherwise.
void print ()
 Prints tree/heap. Priority queue representation followed by tree representation.
void remove_top ()
 Removes the top node of the priority queue and the corresponding node in the BST.
nodePtr remove_node (nodePtr node)
 Removes an arbirtary node from the tree/heap.
void insert (const line_type &l)
 Insert a node both into priority queue.
nodePtr get_top ()
 Returns pointer to the top of the priority queue.
bool remove (const line_type &l)
nodePtr successor (nodePtr x)
 Returns the pointer to the node that follows node x in-order.
nodePtr predecessor (nodePtr x)
 Returns the pointer to the node that preceeds node x in-order.
void swap_nodes (nodePtr a, nodePtr b)
 Swaps two nodes in the BST.
void adjust_PQ (nodePtr node)
 If a node's priority was chnaged, the PQ needs to be adjusted.
void insert_BST (nodePtr t)
 BST is updated to include the node that already exists in PQ.
void segment_right_event (nodePtr it)
 Perform right-end point event operations on segment.
void segment_intersection_event (nodePtr it, point_type point, Data *intersecting)
 Perform intersection event operations on segment.

Private Types

typedef BST_leftPointer leftBSTptr
typedef BST_rightPointer rightBSTptr
typedef BST_parentPointer parentBSTptr
typedef PQ_leftPointer leftPQptr
typedef PQ_rightPointer rightPQptr
typedef PQ_parentPointer parentPQptr
typedef BST_Data BST_Data

Private Member Functions

template<class Parent, class Left, class Right>
nodePtr m_successor (nodePtr x, Parent parent, Left left, Right right)
nodePtr insert_without_balance (nodePtr newLine, nodePtr t, nodePtr &result=NULL)
void percolate_up (nodePtr node)
 If a node's priority was increased, it needs to be percolated up the PQ.
void percolate_down (nodePtr node)
 If a node's priority was decreased, it needs to be percolated down the PQ.
void update_node (nodePtr hole, nodePtr newNode)
 Swap two adjacent nodes in PQ. BST is not affected.
nodePtr m_remove_node_PQ (nodePtr root)
 Removes the top elemnt of the priority queue. BST is also updated.
nodePtr m_remove_BST (nodePtr z)
 Member function that removes a node from the BST.
void preOrder (nodePtr root)
void preOrderPQ (nodePtr root)
nodePtr BST_insert (const line_type &l, nodePtr t, nodePtr &result=NULL)
nodePtr PQ_insert (nodePtr)
 !!!!SEE IF THIS CAN BE DONE BETTER
nodePtr allocateNode (const line_type &)
nodePtr allocateNode (Data &)
void swap (nodePtr, nodePtr)
 explicit_tree_heap (const explicit_tree_heap &p)
explicit_tree_heap operator= (const explicit_tree_heap &p)

Private Attributes

nodePtr rootBST
nodePtr rootPQ
BSTCompare BSTcomp
PQCompare PQcomp
rightBSTptr right
leftBSTptr left
parentBSTptr parent
rightPQptr rightPQ
leftPQptr leftPQ
parentPQptr parentPQ
BST_Data data

Data Structures

struct  BST_Data


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

Code Documentation generated Using Doxygen

Copyright © Ilya Katz and Hervé Brönnimann, 2005, 2006.