Identity Matrix and Matrix Augmentation

  1. Design a function Identity(int n) which returns an n*n identity matrix (i.e., all entries on the diagonal are 1, while other entries are 0.) Note that this is not a member function of the class CMatrix, but you can still put it in the "matrix.h" file so that it can be included together with the definition of CMatrix.
  2. Modify your class CMatrix and add a member functions:
    1. Augment(CMatrix B): suppose the current matrix is A, this function will return the augmented matrix (A | B).
  3. Hide the messages "Constructor called ..." and "Destructor called ...", because we don't need them now.

    Test your class definition with this main program. Save your class definition in "matrix.h" and compile the program with "g++ matrix-6.cpp". The running result should look like:

    
     1 1 1 2 2 2
     1 1 1 2 2 2
     1 1 1 2 2 2
     1 0 0
     0 1 0
     0 0 1
     1 1 1 1 0 0
     1 1 1 0 1 0
     1 1 1 0 0 1