good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Run length encode a bit vectorby johngg (Canon) |
on Jan 05, 2012 at 10:59 UTC ( [id://946361]=note: print w/replies, xml ) | Need Help?? |
I'm not sure your expected output is making sense as I think you have probably mis-counted the number of zeros in the second term because there is actually a run of eight zeros there.
As well as that, you seem to be parsing your data with the low-order bit first in each byte even though you have packed in network order. I would expect you bit vector to look like this
with expected output
Perhaps you could clarify your requirement.
Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|