CLUEstering
High-performance density-based weighted clustering library developed at CERN
|
The Clusterer class is the interface for running the clustering algorithm. It provides methods to set up the clustering parameters, initializes the internal buffers and runs the clustering algorithm on host or device points. More...
#include <Clusterer.hpp>
Public Member Functions | |
Clusterer (float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128) | |
Constuct a Clusterer object. | |
Clusterer (Queue &queue, float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128) | |
Constuct a Clusterer object. | |
Clusterer (Queue &queue, TilesDevice *tile_buffer, float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128) | |
Constuct a Clusterer object. | |
void | setParameters (float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128) |
Set the parameters for the clustering algorithm. | |
template<concepts::convolutional_kernel Kernel = FlatKernel> | |
void | make_clusters (Queue &queue, PointsHost &h_points, const Kernel &kernel=FlatKernel{.5f}, std::size_t block_size=256) |
Construct the clusters from host points. | |
template<concepts::convolutional_kernel Kernel = FlatKernel> | |
void | make_clusters (PointsHost &h_points, const Kernel &kernel=FlatKernel{.5f}, std::size_t block_size=256) |
Construct the clusters from host points. | |
template<concepts::convolutional_kernel Kernel = FlatKernel> | |
void | make_clusters (Queue &queue, PointsHost &h_points, PointsDevice &dev_points, const Kernel &kernel=FlatKernel{.5f}, std::size_t block_size=256) |
Construct the clusters from host and device points. | |
template<concepts::convolutional_kernel Kernel = FlatKernel> | |
void | make_clusters (PointsHost &h_points, PointsDevice &dev_points, const Kernel &kernel=FlatKernel{.5f}, std::size_t block_size=256) |
Construct the clusters from host and device points. | |
template<concepts::convolutional_kernel Kernel = FlatKernel> | |
void | make_clusters (Queue &queue, PointsDevice &dev_points, const Kernel &kernel=FlatKernel{.5f}, std::size_t block_size=256) |
Construct the clusters from device points. | |
void | setWrappedCoordinates (const std::array< uint8_t, Ndim > &wrappedCoordinates) |
Specify which coordinates are periodic. | |
void | setWrappedCoordinates (std::array< uint8_t, Ndim > &&wrappedCoordinates) |
Specify which coordinates are periodic. | |
template<typename... TArgs> | |
void | setWrappedCoordinates (TArgs... wrappedCoordinates) |
Specify which coordinates are periodic. | |
std::vector< std::vector< int > > | getClusters (const PointsHost &h_points) |
Get the clusters from the host points. | |
The Clusterer class is the interface for running the clustering algorithm. It provides methods to set up the clustering parameters, initializes the internal buffers and runs the clustering algorithm on host or device points.
Ndim | The number of dimensions of the points to cluster |
clue::Clusterer< Ndim >::Clusterer | ( | float | dc, |
float | rhoc, | ||
float | dm, | ||
float | seed_dc = -1.f, | ||
int | pPBin = 128 ) |
Constuct a Clusterer object.
dc | Distance threshold for clustering |
rhoc | Density threshold for clustering |
dm | Minimum distance between clusters |
seed_dc | Distance threshold for seed points, if -1.f, dc is used |
pPBin | Number of points per bin, used to determine the tile size |
clue::Clusterer< Ndim >::Clusterer | ( | Queue & | queue, |
float | dc, | ||
float | rhoc, | ||
float | dm, | ||
float | seed_dc = -1.f, | ||
int | pPBin = 128 ) |
Constuct a Clusterer object.
queue | The queue to use for the device operations |
dc | Distance threshold for clustering |
rhoc | Density threshold for clustering |
dm | Minimum distance between clusters |
seed_dc | Distance threshold for seed points, if the default value -1.f, dc is used |
pPBin | Number of points per bin, used to determine the tile size |
clue::Clusterer< Ndim >::Clusterer | ( | Queue & | queue, |
TilesDevice * | tile_buffer, | ||
float | dc, | ||
float | rhoc, | ||
float | dm, | ||
float | seed_dc = -1.f, | ||
int | pPBin = 128 ) |
Constuct a Clusterer object.
queue | The queue to use for the device operations |
tile_buffer | Buffer to pre-allocated tiles |
dc | Distance threshold for clustering |
rhoc | Density threshold for clustering |
dm | Minimum distance between clusters |
seed_dc | Distance threshold for seed points, if the default value -1.f, dc is used |
pPBin | Number of points per bin, used to determine the tile size |
std::vector< std::vector< int > > clue::Clusterer< Ndim >::getClusters | ( | const PointsHost & | h_points | ) |
Get the clusters from the host points.
h_points | Host points to cluster |
void clue::Clusterer< Ndim >::make_clusters | ( | PointsHost & | h_points, |
const Kernel & | kernel = FlatKernel{.5f}, | ||
std::size_t | block_size = 256 ) |
Construct the clusters from host points.
h_points | Host points to cluster |
kernel | The convolutional kernel to use for computing the local densities, default is FlatKernel with height 0.5 |
block_size | The size of the blocks to use for clustering, default is 256 |
void clue::Clusterer< Ndim >::make_clusters | ( | PointsHost & | h_points, |
PointsDevice & | dev_points, | ||
const Kernel & | kernel = FlatKernel{.5f}, | ||
std::size_t | block_size = 256 ) |
Construct the clusters from host and device points.
h_points | Host points to cluster |
dev_points | Device points to cluster |
kernel | The convolutional kernel to use for computing the local densities, default is FlatKernel with height 0.5 |
block_size | The size of the blocks to use for clustering, default is 256 |
void clue::Clusterer< Ndim >::make_clusters | ( | Queue & | queue, |
PointsDevice & | dev_points, | ||
const Kernel & | kernel = FlatKernel{.5f}, | ||
std::size_t | block_size = 256 ) |
Construct the clusters from device points.
queue | The queue to use for the device operations |
dev_points | Device points to cluster |
kernel | The convolutional kernel to use for computing the local densities, default is FlatKernel with height 0.5 |
block_size | The size of the blocks to use for clustering, default is 256 |
void clue::Clusterer< Ndim >::make_clusters | ( | Queue & | queue, |
PointsHost & | h_points, | ||
const Kernel & | kernel = FlatKernel{.5f}, | ||
std::size_t | block_size = 256 ) |
Construct the clusters from host points.
queue | The queue to use for the device operations |
h_points | Host points to cluster |
kernel | The convolutional kernel to use for computing the local densities, default is FlatKernel with height 0.5 |
block_size | The size of the blocks to use for clustering, default is 256 |
void clue::Clusterer< Ndim >::make_clusters | ( | Queue & | queue, |
PointsHost & | h_points, | ||
PointsDevice & | dev_points, | ||
const Kernel & | kernel = FlatKernel{.5f}, | ||
std::size_t | block_size = 256 ) |
Construct the clusters from host and device points.
queue | The queue to use for the device operations |
h_points | Host points to cluster |
dev_points | Device points to cluster |
kernel | The convolutional kernel to use for computing the local densities, default is FlatKernel with height 0.5 |
block_size | The size of the blocks to use for clustering, default is 256 |
void clue::Clusterer< Ndim >::setParameters | ( | float | dc, |
float | rhoc, | ||
float | dm, | ||
float | seed_dc = -1.f, | ||
int | pPBin = 128 ) |
Set the parameters for the clustering algorithm.
dc | Distance threshold for clustering |
rhoc | Density threshold for clustering |
dm | Minimum distance between clusters |
seed_dc | Distance threshold for seed points, if the defualt value -1.f, dc is used |
pPBin | Number of points per bin, used to determine the tile size |
void clue::Clusterer< Ndim >::setWrappedCoordinates | ( | const std::array< uint8_t, Ndim > & | wrappedCoordinates | ) |
Specify which coordinates are periodic.
wrappedCoordinates | Array of wrapped coordinates, where 1 means periodic and 0 means non-periodic |
void clue::Clusterer< Ndim >::setWrappedCoordinates | ( | std::array< uint8_t, Ndim > && | wrappedCoordinates | ) |
Specify which coordinates are periodic.
wrappedCoordinates | Array of wrapped coordinates, where 1 means periodic and 0 means non-periodic |
void clue::Clusterer< Ndim >::setWrappedCoordinates | ( | TArgs... | wrappedCoordinates | ) |
Specify which coordinates are periodic.
TArgs | Types of the wrapped coordinates, should be convertible to uint8_t |
wrappedCoordinates | Wrapped coordinates, where 1 means periodic and 0 means non-periodic |