Cartesian k-means.