octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifications to hist.m


From: Andy Adler
Subject: Re: Modifications to hist.m
Date: Sun, 16 Mar 2003 13:38:26 -0500 (EST)

Paul,

That's some really nice code - Tried to think of a faster
solution that would not eat too much more memory, but
yours is great. It's slightly more expensive for a small
number of bins, but the crossover is about 30, in my example

r=[]; i=0;
for sz= [100, 200, 500];
    x=rand(sz^2,1);
    for n=[10,30,100];  i++;
      tic; h1=hist1(x,n);r(i,1)= toc;
      tic; h2=hist2(x,n);r(i,2)= toc;
      tic; h3=hist3(x,n);r(i,3)= toc;
    end
end

          CURRENT   ANDY    PAUL
SZ=100
   n=10    0.059   0.032   0.077
   n=30    0.172   0.079   0.085
   n=100   0.575   0.245   0.086
SZ=200
   n=10    0.242   0.109   0.344
   n=30    0.754   0.312   0.335
   n=100   2.526   1.016   0.350
SZ=500
   n=10    1.688   0.733   2.831
   n=30    9.110   2.237   4.967
   n=100  32.847  13.291   5.431

Andy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]