Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
greedy_kmpp_seeder.h File Reference
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <type_traits>
#include <vector>
#include "clustering/always_assert.h"
#include "clustering/math/detail/avx2_helpers.h"
#include "clustering/math/detail/gemm_outer.h"
#include "clustering/math/detail/matrix_desc.h"
#include "clustering/math/pairwise.h"
#include "clustering/math/rng.h"
#include "clustering/math/thread.h"
#include "clustering/ndarray.h"
#include <immintrin.h>
#include "clustering/math/detail/kmpp_score_avx2.h"
Include dependency graph for greedy_kmpp_seeder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clustering::kmeans::GreedyKmppSeeder< T >
 Greedy k-means++ seeder. More...

Namespaces

namespace  clustering
namespace  clustering::kmeans
namespace  clustering::kmeans::detail

Functions

std::size_t clustering::kmeans::detail::greedyKmppLocalTrials (std::size_t k) noexcept
 Compute the local-trials count used by greedy k-means++.
constexpr std::size_t clustering::kmeans::detail::greedyKmppTransposedWidth (std::size_t L) noexcept
 Round L up to the nearest multiple of 8 used by the transposed scoring layout.
template<std::size_t B>
void clustering::kmeans::detail::sqEuclideanRowToBatchAvx2Fixed (const float *x, const float *candData, std::size_t d, float *out) noexcept
 Compile-time batched scoring kernel: stream x once across B parallel AVX2 accumulators to compute B squared distances against candData rows.
template<std::size_t B>
void clustering::kmeans::detail::sqEuclideanRowToBatchAvx2Fixed (const double *x, const double *candData, std::size_t d, double *out) noexcept
template<class T>
void clustering::kmeans::detail::sqEuclideanRowToBatchAvx2 (const T *x, const T *candData, std::size_t L, std::size_t d, T *out) noexcept
 Compute L squared Euclidean distances against an (L, d) row-batched candidate layout in a single streaming pass over the x row.
void clustering::kmeans::detail::sqEuclideanRowAgainst8Transposed (const float *x, const float *candData, std::size_t d, float *out) noexcept
 Compute L squared distances against an (d, 8) transposed candidate layout with one streaming pass over the x row.
void clustering::kmeans::detail::sqEuclideanRowAgainst16Transposed (const float *x, const float *candData, std::size_t d, float *out) noexcept
 Compute two 8-way squared distance slabs against an (d, 16) transposed candidate layout in one streaming pass over the x row.
void clustering::kmeans::detail::sqEuclideanRowAgainst8TransposedStrided (const float *x, const float *candData, std::size_t d, std::size_t rowStride, float *out) noexcept
 Compute one 8-way squared distance slab against an (d, W) transposed candidate layout with an explicit row stride W.
template<class T>
void clustering::kmeans::detail::sqEuclideanRowToBatch (const T *x, const T *candData, std::size_t L, std::size_t d, T *out) noexcept
 Squared Euclidean distance from one x row to a batch of L candidate rows.