Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
distance.h File Reference
#include <cmath>
#include <cstddef>
#include <type_traits>
#include <utility>
#include "clustering/ndarray.h"
#include "clustering/math/detail/distance_avx2.h"
Include dependency graph for distance.h:

Go to the source code of this file.

Classes

struct  clustering::math::distance::SqEuclideanTag
 Tag selecting the squared Euclidean metric. More...
struct  clustering::math::distance::CosineTag
 Tag selecting the cosine distance metric (1 - cos(angle)). More...
struct  clustering::math::distance::ManhattanTag
 Tag selecting the Manhattan (L1) metric: sum of absolute differences. More...

Namespaces

namespace  clustering
namespace  clustering::math
namespace  clustering::math::distance
namespace  clustering::math::distance::detail

Functions

template<class T, Layout LA, Layout LB>
clustering::math::distance::tag_invoke (const detail::PointwiseSqFn &, SqEuclideanTag, const NDArray< T, 1, LA > &a, const NDArray< T, 1, LB > &b) noexcept
 Squared Euclidean distance between two rank-1 NDArrays.
template<class T, Layout LA, Layout LB>
clustering::math::distance::tag_invoke (const detail::PointwiseSqFn &, ManhattanTag, const NDArray< T, 1, LA > &a, const NDArray< T, 1, LB > &b) noexcept
 Manhattan (L1) distance between two rank-1 NDArrays.
template<class T, Layout LA, Layout LB>
clustering::math::distance::tag_invoke (const detail::PointwiseSqFn &, CosineTag, const NDArray< T, 1, LA > &a, const NDArray< T, 1, LB > &b) noexcept
 Cosine distance between two rank-1 NDArrays.

Variables

constexpr detail::PointwiseSqFn clustering::math::distance::pointwiseSq {}
 Customization-point object for pairwise squared distances between two rank-1 arrays.