docs: public static <V extends NumberVector> double varianceOfCluster(Cluster<? extends MeanModel> cluster, NumberVectorDistanceFunction<? super V> distanceFunction, Relation<V> relation) {
      MeanModel model = cluster.getModel();
      if(model instanceof KMeansModel) {
        return ((KMeansModel) model).getVarianceContribution();
      }
      // Re-compute:
      DBIDs ids = cluster.getIDs();
      DoubleVector mean = DoubleVector.wrap(model.getMean());
  
      boolean squared = distanceFunction.isSquared();
      double variance = 0.;
      for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
        double dist = distanceFunction.distance(relation.get(iter), mean);
        variance += squared ? dist : dist * dist;
      }
      return variance;
    }