]> git.donarmstrong.com Git - mothur.git/blobdiff - rabundvector.cpp
added shannonrange calc.
[mothur.git] / rabundvector.cpp
index e01063dad484f2328a714b0cbf8cff15c445b169..4d985e9f8a5ead507841799f3fa24b095017e710 100644 (file)
@@ -41,7 +41,7 @@ RAbundVector::RAbundVector(string id, vector<int> rav) : DataVector(id), data(ra
                }
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "RAbundVector");
+               m->errorOut(e, "RAbundVector", "RAbundVector");
                exit(1);
        }
 }
@@ -56,7 +56,7 @@ RAbundVector::RAbundVector(vector<int> rav, int mr, int nb, int ns) {
                data = rav;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "RAbundVector");
+               m->errorOut(e, "RAbundVector", "RAbundVector");
                exit(1);
        }
 }
@@ -76,9 +76,10 @@ RAbundVector::RAbundVector(ifstream& f) : DataVector(), maxRank(0), numBins(0),
                        f >> inputData;
                        set(i, inputData);
                }
+        
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "RAbundVector");
+               m->errorOut(e, "RAbundVector", "RAbundVector");
                exit(1);
        }
 }
@@ -103,7 +104,7 @@ void RAbundVector::set(int binNumber, int newBinSize){
                numSeqs += (newBinSize - oldBinSize);
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "set");
+               m->errorOut(e, "RAbundVector", "set");
                exit(1);
        }
 }
@@ -114,7 +115,15 @@ int RAbundVector::get(int index){
        return data[index];
        
 }
+/***********************************************************************/
 
+void RAbundVector::clear(){
+       numBins = 0;
+       maxRank = 0;
+       numSeqs = 0;
+       data.clear();
+       
+}
 /***********************************************************************/
 
 void RAbundVector::push_back(int binSize){
@@ -129,7 +138,7 @@ void RAbundVector::push_back(int binSize){
                numSeqs += binSize;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "push_back");
+               m->errorOut(e, "RAbundVector", "push_back");
                exit(1);
        }
 }
@@ -202,7 +211,7 @@ void RAbundVector::nonSortedPrint(ostream& output){
                output << endl;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "nonSortedPrint");
+               m->errorOut(e, "RAbundVector", "nonSortedPrint");
                exit(1);
        }
 }
@@ -218,7 +227,7 @@ void RAbundVector::print(string prefix, ostream& output){
                output << endl;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "print");
+               m->errorOut(e, "RAbundVector", "print");
                exit(1);
        }
 }
@@ -236,7 +245,7 @@ void RAbundVector::print(ostream& output){
                output << endl;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "print");
+               m->errorOut(e, "RAbundVector", "print");
                exit(1);
        }
 }
@@ -279,7 +288,7 @@ SAbundVector RAbundVector::getSAbundVector() {
                return sav;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "getSAbundVector");
+               m->errorOut(e, "RAbundVector", "getSAbundVector");
                exit(1);
        }
 }
@@ -302,7 +311,7 @@ OrderVector RAbundVector::getOrderVector(map<string,int>* nameMap = NULL) {
                return ov;
        }
        catch(exception& e) {
-               errorOut(e, "RAbundVector", "getOrderVector");
+               m->errorOut(e, "RAbundVector", "getOrderVector");
                exit(1);
        }
 }