* @param level the level of the node
* @param path the path to the node
*/
@SuppressWarnings("unchecked")
protected void reInsert(N node, int level, IndexTreePath<E> path) {
EuclideanDistanceFunction distFunction = EuclideanDistanceFunction.STATIC;
DistanceEntry<DoubleDistance, E>[] reInsertEntries = new DistanceEntry[node.getNumEntries()];
// compute the center distances of entries to the node and sort it
// in decreasing order to their distances
for(int i = 0; i < node.getNumEntries(); i++) {
E entry = node.getEntry(i);
DoubleDistance dist = distFunction.centerDistance(node, entry);
reInsertEntries[i] = new DistanceEntry<DoubleDistance, E>(entry, dist, i);
}
Arrays.sort(reInsertEntries, Collections.reverseOrder());
// define, how many entries will be reinserted