hw3 - Due: September 18, 2008 CS 257 (Luke Olson): Homework...

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

View Full Document Right Arrow Icon
Due: September 18, 2008 CS 257 (Luke Olson): Homework #3 Problem 1 [Puzzled] You are profiling a loop in your numerical code at work with the following snippet: Listing 1: First 1 function t = test1 ( n ) 2 3 tic ; 4 5 x(1) = 150; 6 for i=2:n 7 x(i) = .99 * x(i-1); 8 end 9 10 t = toc ; However, it is noticed that this piece is very slow as n increases. Offer a fix ( hint: one line ) that speeds up your code. Hand in the solution, a comparative timing showing the speedup, and a short explanation . Problem 2 [Storage] While profiling another portion of code ( mat-vec.m ) you implement two versions of a matrix- vector multiply ( see review lecture slides 5a ). Why is one method faster? Is this Matlab dependent? Hand in a timing result and a short explanation . Page 1 of 3
Background image of page 1

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

View Full DocumentRight Arrow Icon
Due: September 18, 2008 CS 257 (Luke Olson): Homework #3 Problem 3 [Naive Gaussian Elimination] Implement the following algorithm for (naive) Gaussian elimination. You can use the template GE naive.m . Hand in just your implementation.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/10/2011 for the course CS 257 taught by Professor Olson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 3

hw3 - Due: September 18, 2008 CS 257 (Luke Olson): Homework...

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

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