///////////////////////////////////////////////////////////////////////// // matrix.h - Fairly simple prototype for a matrix class // // Jim Fawcett, ELE591/791 - Intelligent Systems, Summer 2000 // ///////////////////////////////////////////////////////////////////////// #include // file stream module #include "matrix.h" using namespace std; //----< test for single matrix >----------------------------------------- void testMat(istream &in, ostream &out) { cout << "\n test void construction, reading, and writing matrix " << "\n -----------------------------------------------------"; mat m1; in >> m1; out << m1; cout << "\n test sized construction, copy construction, and assignment " << "\n ------------------------------------------------------------"; mat m2(5,3); int i,j; for(i=0; i m3 = m2; m3.name() = "m3 - copied from m2"; out << m3; m3[1][1] = -999; m3.name() = "modified m3"; out << m3; m2 = m3; m2.name() = "m2 - state assigned from m3"; out << m2; } // //----< read matrix file name from command line and read its values >---- void main(int argc, char *argv[]) { cout << "\n Test Prototype Matrix class " << "\n =============================\n"; if(argc == 1) { cout << "\n please enter matrix file name on command line\n\n"; return; } ifstream in; int i; for(i=1; i