heap

package
v0.29.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

package heap implements a min-heap for pairs of jets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heap

type Heap struct {
	// contains filtered or unexported fields
}

Heap contains a slice of items and the last index.

func New

func New() *Heap

New returns a heap pointer.

func (*Heap) IsEmpty

func (h *Heap) IsEmpty() bool

IsEmpty returns whether a heap is empty.

func (*Heap) Pop

func (h *Heap) Pop() (jeti, jetj int, dij float64)

Pop returns the two jets with the smallest distance. It returns -1, -1, 0 if the heap is empty.

func (*Heap) Push

func (h *Heap) Push(jeti, jetj int, dij float64)

Push inserts two new clustering candidates and their kt distance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL