Question: Please i need this asap. Write a function with the following signature: float* matrix_multiplication(float* left, float* right, int rows, int shared, int columns); The first
Please i need this asap.
Write a function with the following signature:
float* matrix_multiplication(float* left, float* right, int rows, int shared, int columns);
The first two arguments are two pointers to the beginning of two matrices with the dimensions (rows,shared) and (shared, columns) correspondingly. The remaining arguments specify these dimensions. The return value will return a pointer to the very beginning of the result matrix. That said, you need to provide the space for the result matrix by dynamically allocating memory within your function.
What to submit I ask you to submit the following:
Submit your well-structured, well-documented code for the above function.
Submit a driver that tests your code as follows:
Hard-code the following two matrices into the driver code and then run your function:
Left matrix: float left[2][3] = {{1,2,3},{4,5,6}}
Right matrix: float right[3][4] = {{7,8,9,10},{11,12,13,14},{15,16,17,18}}
Finally, print out the result matrix on the standard output two-dimentionally, i.e. in its natural appearance.
Submit a screen shot that shows the printout of your result matrix.
Hint Use malloc() as discussed in class in order to allocate the piece of memory that is going to accommodate your result matrix.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
