Answered step by step
Verified Expert Solution
Link Copied!

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);

image text in transcribed

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

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What is operatiing system?

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago