protected double computeLOFScore(KNNQuery<O> knnq,DBIDRef cur,DoubleDataStore lrds){
  final double lrdp=lrds.doubleValue(cur);
  if (Double.isInfinite(lrdp)) {
    return 1.0;
  }
  double sum=0.;
  int count=0;
  final KNNList neighbors=knnq.getKNNForDBID(cur,k);
  for (DBIDIter neighbor=neighbors.iter(); neighbor.valid(); neighbor.advance()) {
    if (DBIDUtil.equal(cur,neighbor)) {
      continue;
    }
    sum+=lrds.doubleValue(neighbor);
    ++count;
  }
  return sum / (lrdp * count);
}

protected double computeLOFScore ( KNNQuery < O > knnq , DBIDRef cur , DoubleDataStore lrds ) { final double lrdp = lrds . doubleValue ( cur ) ; if ( Double . isInfinite ( lrdp ) ) { return 1.0 ; } double sum = 0. ; int count = 0 ; final KNNList neighbors = knnq . getKNNForDBID ( cur , k ) ; for ( DBIDIter neighbor = neighbors . iter ( ) ; neighbor . valid ( ) ; neighbor . advance ( ) ) { if ( DBIDUtil . equal ( cur , neighbor ) ) { continue ; } sum += lrds . doubleValue ( neighbor ) ; ++ count ; } return sum / ( lrdp * count ) ; }
compute a single lof score .
