/*
* #%L
* org.gitools.analysis
* %%
* Copyright (C) 2013 - 2014 Universitat Pompeu Fabra - Biomedical Genomics group
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
package org.gitools.analysis.clustering.kmeans;
/**
* A Cluster used by centroid-based clustering algorithms.
* <p>
* Defines additionally a cluster center which may not necessarily be a member
* of the original data set.
*
* @param <T> the type of points that can be clustered
* @version $Id $
* @since 3.2
*/
public class CentroidCluster<T extends Clusterable> extends Cluster<T> {
/** Center of the cluster. */
private final Clusterable center;
/**
* Build a cluster centered at a specified point.
* @param center the point which is to be the center of this cluster
*/
public CentroidCluster(final Clusterable center) {
super();
this.center = center;
}
/**
* Get the point chosen to be the center of this cluster.
* @return chosen cluster center
*/
public Clusterable getCenter() {
return center;
}
}