K-means clustering C++ code