31 [[maybe_unused]]
const bool use_kmeansplusplus_method,
const size_t nPoints,
32 const size_t k,
const size_t dims,
const double* points,
33 const size_t attempts,
double* out_center,
int* out_assignments)
36 nPoints, k, dims, const_cast<double*>(points), attempts, out_center,
42 [[maybe_unused]]
const bool use_kmeansplusplus_method,
const size_t nPoints,
43 const size_t k,
const size_t dims,
const float* points,
44 const size_t attempts,
float* out_center,
int* out_assignments)
46 std::vector<double> points_d(nPoints * dims);
47 std::vector<double> centers_d(k * dims);
49 for (
size_t i = 0; i < nPoints * dims; i++) points_d[i] =
double(points[i]);
52 nPoints, k, dims, &points_d[0], attempts, ¢ers_d[0],
57 for (
size_t i = 0; i < k * dims; i++)
58 out_center[i] =
float(centers_d[i]);
Scalar RunKMeans(int n, int k, int d, Scalar *points, int attempts, Scalar *ret_centers, int *ret_assignment)
double internal_kmeans< float >([[maybe_unused]] const bool use_kmeansplusplus_method, const size_t nPoints, const size_t k, const size_t dims, const float *points, const size_t attempts, float *out_center, int *out_assignments)
double internal_kmeans< double >([[maybe_unused]] const bool use_kmeansplusplus_method, const size_t nPoints, const size_t k, const size_t dims, const double *points, const size_t attempts, double *out_center, int *out_assignments)
This base provides a set of functions for maths stuff.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.