}
return;
}
// try to expand the cluster
ModifiableDBIDs currentCluster = DBIDUtil.newArray();
for(DistanceResultPair<DoubleDistance> seed : seeds) {
DBID nextID = seed.getDBID();
Integer nextID_corrDim = distFunc.getIndex().getLocalProjection(nextID).getCorrelationDimension();
// nextID is not reachable from start object
if(nextID_corrDim > lambda) {
continue;
}
if(!processedIDs.contains(nextID)) {
currentCluster.add(nextID);
processedIDs.add(nextID);
}
else if(noise.contains(nextID)) {
currentCluster.add(nextID);
noise.remove(nextID);
}
}
seeds.remove(0);
while(seeds.size() > 0) {
DBID q = seeds.remove(0).getDBID();
Integer corrDim_q = distFunc.getIndex().getLocalProjection(q).getCorrelationDimension();
// q forms no lambda-dim hyperplane
if(corrDim_q > lambda) {
continue;
}
List<DistanceResultPair<DoubleDistance>> reachables = rangeQuery.getRangeForDBID(q, epsilon);
if(reachables.size() > minpts) {
for(DistanceResultPair<DoubleDistance> r : reachables) {
Integer corrDim_r = distFunc.getIndex().getLocalProjection(r.getDBID()).getCorrelationDimension();
// r is not reachable from q
if(corrDim_r > lambda) {
continue;
}
boolean inNoise = noise.contains(r.getDBID());
boolean unclassified = !processedIDs.contains(r.getDBID());
if(inNoise || unclassified) {
if(unclassified) {
seeds.add(r);
}
currentCluster.add(r.getDBID());
processedIDs.add(r.getDBID());
if(inNoise) {
noise.remove(r.getDBID());
}
if(objprog != null && clusprog != null) {
objprog.setProcessed(processedIDs.size(), getLogger());
int numClusters = currentCluster.size() > minpts ? resultList.size() + 1 : resultList.size();
clusprog.setProcessed(numClusters, getLogger());
}
}
}
}
if(processedIDs.size() == distFunc.getRelation().size() && noise.size() == 0) {
break;
}
}
if(currentCluster.size() >= minpts) {
resultList.add(currentCluster);
}
else {
for(DBID id : currentCluster) {
noise.add(id);