X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readmatrix.hpp;fp=readmatrix.hpp;h=9c71732f87a712eef8660748926e7a1ceb64c6c6;hb=20a2d0350a737a434c89f303662d64a8eeea7b05;hp=0000000000000000000000000000000000000000;hpb=bbb5879a7e566935c23d63d42bb945072424b939;p=mothur.git diff --git a/readmatrix.hpp b/readmatrix.hpp new file mode 100644 index 0000000..9c71732 --- /dev/null +++ b/readmatrix.hpp @@ -0,0 +1,93 @@ +#ifndef READMATRIX_HPP +#define READMATRIX_HPP + +/* + * readmatrix.hpp + * + * + * Created by Pat Schloss on 8/13/08. + * Copyright 2008 Patrick D. Schloss. All rights reserved. + * + */ + +#include "rabundvector.hpp" +#include "listvector.hpp" +#include "sparsematrix.hpp" +#include "nameassignment.hpp" +#include "inputdata.h" +#include "globaldata.hpp" +#include "sabundvector.hpp" +#include "groupmap.h" + +class SparseMatrix; + +class ReadMatrix { + +public: + ReadMatrix(){ D = new SparseMatrix(); } + virtual void read(NameAssignment*){}; + virtual void read(GlobalData* globaldata){}; + void setCutoff(float c) { cutoff = c; } + SparseMatrix* getMatrix() { return D; } + ListVector* getListVector() { return list; } +// OrderVector* getOrderVector() { return order; } + + int successOpen; + +protected: + SparseMatrix* D; + ListVector* list; + GlobalData* globaldata; + OrderVector* order; + InputData* input; + float cutoff; +}; + + + +class ReadPhylipMatrix : public ReadMatrix { + +public: + ReadPhylipMatrix(string); + ~ReadPhylipMatrix(); + void read(NameAssignment*); +private: + ifstream fileHandle; + string distFile; +}; + + + +class ReadColumnMatrix : public ReadMatrix { + +public: + ReadColumnMatrix(string); + ~ReadColumnMatrix(); + void read(NameAssignment*); +private: + ifstream fileHandle; + string distFile; +}; + + +class ReadPhilFile : public ReadMatrix { + +public: + ReadPhilFile(string); + ~ReadPhilFile(); + void read(GlobalData* globaldata); +private: + ifstream fileHandle; + string philFile; + InputData* input; + InputData* inputSabund; + ListVector* list; + OrderVector* order; + SAbundVector* sabund; + GlobalData* globaldata; + // InputData* getInput() { return input; } +}; + + + +#endif