// finally check for convergence by the absolute difference
long convergedCounter = 0L;
for (int i = 0; i < msgCenters.length; i++) {
final DoubleVector oldCenter = centers[i];
if (msgCenters[i] != null) {
double calculateError = oldCenter.subtract(msgCenters[i]).abs().sum();
if (calculateError > 0.0d) {
centers[i] = msgCenters[i];
convergedCounter++;
}
}