TRF Language Model
wb::Heap< TValue, TWeight > Class Template Reference

heap More...

#include <wb-heap.h>

Public Member Functions

 Heap (_wb_HEAP_MODE_ mode=HEAPMODE_MAXHEAP, int size=1)
 
 ~Heap ()
 
void Clean ()
 
int GetNum ()
 
bool IsEmpty ()
 
void Swap (int i, int j)
 exchange More...
 
void Update (int i)
 update the data at position i and then heapify More...
 
void Heapify (int i)
 heapify More...
 
void Insert (TValue p_value, TWeight p_w)
 insert a value More...
 
bool GetTop (TValue &p_value, TWeight &p_w)
 get the value at the top of heap More...
 
void SetTop (TValue p_value, TWeight p_w)
 set the value at top and heapify More...
 
bool OutTop (TValue &p_value, TWeight &p_w)
 out the top More...
 

Detailed Description

template<typename TValue, typename TWeight>
class wb::Heap< TValue, TWeight >

heap

  • make sure the value has the operation =��
  • using Insert to insert data and using OutTop to get data can make the data order.

Definition at line 75 of file wb-heap.h.

Constructor & Destructor Documentation

§ Heap()

template<typename TValue, typename TWeight>
wb::Heap< TValue, TWeight >::Heap ( _wb_HEAP_MODE_  mode = HEAPMODE_MAXHEAP,
int  size = 1 
)
inline

Definition at line 85 of file wb-heap.h.

§ ~Heap()

template<typename TValue, typename TWeight>
wb::Heap< TValue, TWeight >::~Heap ( )
inline

Definition at line 97 of file wb-heap.h.

Member Function Documentation

§ Clean()

template<typename TValue, typename TWeight>
void wb::Heap< TValue, TWeight >::Clean ( )
inline

Definition at line 102 of file wb-heap.h.

§ GetNum()

template<typename TValue, typename TWeight>
int wb::Heap< TValue, TWeight >::GetNum ( )
inline

Definition at line 103 of file wb-heap.h.

§ GetTop()

template<typename TValue, typename TWeight>
bool wb::Heap< TValue, TWeight >::GetTop ( TValue &  p_value,
TWeight &  p_w 
)
inline

get the value at the top of heap

Definition at line 166 of file wb-heap.h.

§ Heapify()

template<typename TValue, typename TWeight>
void wb::Heap< TValue, TWeight >::Heapify ( int  i)
inline

heapify

Definition at line 133 of file wb-heap.h.

§ Insert()

template<typename TValue, typename TWeight>
void wb::Heap< TValue, TWeight >::Insert ( TValue  p_value,
TWeight  p_w 
)
inline

insert a value

�����������Ԫ�أ��п��ܻ���д�����ڴ棬����bufferָ��

Definition at line 157 of file wb-heap.h.

§ IsEmpty()

template<typename TValue, typename TWeight>
bool wb::Heap< TValue, TWeight >::IsEmpty ( )
inline

Definition at line 104 of file wb-heap.h.

§ OutTop()

template<typename TValue, typename TWeight>
bool wb::Heap< TValue, TWeight >::OutTop ( TValue &  p_value,
TWeight &  p_w 
)
inline

out the top

Definition at line 184 of file wb-heap.h.

§ SetTop()

template<typename TValue, typename TWeight>
void wb::Heap< TValue, TWeight >::SetTop ( TValue  p_value,
TWeight  p_w 
)
inline

set the value at top and heapify

Definition at line 176 of file wb-heap.h.

§ Swap()

template<typename TValue, typename TWeight>
void wb::Heap< TValue, TWeight >::Swap ( int  i,
int  j 
)
inline

exchange

Definition at line 106 of file wb-heap.h.

§ Update()

template<typename TValue, typename TWeight>
void wb::Heap< TValue, TWeight >::Update ( int  i)
inline

update the data at position i and then heapify

Definition at line 117 of file wb-heap.h.


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