Question

Q: "Discuss your background about "investigate the performance of several C implementations of matrix multiplication and...

Q: "Discuss your background about "investigate the performance of several C implementations of matrix multiplication and compare them to the performance of matrix multiplication in Java"

I need to compare between Java and C program performing Matrix Multiplication.I need background about this topic. Not code! I need professional writing about this topic. thanks

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:-

Matrix multiplication in C language: C program to multiply two matrices (two-dimensional arrays) which will be entered by a user. The user will enter the order of a matrix and then its elements and similarly inputs the second matrix. If the orders of the matrices are such that they can't be multiplied by each other, then an error message is displayed. You may have studied the method to multiply matrices in Mathematics.

To multiply two matrices, the number of columns of first matrix should be equal to the number of rows to second matrix. This program displays the error until the number of columns of first matrix is equal to the number of rows of second matrix.

This C program performs matrix multiplication. In matrix multiplication, we take two matrices of order m*n and p*q respectively to find a resultant matrix of the order m*q where n is equal to p . Time Complexity of this algorithm is O(n3).

Java program to multiply two matrices: before multiplication matrices are checked whether they can be multiplied or not. We will use the simplest method of multiplication, there are more efficient algorithms available. Also this approach isn't recommended for sparse matrices which contains a large number of elements as zero.

Let the two matrix to be multiplied be A and B. Let A be a matrix of order d*e - d rows and e columns and B be the second matrix of order e*f. Note that the number of columns in the first matrix should be the same as the number of rows in the second matrix. The product matrix will be of order d*f. Now, our task is to find what numbers go into each of the positions of matrix C with d rows and f columns. We use an outer loop with loop counter i ranging from 0 to d. An inner loop has the loop counter j ranging from 0 to f. At any iteration of the loop, i refers to the row number and j to the column number of the position in matrix C that we are trying to fill. Now, within the body of the inner loop, we have to write some code which will calculate the value to be filled. This body will in turn consist of a loop. When we are obtaining the value at C[i][j], row i of matrix A and column j of matrix B are multiplied element wise.

Add a comment
Know the answer?
Add Answer to:
Q: "Discuss your background about "investigate the performance of several C implementations of matrix multiplication and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write programs implementing matrix multiplication C = AB , where A is m x n and...

    Write programs implementing matrix multiplication C = AB , where A is m x n and B is n x k , in two different ways: ( a ) Compute the mk inner products of rows of A with columns of B , ( b ) Form each column of C as a linear combination of columns of A . Compare the performance of these two implementations on your computer. You may need to try fairly large matrices before the...

  • Matrix Multiplication with Threads - C/C++ **Please read entire question before answering** In this assignment you...

    Matrix Multiplication with Threads - C/C++ **Please read entire question before answering** In this assignment you will use the Pthreads library to write a program that multiplies two square arrays and compare the difference between the imperative and parallel implementations of this algorithm. Use the matrix mulltiplication algorithm. Write a program that contains three functions: (1) A function that has an integer as a parameter and returns a pointer to square array of integers (i.e. both dimensions should be equal)....

  • Background You have applied for a specific job in your field of study

    Paragraph 1 Background You’ve applied for a specific job in your field of studyParagraph 1BackgroundYou’ve applied for a specific job in your field of study. The Human Resources Department arranges aninterview and tells you to bring with you a polished piece of writing for them to evaluate your writingskills. The paragraph must describe one particular experience you’ve had that inspired you or guidedyou to choose the type of position for which you applied.Your audience is your potential employer and your...

  • Background Paragraph 1 You have applied for a specific job in your field of study

    Paragraph 1 Background You’ve applied for a specific job in your field of studyParagraph 1BackgroundYou’ve applied for a specific job in your field of study. The Human Resources Department arranges aninterview and tells you to bring with you a polished piece of writing for them to evaluate your writingskills. The paragraph must describe one particular experience you’ve had that inspired you or guidedyou to choose the type of position for which you applied.Your audience is your potential employer and your...

  • Hi everyone, I have a problem about C programming. Background Material: The figure 6 is as...

    Hi everyone, I have a problem about C programming. Background Material: The figure 6 is as below: The task: Download the file 55.c. Study the C code, then build an executable and run it to see what the output is. Modify the program so that the output is The string in buffer is "In C the value of 12 + 34 / 5 is 18." Do this by looking up decimal values for ASCII codes in Figure 6 and typing...

  • C programming is the main one and pick another code of choice!!! Background This assignment is...

    C programming is the main one and pick another code of choice!!! Background This assignment is based on one of the Big Ideas in this course, namely that reading C source code is a real aid in learning how to write C code. To that end, in this project, you write a program that scans C source from the 'Net and calculates some simple statistics. We're learning lots of concepts, and by running the program you write here on several...

  • Practical 5: Write a program that implements several sorting algorithms, and use it to demonstrate the comparative perfo...

    Practical 5: Write a program that implements several sorting algorithms, and use it to demonstrate the comparative performance of the algorithms for a variety of data sets. Need Help With this Sorting Algorithm task for C++ Base Code for sorting.cpp is given. The header file is not included in this. Help would be much appreciated as I have not started on this due to personal reasons #include <cstdlib> #include <iostream> #include <getopt.h> using namespace std; long compares; // for counting...

  • I need java code... Background Suppose you're working on the next great cligital assistant to compete...

    I need java code... Background Suppose you're working on the next great cligital assistant to compete with the likes of Siri, Cortana Alexa, and the lameless Google Assistant. An important part of your assistant is a text-10-speerlingine, You've managed to get your assistant to pronounce Englisli words, but you've hit a sag! The resistant is unable to pronounce numbers. When it sees 6243, it just says "six two four three insteud of the proper "six thousand two hundred forty three."...

  • CODE MUST BE IN C++ Objective Create a program that provides the solution to a quadratic...

    CODE MUST BE IN C++ Objective Create a program that provides the solution to a quadratic equation. Background: A quadratic equation can be generalized by equation below: f ( x )=ax2+ bx +c Closed form solutions can be found for the zeros of a quadratic function conveniently. That is the locations where the function is equal to zero can be found by the following equation: x=− b± √ b −4ac 2a Note that depending on the sign of the expression...

  • Project Background In a recent regular quarterly meeting in June, several members of the Board of...

    Project Background In a recent regular quarterly meeting in June, several members of the Board of Directors of Crystal Fashion Group (CFG) have a big concern on the future business position and outlook of the company in view of the long-term trade dispute between USA and China. Also, the rising costs of manufacturing in China are eroding off the profit margin and undercut CFG’s competitiveness in the market. Seeing that quite a number of fellow fashion/ garment manufacturers have already...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT