Skip to content

Commit

Permalink
v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tower120 committed Jan 3, 2024
1 parent 617cc9c commit b421076
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "hi_sparse_bitset"
authors = ["Andrey Diduh <tower120@gmail.com>"]
license = "MIT OR Apache-2.0"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
repository = "https://github.com/tower120/hi_sparse_bitset"
keywords = ["hierarchical", "sparse", "bitset", "bitmap", "container"]
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ algorithmic complexity on operations between bitsets.
## Usage

```rust
use hi_sparse_bitset::reduce;
use hi_sparse_bitset::ops::*;
type BitSet = hi_sparse_bitset::BitSet<hi_sparse_bitset::config::_128bit>;

let bitset1 = BitSet::from([1,2,3,4]);
let bitset2 = BitSet::from([3,4,5,6]);
let bitset3 = BitSet::from([3,4,7,8]);
let bitset4 = BitSet::from([4,9,10]);
let bitsets = [bitset1, bitset2, bitset3];

// reduce on bitsets iterator
let intersection = reduce(BitAndOp, bitsets.iter()).unwrap();
let intersection = reduce(And, bitsets.iter()).unwrap();
assert_equal(&intersection, [3,4]);

// operation between different types
Expand Down

0 comments on commit b421076

Please sign in to comment.