Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
mst_output.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstddef>
5#include <cstdint>
6#include <vector>
7
9
10namespace clustering::hdbscan {
11
22template <class T> struct MstEdge {
24 std::int32_t u = 0;
26 std::int32_t v = 0;
28 T weight = T{};
29};
30
41template <class T> struct MstOutput {
43 std::vector<MstEdge<T>> edges;
45 NDArray<T, 1> coreDistances{std::array<std::size_t, 1>{0}};
46};
47
48} // namespace clustering::hdbscan
Represents a multidimensional array (NDArray) of a fixed number of dimensions N and element type T.
Definition ndarray.h:136
One edge of the minimum spanning tree of mutual-reachability distances.
Definition mst_output.h:22
std::int32_t u
First endpoint of the MST edge (0-based vertex index).
Definition mst_output.h:24
T weight
Mutual-reachability distance between u and v.
Definition mst_output.h:28
std::int32_t v
Second endpoint of the MST edge (0-based vertex index).
Definition mst_output.h:26
Frozen output contract of every MST backend.
Definition mst_output.h:41
NDArray< T, 1 > coreDistances
Per-point core distance (length N; self-excluded kNN distance at minSamples).
Definition mst_output.h:45
std::vector< MstEdge< T > > edges
The N - 1 MST edges, in insertion order.
Definition mst_output.h:43