]> git.donarmstrong.com Git - mothur.git/blobdiff - ordervector.cpp
working on pam
[mothur.git] / ordervector.cpp
index 8732c8a614eed4ce29d882f0abeea13693d81340..a6dff32386beb1cfeae07a1aa9f01decee5ea0f1 100644 (file)
@@ -7,12 +7,8 @@
  *
  */
 
-using namespace std;
-
 #include "ordervector.hpp"
-#include "datavector.hpp"
-#include "utilities.hpp"
-#include <exception>
+
 
 /***********************************************************************/
 
@@ -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);
-       }       
 }
 
 /***********************************************************************/