protected void expandCluster ( Relation < O > relation , RangeQuery < O > rangeQuery , DBIDRef startObjectID , ArrayModifiableDBIDs seeds , FiniteProgress objprog , IndefiniteProgress clusprog ) { DoubleDBIDList neighbors = rangeQuery . getRangeForDBID ( startObjectID , epsilon ) ; ncounter += neighbors . size ( ) ; // startObject is no core-object if ( neighbors . size ( ) < minpts ) { noise . add ( startObjectID ) ; processedIDs . add ( startObjectID ) ; if ( objprog != null ) { objprog . incrementProcessed ( LOG ) ; } return ; } ModifiableDBIDs currentCluster = DBIDUtil . newArray ( ) ; currentCluster . add ( startObjectID ) ; processedIDs . add ( startObjectID ) ; // try to expand the cluster assert ( seeds . size ( ) == 0 ) ; seeds . clear ( ) ; processNeighbors ( neighbors . iter ( ) , currentCluster , seeds ) ; DBIDVar o = DBIDUtil . newVar ( ) ; while ( ! seeds . isEmpty ( ) ) { neighbors = rangeQuery . getRangeForDBID ( seeds . pop ( o ) , epsilon ) ; ncounter += neighbors . size ( ) ; if ( neighbors . size ( ) >= minpts ) { processNeighbors ( neighbors . iter ( ) , currentCluster , seeds ) ; } if ( objprog != null ) { objprog . incrementProcessed ( LOG ) ; } } resultList . add ( currentCluster ) ; if ( clusprog != null ) { clusprog . setProcessed ( resultList . size ( ) , LOG ) ; } }
DBSCAN - function expandCluster .