kmeans
k-means clustering in C++
Loading...
Searching...
No Matches
parallelize.hpp
Go to the documentation of this file.
1#ifndef KMEANS_PARALLELIZE_HPP
2#define KMEANS_PARALLELIZE_HPP
3
9#ifndef KMEANS_CUSTOM_PARALLEL
10#include "subpar/subpar.hpp"
11#endif
12
13namespace kmeans {
14
29template<typename Task_, class Run_>
30int parallelize(const int num_workers, const Task_ num_tasks, Run_ run_task_range) {
31#ifndef KMEANS_CUSTOM_PARALLEL
32 // Do NOT make this no-throw as we don't know whether Matrix_::get_observation() might throw.
33 return subpar::parallelize_range(num_workers, num_tasks, std::move(run_task_range));
34#else
35 return KMEANS_CUSTOM_PARALLEL(num_workers, num_tasks, run_task_range);
36#endif
37}
38
39}
40
41#endif
Perform k-means clustering.
Definition compute_wcss.hpp:16
int parallelize(const int num_workers, const Task_ num_tasks, Run_ run_task_range)
Definition parallelize.hpp:30
int parallelize_range(int num_workers, const Task_ num_tasks, const Run_ run_task_range)