00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00031 #ifndef BINARYMATRIX_H
00032 #define BINARYMATRIX_H
00033
00034
00035
00036 #include <fstream>
00037 #include "Itemset.h"
00038
00039 using namespace std;
00040
00046 class BinaryMatrix
00047 {
00048 protected:
00049
00050 ifstream in;
00051
00052
00053 string filename;
00054
00055
00056 string rowtype;
00057
00058
00059 vector<string> colnames;
00060
00061
00062 unsigned int rows;
00063
00064
00065 unsigned int cols;
00066
00067
00068 streampos start;
00069
00070
00071 unsigned int currow;
00072
00073
00074 char errmsg[512];
00075
00076
00077 vector<unsigned int> freqs;
00078
00079 public:
00080 BinaryMatrix();
00081 BinaryMatrix(char* filename);
00082 BinaryMatrix(const BinaryMatrix& src);
00083 virtual ~BinaryMatrix();
00084 virtual BinaryMatrix& operator =(const BinaryMatrix& rhs);
00085 virtual void findRows(const vector<Itemset>& sets,
00086 vector<vector<vector<unsigned int> > >& indecies);
00087 virtual void findRows(const Itemset& is,
00088 vector<vector<unsigned int> >& indecies);
00089 virtual bool getRow(bool* row);
00090 virtual bool getRow(string& rowname, bool* row);
00091 const string& getRowType(unsigned int index) const;
00092 virtual const string& getColname(unsigned int index) const;
00093 virtual bool isOpen();
00094 virtual void rewind();
00095 virtual unsigned int getWidth();
00096 virtual unsigned int getHeight();
00097 virtual const char* setFile(const char* filename);
00098 virtual void transpose(const char* coltype);
00099 virtual const string& getFilename() const;
00100 virtual unsigned int getFreq(unsigned int col, bool one = true)
00101 const;
00102 };
00103
00104 #endif