creaImageIO_lib
|
Indexed priority queues handled by binary trees. More...
#include <creaImageIOIndexedHeap.h>
Public Member Functions | |
IndexedHeap () | |
Constructor. More... | |
IndexedHeap (const Comparator &comp, const Indexer &ind) | |
Constructor. More... | |
~IndexedHeap () | |
Destructor. More... | |
void | set (const Comparator &comp) |
Sets the comparator. More... | |
void | set (const Indexer &ind) |
Sets the Index. More... | |
int | insert (T) |
inserts an element in the Heap and returns its position More... | |
T & | top () |
return a reference on the first element of the Heap More... | |
const T & | top () const |
return a constant reference on the first element of the Heap More... | |
T | remove_top () |
removes and returns the first element of the Heap More... | |
T | remove (int n) |
removes and returns the nth element More... | |
int | size () const |
returns the size of the Heap More... | |
void | clear () |
empties the Heap More... | |
const std::vector< T > & | stack () const |
returns a constant on the stack of elements More... | |
T & | operator[] (int i) |
returns a reference to the ith element of the stack More... | |
const T & | operator[] (int i) const |
returns a constant reference to the ith element of the stack More... | |
int | index (T &t) |
returns the index (position) of t More... | |
int | father (int i) const |
returns the position of the father of i More... | |
int | rightson (int i) const |
returns the position of the right son of i More... | |
int | leftson (int i) const |
returns the position of the leftson of i More... | |
void | swap (int i, int j) |
swaps ith and jth elements More... | |
int | upsort (int) |
int | downsort (int) |
Protected Attributes | |
std::vector< T > | m_p |
binary tree handled by a vector More... | |
const Comparator * | m_c |
comparator pointer More... | |
const Indexer * | m_i |
Index pointer. More... | |
Indexed priority queues handled by binary trees.
Heap Allows :
The Indexer is an unary_function<T,int&> whose operator()(T& t) returns a reference on an integer which is maintained by the IndexedHeap in order to provide at any time the position of the object t in the Heap (hence allowing constant time random access to an object).
Definition at line 48 of file creaImageIOIndexedHeap.h.
|
inline |
creaImageIO::IndexedHeap< T, CT, IT >::IndexedHeap | ( | const CT & | comp, |
const IT & | ind | ||
) |
|
inline |
void IndexedHeap::clear | ( | ) |
empties the Heap
Definition at line 145 of file creaImageIOIndexedHeap.h.
|
inline |
descend un element dans le tas tant qu'il n'est pas a sa place. renvoie la position finale
Definition at line 214 of file creaImageIOIndexedHeap.h.
|
inline |
returns the position of the father of i
Definition at line 158 of file creaImageIOIndexedHeap.h.
|
inline |
int IndexedHeap::insert | ( | T | t | ) |
inserts an element in the Heap and returns its position
Definition at line 75 of file creaImageIOIndexedHeap.h.
|
inline |
returns the position of the leftson of i
Definition at line 174 of file creaImageIOIndexedHeap.h.
|
inline |
returns a reference to the ith element of the stack
Definition at line 116 of file creaImageIOIndexedHeap.h.
|
inline |
returns a constant reference to the ith element of the stack
Definition at line 118 of file creaImageIOIndexedHeap.h.
T IndexedHeap::remove | ( | int | n | ) |
T IndexedHeap::remove_top | ( | ) |
removes and returns the first element of the Heap
Definition at line 104 of file creaImageIOIndexedHeap.h.
|
inline |
returns the position of the right son of i
Definition at line 166 of file creaImageIOIndexedHeap.h.
void creaImageIO::IndexedHeap< T, CT, IT >::set | ( | const CT & | comp | ) |
void creaImageIO::IndexedHeap< T, CT, IT >::set | ( | const IT & | ind | ) |
|
inline |
|
inline |
returns a constant on the stack of elements
Definition at line 114 of file creaImageIOIndexedHeap.h.
|
inline |
swaps ith and jth elements
Definition at line 182 of file creaImageIOIndexedHeap.h.
T & IndexedHeap::top | ( | ) |
return a reference on the first element of the Heap
Definition at line 85 of file creaImageIOIndexedHeap.h.
const T & creaImageIO::IndexedHeap< T, CT, IT >::top | ( | ) | const |
return a constant reference on the first element of the Heap
Definition at line 95 of file creaImageIOIndexedHeap.h.
|
inline |
remonte un element dans le tas tant qu'il n'est pas a sa place. renvoie la position finale
Definition at line 197 of file creaImageIOIndexedHeap.h.
|
protected |
comparator pointer
Definition at line 145 of file creaImageIOIndexedHeap.h.
|
protected |
Index pointer.
Definition at line 147 of file creaImageIOIndexedHeap.h.
|
protected |
binary tree handled by a vector
Definition at line 143 of file creaImageIOIndexedHeap.h.
Referenced by creaImageIO::IndexedHeap< creaImageIO::MultiThreadImageReader::ImageToLoad, creaImageIO::MultiThreadImageReader::ImageToLoadPtrPriorityComparator, creaImageIO::MultiThreadImageReader::ImageToLoadPtrIndexer >::operator[](), creaImageIO::IndexedHeap< creaImageIO::MultiThreadImageReader::ImageToLoad, creaImageIO::MultiThreadImageReader::ImageToLoadPtrPriorityComparator, creaImageIO::MultiThreadImageReader::ImageToLoadPtrIndexer >::size(), and creaImageIO::IndexedHeap< creaImageIO::MultiThreadImageReader::ImageToLoad, creaImageIO::MultiThreadImageReader::ImageToLoadPtrPriorityComparator, creaImageIO::MultiThreadImageReader::ImageToLoadPtrIndexer >::stack().