kmeans
A C++ library for k-means
Loading...
Searching...
No Matches
Initialize.hpp
Go to the documentation of this file.
1#ifndef KMEANS_INITIALIZE_HPP
2#define KMEANS_INITIALIZE_HPP
3
4#include "Matrix.hpp"
5
6#include <type_traits>
7
13namespace kmeans {
14
26template<typename Index_, typename Data_, typename Cluster_, typename Float_, class Matrix_ = Matrix<Data_, Index_> >
28public:
32 Initialize() = default;
33 Initialize(Initialize&&) = default;
34 Initialize(const Initialize&) = default;
35 Initialize& operator=(Initialize&&) = default;
36 Initialize& operator=(const Initialize&) = default;
37 virtual ~Initialize() = default;
38
39 static_assert(std::is_same<decltype(std::declval<Matrix_>().num_observations()), Index_>::value);
40 static_assert(std::is_same<typename std::remove_pointer<decltype(std::declval<Matrix_>().new_extractor()->get_observation(0))>::type, const Data_>::value);
56 virtual Cluster_ run(const Matrix_& data, Cluster_ num_centers, Float_* centers) const = 0;
57};
58
59}
60
61#endif
Interface for matrix inputs.
Interface for k-means initialization algorithms.
Definition Initialize.hpp:27
virtual Cluster_ run(const Matrix_ &data, Cluster_ num_centers, Float_ *centers) const =0
Namespace for k-means clustering.
Definition compute_wcss.hpp:12