// matrix2.h - A simple 3 x 3 matrix class.
// Each element is of type int.
// This version of matrix illustrates the use of global friend functions
// instead of member functions, type convertion constructors,
// and defining an inserter function for output.
//
// Written by Wayne Pollock, Tampa FL  2000.

#ifndef MATRIX_H
#define MATRIX_H

#include <iostream>

using namespace std;

class matrix
{
   enum { dim = 3 };                      // The dimensions of a matrix

 public:
   matrix ();                             // default constructor
   matrix ( const int [dim][dim] );       // conversion constructor
   matrix ( const matrix& );              // copy constructor
   matrix& operator= ( const matrix& );   // assignment operator
   ~matrix () { /*null body*/ }           // destructor (does nothing!)

   friend matrix operator+ ( const matrix&, const matrix& );
   friend matrix operator* ( const matrix&, const matrix& );
   friend ostream& operator<< ( ostream&, const matrix& );  // inserter

 private:
   int rep[dim][dim];
};

#endif
