Submission Deadline: Friday 9:00 pm
Submission Folder: template3_7 or through email directly to me at [email protected]
Make a template-based class Matrix that can store a matrix of any data type. Make a double pointer in the class and allocate dynamic memory to it. Also keep variables to keep row size and column size of the matrix. Write the following functions:
- Constructors
- Get/Set functions for individual elements of the matrix
- Get/Set functions for a row of the matrix
- Get/Set functions for a column of the matrix
- A member function to Add two matrices
- A member function to Subtract two matrices
- A global friend function to multiply two matrices
Again remember which 3 functions (including one studied in today's lecture) you have to write in case of pointer in the class.
There should be no cout or cin statement in Get/Set functions.
SetRow function should receive an array as argument and the specific row of the matrix should be assigned this array.