C# Класс Ocronet.Dynamic.OcroFST.Heap

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Heap() публичный Метод

Constructor. Create a heap storing node indices from 0 to n - 1.
public Heap ( int n ) : System
n int
Результат System

Length() публичный Метод

public Length ( ) : int
Результат int

MinCost() публичный Метод

public MinCost ( ) : float
Результат float

Pop() публичный Метод

public Pop ( ) : int
Результат int

Push() публичный Метод

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
Результат bool

Remove() публичный Метод

public Remove ( int node ) : bool
node int
Результат bool