Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- const int MAX_ROWS = 10;
- const int MAX_COLS = 10;
- using namespace std;
- class MatrixType {
- public:
- //Default Constructor
- MatrixType();
- //Overloaded Constructor
- MatrixType(int,int);
- //Empty the matrices
- void MakeEmpty();
- //Set Matrix row and column
- //void SetSize(int rowSize, int colSize);
- //Set Value to one cell of a matrix
- void StoreItem(int item, int row, int col);
- //Add Two Matrices and store result into another matrix
- void Add(MatrixType otherMatrix, MatrixType& resultMatrix);
- //Subtract Two Matrices and store result into another matrix
- void Sub(MatrixType otherMatrix, MatrixType& resultMatrix);
- //Multiply Two Matrices and store result into another matrix
- void Mult(MatrixType otherMatrix, MatrixType& resultMatrix);
- void PrintMatrix();
- //Check Add and Subtract compatibility of two matrices
- bool isAddSubCompatible(MatrixType otherMatrix);
- //Check if two matrices are compatible for multiplication
- bool isMultCompatible(MatrixType otherMatrix);
- //Accessor Functions
- int getRowSize();
- int getColSize();
- private:
- int values[MAX_ROWS][MAX_COLS];
- int numRows;
- int numCols;
- };
Advertisement
Add Comment
Please, Sign In to add comment