X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=hcluster.cpp;h=4e83777751fa50686903758f41dd61fcdd53c52f;hp=df3626055d33346d0f483e68e2bdc606e357fc0e;hb=3c856e629e20261496b0433c2587f27b2c8ba3f6;hpb=72ebb6fa35b45b149812d47c2b1cb8acaca64659 diff --git a/hcluster.cpp b/hcluster.cpp index df36260..4e83777 100644 --- a/hcluster.cpp +++ b/hcluster.cpp @@ -95,8 +95,9 @@ void HCluster::printInfo(){ } cout << endl; for (int i = 0; i < linkTable.size(); i++) { + cout << i << '\t'; for (it = linkTable[i].begin(); it != linkTable[i].end(); it++) { - cout << it->first << '\t' << it->second << '\t' << '\t'; + cout << it->first << '-' << it->second << '\t'; } cout << endl; } @@ -241,14 +242,13 @@ void HCluster::updateArrayandLinkTable() { activeLinks.erase(smallCol); if(rowSpot>colSpot) { activeLinks[size] = colSpot; } - else{ activeLinks[size] = colSpot-1; } + else{ activeLinks[size] = colSpot; } //adjust everybody elses spot since you deleted - time vs. space for (it = activeLinks.begin(); it != activeLinks.end(); it++) { if (it->second > rowSpot) { activeLinks[it->first]--; } } - //cout << "here4" << endl; } @@ -269,7 +269,7 @@ bool HCluster::update(int row, int col, float distance){ //find upmost parent of row and col smallRow = getUpmostParent(smallRow); smallCol = getUpmostParent(smallCol); - //cout << "smallRow = " << smallRow << " smallCol = " << smallCol << endl; + //cout << "row = " << row << " smallRow = " << smallRow << " col = " << col << " smallCol = " << smallCol << " dist = " << distance << endl; //are they active in the link table int linkValue = makeActive(); //after this point this nodes info is active in linkTable @@ -277,6 +277,7 @@ bool HCluster::update(int row, int col, float distance){ //cout << "linkValue = " << linkValue << " times = " << (clusterArray[smallRow].numSeq * clusterArray[smallCol].numSeq) << endl; //can we cluster??? if (linkValue == (clusterArray[smallRow].numSeq * clusterArray[smallCol].numSeq)) { + //printInfo(); updateArrayandLinkTable(); clusterBins(); clusterNames(); @@ -284,7 +285,7 @@ bool HCluster::update(int row, int col, float distance){ //printInfo(); } - + //printInfo(); return clustered; } catch(exception& e) {