]> git.donarmstrong.com Git - mothur.git/commitdiff
bugs fixes while testing for 1.5 release
authorwestcott <westcott>
Wed, 5 Aug 2009 22:25:58 +0000 (22:25 +0000)
committerwestcott <westcott>
Wed, 5 Aug 2009 22:25:58 +0000 (22:25 +0000)
unweighted.cpp

index 687786a71e783bdb4df476eb17d6864e07238974..c39e6629df1c2749928833fe24af65d48e853d64 100644 (file)
@@ -57,8 +57,10 @@ EstOutput Unweighted::getValues(Tree* t) {
                                        //This section adds in all lengths that are non leaf
                        
                                        copyIpcount = t->tree[i].pcount;
-                                       for (it = copyIpcount.begin(); it != copyIpcount.end(); it++) {
-                                               if (inUsersGroups(it->first, groups) != true) { copyIpcount.erase(it->first);   }
+                                       for (it = copyIpcount.begin(); it != copyIpcount.end();) {
+                                               if (inUsersGroups(it->first, groups) != true) { 
+                                                       copyIpcount.erase(it++);        
+                                               }else { it++;  }
                                        }
                        
                                        //if i's children are from the same group then i's pcount size will be 1 
@@ -133,8 +135,10 @@ EstOutput Unweighted::getValues(Tree* t) {
                                //This section adds in all lengths that are non leaf
                        
                                copyIpcount = t->tree[i].pcount;
-                               for (it = copyIpcount.begin(); it != copyIpcount.end(); it++) {
-                                       if (inUsersGroups(it->first, groups) != true) { copyIpcount.erase(it->first);   }
+                               for (it = copyIpcount.begin(); it != copyIpcount.end();) {
+                                       if (inUsersGroups(it->first, groups) != true) { 
+                                               copyIpcount.erase(it++);        
+                                       }else {  it++;  }
                                }
                        
                                //if i's children are from the same group then i's pcount size will be 1 
@@ -240,10 +244,11 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB) {
                        
                                        /**********************************************************************/
                                        //This section adds in all lengths that are non leaf
-                       
                                        copyIpcount = copyTree->tree[i].pcount;
-                                       for (it = copyIpcount.begin(); it != copyIpcount.end(); it++) {
-                                               if (inUsersGroups(it->first, groups) != true) { copyIpcount.erase(it->first);   }
+                                       for (it = copyIpcount.begin(); it != copyIpcount.end();) {
+                                               if (inUsersGroups(it->first, groups) != true) { 
+                                                       copyIpcount.erase(it++);        
+                                               }else { it++;  }
                                        }
                        
                                        //if i's children are from the same group then i's pcount size will be 1 
@@ -324,8 +329,10 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB) {
                                //This section adds in all lengths that are non leaf
                        
                                copyIpcount = copyTree->tree[i].pcount;
-                               for (it = copyIpcount.begin(); it != copyIpcount.end(); it++) {
-                                       if (inUsersGroups(it->first, groups) != true) { copyIpcount.erase(it->first);   }
+                               for (it = copyIpcount.begin(); it != copyIpcount.end();) {
+                                               if (inUsersGroups(it->first, groups) != true) { 
+                                                       copyIpcount.erase(it++);        
+                                               }else { it++;  }
                                }
                        
                                //if i's children are from the same group then i's pcount size will be 1