Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Run length encode a bit vector

by AnomalousMonk (Chancellor)
on Jan 05, 2012 at 13:53 UTC ( #946399=note: print w/replies, xml ) Need Help??


in reply to Re^2: Run length encode a bit vector
in thread Run length encode a bit vector

Actually irrelevant as it is just sample data.

Can you please provide an example of relevant data and the relevant output you expect from that data?

The actual vector to be compressed is built with vec()...

Can you say why vec must be used? pack/unpack seem better suited.

Replies are listed 'Best First'.
Re^4: Run length encode a bit vector
by Anonymous Monk on Jan 05, 2012 at 14:28 UTC
    -- Can you please provide an example of relevant data and the relevant output you expect from that data?

    You want me to post a 31,156,327 byte bit-vector that represents just under a quarter of a billion boolean states?

    The vector is just a string of bits. Packing a integer to provide a sample was convenient. The ordering of the bits was irrelevant.

    The important factor was showing how the rle was to be encoded. -- Can you say why vec must be used?

    Pack (or any other means) is fine for the rle, but the original vector is built with vec() so the appropriate pack template for accessing the bits in the same order as they were constructed is 'b*'.

    The downside of using unpack 'b*' during the rle, is it expands the 31MB vector to a 250 MB string.

    On the other hand, vec() can process the 31MB without expanding it at all.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946399]
help
Chatterbox?
[1nickt]: choroba Is it a safe assumption that if there is a threaded perl then the user will want to use Thread::Queue?
[hippo]: Why not?
[1nickt]: That's good! I suppose the cpanfile would be the same however the app distro is structured ...
[1nickt]: hippo no reason why not other than wanting to check an assumption :-)
[hippo]: For a self-contained application which can therefore ensure thread safety it seems like a sensible approach.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (19)
As of 2017-10-18 13:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (244 votes). Check out past polls.

    Notices?