[vsipl++] [patch] histogram [signal.histo]
Don McCoy
don at codesourcery.com
Tue Dec 6 01:04:03 UTC 2005
Jules Bergmann wrote:
> Don,
>
> Looks good, a couple of minor suggestions below, please check it in.
> -- Jules
>
Checked in with the following changes. Revised patch attached.
> You could replace code like:
>
>> + index_type n = num_bin_;
>> + while ( n-- )
>> + hist_.put(n, 0);
>
> with this:
>
> hist_ = 0;
>
Done
>
> Also, you might take the common code for computing the histogram index
> and put it into a separate member function:
>
> inline index_type
> impl_bin(T value)
> {
> if (value < min_)
> return 0;
> else if (value >= max_)
> return num_bin - 1;
> else
> return (index_type)((data(i) - min_) / delta_);
> }
Done. Thanks -- that cleans it up nicely.
--
Don McCoy
CodeSourcery, LLC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hg2.diff
Type: text/x-patch
Size: 9117 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20051205/6cbd2d35/attachment.bin>
More information about the vsipl++
mailing list