TRF Language Model
wb-heap.h File Reference

heap, using a linear array. It can be used to sort values. More...

#include "wb-vector.h"

Go to the source code of this file.

Classes

class  wb::_wb_HEAP_UNIT_< TValue, TWeight >
 heap unit More...
 
class  wb::Heap< TValue, TWeight >
 heap More...
 

Namespaces

 wb
 define all the code written by Bin Wang.
 

Macros

#define HEAPMODE_MAXHEAP   0x0001
 max heap, used to sort from large to small More...
 
#define HEAPMODE_MINHEAP   0x0002
 min heap, used to sort from samll to large More...
 
#define wbHeap_PARENT(i)   ((i)/2)
 heap get father index More...
 
#define wbHeap_RIGHT(i)   (2*(i)+1)
 heap Right index More...
 
#define wbHeap_LEFT(i)   (2*(i))
 heap Left index More...
 

Typedefs

typedef unsigned short wb::_wb_HEAP_MODE_
 

Detailed Description

heap, using a linear array. It can be used to sort values.

Author
WangBin
Date
2013-9-23

Definition in file wb-heap.h.

Macro Definition Documentation

§ HEAPMODE_MAXHEAP

#define HEAPMODE_MAXHEAP   0x0001

max heap, used to sort from large to small

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

§ HEAPMODE_MINHEAP

#define HEAPMODE_MINHEAP   0x0002

min heap, used to sort from samll to large

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

§ wbHeap_LEFT

#define wbHeap_LEFT (   i)    (2*(i))

heap Left index

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

§ wbHeap_PARENT

#define wbHeap_PARENT (   i)    ((i)/2)

heap get father index

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

§ wbHeap_RIGHT

#define wbHeap_RIGHT (   i)    (2*(i)+1)

heap Right index

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