Cluster centroids¶
Provides functions for computing the centroids of clusters.
- Authors
Simone Balducci, Felice Pantaleo, Marco Rovere, Wahid Redjeb, Aurora Perego, Francesco Giacomini
-
namespace clue¶
Typedefs¶
-
template<std::size_t Ndim, std::floating_point TData = float>
using Centroid = std::array<TData, Ndim>¶ Type alias for a centroid in Ndim dimensions.
Functions¶
-
template<std::size_t Ndim, std::floating_point TData = float>
inline Centroid<Ndim, TData> cluster_centroid(const clue::PointsHost<Ndim, TData> &points, std::size_t cluster_id)¶ Compute the centroid of a specific cluster from the given Points.
- Template Parameters:¶
- Parameters:¶
- const clue::PointsHost<Ndim, TData> &points¶
The PointsHost object containing the points
- std::size_t cluster_id¶
The ID of the cluster for which to compute the centroid
- Returns:¶
The centroid of the specified cluster as an array of floating points
-
template<std::size_t Ndim, std::floating_point TData = float>
inline Centroids<Ndim, TData> cluster_centroids(const clue::PointsHost<Ndim, TData> &points)¶ Compute the centroids of all clusters from the given Points.
- Template Parameters:¶
- Parameters:¶
- const clue::PointsHost<Ndim, TData> &points¶
The PointsHost object containing the points
- Returns:¶
A vector of centroids, one for each cluster
-
template<std::size_t Ndim, std::floating_point TData = float>