Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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);
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started