X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sabundvector.hpp;h=666e94f4db598b9bf1589bf8288fed75e221bdc3;hp=3c68462a425b5f1710f679c4272c4b5e6e6c7877;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=fd282e6b4be2560f5b1bd154a9e8d24b798eefaf diff --git a/sabundvector.hpp b/sabundvector.hpp index 3c68462..666e94f 100644 --- a/sabundvector.hpp +++ b/sabundvector.hpp @@ -1,14 +1,14 @@ #ifndef SABUND_H #define SABUND_H -using namespace std; - #include "datavector.hpp" #include "rabundvector.hpp" #include "ordervector.hpp" +#include "calculator.h" -/* This class is a child to datavector. It represents OTU information at a certain distance. +/* Data Structure for a sabund file. + This class is a child to datavector. It represents OTU information at a certain distance. A sabundvector can be converted into and ordervector, listvector or rabundvector. Each member of the internal container "data" represents the number of OTU's with that many members, but staring at 1. So data[1] = 2, because there are two OTUs with 1 member. @@ -24,6 +24,7 @@ public: SAbundVector(); SAbundVector(int); // SAbundVector(const SAbundVector&); + SAbundVector(vector, int, int, int); SAbundVector(string, vector); SAbundVector(const SAbundVector& rv) : DataVector(rv.label), data(rv.data), maxRank(rv.maxRank), numBins(rv.numBins), numSeqs(rv.numSeqs){}; SAbundVector(ifstream&); @@ -36,13 +37,16 @@ public: void set(int, int); int get(int); void push_back(int); + void quicksort(); + int sum(); void resize(int); int size(); + void clear(); void print(ostream&); void print(string, ostream&); - RAbundVector getRAbundVector(); + RAbundVector getRAbundVector(); SAbundVector getSAbundVector(); OrderVector getOrderVector(map*); @@ -50,6 +54,7 @@ private: vector data; // bool needToUpdate; // void updateStats(); + int maxRank; int numBins; int numSeqs;