|
Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
|
Node in a KDTree, sharing the same struct shape between internals and leaves. More...
#include <clustering/index/kdtree.h>
Public Attributes | |
| std::size_t | m_index |
| Internal: pivot slot in the tree's reordered point buffer. | |
| std::size_t | m_dim |
Internal: split dimension. Leaf: point count packed at m_index. | |
| KDTreeNode * | m_left |
Left child, or nullptr on a leaf. | |
| KDTreeNode * | m_right |
Right child, or nullptr on a leaf. | |
| std::uint32_t | m_id |
| Monotonic identifier assigned at construction; keys into the owning tree's per-node bounds buffer. | |
Node in a KDTree, sharing the same struct shape between internals and leaves.
Internal node: m_index is the pivot's slot in the owning tree's reordered point buffer, m_dim is the split dimension, and m_left / m_right point to children.
Leaf node: m_index is the start offset into the same reordered buffer, m_dim is the count of points packed at that offset, and m_left == m_right == nullptr.
The leaf-vs-internal test is m_left == nullptr && m_right == nullptr. The struct is declared outside KDTree so the allocator can bump-allocate fixed-size slots without seeing the tree's template parameters.
| std::size_t clustering::KDTreeNode::m_dim |
| std::uint32_t clustering::KDTreeNode::m_id |
Monotonic identifier assigned at construction; keys into the owning tree's per-node bounds buffer.
Stays valid for the tree's lifetime and never collides across nodes of the same tree. Four bytes is enough: KDTree's node budget never exceeds N, which the HDBSCAN contract caps at the signed 32-bit range.
| std::size_t clustering::KDTreeNode::m_index |
| KDTreeNode* clustering::KDTreeNode::m_left |
| KDTreeNode* clustering::KDTreeNode::m_right |