code: private static void computeDistances(double[] distances,
                                           boolean selectMin,
                                           Matrix dataPoints,
                                           DoubleVector centroid) {
          for (int i = 0; i < distances.length; ++i) {
              double distance = Similarity.euclideanDistance(
                      centroid, dataPoints.getRowVector(i));
              if (!selectMin || selectMin && distance < distances[i])
                  distances[i] = distance;
          }
      }
docs: Computes the distance between each data point and the given centroid.  If
  {@code selectMin} is set to true, then this will only overwrite the
  values in {@code distances} if the new distance is smaller.  Otherwise
  the new distance will always be stored in {@code distances}.
  
  @param distances An array of distances that need to be updated.
  @param selectMin Set to true a new distance must smaller than the
  current values in {@code distances}.
  @param dataPoints The set of data points.
  @param centroid The centroid to compare against.