ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 25 May 2017 My Price 8.00

elements of an NxN matrix of type

In this assignment, you will apply the concepts you learned in Chapters 5 and 6 to the problem of optimising code for a memory-intensive application. Consider a procedure to copy and transpose the elements of an NxN matrix of type int. That is, for source matrix S and destination matrix D, we want to copy each element s_i,j to d_j,i. This code can be written with a simple loop.

 

void transpose (int *dst, int *src, int dim)
{
int i,j;
for (i = 0; i < dim; i++)
for (j = 0; j < dim; j++)
dst[j*dim + i] = src[i*dim + j];
}

where the arguments to the procedure are pointers to the destination (dst) and source (src) matrices, as well as the matrix of size N (dim). Your job is to devise a transpose routine that runs as fast as possible.

Answers

(11)
Status NEW Posted 25 May 2017 02:05 AM My Price 8.00

-----------

Not Rated(0)