On 27/03/2014, at 7:33 AM, Jim Lloyd wrote:
>
> int Judy1SetRange( PPvoid_t PPJ1Array, Word_t First, Word_t Last,
> PJError_t PJError);
> int Judy1UnsetRange(PPvoid_t PPJ1Array, Word_t First, Word_t Last,
> PJError_t PJError);
> We could implement these functions as loops over Judy1Set and Judy1Unset,
Sounds good :-)
> but I bet Judy1 could be much smarter about the operations performed on the
> internal data structure using this API. Is this something that could be
> easily added?
Another way:
A set range is represented by a map
first -> length
using JudyL. Set and unset operations are a bit more
complex now, since a set operation may require a merge
of two entries, etc, but the algorithm isn't hard to figure out
and the operation is constant time if the ranges are sparse.
Otherwise you can just use
first % 2^64 -> 2^64
i.e. map to 64 bits (which is more or less what Judy1
is doing internally anyhow). The best technique depends on
your distribution but a suitable hybrid is probably faster than
plain Judy1 if you have any sort of "clumping".
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel