Skip to content

Commit

Permalink
scorecomplex many against many bug fix final
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosub-Kim committed Jan 4, 2024
1 parent 9f8a2ef commit 1c4fdfa
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/strucclustutils/scorecomplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,10 @@ class DBSCANCluster {

unsigned int clusterAlns() {
initializeAlnLabels();
if (++recursiveNum > MAX_RECURSIVE_NUM) return UNCLUSTERED;
if (searchResult.alnVec.size() == idealClusterSize) {
for (size_t alnIdx=0; alnIdx<searchResult.alnVec.size(); alnIdx++) {
neighbors.emplace_back(alnIdx);
}
bestClusters.emplace_back(neighbors);
return finishDBSCAN();
if (recursiveNum==0 && searchResult.alnVec.size() == idealClusterSize) {
checkClusteringNecessity();
}
if (++recursiveNum > MAX_RECURSIVE_NUM) return UNCLUSTERED;
for (size_t centerAlnIdx=0; centerAlnIdx < searchResult.alnVec.size(); centerAlnIdx++) {
ChainToChainAln &centerAln = searchResult.alnVec[centerAlnIdx];
if (centerAln.label != 0) continue;
Expand Down Expand Up @@ -440,6 +436,16 @@ class DBSCANCluster {
return CLUSTERED;
}

unsigned int checkClusteringNecessity() {
for (size_t alnIdx=0; alnIdx<searchResult.alnVec.size(); alnIdx++) {
neighbors.emplace_back(alnIdx);
}
if (checkChainRedundancy())
return UNCLUSTERED;
bestClusters.emplace_back(neighbors);
return finishDBSCAN();
}

// void free() {
// neighbors.clear();
// neighborsOfCurrNeighbor.clear();
Expand Down

0 comments on commit 1c4fdfa

Please sign in to comment.