Boost logo

Boost :

Subject: Re: [boost] Is someone interested in container CompressedVector, a vector-like storage for integer types
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-09-30 09:01:38


Alexander Bulovyatov wrote:
>
> Hi!
>
> Assume you want an interface as for vector<unsigned int>, but know that
> elements have only N significant bits, say 17. In this case the
> container will save 46% memory compared to vector<unsigned int>.
>
> CompressedVector internally stores elements as a dynamic bitset
> (vector<size_t>) and uses bitshift ops to put/get significant bits
> into one or two size_t elements. It's similar to vector<bool> and
> dynamic_bitset, and has the same drawback, it's not a proper STL
> container.
>
> Anyway, the container is simple, efficient and quite fast.
> It will work best for very long arrays of indexes. Since its storage
> is continuous, it can also be used to speed up IO (load/store to
> disk, network transfers) acting as a very fast compression.
>
>

Hi,

Alejandro Cabrera needed something like that for counting bloom filters
(GSOC project). He included a private implementation taking in account his
needs.

Do you think that you could provide an implementation that is optimized for
(2, 4 bits)?

Best,
Vicente

 

--
View this message in context: http://boost.2283326.n4.nabble.com/Is-someone-interested-in-container-CompressedVector-a-vector-like-storage-for-integer-types-tp3858194p3859740.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk