Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / tree / UPGMA / RootedGuideTree.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /**
7  * Changes:
8  * mark May 8th 2007: removed makeEmpty(Node* t function), changed makeEmpty(). I also
9  * made changes to any functions that accessed Node's data members 
10  */
11 #ifndef ROOTEDGUIDETREE_H
12 #define ROOTEDGUIDETREE_H
13
14 #include "Node.h"
15 #include <fstream>
16
17 #include "../../alignment/Alignment.h"
18
19 namespace clustalw
20 {
21
22 using namespace std;
23
24 class RootedGuideTree
25 {
26     public:
27         RootedGuideTree();
28         RootedGuideTree(Node* root);
29         ~RootedGuideTree();
30         void setRoot(Node* r);
31         void makeEmpty();
32         void calcSeqWeights(int firstSeq, int lastSeq, vector<int>* seqWeights);
33         Node* getRoot(){return root;}
34     private:
35         void orderNodes();
36         int calcOrderNode(Node* node);
37         void calcWeights(vector<int>* seqWeights);
38         void doWeightCalc(float weightSoFar, vector<float>* seqWeights, Node* t);
39         Node* root;
40 };
41
42 }
43 #endif