Kmeans clustering algorithm C++