]> git.donarmstrong.com Git - mothur.git/blob - sharedchao1.h
get.oturep ifstream
[mothur.git] / sharedchao1.h
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: 
24                 SharedChao1() : Calculator("sharedchao", 1, true) {};
25                 EstOutput getValues(SAbundVector*) {return data;};
26                 EstOutput getValues(vector<SharedRAbundVector*>);
27         private:
28                 IntNode* f1root;
29                 IntNode* f2root;
30                 vector<IntNode*> f1leaves;
31                 vector<IntNode*> f2leaves;
32                 int numLeaves;
33                 int numNodes;
34
35                 void initialTree(int);  //builds trees structure with n leaf nodes initialized to 0.
36                 void setCoef(IntNode*, int);
37                 void updateTree(vector<int>); //take vector containing the abundance info. for a bin and updates trees.
38                 void updateBranchf1(IntNode*, vector<int>, int);  //pointer, vector of abundance values, index into vector
39                 void updateBranchf2(IntNode*, vector<int>, int);  //pointer, vector of abundance values, index into vector
40                 
41                 //for debugging
42                 void printTree();
43                 void printBranch(IntNode*);
44 };
45
46 /***********************************************************************/
47
48 #endif