Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
reduce.h File Reference
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <span>
#include <utility>
#include <vector>
#include "clustering/ndarray.h"
Include dependency graph for reduce.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  clustering
namespace  clustering::math

Functions

template<class T, Layout L>
clustering::math::sum (const NDArray< T, 1, L > &x) noexcept
 Naive single-pass sum of a rank-1 array.
template<class T, Layout L>
std::size_t clustering::math::argmin (const NDArray< T, 1, L > &x) noexcept
 Index of the first minimum in a rank-1 array.
template<class T, Layout L>
std::size_t clustering::math::argmax (const NDArray< T, 1, L > &x) noexcept
 Index of the first maximum in a rank-1 array.
template<class T, Layout L>
void clustering::math::topk (const NDArray< T, 1, L > &x, std::size_t k, std::span< std::size_t > outIdx) noexcept
 Indices of the top-k largest values, written in descending value order.