QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
Classes | Public Member Functions | Protected Attributes | List of all members
MaxHeap< val_t > Class Template Reference

#include <maxheap.h>

Inheritance diagram for MaxHeap< val_t >:
DevianceMaxHeap

Classes

struct  item
 

Public Member Functions

 MaxHeap (size_t initsize=0)
 default constructor More...
 
 ~MaxHeap ()
 
bool is_notempty () const
 return true if heap is empty More...
 
size_t get_size () const
 return numebr of items stored in the heap More...
 
void push (const double &key, const val_t &val)
 push a new element in the heap and resize the data structure if it is full More...
 
void pop ()
 remove the element on the top of the heap, i.e. More...
 
val_t & top () const
 ref to the top element More...
 

Protected Attributes

itemarr
 
size_t arrsize
 
size_t maxsize
 

Constructor & Destructor Documentation

template<typename val_t >
MaxHeap< val_t >::MaxHeap ( size_t  initsize = 0)
inline

default constructor

Parameters
initsizeset the initial size of the data structure if available
template<typename val_t >
MaxHeap< val_t >::~MaxHeap ( )
inline

Member Function Documentation

template<typename val_t >
size_t MaxHeap< val_t >::get_size ( ) const
inline

return numebr of items stored in the heap

template<typename val_t >
bool MaxHeap< val_t >::is_notempty ( ) const
inline

return true if heap is empty

template<typename val_t >
void MaxHeap< val_t >::pop ( )
inline

remove the element on the top of the heap, i.e.

the element with max key value

template<typename val_t >
void MaxHeap< val_t >::push ( const double &  key,
const val_t &  val 
)
inline

push a new element in the heap and resize the data structure if it is full

Parameters
keyordering key of the new element
valvalue of the new element
template<typename val_t >
val_t& MaxHeap< val_t >::top ( ) const
inline

ref to the top element

Member Data Documentation

template<typename val_t >
item* MaxHeap< val_t >::arr
protected
template<typename val_t >
size_t MaxHeap< val_t >::arrsize
protected
template<typename val_t >
size_t MaxHeap< val_t >::maxsize
protected

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