Skip to content

Commit 8888fe7

Browse files
authored
Provide Clusterer method for setting parameters (#172)
1 parent 4cb875d commit 8888fe7

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

include/CLUEstering/core/Clusterer.hpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace clue {
101101
/// @param dc Distance threshold for clustering
102102
/// @param rhoc Density threshold for clustering
103103
/// @param dm Minimum distance between clusters
104-
/// @param seed_dc Distance threshold for seed points, if -1.f, dc is used
104+
/// @param seed_dc Distance threshold for seed points, if the default value -1.f, dc is used
105105
/// @param pPBin Number of points per bin, used to determine the tile size
106106
Clusterer(Queue& queue, float dc, float rhoc, float dm, float seed_dc = -1.f, int pPBin = 128);
107107
/// @brief Constuct a Clusterer object
@@ -111,7 +111,7 @@ namespace clue {
111111
/// @param dc Distance threshold for clustering
112112
/// @param rhoc Density threshold for clustering
113113
/// @param dm Minimum distance between clusters
114-
/// @param seed_dc Distance threshold for seed points, if -1.f, dc is used
114+
/// @param seed_dc Distance threshold for seed points, if the default value -1.f, dc is used
115115
/// @param pPBin Number of points per bin, used to determine the tile size
116116
Clusterer(Queue& queue,
117117
TilesDevice* tile_buffer,
@@ -121,6 +121,15 @@ namespace clue {
121121
float seed_dc = -1.f,
122122
int pPBin = 128);
123123

124+
/// @brief Set the parameters for the clustering algorithm
125+
///
126+
/// @param dc Distance threshold for clustering
127+
/// @param rhoc Density threshold for clustering
128+
/// @param dm Minimum distance between clusters
129+
/// @param seed_dc Distance threshold for seed points, if the defualt value -1.f, dc is used
130+
/// @param pPBin Number of points per bin, used to determine the tile size
131+
void setParameters(float dc, float rhoc, float dm, float seed_dc = -1.f, int pPBin = 128);
132+
124133
/// @brief Construct the clusters from host points
125134
///
126135
/// @param h_points Host points to cluster

include/CLUEstering/core/detail/Clusterer.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ namespace clue {
6969
init_device(queue, tile_buffer);
7070
}
7171

72+
template <uint8_t Ndim>
73+
void Clusterer<Ndim>::setParameters(float dc, float rhoc, float dm, float seed_dc, int pPBin) {
74+
m_dc = dc;
75+
m_seed_dc = seed_dc < 0.f ? dc : seed_dc;
76+
m_rhoc = rhoc;
77+
m_dm = dm;
78+
m_pointsPerTile = pPBin;
79+
}
80+
7281
template <uint8_t Ndim>
7382
template <typename KernelType>
7483
inline void Clusterer<Ndim>::make_clusters(PointsHost& h_points,

0 commit comments

Comments
 (0)