CLUEstering
High-performance density-based weighted clustering library developed at CERN
Loading...
Searching...
No Matches
clue::Clusterer< Ndim > Class Template Reference

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.
 
template<typename KernelType>
void make_clusters (PointsHost &h_points, const KernelType &kernel, Queue &queue, std::size_t block_size)
 Construct the clusters from host points.
 
template<typename KernelType>
void make_clusters (PointsHost &h_points, const KernelType &kernel, std::size_t block_size)
 Construct the clusters from host points.
 
template<typename KernelType>
void make_clusters (PointsHost &h_points, PointsDevice &dev_points, const KernelType &kernel, Queue &queue, std::size_t block_size)
 Construct the clusters from host and device points.
 
template<typename KernelType>
void make_clusters (PointsHost &h_points, PointsDevice &dev_points, const KernelType &kernel, std::size_t block_size)
 Construct the clusters from host and device points.
 
template<typename KernelType>
void make_clusters (PointsDevice &dev_points, const KernelType &kernel, Queue &queue, std::size_t block_size)
 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.
 

Detailed Description

template<uint8_t Ndim>
class clue::Clusterer< Ndim >

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.

Template Parameters
NdimThe number of dimensions of the points to cluster

Constructor & Destructor Documentation

◆ Clusterer() [1/3]

template<uint8_t Ndim>
clue::Clusterer< Ndim >::Clusterer ( float dc,
float rhoc,
float dm,
float seed_dc = -1.f,
int pPBin = 128 )

Constuct a Clusterer object.

Parameters
dcDistance threshold for clustering
rhocDensity threshold for clustering
dmMinimum distance between clusters
seed_dcDistance threshold for seed points, if -1.f, dc is used
pPBinNumber of points per bin, used to determine the tile size

◆ Clusterer() [2/3]

template<uint8_t Ndim>
clue::Clusterer< Ndim >::Clusterer ( Queue & queue,
float dc,
float rhoc,
float dm,
float seed_dc = -1.f,
int pPBin = 128 )

Constuct a Clusterer object.

Parameters
queueThe queue to use for the device operations
dcDistance threshold for clustering
rhocDensity threshold for clustering
dmMinimum distance between clusters
seed_dcDistance threshold for seed points, if -1.f, dc is used
pPBinNumber of points per bin, used to determine the tile size

◆ Clusterer() [3/3]

template<uint8_t Ndim>
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.

Parameters
queueThe queue to use for the device operations
tile_bufferBuffer to pre-allocated tiles
dcDistance threshold for clustering
rhocDensity threshold for clustering
dmMinimum distance between clusters
seed_dcDistance threshold for seed points, if -1.f, dc is used
pPBinNumber of points per bin, used to determine the tile size

Member Function Documentation

◆ getClusters()

template<uint8_t Ndim>
std::vector< std::vector< int > > clue::Clusterer< Ndim >::getClusters ( const PointsHost & h_points)

Get the clusters from the host points.

Parameters
h_pointsHost points to cluster
Returns
A vector of clusters, where each cluster is a vector of point indices

◆ make_clusters() [1/5]

template<uint8_t Ndim>
template<typename KernelType>
void clue::Clusterer< Ndim >::make_clusters ( PointsDevice & dev_points,
const KernelType & kernel,
Queue & queue,
std::size_t block_size )

Construct the clusters from device points.

Parameters
dev_pointsDevice points to cluster
kernelThe convolutional kernel to use for clustering
queueThe queue to use for the device operations
block_sizeThe size of the blocks to use for clustering

◆ make_clusters() [2/5]

template<uint8_t Ndim>
template<typename KernelType>
void clue::Clusterer< Ndim >::make_clusters ( PointsHost & h_points,
const KernelType & kernel,
Queue & queue,
std::size_t block_size )

Construct the clusters from host points.

Parameters
h_pointsHost points to cluster
kernelThe convolutional kernel to use for clustering
queueThe queue to use for the device operations
block_sizeThe size of the blocks to use for clustering

◆ make_clusters() [3/5]

template<uint8_t Ndim>
template<typename KernelType>
void clue::Clusterer< Ndim >::make_clusters ( PointsHost & h_points,
const KernelType & kernel,
std::size_t block_size )

Construct the clusters from host points.

Parameters
h_pointsHost points to cluster
kernelThe convolutional kernel to use for clustering
block_sizeThe size of the blocks to use for clustering

◆ make_clusters() [4/5]

template<uint8_t Ndim>
template<typename KernelType>
void clue::Clusterer< Ndim >::make_clusters ( PointsHost & h_points,
PointsDevice & dev_points,
const KernelType & kernel,
Queue & queue,
std::size_t block_size )

Construct the clusters from host and device points.

Parameters
h_pointsHost points to cluster
dev_pointsDevice points to cluster
kernelThe convolutional kernel to use for clustering
queueThe queue to use for the device operations
block_sizeThe size of the blocks to use for clustering

◆ make_clusters() [5/5]

template<uint8_t Ndim>
template<typename KernelType>
void clue::Clusterer< Ndim >::make_clusters ( PointsHost & h_points,
PointsDevice & dev_points,
const KernelType & kernel,
std::size_t block_size )

Construct the clusters from host and device points.

Parameters
h_pointsHost points to cluster
dev_pointsDevice points to cluster
kernelThe convolutional kernel to use for clustering
block_sizeThe size of the blocks to use for clustering

◆ setWrappedCoordinates() [1/3]

template<uint8_t Ndim>
void clue::Clusterer< Ndim >::setWrappedCoordinates ( const std::array< uint8_t, Ndim > & wrappedCoordinates)

Specify which coordinates are periodic.

Parameters
wrappedCoordinatesArray of wrapped coordinates, where 1 means periodic and 0 means non-periodic

◆ setWrappedCoordinates() [2/3]

template<uint8_t Ndim>
void clue::Clusterer< Ndim >::setWrappedCoordinates ( std::array< uint8_t, Ndim > && wrappedCoordinates)

Specify which coordinates are periodic.

Parameters
wrappedCoordinatesArray of wrapped coordinates, where 1 means periodic and 0 means non-periodic

◆ setWrappedCoordinates() [3/3]

template<uint8_t Ndim>
template<typename... TArgs>
void clue::Clusterer< Ndim >::setWrappedCoordinates ( TArgs... wrappedCoordinates)

Specify which coordinates are periodic.

Template Parameters
TArgsTypes of the wrapped coordinates, should be convertible to uint8_t
Parameters
wrappedCoordinatesWrapped coordinates, where 1 means periodic and 0 means non-periodic

The documentation for this class was generated from the following file: