help-octave
[Top][All Lists]
Advanced

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

Re: fast hist() / histogram() implementation in C++


From: Andy Adler
Subject: Re: fast hist() / histogram() implementation in C++
Date: Thu, 27 May 2004 12:42:56 -0400 (EDT)

About a year ago, a fair amount of effort was put into
optimizing the hist.m function. I believe that your
argument for adding a C++ implementation would be better
if you provided some benchmark examples rather than
"it is order(s) of magnitude worse".

Take a look at:
http://www.octave.org/octave-lists/archive/octave-maintainers.2003/msg00084.html

Thanks

Andy


On Thu, 27 May 2004, Petr Mikulik wrote:

> It seems that the M-language does not provide an efficient way to implement
> histogram function. It is order(s) of magnitude worse than  ndat*log2(nbins)
> efficiency of a loop-friendly language, like C/C++. As an example, try the
> following histograming code for a 2048x2048 image:
>         n=2048;
>       nbins=100;
>         a=1./hilb(n);
>         imagesc(a);
>         tic; [y,x]=hist(a(:),nbins); toc
>
>
> I'm using my own function called "histogram" with this syntax:
>   [ [x, ] h ] = histogram ( image [, bins [, zfrom, zto] [, do_log ]] )
>
> I've put its M and well as C++ (=>.oct) code to
>       http://www.sci.muni.cz/~mikulik/tmp/pmhist4octave.zip
>
> It would be great if someone uses its code (...or his own code) for a C++
> (thus => .oct routine) implementation of
>         histc(data, edges)
> function for calculating histogram based on given vector of bin edges. Then,
> hist() function should call this histc.oct instead of its current inefficient
> M-language implementation.
>
> Looking forward to histc.cc.
>
> Petr Mikulik
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
>
>



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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