]> git.donarmstrong.com Git - mothur.git/blob - readmatrix.hpp
fixed memory leak in parsimony calculator and added progress bars to parsimony and...
[mothur.git] / readmatrix.hpp
1 #ifndef READMATRIX_HPP
2 #define READMATRIX_HPP
3
4 /*
5  *  readmatrix.hpp
6  *  
7  *
8  *  Created by Pat Schloss on 8/13/08.
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
10  *
11  */
12
13 #include "rabundvector.hpp"
14 #include "listvector.hpp"
15 #include "sharedlistvector.h"
16 #include "sparsematrix.hpp"
17 #include "nameassignment.hpp"
18 #include "inputdata.h"
19 #include "globaldata.hpp"
20 #include "sabundvector.hpp"
21 #include "groupmap.h"
22
23 class SparseMatrix;
24
25 class ReadMatrix {
26
27 public:
28         ReadMatrix(){   D = new SparseMatrix(); }
29         virtual void read(NameAssignment*){};
30         virtual void read(GlobalData* globaldata){};
31         void setCutoff(float c)                 {       cutoff = c;             }
32         SparseMatrix* getMatrix()               {       return D;               }
33         ListVector* getListVector()             {       return list;    }
34 //      OrderVector* getOrderVector()   {       return order;   }
35
36         int successOpen;
37         
38 protected:
39         SparseMatrix* D;
40         ListVector* list;
41         GlobalData* globaldata;
42         OrderVector* order;
43         InputData* input;
44         float cutoff;
45 };
46
47
48
49 class ReadPhylipMatrix : public ReadMatrix {
50         
51 public:
52         ReadPhylipMatrix(string);
53         ~ReadPhylipMatrix();
54         void read(NameAssignment*);
55 private:
56         ifstream fileHandle;
57         string distFile;
58 };
59
60
61
62 class ReadColumnMatrix : public ReadMatrix {
63         
64 public:
65         ReadColumnMatrix(string);
66         ~ReadColumnMatrix();
67         void read(NameAssignment*);
68 private:
69         ifstream fileHandle;
70         string distFile;
71 };
72
73
74 class ReadPhilFile : public ReadMatrix {
75         
76 public:
77         ReadPhilFile(string);
78         ~ReadPhilFile();
79         void read(GlobalData* globaldata);
80 private:
81         ifstream fileHandle;
82         string philFile;
83         InputData* input;
84         InputData* inputSabund;
85         InputData* inputList;
86         ListVector* list;
87         SharedListVector* SharedList;
88         OrderVector* order;
89         SAbundVector* sabund;
90         GlobalData* globaldata;
91         // InputData* getInput()                        {       return input;   }
92 };
93
94
95
96 #endif