My code is pre-aligning the needle to a byte boundary,
That would, for my purposes, mean that the entire needle would need to be copied, and the time taken counted.
The reason is hinted at in the 6 argument function signature(*) I posted in the OP:
U64 bsSearch( U64 *hay, U8 oHay, U64 lHay, U64 *ndl, U8 oNdl, U64 lNdl + );
Both the haystack and needle will be subsections of -- potentially much larger -- bitstrings; and shifting them in-place is not on, because they are effectively just windows into the parent bitstrings -- think substr refs. (Though I guess you might be able to rotate them in place -- rotate so that no bits are lost -- then rotate them back afterwards; but again, the time taken would have to be counted.).
That's why I'm now recoding in OO-style; so that the function signature can become: bvSearch( BV *hay, BV *ndl ); and I can hide the nasty offsets, cross-boundary manipulations and (in particular) end-of-bitstring sub-64-bit bits behind the curtains.
In reply to Re^18: [OT] The interesting problem of comparing (long) bit-strings.
by BrowserUk
in thread [OT] The interesting problem of comparing bit-strings.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |