final SpatialPointLeafEntry s_e = (SpatialPointLeafEntry) ps.getEntry(j);
DBID s_id = s_e.getDBID();
for(int i = 0; i < pr.getNumEntries(); i++) {
final SpatialPointLeafEntry r_e = (SpatialPointLeafEntry) pr.getEntry(i);
double distance = df.doubleMinDist(s_e, r_e);
pr_heaps.get(i).add(new DoubleDistanceResultPair(distance, s_id));
if(pr != ps && ps_heaps != null) {
ps_heaps.get(j).add(new DoubleDistanceResultPair(distance, r_e.getDBID()));
}
}
}
}