Matrix.h
00001 /******************************************************************************
00002 
00003  Copyright 2008 Departamento de Realidad Virtual
00004  y Unidad de Cómputo Aplicado DGSGA, UNAM.
00005 
00006 
00007  This file is part of RBF++.
00008 
00009  RBF++ is free software: you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation, either version 3 of the License, or
00012  (at your option) any later version.
00013 
00014  RBF++ is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with RBF++. If not, see .
00021 
00022 
00023 *******************************************************************************/
00024 
00025 
00026 
00027 
00028 #ifndef _MATRIX_H_
00029 #define _MATRIX_H_
00030 
00031 #include 
00032 #include 
00033 
00034 
00035 
00036 namespace LA{
00037 
00038 using namespace std;
00039 
00057 template
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 operator/(vector &b);
00082   template
00083   friend  ostream& operator<<(ostream&, const Matrix&);
00084 
00085 };
00086 
00087 
00088 typedef Matrix Matrixf;
00089 typedef Matrix Matrixd;
00090 
00091 
00092 };
00093 
00094 
00095 #include "../../src/LA/Matrix.cpp"
00096 #endif
00097 
00098