X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sabundvector.cpp;h=6e4401bab964db2755e7ce1bb9f39c67703bf864;hb=9013e13ecfb2fda3c2664a76f76cc99b8c7fa74c;hp=b70c642643cfd746e63c236e328feb8e37d74a44;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2;p=mothur.git diff --git a/sabundvector.cpp b/sabundvector.cpp index b70c642..6e4401b 100644 --- a/sabundvector.cpp +++ b/sabundvector.cpp @@ -29,7 +29,7 @@ SAbundVector::SAbundVector(string id, vector sav) : DataVector(id), data(sa } } catch(exception& e) { - errorOut(e, "SAbundVector", "SAbundVector"); + m->errorOut(e, "SAbundVector", "SAbundVector"); exit(1); } } @@ -44,7 +44,7 @@ SAbundVector::SAbundVector(vector dataVec, int mr, int nb, int ns) { numSeqs = ns; } catch(exception& e) { - errorOut(e, "SAbundVector", "SAbundVector"); + m->errorOut(e, "SAbundVector", "SAbundVector"); exit(1); } } @@ -60,11 +60,13 @@ SAbundVector::SAbundVector(ifstream& f): DataVector(), maxRank(0), numBins(0), n for(int i=1;i<=hold;i++){ f >> inputData; + set(i, inputData); } + } catch(exception& e) { - errorOut(e, "SAbundVector", "SAbundVector"); + m->errorOut(e, "SAbundVector", "SAbundVector"); exit(1); } } @@ -87,7 +89,7 @@ void SAbundVector::set(int sabund, int abundance){ if(sabund > maxRank) { maxRank = sabund; } } catch(exception& e) { - errorOut(e, "SAbundVector", "set"); + m->errorOut(e, "SAbundVector", "set"); exit(1); } } @@ -112,7 +114,7 @@ void SAbundVector::push_back(int abundance){ numSeqs += (maxRank * abundance); } catch(exception& e) { - errorOut(e, "SAbundVector", "push_back"); + m->errorOut(e, "SAbundVector", "push_back"); exit(1); } } @@ -163,7 +165,7 @@ void SAbundVector::print(ostream& output){ output << endl; } catch(exception& e) { - errorOut(e, "SAbundVector", "print"); + m->errorOut(e, "SAbundVector", "print"); exit(1); } } @@ -192,18 +194,18 @@ RAbundVector SAbundVector::getRAbundVector(){ try { RAbundVector rav; - for(int i=1;i<=data.size();i++){ + for(int i=1;i < data.size();i++){ for(int j=0;jerrorOut(e, "SAbundVector", "getRAbundVector"); exit(1); } } @@ -238,7 +240,7 @@ OrderVector SAbundVector::getOrderVector(map* hold = NULL){ return ov; } catch(exception& e) { - errorOut(e, "SAbundVector", "getOrderVector"); + m->errorOut(e, "SAbundVector", "getOrderVector"); exit(1); } }