Boost logo

Boost :

From: Yuriy Koblents-Mishke (yurakm_at_[hidden])
Date: 2007-02-02 03:46:24

On 2/1/07, Hervé Brönnimann <hervebronnimann_at_[hidden]> wrote:
> I was surprised not to find the least_significant_ bit_index and
> most_significant_bit_index functions. These can be heavily optimized
> using binary search and logical and/or manips for integral types,
> compared to a loop, so it would be especially worth having in your
> collection.
> [snip]

To my understanding, these functions are already accepted into Boost under
different names. See integer_log2.hpp and lowest_bit.hpp by Gennaro Prota,
2003 - 2004, in boost\pending. Function integer_log2.hpp is implemented
using binary search, and function lowest_bit.hpp simply calls

I believe that the codes can be optimized even more using lookup tables, and
I work on it together with Alla Serikova.



Boost list run by bdawes at, gregod at, cpdaniel at, john at