X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=listvector.cpp;h=2758c94264a1ba527e8d7c3970e0bac53254579b;hb=70491a12902e89b85cfa6b44a7b7fbe066ee2ac1;hp=4bb45b7f83d9c811a018f5c475fc557a9f65287f;hpb=260ae19c36cb11a53ddc5a75b5e507f8dd8b31d6;p=mothur.git diff --git a/listvector.cpp b/listvector.cpp index 4bb45b7..2758c94 100644 --- a/listvector.cpp +++ b/listvector.cpp @@ -13,6 +13,27 @@ #include "ordervector.hpp" #include "listvector.hpp" +//sorts highest to lowest +/***********************************************************************/ +inline bool abundNamesSort(string left, string right){ + + int countLeft = 0; + if(left != ""){ + countLeft = 1; + for(int i=0;i countRight) { + return true; + } + return false; +} /***********************************************************************/ @@ -55,7 +76,6 @@ ListVector::ListVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numS f >> inputData; set(i, inputData); } - m->gobble(f); } catch(exception& e) { @@ -136,9 +156,12 @@ void ListVector::print(ostream& output){ try { output << label << '\t' << numBins << '\t'; - for(int i=0;i hold = data; + sort(hold.begin(), hold.end(), abundNamesSort); + + for(int i=0;i