Question: ( a ) Write a program, using C , C + + , or Java, that multiplies two rectangular matrices - - please no square

(a) Write a program, using C,C++, or Java, that multiplies two rectangular matrices -- please no square matrices - whose elements are randomly generated. You may not use a matrix multiplication library in your code. You will have two versions of the program, one in which matrix elements are integers and another one where they are real numbers (double)(215 points).
You will compile and run the programs on two different systems -- most likely one of them will be your own desktop/laptop and the other one a computer in the lab, or otherwise on one of the UNIX computers IIT makes available to its students.
Measure the time it takes each program to complete (25) and then compare the performance of the two systems (5). Since the matrices are randomly generated, you will have to run the program several times, measure the running time and then take the average. Also the running time has to be significantly large (at least several seconds) to reduce the impact of measuring errors; this means you will have to work with matrices that have at least hundreds of lines and columns.
Is the performance ratio the same as the clock rate ratio of the two systems (5)? Explain. Based on the retail price of the two systems, which one is more cost effective (5)?
(b) Change your multiplication algorithm and repeat the steps above; for instance, if you used the the naive multiplication algorith with the column in the inner loop, then just use the same algorithm with the row in the inner loop (same scoring as part a).
Make sure your work includes a description of the two systems (manufacturer, CPU type, amount of memory, operating system, etc.) and of the compiler used (5). Attach the source code, the tables with your time measurements for your work, and a link to your repository such that we can check-out the code, build, and execute (5).
 (a) Write a program, using C,C++, or Java, that multiplies two

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!