Matrix.h
Go to the documentation of this file.00001
00018 #ifndef MATRIX_H
00019 #define MATRIX_H
00020 #include <vector>
00021 #include <iostream>
00022 #include <string>
00023 #include <stdio.h>
00024 #include <stdlib.h>
00025 #include <iomanip>
00026 #include <fstream>
00027 #include <sstream>
00028 #include <math.h>
00029 #include <map>
00030 #include "StringUtils.h"
00031
00032 using namespace std;
00033
00038 class Matrix
00039 {
00040 public:
00042 Matrix( ){};
00044 ~Matrix( void ){};
00045
00046
00047 bool operator==( Matrix & );
00048 void printTheMat( ostream & );
00049 void printTheMat_MaplePCAFrmt( ostream &, const string & );
00050 void printTheMat_MapleTransposedPCAFrmt( ostream &, const string & );
00051
00053 vector<int> getConsDist( void )
00054 { return calcConsDist(); }
00055 void printConsDist( ostream & );
00056 void transpose( void );
00058 int size( void )
00059 { return theMatrix.size(); }
00060 void printTheMat( int, ostream & );
00061 void printMat( vector< vector<string> >, ostream & );
00062 bool findCycles( int &, int & );
00063 Matrix getSubMat( const int &, const int & );
00064 vector<int> getAvgVec ( void );
00065 vector<double> getStdVec ( void );
00066 void printAvgVec ( ostream & );
00067 void printStdVec ( ostream & );
00068 void printStats ( ostream & );
00069 void printStats_GnuPlot ( ostream & );
00070 map<string, vector<int> > groupMat( void );
00071 int rowSize( void );
00072 int colSize( void );
00073 void addRow( const vector<int> & row);
00074 void addRow_String( const string &, char * );
00075 vector<int> getRow( const int & );
00076 vector<int> getCol( const int & );
00077 vector<int> getCol( const string & );
00079 bool isEmpty( void )
00080 { return (theMatrix.size() == 0); }
00082 void clear( void )
00083 { theMatrix.clear(); }
00084 void printCycles( ostream &, const int &, const int & );
00085
00086
00087 void readMat( ifstream & );
00088 void readMat2( ifstream & );
00089 void readLabels( ifstream & );
00091 vector<string> getLabels( void )
00092 { return labels; }
00093 private:
00094 vector< vector<int> > theMatrix;
00095 vector< string > labels;
00096
00097 vector<int> calcDistVec( vector< vector< string> >, vector< vector<string> > );
00098 vector<int> calcConsDist( void );
00099 vector<int> calcAvgVec ( void );
00100 vector<double> calcStdVec ( void );
00101 };
00102
00103 #endif