k-means algorithm in c++