source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/flops_sample.m
@
86
Last change on this file since 86 was 37, checked in by , 15 years ago | |
---|---|
File size: 383 bytes |
Line | |
---|---|
1 | function 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 | |
10 | if nargin == 1 |
11 | n = 1; |
12 | end |
13 | %f = n*sum((1:length(p)).*p); |
14 | f = 2*(n + length(p)); |
Note: See TracBrowser
for help on using the repository browser.