]> git.donarmstrong.com Git - mothur.git/blob - readmatrix.hpp
Initial revision
[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 "sparsematrix.hpp"
16 #include "nameassignment.hpp"
17 #include "inputdata.h"
18 #include "globaldata.hpp"
19 #include "sabundvector.hpp"
20 #include "groupmap.h"
21
22 class SparseMatrix;
23
24 class ReadMatrix {
25
26 public:
27         ReadMatrix(){   D = new SparseMatrix(); }
28         virtual void read(NameAssignment*){};
29         virtual void read(GlobalData* globaldata){};
30         void setCutoff(float c)                 {       cutoff = c;             }
31         SparseMatrix* getMatrix()               {       return D;               }
32         ListVector* getListVector()             {       return list;    }
33 //      OrderVector* getOrderVector()   {       return order;   }
34
35         int successOpen;
36         
37 protected:
38         SparseMatrix* D;
39         ListVector* list;
40         GlobalData* globaldata;
41         OrderVector* order;
42         InputData* input;
43         float cutoff;
44 };
45
46
47
48 class ReadPhylipMatrix : public ReadMatrix {
49         
50 public:
51         ReadPhylipMatrix(string);
52         ~ReadPhylipMatrix();
53         void read(NameAssignment*);
54 private:
55         ifstream fileHandle;
56         string distFile;
57 };
58
59
60
61 class ReadColumnMatrix : public ReadMatrix {
62         
63 public:
64         ReadColumnMatrix(string);
65         ~ReadColumnMatrix();
66         void read(NameAssignment*);
67 private:
68         ifstream fileHandle;
69         string distFile;
70 };
71
72
73 class ReadPhilFile : public ReadMatrix {
74         
75 public:
76         ReadPhilFile(string);
77         ~ReadPhilFile();
78         void read(GlobalData* globaldata);
79 private:
80         ifstream fileHandle;
81         string philFile;
82         InputData* input;
83         InputData* inputSabund;
84         ListVector* list;
85         OrderVector* order;
86         SAbundVector* sabund;
87         GlobalData* globaldata;
88         // InputData* getInput()                        {       return input;   }
89 };
90
91
92
93 #endif