vigna / dsi-bitstream-rs

A Rust implementation of read/write bit streams supporting several types of instantaneous codes
Apache License 2.0
7 stars 3 forks source link

Adding methods to subtract gaps in CodesStats #15

Open LucaCappelletti94 opened 2 weeks ago

LucaCappelletti94 commented 2 weeks ago

In my use case, I am adding and removing elements from a sequence of hashes up until the best code fits within the size of the bitarray. Therefore, in order to estimate the optimal code for my use case, I need to add a method to remove a value from the CodesStats so that I may use it more straightforwardly than what I am presently doing.

LucaCappelletti94 commented 2 weeks ago

Also, at this time the methods to add a new value to the CodesStats are called update or update_many. This seems like an unfortunate naming choice once I add a method to subtract a value, as it does not make it clear whether the update operation is an addition or subtraction - maybe the update_many should accept an i64 as the count parameter.