sctchoi / gail

Automatically exported from code.google.com/p/gail
1 stars 0 forks source link

Saving O(n) flops in FUNAPPX_G #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Used Matlab profiler to find out a few time-consuming lines in funappx_g 
(version from Oct 1, 2013). Please refer to IIT 573 RMS Lecture 3 slides 
"Example of Running Profiler".

The following modifications save up to O(n) FLOPS per iteration:

1) Take (n-1) out of MAX to save O(n) multiplications per iteration

2) Take (n-1)^2  out of MAX to save O(n) multiplications per iteration

3) Recall from IIT RMS Lecture 2 that x = 0:1/(n-1):1; is a faster way than x = 
(0:n-1)/(n-1); for generating step vector. 

Original issue reported on code.google.com by sou.chen...@gmail.com on 7 Oct 2013 at 3:27

GoogleCodeExporter commented 9 years ago
Suggested steps: 

(Step 1) Modify the code. Time the code with tic, toc and/or profiler before 
and after code change. 

(Step 2) Ensure all doc tests and unit tests for FUNAPPX_G pass. 

(Step 3) Check in code. 

(Step 6) Edit this ticket by noting the code check-in date and/or version 
number. Change the "Status" from "Accepted" to "Fixed".

Original comment by sou.chen...@gmail.com on 7 Oct 2013 at 3:31

GoogleCodeExporter commented 9 years ago
Check-in date Oct 8

Original comment by ydi...@hawk.iit.edu on 9 Oct 2013 at 12:43