Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

c++ and gtest

image text in transcribedimage text in transcribed

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 *

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions