NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Methods | Public Members | List of all members
nvbio::priority_queue< Key, Container, Compare > Struct Template Reference

Detailed description

template< typename Key, typename Container, typename Compare>
struct nvbio::priority_queue< Key, Container, Compare >

A priority queue

Template Parameters
Keythe key type
Containerthe underlying container used to hold keys, must implement push_back(), size(), resize(), clear()
Comparethe 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
 

Member Typedef Documentation

template<typename Key , typename Container , typename Compare >
typedef container_type::const_iterator nvbio::priority_queue< Key, Container, Compare >::const_iterator

Definition at line 94 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
typedef Container nvbio::priority_queue< Key, Container, Compare >::container_type

Definition at line 93 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
typedef const_iterator nvbio::priority_queue< Key, Container, Compare >::iterator

Definition at line 95 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
typedef Key nvbio::priority_queue< Key, Container, Compare >::value_type

Definition at line 92 of file priority_queue.h.

Constructor & Destructor Documentation

template<typename Key , typename Container , typename Compare >
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.

Member Function Documentation

template<typename Key , typename Container , typename Compare >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const_iterator nvbio::priority_queue< Key, Container, Compare >::begin ( void  ) const
inline

starting iterator

Definition at line 136 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE iterator nvbio::priority_queue< Key, Container, Compare >::begin ( void  )
inline

starting iterator

Definition at line 141 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE const_iterator nvbio::priority_queue< Key, Container, Compare >::end ( void  ) const
inline

ending iterator

Definition at line 146 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE iterator nvbio::priority_queue< Key, Container, Compare >::end ( void  )
inline

ending iterator

Definition at line 151 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

template<typename Key , typename Container , typename Compare >
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.

Member Data Documentation

template<typename Key , typename Container , typename Compare >
Compare nvbio::priority_queue< Key, Container, Compare >::m_cmp

Definition at line 160 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
Container nvbio::priority_queue< Key, Container, Compare >::m_queue

Definition at line 159 of file priority_queue.h.

template<typename Key , typename Container , typename Compare >
uint32 nvbio::priority_queue< Key, Container, Compare >::m_size

Definition at line 158 of file priority_queue.h.


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