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

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

Added original make3d

File size: 383 bytes
Line 
1function f = flops_sample(p,n)
2% FLOPS_SAMPLE   Flops for sample(p,n)
3% Flopcount based on systematic sampling.
4
5% old algorithm:
6% The flopcount for sample is the same as the value returned by sample,
7% so the expected flops is E[x].
8% Note that the result is typically not an integer.
9
10if nargin == 1
11  n = 1;
12end
13%f = n*sum((1:length(p)).*p);
14f = 2*(n + length(p));
Note: See TracBrowser for help on using the repository browser.