kmeans
k-means clustering in C++
Loading...
Searching...
No Matches
Refine.hpp
Go to the documentation of this file.
1#ifndef KMEANS_REFINE_HPP
2#define KMEANS_REFINE_HPP
3
4#include <utility>
5#include <type_traits>
6
7#include "Details.hpp"
8#include "Matrix.hpp"
9#include "utils.hpp"
10
16namespace kmeans {
17
29template<typename Index_, typename Data_, typename Cluster_, typename Float_, typename Matrix_ = Matrix<Index_, Data_> >
30class Refine {
31public:
35 Refine() = default;
36 Refine(Refine&&) = default;
37 Refine(const Refine&) = default;
38 Refine& operator=(Refine&&) = default;
39 Refine& operator=(const Refine&) = default;
40 virtual ~Refine() = default;
41
42 static_assert(std::is_same<decltype(I(std::declval<Matrix_>().num_observations())), Index_>::value);
43 static_assert(std::is_same<decltype(I(*(std::declval<Matrix_>().new_extractor()->get_observation(0)))), Data_>::value);
61 virtual Details<Index_> run(const Matrix_& data, Cluster_ num_centers, Float_* centers, Cluster_* clusters) const = 0;
62};
63
64}
65
66#endif
Report detailed clustering statistics.
Interface for matrix inputs.
Interface for k-means refinement algorithms.
Definition Refine.hpp:30
virtual Details< Index_ > run(const Matrix_ &data, Cluster_ num_centers, Float_ *centers, Cluster_ *clusters) const =0
Perform k-means clustering.
Definition compute_wcss.hpp:16
Additional statistics from the k-means algorithm.
Definition Details.hpp:20