X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=ordervector.cpp;h=a6dff32386beb1cfeae07a1aa9f01decee5ea0f1;hp=8732c8a614eed4ce29d882f0abeea13693d81340;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=20a2d0350a737a434c89f303662d64a8eeea7b05 diff --git a/ordervector.cpp b/ordervector.cpp index 8732c8a..a6dff32 100644 --- a/ordervector.cpp +++ b/ordervector.cpp @@ -7,12 +7,8 @@ * */ -using namespace std; - #include "ordervector.hpp" -#include "datavector.hpp" -#include "utilities.hpp" -#include + /***********************************************************************/ @@ -20,7 +16,7 @@ OrderVector::OrderVector() : DataVector() {} /***********************************************************************/ -//OrderVector::OrderVector(int ns) : DataVector(), data(ns, -1) {}; +//OrderVector::OrderVector(int ns) : DataVector(), data(ns, -1) {} /***********************************************************************/ @@ -51,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); } } @@ -81,7 +73,14 @@ int OrderVector::getMaxRank(){ if(needToUpdate == 1){ updateStats(); } return maxRank; } +/***********************************************************************/ +void OrderVector::clear(){ + numBins = 0; + maxRank = 0; + numSeqs = 0; + data.clear(); +} /***********************************************************************/ @@ -120,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); } } @@ -141,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"); } /***********************************************************************/ @@ -195,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); - } } /***********************************************************************/ @@ -248,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); - } } /***********************************************************************/