1package denoptim.fragmenter;
3import java.util.ArrayList;
4import java.util.Collection;
7import org.apache.commons.math3.ml.distance.DistanceMeasure;
9import denoptim.utils.MathUtils;
24 private List<ClusterableFragment>
points;
46 this.points =
new ArrayList<ClusterableFragment>();
58 this.points =
new ArrayList<ClusterableFragment>();
73 List<double[]> membersCoords =
new ArrayList<double[]>();
76 membersCoords.add(cf.getPoint());
104 double smallestDistance = Double.MAX_VALUE;
108 if (distance < smallestDistance)
111 smallestDistance = distance;
Represents a fragment that can be clustered based on the 3*N coordinate of atoms and attachment point...
ClusterableFragment clone()
Returns a shallow copy where the vector of coordinates has a new reference.
void setCoordsVector(double[] coords)
Sets the coordinates of each atom and attachment point in this object.
A cluster with a centroid that can be updated after definition of the cluster.
ClusterableFragment getCentroid()
Get the point chosen to be the centroid of this cluster.
DynamicCentroidCluster()
Constructor that defines an empty cluster.
DynamicCentroidCluster(ClusterableFragment centroid)
Constructor that defines the current centroid to be a clone of the given fragment and adds the given ...
void removeAll(Collection< ClusterableFragment > points)
Remove the given cluster member, if it is a member of this cluster.
ClusterableFragment getNearestToCentroid(DistanceMeasure measure)
Gets the original data that upon clustering is closest to the cluster centroid according to the given...
void addPoint(ClusterableFragment point)
Add a new member of this cluster.
List< ClusterableFragment > getPoints()
Get the points contained in the cluster.
ClusterableFragment centroid
Current centroid.
boolean updateCentroid
Flag requesting the update of the centroid.
List< ClusterableFragment > points
The points contained in this cluster.
Some useful math operations.
static double[] centroidOf(Collection< double[]> points, int dimension)