C# Class Ocronet.Dynamic.OcroFST.Heap

Exibir arquivo Open project: nickun/OCRonet Class Usage Examples

Public Methods

Method Description
Heap ( int n ) : System

Constructor. Create a heap storing node indices from 0 to n - 1.

Length ( ) : int
MinCost ( ) : float
Pop ( ) : int
Push ( int node, float cost ) : bool

Push the node in the heap if it's not already there, otherwise promote.

Remove ( int node ) : bool

Private Methods

Method Description
heapify_down ( int i ) : void

Fix the heap invariant broken by increasing the cost of heap node i.

heapify_up ( int i ) : void

Fix the heap invariant broken by decreasing the cost of heap node i.

heapswap ( int i, int j ) : void

Swap 2 nodes on the heap, maintaining heapback.

left ( int i ) : int
parent ( int i ) : int
right ( int i ) : int
rotate ( int i ) : int

Method Details

Heap() public method

Constructor. Create a heap storing node indices from 0 to n - 1.
public Heap ( int n ) : System
n int
return System

Length() public method

public Length ( ) : int
return int

MinCost() public method

public MinCost ( ) : float
return float

Pop() public method

public Pop ( ) : int
return int

Push() public method

Push the node in the heap if it's not already there, otherwise promote.
public Push ( int node, float cost ) : bool
node int
cost float
return bool

Remove() public method

public Remove ( int node ) : bool
node int
return bool