package heap

import "go-hep.org/x/hep/fastjet/internal/heap"

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

Index

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.

Source Files

doc.go heap.go

Version
v0.36.0 (latest)
Published
Nov 15, 2024
Platform
linux/amd64
Last checked
1 day ago

Tools for package owners.