Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
clustering::HDBSCAN< T, MstBackend >::CondensedTreeView Struct Reference

Read-only view over the condensed-tree result. More...

#include <clustering/hdbscan.h>

Collaboration diagram for clustering::HDBSCAN< T, MstBackend >::CondensedTreeView:
[legend]

Public Member Functions

bool empty () const noexcept
 True when the view holds no rows (no fit or reset called).
std::size_t size () const noexcept
 Number of rows in the condensed tree.

Public Attributes

std::span< const std::int32_t > parent
 Parent cluster id for each row of the condensed tree.
std::span< const std::int32_t > child
 Child cluster or leaf point id for each row.
std::span< const T > lambda
 Lambda value (= 1 / distance) at which child detaches from parent.
std::span< const std::int32_t > childSize
 Size of the child subtree at its birth lambda.

Detailed Description

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
struct clustering::HDBSCAN< T, MstBackend >::CondensedTreeView

Read-only view over the condensed-tree result.

The parallel-array layout matches the reference implementation – parent, child, lambda-at-merge, and child-size – so excess-of-mass and leaf extraction can walk it without auxiliary structures.

Definition at line 121 of file hdbscan.h.

Member Function Documentation

◆ empty()

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
bool clustering::HDBSCAN< T, MstBackend >::CondensedTreeView::empty ( ) const
inlinenodiscardnoexcept

True when the view holds no rows (no fit or reset called).

Definition at line 132 of file hdbscan.h.

◆ size()

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
std::size_t clustering::HDBSCAN< T, MstBackend >::CondensedTreeView::size ( ) const
inlinenodiscardnoexcept

Number of rows in the condensed tree.

Definition at line 134 of file hdbscan.h.

Member Data Documentation

◆ child

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
std::span<const std::int32_t> clustering::HDBSCAN< T, MstBackend >::CondensedTreeView::child

Child cluster or leaf point id for each row.

Definition at line 125 of file hdbscan.h.

◆ childSize

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
std::span<const std::int32_t> clustering::HDBSCAN< T, MstBackend >::CondensedTreeView::childSize

Size of the child subtree at its birth lambda.

Definition at line 129 of file hdbscan.h.

◆ lambda

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
std::span<const T> clustering::HDBSCAN< T, MstBackend >::CondensedTreeView::lambda

Lambda value (= 1 / distance) at which child detaches from parent.

Definition at line 127 of file hdbscan.h.

◆ parent

template<class T, class MstBackend = hdbscan::AutoMstBackend<T>>
std::span<const std::int32_t> clustering::HDBSCAN< T, MstBackend >::CondensedTreeView::parent

Parent cluster id for each row of the condensed tree.

Definition at line 123 of file hdbscan.h.


The documentation for this struct was generated from the following file: