kmeans
A C++ library for k-means
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 "Details.hpp"
5#include "Matrix.hpp"
6
12namespace kmeans {
13
25template<typename Index_, typename Data_, typename Cluster_, typename Float_, typename Matrix_ = Matrix<Index_, Data_> >
26class Refine {
27public:
31 Refine() = default;
32 Refine(Refine&&) = default;
33 Refine(const Refine&) = default;
34 Refine& operator=(Refine&&) = default;
35 Refine& operator=(const Refine&) = default;
36 virtual ~Refine() = default;
37
38 static_assert(std::is_same<decltype(std::declval<Matrix_>().num_observations()), Index_>::value);
39 static_assert(std::is_same<typename std::remove_pointer<decltype(std::declval<Matrix_>().new_extractor()->get_observation(0))>::type, const Data_>::value);
57 virtual Details<Index_> run(const Matrix_& data, Cluster_ num_centers, Float_* centers, Cluster_* clusters) const = 0;
58};
59
60}
61
62#endif
Report detailed clustering statistics.
Interface for matrix inputs.
Interface for k-means refinement algorithms.
Definition Refine.hpp:26
virtual Details< Index_ > run(const Matrix_ &data, Cluster_ num_centers, Float_ *centers, Cluster_ *clusters) const =0
Namespace for k-means clustering.
Definition compute_wcss.hpp:12
Additional statistics from the k-means algorithm.
Definition Details.hpp:20