Package elki.outlier.lof
Class ALOCI.ALOCIQuadTree
- java.lang.Object
-
- elki.outlier.lof.ALOCI.ALOCIQuadTree
-
- Enclosing class:
- ALOCI<V extends NumberVector>
static class ALOCI.ALOCIQuadTree extends java.lang.Object
Simple quadtree for ALOCI. Not storing the actual objects, just the counts.Furthermore, the quadtree can be shifted by a specified vector, wrapping around min/max
- Author:
- Jonathan von Brünken, Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private double[]
min
Tree parametersprivate int
nmin
Maximum fill for a page before splittingprivate Relation<? extends NumberVector>
relation
Relation indexed.(package private) ALOCI.Node
root
Tree rootprivate double[]
shift
Tree parametersprivate double[]
width
Tree parameters
-
Constructor Summary
Constructors Constructor Description ALOCIQuadTree(double[] min, double[] max, double[] shift, int nmin, Relation<? extends NumberVector> relation)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
bulkLoad(double[] lmin, double[] lmax, java.util.List<ALOCI.Node> children, ArrayModifiableDBIDs ids, int start, int end, int dim, int level, int code)
Bulk load the treeALOCI.Node
findClosestNode(NumberVector vec, int tlevel)
Find the closest node (of depthtlevel
or above, if there is no node at this depth) for the given vector.private double
getShiftedDim(NumberVector obj, int dim, int level)
Shift and wrap a single dimension.
-
-
-
Field Detail
-
shift
private double[] shift
Tree parameters
-
min
private double[] min
Tree parameters
-
width
private double[] width
Tree parameters
-
nmin
private int nmin
Maximum fill for a page before splitting
-
root
ALOCI.Node root
Tree root
-
relation
private Relation<? extends NumberVector> relation
Relation indexed.
-
-
Constructor Detail
-
ALOCIQuadTree
public ALOCIQuadTree(double[] min, double[] max, double[] shift, int nmin, Relation<? extends NumberVector> relation)
Constructor.- Parameters:
min
- Minimum coordinatesmax
- Maximum coordinatesshift
- Tree shift offsetnmin
- Maximum size for a page to splitrelation
- Relation to index
-
-
Method Detail
-
bulkLoad
private void bulkLoad(double[] lmin, double[] lmax, java.util.List<ALOCI.Node> children, ArrayModifiableDBIDs ids, int start, int end, int dim, int level, int code)
Bulk load the tree- Parameters:
lmin
- Subtree minimum (unshifted, will be modified)lmax
- Subtree maximum (unshifted, will be modified)children
- List of children for current parentids
- IDs to processstart
- Start of ids subintervalend
- End of ids subintervaldim
- Current dimensionlevel
- Current tree levelcode
- Bit code of node position
-
getShiftedDim
private double getShiftedDim(NumberVector obj, int dim, int level)
Shift and wrap a single dimension.- Parameters:
obj
- Objectdim
- Dimensionlevel
- Level (controls scaling/wrapping!)- Returns:
- Shifted position
-
findClosestNode
public ALOCI.Node findClosestNode(NumberVector vec, int tlevel)
Find the closest node (of depthtlevel
or above, if there is no node at this depth) for the given vector.- Parameters:
vec
- Query vectortlevel
- Target level- Returns:
- Node
-
-