Template Class SimpleKmeans

Class Documentation

template<class Feature, class Distance = distance::L2<Feature>, class FeatureAllocator = typename DefaultAllocator<Feature>::type>
class loop_closure::SimpleKmeans

Public Types

typedef Distance::result_type SquaredDistanceType
typedef std::shared_ptr<std::vector<Feature, FeatureAllocator>> Centers
typedef std::function<void(const std::vector<Feature*>&, size_t, Distance, int random_seed, std::vector<Feature, FeatureAllocator>*)> Initializer

Public Functions

SimpleKmeans(const Feature &zero = Feature(), const Distance &d = Distance())
inline void SetInitMethod(const Initializer &init)
inline size_t GetMaxIterations() const
inline void SetMaxIterations(size_t iters)
inline size_t GetRestarts() const
inline void SetRestarts(size_t restarts)
SquaredDistanceType Cluster(const std::vector<Feature, FeatureAllocator> &features, size_t k, int random_seed, std::vector<unsigned int> *const membership, Centers *const centers) const
SquaredDistanceType ClusterPointers(const std::vector<Feature*> &features, size_t k, int random_seed, Centers *const centers, std::vector<unsigned int> *const membership) const