in reply to Re^5: Need a faster way to find matches
in thread Need a faster way to find matches
The criteria to be in the list is complex (and I don't want to go off-topic). The numbers are highly constrained, yet once they make it to the list, I need to find all pairs of numbers which do not share any common bits (after getting rid of the one shared lsb). Below is an example of a valid pair. The bit-wise complement may or may not exist in the list.
Does that example, clarify why the bitwise negation isn't a quick trick? I may be missing your approach altogether.#all values have been right shifted to get rid of lsb $i1 = 0b1010_0100; $i2 = 0b0100_1000; #the above two numbers are a valid pair. # yet my list may not contain either ~$i1 or ~$i2 $i1_bits_reversed = 0b0101_1011; $i2_bits_reversed = 0b1011_0111 # the above two numbers are not a valid pair,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Need a faster way to find matches
by kikuchiyo (Hermit) on Jan 18, 2010 at 10:01 UTC |