Skip to content

@graphty/algorithms / index / TeraHacResult

Interface: TeraHacResult ​

Defined in: indexed/terahac.ts:34

Result of the index-based TeraHAC: the flat clustering plus the dendrogram. Dendrogram node i < n is node index i; node n + k is the k-th join, with children left[k] and right[k].

Extends ​

Properties ​

count ​

readonly count: number

Defined in: indexed/components.ts:11

Number of distinct labels.

Inherited from ​

LabelResult.count


distance ​

readonly distance: F64

Defined in: indexed/terahac.ts:40

Linkage distance of each join; Infinity for the joins that tie the remaining clusters under one root.


labels ​

readonly labels: U32

Defined in: indexed/components.ts:9

Dense label per node index, in first-seen order.

Inherited from ​

LabelResult.labels


left ​

readonly left: U32

Defined in: indexed/terahac.ts:36

Left child of each join (the legacy ClusterNode.left).


merges ​

readonly merges: number

Defined in: indexed/terahac.ts:44

Joins made by distance: distance.subarray(0, merges) is the legacy distances list.


readonly right: U32

Defined in: indexed/terahac.ts:38

Right child of each join.


root ​

readonly root: number

Defined in: indexed/terahac.ts:46

The dendrogram root: 2n - 2, or 0 for a single node.


size ​

readonly size: U32

Defined in: indexed/terahac.ts:42

Node count under each join.

Methods ​

groups() ​

groups(): U32[]

Defined in: indexed/components.ts:16

Node indices grouped by label, computed once and cached.

Returns ​

U32[]

One array per label

Inherited from ​

LabelResult.groups