Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
clustering::kmeans::LloydStrategy Concept Reference

Contract for the Lloyd driver that KMeans<T> delegates to. More...

#include <clustering/kmeans/policy/lloyd.h>

Concept definition

template<class A, class T>
concept LloydStrategy =
std::default_initializable<A> &&
requires(A &algo, const NDArray<T, 2> &X, NDArray<T, 2> &centroids, std::size_t k,
std::size_t maxIter, T tol, math::Pool pool, NDArray<std::int32_t, 1> &labels,
double &inertia, std::size_t &nIter, bool &converged) {
{ algo.run(X, centroids, k, maxIter, tol, pool, labels, inertia, nIter, converged) };
}
Represents a multidimensional array (NDArray) of a fixed number of dimensions N and element type T.
Definition ndarray.h:136
Contract for the Lloyd driver that KMeans<T> delegates to.
Definition lloyd.h:23
Thin injection wrapper around a BS::light_thread_pool.
Definition thread.h:63

Detailed Description

Contract for the Lloyd driver that KMeans<T> delegates to.

A LloydStrategy owns its private scratch, takes seeded centroids as input, runs the iteration loop, and writes final labels, inertia, iteration count, and convergence state into caller-provided output slots.

Template Parameters
ACandidate Lloyd policy type.
TElement type of the point cloud.

Definition at line 23 of file lloyd.h.