3. Consider the following procedure that performs multiplication of two lower triangular matrices A..n and B.1[1.n] MATRIX_MU

3. Consider the following procedure that performs multiplication of two lower triangular matrices A..n and B.1[1.n] MATRIX_MULTIPLY(A[1..n][1..n], B[..n]1..m Run-time per instruction Frequency to n C1 1. for for j C2 C3 C4 2. to i Cij0 for k 3. 4. to i Cs 5. CijCij+ak bkj C6 6. return C As the product C[1..]|1..n is also lower triangular, concerned with the strictly upper triangular entries of the matrix, which are all zeros we assume that we do not have to be (a) Fill in for each line of instruction, the number of times (i.e., frequency) the instruction is executed (b) Derive the expression for the run-time of MATRIX_MULTIPLY in terms of n and C; (c) When you run MATRIX_MULTIPLY in this question and MATRIX_MULTIPLY in question 2, as- suming all matrices involved are of dimensions nx n, you would notice that this version is faster Assume that the C’s in this question and in question 2 are the same. If it takes T to complete the computation in question 2, roughly how much time would it take to complete the computation in this question?



Source link

Leave a Reply

Your email address will not be published.