Just to clarify, I need to walk all set indexes in random order. I thought you meant Judy1Test as you mentioned below, might be a good bet to modify to create Judy1Rand to randomly walk the Judy data structure 1 bit at a time. But checking one bit at a time would not return the Indices uniformly in a tree, without taking into account the count of Indices below a certain bit level. It would just be more fun to select an integer between 1,...,(no of indices left in Judy1 Array) and use J1BC to pick it out. Then keep repeating until none left. It doesn't need to happen too often, so all good.
Thanks everyone for your help :). I think I've got what I need. Judy Arrays are awesome. -----Original Message----- From: John Skaller2 <[email protected]> Sent: Wednesday, 22 January 2020 7:30 PM To: Matthew Brown <[email protected]> Cc: judy <[email protected]> Subject: Re: Select value in Judy1 Array at random > On 22 Jan 2020, at 07:34, Matthew Brown <[email protected]> wrote: > > Hi Again > > Thank you very much for your help last time (2017). > > I need to be able to get a value from a Judy1 array at random. Judy1Test(PJ1Array, Index, &JError) #define J1T(Rc_int, PJ1Array, Index) \ Rc_int = Judy1Test(PJ1Array, Index, PJE0) — John Skaller [email protected] _______________________________________________ Judy-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/judy-devel
