HW 5 Challenge

HW 5 Challenge - LU Decomposition (m_ludet): order of n 3 I...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
HW 5 Challenge I used m_ddrand() function in matrix.c of HW5 to generate the diagonally dominant matrices to test the performance of m_det() function from my HW4 and m_ludet() function from my HW5. The following plots show time in milliseconds per one function call vs matrix size. m_det() - recursive 0 20000 40000 60000 80000 100000 120000 140000 160000 1 2 3 4 5 6 7 8 9 10 11 12 n time (ms) m_ludet() - LU Decomposition 0 500 1000 1500 2000 2500 3000 1 65 129 193 257 321 385 449 n Best guess formulae: Recursive Function (m_det) : order of (n!) If the computation required for a matrix of size 1 is 1 unit, for matrix of size 2, the function calls itself twice requiring 1 unit of computation each time i.e. requiring total of 2*1 = 2 units of computation. Similarly, a matrix of size n would require n(n-1)(n-2)…1 Note: Projected time for n = 512 is too high to compute.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
= n! units of computation. When I checked with my time data, the best formula I got to calculate time needed was (n!/ 3500) milliseconds.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: LU Decomposition (m_ludet): order of n 3 I approximated number of operations of LU algorithm to =--+--n k k n k n 1 2 ] ) 1 ( ) 1 [( which I further simplified into (n 3 +n 2 +n) n 3 . When I checked with my data, the best formula I got to calculate time needed was (n 3 /100000) milliseconds. Factors governing the speeds of functions: 1. Number of floating point operations involved. 2. Memory operations: In every iteration in recursive function, new matrix is being created and freed, these operations take time. We dont have this in LU. 3. Memory Accessibility: In recursive function, we have to store the matrix itself and also the minors. Once the Cache is full, accessing data from other memory locations is more time taking. In LU algorithm, we only have one matrix which for reasonable n, can fit in the Cache. Name: Kranthi Kode...
View Full Document

This note was uploaded on 06/17/2010 for the course CME 211 taught by Professor Staff during the Winter '10 term at Stanford.

Page1 / 2

HW 5 Challenge - LU Decomposition (m_ludet): order of n 3 I...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online