using namespace std;
#include "sabundvector.hpp"
-#include "utilities.hpp"
+#include "calculator.h"
/***********************************************************************/
SAbundVector::SAbundVector(string id, vector<int> sav) : DataVector(id), data(sav) {
try {
-
for(int i=0;i<sav.size();i++){
if(data[i] != 0){ maxRank = i; }
numSeqs += i*data[i];
/***********************************************************************/
+SAbundVector::SAbundVector(vector <int> dataVec, int mr, int nb, int ns) {
+ try {
+ data = dataVec;
+ maxRank = mr;
+ numBins = nb;
+ numSeqs = ns;
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the SAbundVector class Function SAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the SAbundVector class function SAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+/***********************************************************************/
+
SAbundVector::SAbundVector(ifstream& f): DataVector(), maxRank(0), numBins(0), numSeqs(0) {
try {
int hold;
}
}
+
/***********************************************************************/
void SAbundVector::set(int sabund, int abundance){
}
}
+
/***********************************************************************/
int SAbundVector::get(int index){
exit(1);
}
}
+/***********************************************************************/
+
+void SAbundVector::quicksort(){
+ sort(data.rbegin(), data.rend());
+}
+
+/***********************************************************************/
+
+int SAbundVector::sum(){
+ VecCalc vecCalc;
+ return vecCalc.sumElements(data);
+}
/***********************************************************************/