Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
lloyd.h
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4#include <cstddef>
5#include <cstdint>
6
9
10namespace clustering::kmeans {
11
22template <class A, class T>
24 std::default_initializable<A> &&
25 requires(A &algo, const NDArray<T, 2> &X, NDArray<T, 2> &centroids, std::size_t k,
26 std::size_t maxIter, T tol, math::Pool pool, NDArray<std::int32_t, 1> &labels,
27 double &inertia, std::size_t &nIter, bool &converged) {
28 { algo.run(X, centroids, k, maxIter, tol, pool, labels, inertia, nIter, converged) };
29 };
30
31} // namespace clustering::kmeans
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