@Test
public void kmeansSparseTest() {

	int len = 10;
	int k = 2;
	int size = 20;
	EuclideanDistance distance = new EuclideanDistance();
	long[] sampleWeights = new long[len];
	FastDistanceVectorData[] samples = new FastDistanceVectorData[len];
	for (int i = 0; i < 10; i++) {
		sampleWeights[i] = i;
		samples[i] = distance.prepareVectorData(Tuple2.of(new SparseVector(size, new int[]{i, i + 1}, new double[]{i, i}), null));
	}
	FastDistanceMatrixData initCentroid = kmeans(k, sampleWeights, samples, distance, size);
	DenseMatrix initCentroidData = initCentroid.getVectors();
	Assert.assertEquals(initCentroidData.numCols(), k);
	Assert.assertEquals(new DenseVector(initCentroidData.getColumn(0)).normL2(), 8.615, 0.001);
	Assert.assertEquals(new DenseVector(initCentroidData.getColumn(1)).normL2(), 4.128, 0.001);
}