// matmain1.cpp - a file that uses the user-defined type matrix.
// Written by Wayne Pollock, Tampa FL, 2000.

#include <iostream>
#include "matrix1.h"

using namespace std;

int main ()
{  int ary1[3][3] = { 1, 1, 1,  2, 2, 2,  3, 3, 3 };
   int ary2[3][3] = { 1, 0, 0,  0, 1, 0,  0, 0, 1 };
   matrix m1, m2(ary1);
   matrix ident = ary2;
   cout << endl << "m1 = (Default):";
   m1.print();
   cout << endl << "m2 = (array of ints)";
   m2.print();
   matrix m3 = m2 + m2;    //  matrix m3 = m1.operator+( m2 );
   cout << endl << "m3 = m2 + m2:";
   m3.print();
   matrix m4 = m2 * m2;
   cout << endl << "m4 = m2 * m2:";
   m4.print();
   m1 = ident * m3 + m2;
   cout << endl << "m1 = ident * m3 + m2:";
   m1.print();	
   return 0;
}

#ifdef COMMENTED_OUT	// Output of Above Program:

m1 = (Default):
  {
      0,  0,  0,
      0,  0,  0,
      0,  0,  0,
  }

m2 = (array of ints)
  {
      1,  1,  1,
      2,  2,  2,
      3,  3,  3,
  }

m3 = m2 + m2:
  {
      2,  2,  2,
      4,  4,  4,
      6,  6,  6,
  }

m4 = m2 * m2:
  {
      6,  6,  6,
     12, 12, 12,
     18, 18, 18,
  }

m1 = ident * m3 + m2:
  {
      3,  3,  3,
      6,  6,  6,
      9,  9,  9,
  }

#endif
