X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=ordervector.cpp;h=a6dff32386beb1cfeae07a1aa9f01decee5ea0f1;hp=ccbfa666bac044cd6eeaa639719938d571bad2ea;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=c5c7502f435e1413c19e373dab1dfebcaa67588d diff --git a/ordervector.cpp b/ordervector.cpp index ccbfa66..a6dff32 100644 --- a/ordervector.cpp +++ b/ordervector.cpp @@ -7,8 +7,6 @@ * */ -using namespace std; - #include "ordervector.hpp" @@ -18,7 +16,7 @@ OrderVector::OrderVector() : DataVector() {} /***********************************************************************/ -//OrderVector::OrderVector(int ns) : DataVector(), data(ns, -1) {}; +//OrderVector::OrderVector(int ns) : DataVector(), data(ns, -1) {} /***********************************************************************/ @@ -49,11 +47,7 @@ OrderVector::OrderVector(ifstream& f) : DataVector() { updateStats(); } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the OrderVector class Function OrderVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the OrderVector class function OrderVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "OrderVector", "OrderVector"); exit(1); } } @@ -79,7 +73,14 @@ int OrderVector::getMaxRank(){ if(needToUpdate == 1){ updateStats(); } return maxRank; } +/***********************************************************************/ +void OrderVector::clear(){ + numBins = 0; + maxRank = 0; + numSeqs = 0; + data.clear(); +} /***********************************************************************/ @@ -118,11 +119,7 @@ void OrderVector::print(ostream& output){ output << endl; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the OrderVector class Function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the OrderVector class function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "OrderVector", "print"); exit(1); } } @@ -139,19 +136,15 @@ void OrderVector::print(string prefix, ostream& output){ output << endl; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the OrderVector class Function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "OrderVector", "print"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the OrderVector class function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /***********************************************************************/ void OrderVector::resize(int){ - cout << "resize() did nothing in class OrderVector"; + m->mothurOut("resize() did nothing in class OrderVector"); } /***********************************************************************/ @@ -193,13 +186,9 @@ RAbundVector OrderVector::getRAbundVector(){ return rav; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the OrderVector class Function getRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "OrderVector", "getRAbundVector"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the OrderVector class function getRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /***********************************************************************/ @@ -246,13 +235,9 @@ void OrderVector::updateStats(){ } } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the OrderVector class Function updateStats. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "OrderVector", "updateStats"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the OrderVector class function updateStats. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /***********************************************************************/