]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedrabundvector.cpp
fixed metastats, added resize to cluster.classic, added code to kill children if...
[mothur.git] / sharedrabundvector.cpp
index 9328cbd2b3da8cef5a0067bedced912ddbea399b..9276b7bfdc0ae441a883f42ddd0aabcddf1f04bd 100644 (file)
@@ -205,6 +205,16 @@ vector <individual> SharedRAbundVector::getData(){
 }
 /***********************************************************************/
 
+void SharedRAbundVector::clear(){
+       numBins = 0;
+       maxRank = 0;
+       numSeqs = 0;
+       data.clear();
+       for (int i = 0; i < lookup.size(); i++) {  delete lookup[i]; lookup[i] = NULL; }
+       lookup.clear();
+}
+/***********************************************************************/
+
 void SharedRAbundVector::push_back(int binSize, string groupName){
        try {
                individual newGuy;
@@ -486,15 +496,15 @@ SharedOrderVector SharedRAbundVector::getSharedOrderVector() {
 OrderVector SharedRAbundVector::getOrderVector(map<string,int>* nameMap = NULL) {
        try {
                OrderVector ov;
-       
-               for(int i=0;i<data.size();i++){
+               for(int i=0;i<numBins;i++){
                        for(int j=0;j<data[i].abundance;j++){
                                ov.push_back(i);
                        }
                }
                random_shuffle(ov.begin(), ov.end());
-
+               
                ov.setLabel(label);     
+
                return ov;
        }
        catch(exception& e) {