Skip to main content

Module bit_set

Module bit_set 

Source

Re-exportsΒ§

use std::marker::PhantomData; πŸ”’
use std::ops::Bound; πŸ”’
use std::ops::Range; πŸ”’
use std::ops::RangeBounds; πŸ”’
use std::rc::Rc; πŸ”’
use std::fmt; πŸ”’
use std::iter; πŸ”’
use std::slice; πŸ”’
use rustc_macros::Decodable_NoContext; πŸ”’
use rustc_macros::Encodable_NoContext; πŸ”’
use crate::Idx; πŸ”’
use crate::IndexVec; πŸ”’
use Chunk::*; πŸ”’

StructsΒ§

BitIter
BitMatrix
A fixed-size 2D bit matrix type with a dense representation.
ChunkedBitIter
ChunkedBitSet
A fixed-size bitset type with a partially dense, partially sparse representation. The bitset is broken into chunks, and chunks that are all zeros or all ones are represented and handled very efficiently.
DenseBitSet
A fixed-size bitset type with a dense representation.
GrowableBitSet
A resizable bitset type with a dense representation.
SparseBitMatrix
A fixed-column-size, variable-row-size 2D bit matrix with a moderately sparse representation.

EnumsΒ§

Chunk πŸ”’
ChunkIter πŸ”’
MixedBitIter
MixedBitSet
A bitset with a mixed representation, using DenseBitSet for small and medium bitsets, and ChunkedBitSet for large bitsets, i.e. those with enough bits for at least two chunks. This is a good choice for many bitsets that can have large domain sizes (e.g. 5000+).

ConstantsΒ§

CHUNK_BITS πŸ”’
CHUNK_WORDS πŸ”’
WORD_BITS πŸ”’
WORD_BYTES πŸ”’

FunctionsΒ§

chunk_index πŸ”’
chunk_word_index_and_mask πŸ”’
clear_excess_bits_in_final_word πŸ”’
count_ones πŸ”’
inclusive_start_end πŸ”’
insert πŸ”’
max_bit πŸ”’
num_words πŸ”’
update_words πŸ”’
Sets lhs[i] = op(lhs[i], rhs[i]) for each index i in both slices. The slices must have the same length.
word_index_and_mask πŸ”’
would_modify_words πŸ”’
Returns true if a call to update_words would modify lhs, i.e. lhs[i] != op(lhs[i], rhs[i]) for some i.

Type AliasesΒ§

ChunkSize πŸ”’
ChunkSize is small to keep Chunk small. The static assertion ensures it’s not too small.
Word πŸ”’