X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sharedsabundvector.cpp;h=efd14bcc249207ac4181fc552b8a918d57144083;hp=8282f66878e9f29324b136b243956c5a33f07243;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2 diff --git a/sharedsabundvector.cpp b/sharedsabundvector.cpp index 8282f66..efd14bc 100644 --- a/sharedsabundvector.cpp +++ b/sharedsabundvector.cpp @@ -13,7 +13,7 @@ /***********************************************************************/ -SharedSAbundVector::SharedSAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){} +SharedSAbundVector::SharedSAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){ } /***********************************************************************/ @@ -45,7 +45,7 @@ void SharedSAbundVector::set(int bin, int abundance, string groupName){ if(bin > maxRank) { maxRank = bin; } } catch(exception& e) { - errorOut(e, "SharedSAbundVector", "set"); + m->errorOut(e, "SharedSAbundVector", "set"); exit(1); } } @@ -79,7 +79,7 @@ void SharedSAbundVector::push_back(int abundance, int bin, string groupName){ numSeqs += (maxRank * abundance); } catch(exception& e) { - errorOut(e, "SharedSAbundVector", "push_back"); + m->errorOut(e, "SharedSAbundVector", "push_back"); exit(1); } } @@ -107,7 +107,7 @@ void SharedSAbundVector::print(ostream& output){ output << endl; } catch(exception& e) { - errorOut(e, "SharedSAbundVector", "print"); + m->errorOut(e, "SharedSAbundVector", "print"); exit(1); } } @@ -143,7 +143,7 @@ RAbundVector SharedSAbundVector::getRAbundVector(){ try { RAbundVector rav; - for(int i=1;i<=data.size();i++){ + for(int i=1;ierrorOut(e, "SharedSAbundVector", "getRAbundVector"); exit(1); } } @@ -170,7 +170,7 @@ SAbundVector SharedSAbundVector::getSAbundVector(){ } catch(exception& e) { - errorOut(e, "SharedSAbundVector", "getSAbundVector"); + m->errorOut(e, "SharedSAbundVector", "getSAbundVector"); exit(1); } } @@ -191,11 +191,9 @@ SharedRAbundVector SharedSAbundVector::getSharedRAbundVector(){ try { SharedRAbundVector rav; - int binNumber = 0; - for(int i=1;i<=data.size();i++){ + for(int i=1;ierrorOut(e, "SharedSAbundVector", "getSharedRAbundVector"); exit(1); } } @@ -232,10 +230,19 @@ SharedOrderVector SharedSAbundVector::getSharedOrderVector() { return ov; } catch(exception& e) { - errorOut(e, "SharedSAbundVector", "getSharedOrderVector"); + m->errorOut(e, "SharedSAbundVector", "getSharedOrderVector"); exit(1); } } +/***********************************************************************/ + +void SharedSAbundVector::clear(){ + numBins = 0; + maxRank = 0; + numSeqs = 0; + data.clear(); +} + /***********************************************************************/ OrderVector SharedSAbundVector::getOrderVector(map* hold = NULL){ try { @@ -259,7 +266,7 @@ OrderVector SharedSAbundVector::getOrderVector(map* hold = NULL){ return ov; } catch(exception& e) { - errorOut(e, "SharedSAbundVector", "getOrderVector"); + m->errorOut(e, "SharedSAbundVector", "getOrderVector"); exit(1); } }