X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sharedchao1.h;h=ae07a8706c30fa76d1b2c975db417201a9470b5f;hp=7cca63a8fb48bb9ac9a45757d95436562deff455;hb=615301e57c25e241356a9c2380648d117709458d;hpb=2c5f6dfaab750da109bb7bc7e51b005d135c2d77 diff --git a/sharedchao1.h b/sharedchao1.h index 7cca63a..ae07a87 100644 --- a/sharedchao1.h +++ b/sharedchao1.h @@ -17,12 +17,31 @@ It is a child of the calculator class. */ /***********************************************************************/ + class SharedChao1 : public Calculator { -public: - SharedChao1() : Calculator("sharedchao", 3) {}; - EstOutput getValues(SAbundVector*) {return data;}; - EstOutput getValues(SharedRAbundVector*, SharedRAbundVector*); + public: + SharedChao1() : Calculator("sharedchao", 1, true) {}; + EstOutput getValues(SAbundVector*) {return data;}; + EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sharedchao"; } + private: + IntNode* f1root; + IntNode* f2root; + vector f1leaves; + vector f2leaves; + int numLeaves; + int numNodes; + + void initialTree(int); //builds trees structure with n leaf nodes initialized to 0. + void setCoef(IntNode*, int); + void updateTree(vector); //take vector containing the abundance info. for a bin and updates trees. + void updateBranchf1(IntNode*, vector, int); //pointer, vector of abundance values, index into vector + void updateBranchf2(IntNode*, vector, int); //pointer, vector of abundance values, index into vector + + //for debugging + void printTree(); + void printBranch(IntNode*); }; /***********************************************************************/