protected void computePDists(Relation<O> relation,KNNQuery<O> knn,WritableDoubleDataStore pdists){
  FiniteProgress prdsProgress=LOG.isVerbose() ? new FiniteProgress("pdists",relation.size(),LOG) : null;
  for (DBIDIter iditer=relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
    final KNNList neighbors=knn.getKNNForDBID(iditer,kreach + 1);
    int ks=0;
    double ssum=0.;
    for (DoubleDBIDListIter neighbor=neighbors.iter(); neighbor.valid() && ks < kreach; neighbor.advance()) {
      if (DBIDUtil.equal(neighbor,iditer)) {
        continue;
      }
      final double d=neighbor.doubleValue();
      ssum+=d * d;
      ks++;
    }
    double pdist=ks > 0 ? Math.sqrt(ssum / ks) : 0.;
    pdists.putDouble(iditer,pdist);
    LOG.incrementProcessed(prdsProgress);
  }
  LOG.ensureCompleted(prdsProgress);
}

protected void computePDists ( Relation < O > relation , KNNQuery < O > knn , WritableDoubleDataStore pdists ) { FiniteProgress prdsProgress = LOG . isVerbose ( ) ? new FiniteProgress ( "pdists" , relation . size ( ) , LOG ) : null ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { final KNNList neighbors = knn . getKNNForDBID ( iditer , kreach + 1 ) ; int ks = 0 ; double ssum = 0. ; for ( DoubleDBIDListIter neighbor = neighbors . iter ( ) ; neighbor . valid ( ) && ks < kreach ; neighbor . advance ( ) ) { if ( DBIDUtil . equal ( neighbor , iditer ) ) { continue ; } final double d = neighbor . doubleValue ( ) ; ssum += d * d ; ks ++ ; } double pdist = ks > 0 ? Math . sqrt ( ssum / ks ) : 0. ; pdists . putDouble ( iditer , pdist ) ; LOG . incrementProcessed ( prdsProgress ) ; } LOG . ensureCompleted ( prdsProgress ) ; }
compute the probabilistic distances used by loop .
