mlpack  1.0.12
allow_empty_clusters.hpp
Go to the documentation of this file.
1 
15 #ifndef __MLPACK_METHODS_KMEANS_ALLOW_EMPTY_CLUSTERS_HPP
16 #define __MLPACK_METHODS_KMEANS_ALLOW_EMPTY_CLUSTERS_HPP
17 
18 #include <mlpack/core.hpp>
19 
20 namespace mlpack {
21 namespace kmeans {
22 
28 {
29  public:
32 
46  template<typename MatType>
47  static size_t EmptyCluster(const MatType& /* data */,
48  const size_t /* emptyCluster */,
49  const MatType& /* centroids */,
50  arma::Col<size_t>& /* clusterCounts */,
51  arma::Col<size_t>& /* assignments */)
52  {
53  // Empty clusters are okay! Do nothing.
54  return 0;
55  }
56 };
57 
58 }; // namespace kmeans
59 }; // namespace mlpack
60 
61 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
static size_t EmptyCluster(const MatType &, const size_t, const MatType &, arma::Col< size_t > &, arma::Col< size_t > &)
This function does nothing.
AllowEmptyClusters()
Default constructor required by EmptyClusterPolicy policy.
Policy which allows K-Means to create empty clusters without any error being reported.