/*************************************************************************** matrix.h - description ------------------- begin : Fri Jan 17 19:41:58 CST 2003 copyright : (C) 2003 by Daniel Eric Smith email : ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include const int SIZE=20; class matrix{ int nrow,ncol; float elt[SIZE][SIZE]; public: //matrix(); //{nrow=1; ncol=1;} matrix(int r, int c) {nrow=r; ncol=c;} //parameterized construtor matrix trans(); /* ARITIMETIC */ matrix operator+(matrix N); //rational addition r+s matrix operator-(matrix N); matrix operator*(matrix N); //matrix operator/(matrix N); /* INPUT/OUTPUT */ friend istream& operator>>(istream& s, matrix& N); friend ostream& operator<<(ostream& s, matrix N); }; matrix matrix::trans() { matrix t(ncol,nrow); for(int i=0;i>(istream& s, matrix& N) { for(int j=0;j>N.elt[j][i]; } } return s; } ostream& operator<<(ostream& s, matrix N) { for(int j=0;j