}
}
}
// dim == minDim
else {
LinearEquationSystem les = runDerivator(relation, dim - 1, interval.getIDs());
Cluster<Model> c = new Cluster<Model>(interval.getIDs(), new LinearEquationModel(les));
res.addCluster(c);
noiseIDs.removeDBIDs(interval.getIDs());
clusterIDs.addDBIDs(interval.getIDs());
processedIDs.addAll(interval.getIDs());
}
// Rebuild heap
List<IntegerPriorityObject<CASHInterval>> heapVector = heap.toSortedArrayList();
for(IntegerPriorityObject<CASHInterval> pair : heapVector) {
CASHInterval currentInterval = pair.getObject();
currentInterval.removeIDs(clusterIDs);
if(currentInterval.getIDs().size() >= minPts) {
heap.add(new IntegerPriorityObject<CASHInterval>(currentInterval.priority(), currentInterval));
}
}
if(progress != null) {
progress.setProcessed(processedIDs.size(), logger);
}
}
// put noise to clusters
if(!noiseIDs.isEmpty()) {
if(dim == noiseDim) {
Cluster<Model> c = new Cluster<Model>(noiseIDs, true, ClusterModel.CLUSTER);
res.addCluster(c);
processedIDs.addAll(noiseIDs);
}
else if(noiseIDs.size() >= minPts) {
LinearEquationSystem les = runDerivator(fulldatabase, dim - 1, noiseIDs);
Cluster<Model> c = new Cluster<Model>(noiseIDs, true, new LinearEquationModel(les));
res.addCluster(c);
processedIDs.addAll(noiseIDs);
}
}