Question: IMPORTANT NOTE = MUST USE *char INSTEAD OF STRINGS. STRINGS MUST NOT BE USED . Q3: Matrix Operations A matrix is a collection of values



IMPORTANT NOTE = MUST USE *char INSTEAD OF STRINGS. STRINGS MUST NOT BE USED .
Q3: Matrix Operations A matrix is a collection of values in the form of rows and columns. In this question, you are required to implement the following matrix functions using C++. You can only use int** data type and DMA to create a matrix AN 1. Matrix Multiplication 1 int** Matrix Mul (int ** MatrixA, int rowsA, int cols A, int** MatrixB, int rowsB, int cols B) { 3 /* MatrixMul implements MatrixA x MatrixB 4 Both the matrices are stored using DMA. 5 Number of rows are columns of both the matrices 6 are available in rows A, cols A, rowsB, and cols B variables. 8 } 2. Matrix Addition 1 int **Matrix Add (int ** MatrixA, int rowsA, int cols A, 2 int ** MatrixB, int rowsB, int cols B) { 3 /* MatrixAdd implements MatrixA + MatrixB 4 Both the matrices are stored using DMA. 5 Number of rows are columns of both the matrices 6 are available in rowsA, colsA, rowsB, and cols B variables. 7 */ 8 } 3. Matrix Subtraction 1 int ** MatrixSub(int ** MatrixA, int rowsA, int cols A, int ** MatrixB, int rowsB, int colsB) { 3 /* Matrix Sub implements MatrixA - MatrixB 4. Both the matrices are stored using DMA. 5 Number of rows are columns of both the matrices 6 are available in rowsA, cols A, rowsB, and cols B variables. 7 */ 8 } 4. Matrix Transpose 4. Matrix Transpose 1 int** Matrix Transpose(int ** Matrix, int rows, int cols) { 2 /* Matrix Transpose implements transpose of a Matrix 3 The matrix is stored using DMA. 4 Number of rows are columns of the matrix 5 are available in rows and cols. 6 */ 5. Matrix Rotate 1 int** Matrix Rotate (int ** Matrix, int rows, int cols) { 2 /* MatrixRotate rotates a matrix 90 degree clockwise. 3 The matrix is stored using DMA. 4 Number of rows are columns of the matrix 11 22 33 44 55 66 77 88 99 into the matrix 77 44 11 88 55 22 99 66 33 Figure 1: Matrix rotation 90 degree clockwise into the matrix 77 44 11 88 55 22 99 66 33 Figure 1: Matrix rotation 90 degree clockwise 5 are available in rows and cols. 6 */ 7 } 6. Matrix Determinant See: https://people.richland.edu/james/lecture/m116/matrices/determinant.html See: https://www.math10.com/en/algebra/matrices/determinant.html 1 int MatrixDet (int ** Matrix, int rows, int cols) { 2 /* MatrixDet implements determinant of a square Matrix 3 The matrix is stored using DMA. 4 Number of rows are columns of the matrix 5 are available in rows and cols. 6 */ 7 } 7. Matrix Inverse See: https://people.richland.edu/james/lecture/m116/matrices/inverses.html 1 float ** Matrix Inverse (int ** Matrix, int rows, int cols) { 2 /* MatrixInverse implements inverse of a Matrix 3 The matrix is stored using DMA. 4 Number of rows are columns of the matrix 5 are available in rows and cols. 6 */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
