Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

MxHeap Class Reference

#include <heap.h>

List of all members.

Public Member Functions

 MxHeap ()
 MxHeap (unsigned int n)
void insert (MxHeapable *t)
void insert (MxHeapable *, double)
void update (MxHeapable *t)
void update (MxHeapable *, double)
void reset ()
unsigned int size () const
MxHeapableitem (int i)
const MxHeapableitem (int i) const
MxHeapableextract ()
MxHeapabletop ()
MxHeapableremove (MxHeapable *)

Private Member Functions

void place (MxHeapable *x, unsigned int i)
void swap (unsigned int i, unsigned int j)
unsigned int parent (unsigned int i)
unsigned int left (unsigned int i)
unsigned int right (unsigned int i)
void upheap (unsigned int i)
void downheap (unsigned int i)


Constructor & Destructor Documentation

MxHeap::MxHeap  )  [inline]
 

Definition at line 65 of file heap.h.

MxHeap::MxHeap unsigned int  n  )  [inline]
 

Definition at line 66 of file heap.h.


Member Function Documentation

void MxHeap::downheap unsigned int  i  )  [private]
 

Definition at line 49 of file heap.cpp.

References MxHeapable::heap_key(), left(), place(), ref, right(), and size().

Referenced by extract(), remove(), and update().

MxHeapable * MxHeap::extract  ) 
 

Definition at line 107 of file heap.cpp.

References downheap(), MxHeapable::not_in_heap(), size(), and swap().

Referenced by Octree::traverse_in_order().

void MxHeap::insert MxHeapable ,
double 
 

Definition at line 84 of file heap.cpp.

References MxHeapable::heap_key(), MxHeapable::set_heap_pos(), size(), and upheap().

void MxHeap::insert MxHeapable t  )  [inline]
 

Definition at line 68 of file heap.h.

References MxHeapable::heap_key().

Referenced by Octree::traverse_in_order().

const MxHeapable* MxHeap::item int  i  )  const [inline]
 

Definition at line 77 of file heap.h.

MxHeapable* MxHeap::item int  i  )  [inline]
 

Definition at line 76 of file heap.h.

Referenced by top(), and Octree::traverse_in_order().

unsigned int MxHeap::left unsigned int  i  )  [inline, private]
 

Definition at line 56 of file heap.h.

Referenced by downheap().

unsigned int MxHeap::parent unsigned int  i  )  [inline, private]
 

Definition at line 55 of file heap.h.

Referenced by update(), and upheap().

void MxHeap::place MxHeapable x,
unsigned int  i
[inline, private]
 

Definition at line 18 of file heap.cpp.

References ref, and MxHeapable::set_heap_pos().

Referenced by downheap(), swap(), and upheap().

MxHeapable * MxHeap::remove MxHeapable  ) 
 

Definition at line 120 of file heap.cpp.

References downheap(), MxHeapable::get_heap_pos(), MxHeapable::heap_key(), MxHeapable::is_in_heap(), MxHeapable::not_in_heap(), ref, size(), swap(), and upheap().

void MxHeap::reset  )  [inline]
 

Definition at line 73 of file heap.h.

Referenced by Octree::traverse_in_order().

unsigned int MxHeap::right unsigned int  i  )  [inline, private]
 

Definition at line 57 of file heap.h.

Referenced by downheap().

unsigned int MxHeap::size  )  const [inline]
 

Definition at line 75 of file heap.h.

Referenced by downheap(), extract(), insert(), remove(), top(), and Octree::traverse_in_order().

void MxHeap::swap unsigned int  i,
unsigned int  j
[private]
 

Definition at line 24 of file heap.cpp.

References place(), and ref.

Referenced by extract(), and remove().

MxHeapable* MxHeap::top  )  [inline]
 

Definition at line 79 of file heap.h.

References item(), and size().

void MxHeap::update MxHeapable ,
double 
 

Definition at line 95 of file heap.cpp.

References downheap(), MxHeapable::get_heap_pos(), MxHeapable::heap_key(), parent(), ref, and upheap().

void MxHeap::update MxHeapable t  )  [inline]
 

Definition at line 70 of file heap.h.

References MxHeapable::heap_key().

void MxHeap::upheap unsigned int  i  )  [private]
 

Definition at line 32 of file heap.cpp.

References MxHeapable::heap_key(), parent(), place(), and ref.

Referenced by insert(), remove(), and update().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:02:29 2004 for Advanced Surface Library by doxygen 1.3.4