Guest User

MatrixType.h

a guest
Oct 8th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <iostream>
  2. const int MAX_ROWS = 10;
  3. const int MAX_COLS = 10;
  4.  
  5. using namespace std;
  6.  
  7. class MatrixType {
  8. public:
  9.     //Default Constructor
  10.     MatrixType();
  11.  
  12.     //Overloaded Constructor
  13.     MatrixType(int,int);
  14.  
  15.     //Empty the matrices
  16.     void MakeEmpty();
  17.  
  18.     //Set Matrix row and column
  19.     //void SetSize(int rowSize, int colSize);
  20.  
  21.     //Set Value to one cell of a matrix
  22.     void StoreItem(int item, int row, int col);
  23.  
  24.     //Add Two Matrices and store result into another matrix
  25.     void Add(MatrixType otherMatrix, MatrixType& resultMatrix);
  26.  
  27.     //Subtract Two Matrices and store result into another matrix
  28.     void Sub(MatrixType otherMatrix, MatrixType& resultMatrix);
  29.  
  30.     //Multiply Two Matrices and store result into another matrix
  31.     void Mult(MatrixType otherMatrix, MatrixType& resultMatrix);
  32.  
  33.     void PrintMatrix();
  34.  
  35.     //Check Add and Subtract compatibility of two matrices
  36.     bool isAddSubCompatible(MatrixType otherMatrix);
  37.  
  38.     //Check if two matrices are compatible for multiplication
  39.     bool isMultCompatible(MatrixType otherMatrix);
  40.  
  41.     //Accessor Functions
  42.     int getRowSize();
  43.  
  44.     int getColSize();
  45.  
  46. private:
  47.     int values[MAX_ROWS][MAX_COLS];
  48.     int numRows;
  49.     int numCols;
  50. };
Advertisement
Add Comment
Please, Sign In to add comment