On Wed, Jul 19, 2017 at 2:50 AM, Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:
Google ate my e-mail. :-)
Also your code to iterate the bitarray is still inefficient. You check the
> leading zeros in an uint but then you iterate the bits one by one over that
> to iterate over all set bits. This should be faster:
>
> uint mask; /* initialized with some bits set. */
> uint i, n;
> i = 0;
> while (mask != 0) {
> n = clz(mask);
> i += n;
> /* bit 32-i is set */
> mask <<= (n+1);
>
i++;
> }
>
> or some variation of this.
>
>
--
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel