List of usage examples for org.apache.commons.math.stat.clustering Cluster addPoint
public void addPoint(final T point)
From source file:org.basketball.MyKMeansPlusPlusClusterer.java
/** * Adds the given points to the closest {@link Cluster}. * * @param <T> type of the points to cluster * @param clusters the {@link Cluster}s to add the points to * @param points the points to add to the given {@link Cluster}s */// ww w . ja v a 2 s. c om private static <T extends Clusterable<T>> void assignPointsToClusters(final Collection<Cluster<T>> clusters, final Collection<T> points) { for (final T p : points) { Cluster<T> cluster = getNearestCluster(clusters, p); cluster.addPoint(p); } }