WeightedVectorWritable point,
DistanceMeasure measure,
Map<Integer, List<VectorWritable>> representativePoints,
Map<Integer, WeightedVectorWritable> mostDistantPoints) {
int key = clusterId.get();
WeightedVectorWritable currentMDP = mostDistantPoints.get(key);
List<VectorWritable> repPoints = representativePoints.get(key);
double totalDistance = 0.0;
for (VectorWritable refPoint : repPoints) {
totalDistance += measure.distance(refPoint.get(), point.getVector());
}
if (currentMDP == null || currentMDP.getWeight() < totalDistance) {
mostDistantPoints.put(key, new WeightedVectorWritable(totalDistance, point.getVector().clone()));
}
}