[PPL-devel] Re: Integers as bit arrays
Wed, 30 Jul 2003 22:51:05 +0200
Kevin Ryde wrote:
> Roberto Bagnara <firstname.lastname@example.org> writes:
>>- searching 0 or 1 bits scanning towards less significant bits;
>>- efficiently deciding whether a set of naturals is a (proper
>> or non proper) subset of another.
> They're in the tasks list. If Torbjorn likes the concepts then
> they're only waiting for nice names and good implementations.
Good. For the names, I think the choice belongs to senior GMP
developer; for the good implementations, what I contributed is
a possible starting point that Brian can refine at will (I will
release it under a different license if that helps).
> Is your "next" routine the same as mpz_scan1?
More or less. In particular, our next() routine
can be implemented as
unsigned long r = mpz_scan1(vec, ++position);
return (r == ULONG_MAX) ? -1 : r;
However, last time I checked this was significantly slower.
I will re-check though.
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy