source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/test_row_sum.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 587 bytes
Line 
1% timing test for row_sum
2
3% each trial should take the same amount of time
4% if not, then you are not managing the cache properly
5tim = [];
6for k = 1:6
7  x = randn(1024*k/4, 400);
8  niter = floor(120/k);
9
10  tic; for i = 1:niter sum(x,2); end; tim(k,1) = toc;
11  tic; for i = 1:niter row_sum(x); end; tim(k,2) = toc;
12  tic; for i = 1:niter x*ones(cols(x),1); end; tim(k,3) = toc;
13  tic; for i = 1:niter sum(x')'; end; tim(k,4) = toc;
14end
15figure(1)
16clf
17plot(tim)
18xlabel('trial')
19ylabel('time (sec)')
20legend('sum(x,2)', 'rowsum', 'product', 'sum(x'')''', 2)
21tim(end,1)
Note: See TracBrowser for help on using the repository browser.