From 4542a79d20176ff0ee830b0f9d4f4c92637439d9 Mon Sep 17 00:00:00 2001 From: Sarah Westcott Date: Mon, 17 Dec 2012 13:07:31 -0500 Subject: [PATCH] fixed issue in tree.shared when shared file was not sorted --- sharedutilities.cpp | 4 +++- treegroupscommand.cpp | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sharedutilities.cpp b/sharedutilities.cpp index 71d7782..d9891db 100644 --- a/sharedutilities.cpp +++ b/sharedutilities.cpp @@ -22,7 +22,9 @@ void SharedUtil::getSharedVectors(vector Groups, vectorgetNumBins()); diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 90d336d..0d01459 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -429,7 +429,10 @@ int TreeGroupCommand::execute(){ m->Treenames.clear(); //fills globaldatas tree names - m->Treenames = m->getGroups(); + //m->Treenames = m->getGroups(); + for (int k = 0; k < lookup.size(); k++) { + m->Treenames.push_back(lookup[k]->getGroup()); + } if (m->control_pressed) { return 0; } @@ -463,7 +466,10 @@ int TreeGroupCommand::execute(){ list = readMatrix->getListVector(); SparseDistanceMatrix* dMatrix = readMatrix->getDMatrix(); - + + //clear globaldatas old tree names if any + m->Treenames.clear(); + //make treemap if (ct != NULL) { delete ct; } ct = new CountTable(); @@ -475,17 +481,12 @@ int TreeGroupCommand::execute(){ nameMap.insert(bin); gps.insert(bin); groupMap[bin] = bin; + m->Treenames.push_back(bin); } ct->createTable(nameMap, groupMap, gps); vector namesGroups = ct->getNamesOfGroups(); m->setGroups(namesGroups); - - //clear globaldatas old tree names if any - m->Treenames.clear(); - - //fills globaldatas tree names - m->Treenames = m->getGroups(); //used in tree constructor m->runParse = false; -- 2.39.2