Question: IMPLEMENT IN C++ TEST CASES: TEST(matrixMult,T1){ int mat1[4][4] = { { 1, 1, 1, 1 },{ 2, 2, 2, 2 },{ 3, 3, 3, 3

IMPLEMENT IN C++

TEST CASES:

TEST(matrixMult,T1){ int mat1[4][4] = { { 1, 1, 1, 1 },{ 2, 2, 2, 2 },{ 3, 3, 3, 3 },{ 4, 4, 4, 4 } };// 4*4 int mat2[4][4] = { { 1, 1, 1, 1 },{ 2, 2, 2, 2 },{ 3, 3, 3, 3 },{ 4, 4, 4, 4 } };//4*4 EXPECT_EQ(400,multiplyMatrix(mat1,mat2,4,4,4,4)) } TEST(matrixMult,T2){ int mat1[4][4] = { { 1, 1, 1, 1 },{ 2, 2, 2, 2 },{ 3, 3, 3, 3 },{ 4, 4, 4, 4 } };// 4*4 int mat2[4][3] = { { 1, 1, 1, 1 },{ 2, 2, 2, 2 },{ 3, 3, 3, 3 } };//3*4 EXPECT_EQ(240,mat1,mat2,4,4,4,3);

IMPLEMENT IN C++ TEST CASES: TEST(matrixMult,T1){ int mat1[4][4] = { { 1,

TASK 04 This sample problem requires you to multiply 2 matrices and given the sum of the resultant matrix. For example, given the matrices M and N, you are required to multiple these matrices. Let A be the resultant matrix. Then your final answer should be element-wise sum of A. Note that the dimensions of M and N must match. The only operation allowed is transpose (i.e., changing the rows into columns and columns into rows). If the dimensions of N do not match with those of M, you try to take the transpose of N. Example 1 2 3 4 5 6 7 8 9 10 11 12 M= N- 1 0 3 4 5 6 1 8 0 0 0 12 A= 26 52 48 26 58 132 96 58 90 212 144 90 Answer is 26+52+48+26+58+132+96+58+90+212+144+90 = 858

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!