A library for working with phylogenetic and population genetic data.
v0.32.0
EuclideanKmeans Class Reference

#include <genesis/utils/math/euclidean_kmeans.hpp>

Inherits Kmeans< std::vector< double > >.

Detailed Description

Definition at line 59 of file euclidean_kmeans.hpp.

Public Member Functions

 EuclideanKmeans (EuclideanKmeans &&)=default
 
 EuclideanKmeans (EuclideanKmeans const &)=default
 
 EuclideanKmeans (size_t dimensions)
 
virtual ~EuclideanKmeans () override=default
 
EuclideanKmeansoperator= (EuclideanKmeans &&)=default
 
EuclideanKmeansoperator= (EuclideanKmeans const &)=default
 
- Public Member Functions inherited from Kmeans< std::vector< double > >
 Kmeans ()=default
 
 Kmeans (Kmeans &&)=default
 
 Kmeans (Kmeans const &)=default
 
virtual ~Kmeans ()=default
 
std::vector< size_t > const & assignments () const
 
Kmeansassignments (std::vector< size_t > const &value)
 
std::vector< std::vector< double > > const & centroids () const
 
Kmeanscentroids (std::vector< std::vector< double > > const &value)
 
void clear ()
 
KmeansClusteringInfo cluster_info (std::vector< std::vector< double > > const &data) const
 
std::vector< size_t > cluster_sizes () const
 
KmeansInitializationStrategy initialization_strategy () const
 
Kmeansinitialization_strategy (KmeansInitializationStrategy value)
 
size_t max_iterations () const
 
Kmeansmax_iterations (size_t value)
 
Kmeansoperator= (Kmeans &&)=default
 
Kmeansoperator= (Kmeans const &)=default
 
size_t run (std::vector< std::vector< double > > const &data, size_t const k)
 

Public Types

using Point = std::vector< double >
 
- Public Types inherited from Kmeans< std::vector< double > >
using value_type = std::vector< double >
 

Additional Inherited Members

- Public Attributes inherited from Kmeans< std::vector< double > >
std::function< void(void)> report_initialization
 
std::function< void(size_t i)> report_iteration
 
- Protected Member Functions inherited from Kmeans< std::vector< double > >
virtual bool assign_to_centroids (std::vector< std::vector< double > > const &data, std::vector< std::vector< double > > const &centroids, std::vector< size_t > &assignments)
 
virtual KmeansClusteringInfo cluster_info (std::vector< std::vector< double > > const &data, std::vector< size_t > const &assignments, std::vector< std::vector< double > > const &centroids) const
 
virtual std::pair< size_t, double > find_nearest_cluster (std::vector< std::vector< double > > const &centroids, std::vector< double > const &datum) const
 
virtual void initialize (std::vector< std::vector< double > > const &data, size_t const k)
 
virtual bool lloyd_step (std::vector< std::vector< double > > const &data, std::vector< size_t > &assignments, std::vector< std::vector< double > > &centroids)
 
virtual void post_loop_hook (std::vector< std::vector< double > > const &data, std::vector< size_t > &assignments, std::vector< std::vector< double > > &centroids)
 
virtual void pre_loop_hook (std::vector< std::vector< double > > const &data, std::vector< size_t > &assignments, std::vector< std::vector< double > > &centroids)
 
virtual bool treat_empty_centroids (std::vector< std::vector< double > > const &data, std::vector< size_t > &assignments, std::vector< std::vector< double > > &centroids, std::unordered_set< size_t > const &empty_centroids)
 

Constructor & Destructor Documentation

◆ EuclideanKmeans() [1/3]

EuclideanKmeans ( size_t  dimensions)

Definition at line 47 of file euclidean_kmeans.cpp.

◆ ~EuclideanKmeans()

virtual ~EuclideanKmeans ( )
overridevirtualdefault

◆ EuclideanKmeans() [2/3]

EuclideanKmeans ( EuclideanKmeans const &  )
default

◆ EuclideanKmeans() [3/3]

EuclideanKmeans ( EuclideanKmeans &&  )
default

Member Function Documentation

◆ operator=() [1/2]

EuclideanKmeans& operator= ( EuclideanKmeans &&  )
default

◆ operator=() [2/2]

EuclideanKmeans& operator= ( EuclideanKmeans const &  )
default

Member Typedef Documentation

◆ Point

using Point = std::vector<double>

Definition at line 68 of file euclidean_kmeans.hpp.


The documentation for this class was generated from the following files: