# (Solved): O 4 Of 5 A Assignment_1_Spr2020.pdf 78.3% Q - X Q3: Matrix Operations A Matrix Is A Collection Of Va...

c++ and gtest

Home /
Answered Questions /
Other /
o-4-of-5-a-assignment-1-spr2020-pdf-78-3-q-x-q3-matrix-operations-a-matrix-is-a-collection-of-values-aw999

c++ and gtest

o 4 of 5 a Assignment_1_Spr2020.pdf 78.3% Q - X 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 1. Matrix Multiplication 1 int ** Matrix Mul (int ** MatrixA, int row , int colsA , int ** MatrixB, int rows B. int colsB) { 3 /* MatrixMul implements Matrix A x Matrix 4 Both the matrices are stored using DMA. 5 Number of rows are columns of both the matrices 6 are available in rows, colsA rows and cols B variables. 7 * 2. Matrix Addition 1 int **MatrixAdd(int ** MatrixA, int row , int colsA , 2 int ** MatrixB, int rowsB, int colsB) { 3 /* Matrix Add implements Matrix A + Matrix 4 Both the matrices are stored using DMA. 5 Number of rows are columns of both the matrices 6 are available in TOWA, cols A, rows, and cols variables. 3. Matrix Subtraction 1 int **MatrixSub (int ** MatrixA, int rows A, int colsA , int ** MatrixB, int rowsB, int colsB){ 3 /* Matrix Sub implements Matrix A - Matrix 4. Both the matrices are stored using DMA. 5 Number of rows are columns of both the matrices 6 are available in TO WSA, cols A, rows, and colse variables. 4. Matrix Transpose 1 int ** Matrix Transpose(float ** 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 * 7 } 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
0 5 of 5 a Assignment_1_Spr2020.pdf 78.3% Q - X 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 5 are available in rows and cols. 6 * 6. Matrix Determinant See: https://people. richland.edu/james/lecture/m 116/matrices/determinant.html See: https://www.mathio.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. 7 } 7. Matrix Inverse See: https://people. richland.edu/james/lecture/m 116/matrices/inverses.html 1 float** Matrix Inverse(int **Matrix, int rows, int cols) { 2 /* Matrix Inverse 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 *

We have an Answer from Expert
View Expert Answer

hi, here is the solution, all functions are implemented, added extra functions printMatrix() (overloaded for int and float) and MatrixTRanspose() (overloaded for int and float). try it and let me kn