00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _MATRIX_H_
00029 #define _MATRIX_H_
00030
00031 #include <iostream>
00032 #include <vector>
00033
00034
00035
00036 namespace LA{
00037
00038 using namespace std;
00039
00057 template<typename T>
00058 class Matrix {
00059 private:
00060
00061 int maxColumElem(int);
00062
00063 protected:
00064 T **data;
00065 int row, col;
00066
00067 public:
00068
00069 Matrix();
00070 Matrix(int r, int c);
00071 Matrix(const Matrix& otra);
00072 ~Matrix();
00073
00074 void resize(int, int);
00075 int getRow() { return row; }
00076 int getCol() { return col; }
00077 Matrix transpose();
00078 T& operator()(int i, int j) const;
00080 vector<T> operator/(vector<T> &b);
00082 template<typename U>
00083 friend ostream& operator<<(ostream&, const Matrix<U>&);
00084
00085 };
00086
00087
00088 typedef Matrix<float> Matrixf;
00089 typedef Matrix<double> Matrixd;
00090
00091
00092 };
00093
00094
00095 #include "../../src/LA/Matrix.cpp"
00096 #endif
00097
00098