X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=rabundvector.cpp;h=6cbaa0d896ad7d47105873c67cdc6d003329b83a;hp=ce04df11ccd769a233ce30bfdf0554f34377d6cd;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2 diff --git a/rabundvector.cpp b/rabundvector.cpp index ce04df1..6cbaa0d 100644 --- a/rabundvector.cpp +++ b/rabundvector.cpp @@ -41,7 +41,7 @@ RAbundVector::RAbundVector(string id, vector rav) : DataVector(id), data(ra } } catch(exception& e) { - errorOut(e, "RAbundVector", "RAbundVector"); + m->errorOut(e, "RAbundVector", "RAbundVector"); exit(1); } } @@ -56,7 +56,7 @@ RAbundVector::RAbundVector(vector rav, int mr, int nb, int ns) { data = rav; } catch(exception& e) { - errorOut(e, "RAbundVector", "RAbundVector"); + m->errorOut(e, "RAbundVector", "RAbundVector"); exit(1); } } @@ -78,7 +78,7 @@ RAbundVector::RAbundVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), } } catch(exception& e) { - errorOut(e, "RAbundVector", "RAbundVector"); + m->errorOut(e, "RAbundVector", "RAbundVector"); exit(1); } } @@ -103,7 +103,7 @@ void RAbundVector::set(int binNumber, int newBinSize){ numSeqs += (newBinSize - oldBinSize); } catch(exception& e) { - errorOut(e, "RAbundVector", "set"); + m->errorOut(e, "RAbundVector", "set"); exit(1); } } @@ -114,7 +114,15 @@ int RAbundVector::get(int index){ return data[index]; } +/***********************************************************************/ +void RAbundVector::clear(){ + numBins = 0; + maxRank = 0; + numSeqs = 0; + data.clear(); + +} /***********************************************************************/ void RAbundVector::push_back(int binSize){ @@ -129,7 +137,7 @@ void RAbundVector::push_back(int binSize){ numSeqs += binSize; } catch(exception& e) { - errorOut(e, "RAbundVector", "push_back"); + m->errorOut(e, "RAbundVector", "push_back"); exit(1); } } @@ -193,6 +201,19 @@ vector::reverse_iterator RAbundVector::rend(){ return data.rend(); } +/***********************************************************************/ +void RAbundVector::nonSortedPrint(ostream& output){ + try { + output << label << '\t' << numBins << '\t'; + + for(int i=0;ierrorOut(e, "RAbundVector", "nonSortedPrint"); + exit(1); + } +} /***********************************************************************/ void RAbundVector::print(string prefix, ostream& output){ try { @@ -205,11 +226,12 @@ void RAbundVector::print(string prefix, ostream& output){ output << endl; } catch(exception& e) { - errorOut(e, "RAbundVector", "print"); + m->errorOut(e, "RAbundVector", "print"); exit(1); } } + /***********************************************************************/ void RAbundVector::print(ostream& output){ try { @@ -222,7 +244,7 @@ void RAbundVector::print(ostream& output){ output << endl; } catch(exception& e) { - errorOut(e, "RAbundVector", "print"); + m->errorOut(e, "RAbundVector", "print"); exit(1); } } @@ -265,7 +287,7 @@ SAbundVector RAbundVector::getSAbundVector() { return sav; } catch(exception& e) { - errorOut(e, "RAbundVector", "getSAbundVector"); + m->errorOut(e, "RAbundVector", "getSAbundVector"); exit(1); } } @@ -275,19 +297,20 @@ SAbundVector RAbundVector::getSAbundVector() { OrderVector RAbundVector::getOrderVector(map* nameMap = NULL) { try { OrderVector ov; - + for(int i=0;ierrorOut(e, "RAbundVector", "getOrderVector"); exit(1); } }