V - Vector typeprotected static class GriDBSCAN.Instance<V extends NumberVector>
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
| private Border[] | bordersBorder identifier objects (shared to conserve memory). | 
| protected int[] | cellsNumber of cells per dimension. | 
| private WritableDataStore<Assignment> | clusteridsCluster assignments. | 
| private Core[] | coresCore identifier objects (shared to conserve memory). | 
| protected int | dimDimensionality. | 
| protected DistanceFunction<? super V> | distanceFunctionDistance function used. | 
| protected double[][] | domainValue domain. | 
| protected double | epsilonHolds the epsilon radius threshold. | 
| (package private) it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<ModifiableDBIDs> | gridData grid partitioning. | 
| protected double | gridwidthWidth of the grid cells. | 
| protected int | minptsHolds the minimum cluster size. | 
| protected static int | NOISENoise IDs. | 
| protected double[] | offsetGrid offset. | 
| private boolean | overflownIndicates that the number of grid cells has overflown. | 
| private WritableIntegerDataStore | temporaryTemporary assignments of a single run. | 
| protected static int | UNPROCESSEDUnprocessed IDs. | 
| Constructor and Description | 
|---|
| Instance(DistanceFunction<? super V> distanceFunction,
        double epsilon,
        int minpts,
        double gridwidth)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | buildGrid(Relation<V> relation,
         int numcells,
         double[] offset)Build the data grid. | 
| protected int | checkGridCellSizes(int size,
                  long numcell)Perform some sanity checks on the grid cells. | 
| private long | computeGridBaseOffsets()Compute the grid base offset. | 
| protected int | expandCluster(DBIDRef seed,
             int clusterid,
             WritableIntegerDataStore clusterids,
             ModifiableDoubleDBIDList neighbors,
             ArrayModifiableDBIDs activeSet,
             RangeQuery<V> rq,
             FiniteProgress pprog)Set-based expand cluster implementation. | 
| private void | insertIntoGrid(DBIDRef id,
              V obj,
              int d,
              int v)Insert a single object into the grid; potentially into multiple cells (at
 most 2^d) via recursion. | 
| protected void | mergeClusterInformation(ModifiableDBIDs cellids,
                       WritableIntegerDataStore temporary,
                       WritableDataStore<Assignment> clusterids)Merge cluster information. | 
| protected int | processCorePoint(DBIDRef seed,
                DoubleDBIDList newneighbors,
                int clusterid,
                WritableIntegerDataStore clusterids,
                ArrayModifiableDBIDs activeSet)Process a single core point. | 
| Clustering<Model> | run(Relation<V> relation)Performs the DBSCAN algorithm on the given database. | 
| private void | updateCoreBorderObjects(int clusterid)Update the shared arrays for core points (to conserve memory) | 
protected static final int UNPROCESSED
protected static final int NOISE
protected DistanceFunction<? super V extends NumberVector> distanceFunction
protected double epsilon
protected int minpts
protected double gridwidth
protected double[][] domain
protected int dim
protected double[] offset
protected int[] cells
it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<ModifiableDBIDs> grid
private Core[] cores
private Border[] borders
private WritableDataStore<Assignment> clusterids
private WritableIntegerDataStore temporary
private boolean overflown
public Instance(DistanceFunction<? super V> distanceFunction, double epsilon, int minpts, double gridwidth)
distanceFunction - Distance functionepsilon - Epsilonminpts - MinPtsgridwidth - Grid widthpublic Clustering<Model> run(Relation<V> relation)
relation - Relation to processprivate void updateCoreBorderObjects(int clusterid)
clusterid - Number of clustersprivate long computeGridBaseOffsets()
protected void buildGrid(Relation<V> relation, int numcells, double[] offset)
relation - Data relationnumcells - Total number of cellsoffset - Offsetprivate void insertIntoGrid(DBIDRef id, V obj, int d, int v)
id - Object IDobj - Objectd - Current dimensionv - Current cell valueprotected int checkGridCellSizes(int size,
                                 long numcell)
numcell - Number of cellssize - Relation sizeprotected int expandCluster(DBIDRef seed, int clusterid, WritableIntegerDataStore clusterids, ModifiableDoubleDBIDList neighbors, ArrayModifiableDBIDs activeSet, RangeQuery<V> rq, FiniteProgress pprog)
clusterid - ID of the current cluster.clusterids - Current object to cluster mapping.neighbors - Neighbors acquired by initial getNeighbors call.activeSet - Set to manage active candidates.rq - Range querypprog - Object progressprotected int processCorePoint(DBIDRef seed, DoubleDBIDList newneighbors, int clusterid, WritableIntegerDataStore clusterids, ArrayModifiableDBIDs activeSet)
seed - Point to processnewneighbors - New neighborsclusterid - Cluster to add toclusterids - Cluster assignment storage.activeSet - Active set of cluster seedsprotected void mergeClusterInformation(ModifiableDBIDs cellids, WritableIntegerDataStore temporary, WritableDataStore<Assignment> clusterids)
cellids - IDs in current celltemporary - Temporary assignmentsclusterids - Merged cluster assignmentCopyright © 2019 ELKI Development Team. License information.