]> git.donarmstrong.com Git - mothur.git/blob - fullmatrix.h
fixed bug in read.tree
[mothur.git] / fullmatrix.h
1 #ifndef FULLMATRIX_H
2 #define FULLMATRIX_H
3 /*
4  *  fullmatrix.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 3/6/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "mothur.h"
13 #include "groupmap.h"
14 #include "globaldata.hpp"
15 #include "progress.hpp"
16
17 using namespace std;
18
19 struct Names {
20         string          groupname;
21         string          seqName;
22         float           minDist;
23 };
24
25
26 class FullMatrix {
27         
28         public:
29                 FullMatrix(){};
30                 FullMatrix(ifstream&);
31                 ~FullMatrix(){};
32         
33                 int getNumSeqs();
34                 void printMatrix(ostream&);
35         
36         private:
37                 void sortGroups(int, int);  //this function sorts the sequences within the matrix.
38                 void readSquareMatrix(ifstream&);  
39                 void readLTMatrix(ifstream&);
40                 vector< vector<float> > matrix;  //a 2D distance matrix of all the sequences and their distances to eachother.
41                 map<int, Names> index; // row in vector, sequence group.  need to know this so when we sort it can be updated.
42                 GroupMap* groupmap;  //maps sequences to groups they belong to.
43                 GlobalData* globaldata;
44                 int numSeqs;
45                 bool square;
46
47 };
48
49 #endif