mpqc::math::clustering Namespace Reference

Classes

class  Kmeans
 Kmeans is a class that performs k-means clustering. More...
 

Functions

template<typename Iter >
Iter closest_cluster (Iter begin, Iter end, Vector3d const &target_center)
 returns the closest element in the input range to the center provided More...
 
template<typename Cluster >
double kmeans_objective (std::vector< Cluster > const &cs)
 provides the quality of the k-means guess for a given clustering. More...
 

Function Documentation

◆ kmeans_objective()

template<typename Cluster >
double mpqc::math::clustering::kmeans_objective ( std::vector< Cluster > const &  cs)

provides the quality of the k-means guess for a given clustering.

The k-means objective function is the sum of the squares of the distance of the cluster's center to the center of each element in the cluster.

Parameters
csa vector of clusters which must match the requirements for clusters in Kmeans
See also
Kmeans