1 #ifndef SHAREDCHAO1_H 2 #define SHAREDCHAO1_H 3 /* 4 * sharedchao1.h 5 * Dotur 6 * 7 * Created by Sarah Westcott on 1/8/09. 8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. 9 * 10 */ 11 12 /* This class implements the Sharedchao1 estimator on two groups. 13 It is a child of the calculator class. */ 14 15 16 #include "calculator.h" 17 18 /***********************************************************************/ 19 20 21 class SharedChao1 : public Calculator { 22 23 public: SharedChao1()24 SharedChao1() : Calculator("sharedchao", 1, true) {}; getValues(SAbundVector *)25 EstOutput getValues(SAbundVector*) {return data;}; 26 EstOutput getValues(vector<SharedRAbundVector*>); getCitation()27 string getCitation() { return "http://www.mothur.org/wiki/Sharedchao"; } 28 private: 29 IntNode* f1root; 30 IntNode* f2root; 31 vector<IntNode*> f1leaves; 32 vector<IntNode*> f2leaves; 33 int numLeaves; 34 int numNodes; 35 36 void initialTree(int); //builds trees structure with n leaf nodes initialized to 0. 37 void setCoef(IntNode*, int); 38 void updateTree(vector<int>); //take vector containing the abundance info. for a bin and updates trees. 39 void updateBranchf1(IntNode*, vector<int>, int); //pointer, vector of abundance values, index into vector 40 void updateBranchf2(IntNode*, vector<int>, int); //pointer, vector of abundance values, index into vector 41 42 //for debugging 43 void printTree(); 44 void printBranch(IntNode*); 45 }; 46 47 /***********************************************************************/ 48 49 #endif 50