NVBIO
|
A priority queue
Key | the key type |
Container | the underlying container used to hold keys, must implement push_back(), size(), resize(), clear() |
Compare | the comparison binary functor, Compare(a,b) == true iff a < b |
Definition at line 90 of file priority_queue.h.
#include <priority_queue.h>
Public Types | |
typedef Key | value_type |
typedef Container | container_type |
typedef container_type::const_iterator | const_iterator |
typedef const_iterator | iterator |
Public Methods | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE | priority_queue (Container cont=Container(), const Compare cmp=Compare()) |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | empty () const |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 | size () const |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void | push (const Key key) |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void | pop () |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE Key & | top () |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE Key | top () const |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const Key & | operator[] (const uint32 i) const |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void | clear () |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const_iterator | begin () const |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE iterator | begin () |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const_iterator | end () const |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE iterator | end () |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE iterator | upper_bound (const Key &x) |
Public Members | |
uint32 | m_size |
Container | m_queue |
Compare | m_cmp |
typedef container_type::const_iterator nvbio::priority_queue< Key, Container, Compare >::const_iterator |
Definition at line 94 of file priority_queue.h.
typedef Container nvbio::priority_queue< Key, Container, Compare >::container_type |
Definition at line 93 of file priority_queue.h.
typedef const_iterator nvbio::priority_queue< Key, Container, Compare >::iterator |
Definition at line 95 of file priority_queue.h.
typedef Key nvbio::priority_queue< Key, Container, Compare >::value_type |
Definition at line 92 of file priority_queue.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE nvbio::priority_queue< Key, Container, Compare >::priority_queue | ( | Container | cont = Container() , |
const Compare | cmp = Compare() |
||
) |
constructor
Definition at line 33 of file priority_queue_inline.h.
|
inline |
starting iterator
Definition at line 136 of file priority_queue.h.
|
inline |
starting iterator
Definition at line 141 of file priority_queue.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::priority_queue< Key, Container, Compare >::clear | ( | void | ) |
clear the queue
Definition at line 130 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::priority_queue< Key, Container, Compare >::empty | ( | void | ) | const |
is queue empty?
Definition at line 43 of file priority_queue_inline.h.
|
inline |
ending iterator
Definition at line 146 of file priority_queue.h.
|
inline |
ending iterator
Definition at line 151 of file priority_queue.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const Key & nvbio::priority_queue< Key, Container, Compare >::operator[] | ( | const uint32 | i) | const |
return the i-th element in the heap
Definition at line 122 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::priority_queue< Key, Container, Compare >::pop | ( | void | ) |
pop an element
Definition at line 81 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::priority_queue< Key, Container, Compare >::push | ( | const Key | key) |
push an element
Definition at line 59 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::priority_queue< Key, Container, Compare >::size | ( | void | ) | const |
return queue size
Definition at line 51 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE Key & nvbio::priority_queue< Key, Container, Compare >::top | ( | void | ) |
top of the queue
Definition at line 106 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE Key nvbio::priority_queue< Key, Container, Compare >::top | ( | void | ) | const |
top of the queue
Definition at line 114 of file priority_queue_inline.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE priority_queue< Key, Container, Compare >::iterator nvbio::priority_queue< Key, Container, Compare >::upper_bound | ( | const Key & | x) |
locate the largest element v such that v <= x; return end() if no such element exists
Definition at line 163 of file priority_queue_inline.h.
Compare nvbio::priority_queue< Key, Container, Compare >::m_cmp |
Definition at line 160 of file priority_queue.h.
Container nvbio::priority_queue< Key, Container, Compare >::m_queue |
Definition at line 159 of file priority_queue.h.
uint32 nvbio::priority_queue< Key, Container, Compare >::m_size |
Definition at line 158 of file priority_queue.h.