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

◆ handle_type

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

◆ HeapElementPointer

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

Constructor & Destructor Documentation

◆ ~BinaryHeap()

template<typename T, typename Comparator = std::less<T>>
sgpp::combigrid::BinaryHeap< T, Comparator >::~BinaryHeap ( )
inline

◆ BinaryHeap() [1/3]

template<typename T, typename Comparator = std::less<T>>
sgpp::combigrid::BinaryHeap< T, Comparator >::BinaryHeap ( )
inline

◆ BinaryHeap() [2/3]

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

◆ BinaryHeap() [3/3]

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

Member Function Documentation

◆ clear()

template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::clear ( )
inline

◆ empty()

◆ get()

template<typename T, typename Comparator = std::less<T>>
HeapElementPointer sgpp::combigrid::BinaryHeap< T, Comparator >::get ( size_t  index)
inline

◆ pop()

◆ print()

template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::print ( )
inline

◆ push()

template<typename T, typename Comparator = std::less<T>>
Handle sgpp::combigrid::BinaryHeap< T, Comparator >::push ( elem)
inline

◆ set()

template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::set ( size_t  index,
value 
)
inline

◆ top()

◆ update() [1/2]

template<typename T, typename Comparator = std::less<T>>
void sgpp::combigrid::BinaryHeap< T, Comparator >::update ( Handle  h_in,
T const &  value 
)
inline

◆ update() [2/2]

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: