use of de.lmu.ifi.dbs.elki.data.ModifiableHyperBoundingBox in project elki by elki-project.
the class AbstractRStarTreeNode method adjustEntry.
/**
* Adjusts the parameters of the entry representing this node.
*
* @param entry the entry representing this node
*/
public boolean adjustEntry(E entry) {
final SpatialDirectoryEntry se = (SpatialDirectoryEntry) entry;
final ModifiableHyperBoundingBox mbr = computeMBR();
boolean changed = false;
if (se.hasMBR()) {
final int dim = se.getDimensionality();
// Test for changes
for (int i = 0; i < dim; i++) {
if (Math.abs(se.getMin(i) - mbr.getMin(i)) > Float.MIN_NORMAL) {
changed = true;
break;
}
if (Math.abs(se.getMax(i) - mbr.getMax(i)) > Float.MIN_NORMAL) {
changed = true;
break;
}
}
} else {
// No preexisting MBR.
changed = true;
}
if (changed) {
se.setMBR(mbr);
}
return changed;
}
use of de.lmu.ifi.dbs.elki.data.ModifiableHyperBoundingBox in project elki by elki-project.
the class FlatRStarTree method createEmptyRoot.
@Override
protected void createEmptyRoot(SpatialEntry exampleLeaf) {
root = createNewDirectoryNode();
root.setPageID(getRootID());
getFile().setNextPageID(getRootID() + 1);
FlatRStarTreeNode leaf = createNewLeafNode();
writeNode(leaf);
ModifiableHyperBoundingBox mbr = new ModifiableHyperBoundingBox(new double[exampleLeaf.getDimensionality()], new double[exampleLeaf.getDimensionality()]);
root.addDirectoryEntry(new SpatialDirectoryEntry(leaf.getPageID(), mbr));
setHeight(2);
}
Aggregations