docs: public static List<double[]> generatekMeansPlusPlusCentroids(int k,
  			List<double[]> input, Random random) {
  		int n = input.size();
  		assert (n > 0);
  		int d = input.get(0).length - 1;
  		assert (k <= n);
  
  		List<double[]> centerValue = new ArrayList<double[]>(k);
  		// Selects and copies the first centroid
  		double[] lastCenter = new double[d];
  		System.arraycopy(input.get(random.nextInt(n)), 1, lastCenter, 0, d);
  		centerValue.add(lastCenter);
  
  		double[] distance = new double[n];
  		for (int j = 0; j < n; j++) {
  			distance[j] = Double.POSITIVE_INFINITY;
  		}
  		for (int i = 1; i < k; i++) {
  			// Selects the next centroid
  			double sum = 0.0;
  			Iterator<double[]> jIter = input.iterator();
  			for (int j = 0; j < n; j++) {
  				double[] point = jIter.next();
  				distance[j] = Math
  						.min(distance[j],
  								point[0]
  										* Metric.distanceSquared(lastCenter,
  												point, 1));
  				sum += distance[j];
  
  			}
  			int candidate = 0;
  			if (sum > 0) {
  				double nextCenterValue = sum * random.nextDouble();
  				double currentValue = distance[0];
  				while (!(nextCenterValue < currentValue)) {
  					currentValue += distance[++candidate];
  				}
  			}
  			// Copies the selected centroid
  			lastCenter = new double[d];
  			System.arraycopy(input.get(candidate), 1, lastCenter, 0, d);
  			centerValue.add(lastCenter);
  		}
  
  		return centerValue;
  	}