On Wed, Jul 19, 2017 at 2:50 AM, Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:
Duh.
> 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);
>
> }
>
> or some variation of this.
>
>>
>> In the next days I’m planning to work on replacing the bitarray to a
>> solution that uses a list to represent the regions involved in each
>> partition (regiontable), which despite using more memory, should be
>> considerably faster.
>>
>
> --
> Vasco Alexandre da Silva Costa
> PhD in Computer Engineering (Computer Graphics)
> Instituto Superior Técnico/University of Lisbon, Portugal
>
--
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