SG++-Doxygen-Documentation
sgpp::combigrid::BinaryHeap< T, Comparator > Class Template Reference

Implements a max heap using a binary heap. More...

#include <BinaryHeap.hpp>

Classes

struct  Handle
 
struct  HeapElement
 

Public Types

typedef Handle handle_type
 
typedef std::shared_ptr< HeapElementHeapElementPointer
 

Public Member Functions

 BinaryHeap ()
 
 BinaryHeap (size_t size)
 
 BinaryHeap (std::vector< T > v)
 
void clear ()
 
bool empty ()
 
HeapElementPointer get (size_t index)
 
void pop ()
 
void print ()
 
Handle push (T elem)
 
void set (size_t index, T value)
 
T const & top ()
 
void update (Handle h_in, T const &value)
 
void update (Handle h_in)
 
 ~BinaryHeap ()
 

Detailed Description

template<typename T, typename Comparator = std::less<T>>
class sgpp::combigrid::BinaryHeap< T, Comparator >

Implements a max heap using a binary heap.

We need this as a priority queue implementation with a updatePriority() function because we do not want to have boost as a dependency.

Member Typedef Documentation

template<typename T, typename Comparator = std::less<T>>
typedef Handle sgpp::combigrid::BinaryHeap< T, Comparator >::handle_type
template<typename T, typename Comparator = std::less<T>>
typedef std::shared_ptr<HeapElement> sgpp::combigrid::BinaryHeap< T, Comparator >::HeapElementPointer

Constructor & Destructor Documentation

template<typename T, typename Comparator = std::less<T>>
sgpp::combigrid::BinaryHeap< T, Comparator >::~BinaryHeap ( )
inline
template<typename T, typename Comparator = std::less<T>>
sgpp::combigrid::BinaryHeap< T, Comparator >::BinaryHeap ( )
inline
template<typename T, typename Comparator = std::less<T>>
sgpp::combigrid::BinaryHeap< T, Comparator >::BinaryHeap ( size_t  size)
inlineexplicit
template<typename T, typename Comparator = std::less<T>>
sgpp::combigrid::BinaryHeap< T, Comparator >::BinaryHeap ( std::vector< T >  v)
inlineexplicit

Member Function Documentation

template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::clear ( )
inline
template<typename T, typename Comparator = std::less<T>>
HeapElementPointer sgpp::combigrid::BinaryHeap< T, Comparator >::get ( size_t  index)
inline
template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::print ( )
inline
template<typename T, typename Comparator = std::less<T>>
Handle sgpp::combigrid::BinaryHeap< T, Comparator >::push ( elem)
inline
template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::set ( size_t  index,
value 
)
inline
template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::update ( Handle  h_in,
T const &  value 
)
inline
template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::update ( Handle  h_in)
inline

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