/** * Recalculates the centroid if any data point was added or removed to this cluster in the last * iteration of kmeans. */ public void updateCentroid() { if (changed_ == false || dpoints_.size() == 0) { return; } super.calculateCentroid(); changed_ = false; }
/** * Creates a new instance of a partitional cluster given a list of data points. * * @param dpoints List of data points that will become members of this cluster. */ public PartitionalCluster(ArrayList<DataPoint> dpoints) { dpoints_ = dpoints; changed_ = false; super.calculateCentroid(); }