private void computeVOVs(KNNQuery<O> knnq,DBIDs ids,DoubleDataStore vols,WritableDoubleDataStore vovs,DoubleMinMax vovminmax){
  FiniteProgress prog=LOG.isVerbose() ? new FiniteProgress("Variance of Volume",ids.size(),LOG) : null;
  boolean warned=false;
  for (DBIDIter iter=ids.iter(); iter.valid(); iter.advance()) {
    KNNList knns=knnq.getKNNForDBID(iter,k);
    DoubleDBIDListIter it=knns.iter();
    double vbar=0.;
    for (; it.valid(); it.advance()) {
      vbar+=vols.doubleValue(it);
    }
    vbar/=knns.size();
    double vov=0.;
    for (it.seek(0); it.valid(); it.advance()) {
      double v=vols.doubleValue(it) - vbar;
      vov+=v * v;
    }
    if (!(vov < Double.POSITIVE_INFINITY) && !warned) {
      LOG.warning("Variance of Volumes has hit double precision limits, results are not reliable.");
      warned=true;
    }
    vov=(knns.size() > 1 && vov < Double.POSITIVE_INFINITY) ? vov / (knns.size() - 1) : Double.POSITIVE_INFINITY;
    vovs.putDouble(iter,vov);
    vovminmax.put(vov);
    LOG.incrementProcessed(prog);
  }
  LOG.ensureCompleted(prog);
}

private void computeVOVs ( KNNQuery < O > knnq , DBIDs ids , DoubleDataStore vols , WritableDoubleDataStore vovs , DoubleMinMax vovminmax ) { FiniteProgress prog = LOG . isVerbose ( ) ? new FiniteProgress ( "Variance of Volume" , ids . size ( ) , LOG ) : null ; boolean warned = false ; for ( DBIDIter iter = ids . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { KNNList knns = knnq . getKNNForDBID ( iter , k ) ; DoubleDBIDListIter it = knns . iter ( ) ; double vbar = 0. ; for ( ; it . valid ( ) ; it . advance ( ) ) { vbar += vols . doubleValue ( it ) ; } vbar /= knns . size ( ) ; double vov = 0. ; for ( it . seek ( 0 ) ; it . valid ( ) ; it . advance ( ) ) { double v = vols . doubleValue ( it ) - vbar ; vov += v * v ; } if ( ! ( vov < Double . POSITIVE_INFINITY ) && ! warned ) { LOG . warning ( "Variance of Volumes has hit double precision limits, results are not reliable." ) ; warned = true ; } vov = ( knns . size ( ) > 1 && vov < Double . POSITIVE_INFINITY ) ? vov / ( knns . size ( ) - 1 ) : Double . POSITIVE_INFINITY ; vovs . putDouble ( iter , vov ) ; vovminmax . put ( vov ) ; LOG . incrementProcessed ( prog ) ; } LOG . ensureCompleted ( prog ) ; }
compute variance of volumes .
