pub struct SparseBitset { /* private fields */ }Expand description
A set of instances that supports intersection and constant-time undo.
Words that become zero are moved out of the active part of
non_zero_words, so later operations only visit non-empty words.
Implementations§
Source§impl SparseBitset
impl SparseBitset
Sourcepub fn intersect_with(&mut self, other: &Bitset, invert: bool) -> usize
pub fn intersect_with(&mut self, other: &Bitset, invert: bool) -> usize
Intersects with other (with its complement when invert), saving the
current state for Self::restore. Returns the new size.
Sourcepub fn count_intersect_with(&self, other: &Bitset, invert: bool) -> usize
pub fn count_intersect_with(&self, other: &Bitset, invert: bool) -> usize
Size of the intersection with other (or its complement), without
changing the set.
Sourcepub fn count_intersect_with_many(&self, others: &[Bitset]) -> Vec<usize>
pub fn count_intersect_with_many(&self, others: &[Bitset]) -> Vec<usize>
Size of the intersection with each of others.
Trait Implementations§
Source§impl From<&SparseBitset> for ShallowBitset
impl From<&SparseBitset> for ShallowBitset
Source§fn from(val: &SparseBitset) -> Self
fn from(val: &SparseBitset) -> Self
Converts to this type from the input type.
Source§impl Sub<&ShallowBitset> for &SparseBitset
in_count counts the elements of self missing from rhs, and
out_count the elements of rhs missing from self.
impl Sub<&ShallowBitset> for &SparseBitset
in_count counts the elements of self missing from rhs, and
out_count the elements of rhs missing from self.
Source§type Output = Difference
type Output = Difference
The resulting type after applying the
- operator.Source§impl Sub<&ShallowBitset> for SparseBitset
impl Sub<&ShallowBitset> for SparseBitset
Source§type Output = Difference
type Output = Difference
The resulting type after applying the
- operator.Source§impl Sub<ShallowBitset> for SparseBitset
impl Sub<ShallowBitset> for SparseBitset
Source§type Output = Difference
type Output = Difference
The resulting type after applying the
- operator.Source§impl Sub<ShallowBitset> for &SparseBitset
impl Sub<ShallowBitset> for &SparseBitset
Source§type Output = Difference
type Output = Difference
The resulting type after applying the
- operator.Auto Trait Implementations§
impl Freeze for SparseBitset
impl RefUnwindSafe for SparseBitset
impl Send for SparseBitset
impl Sync for SparseBitset
impl Unpin for SparseBitset
impl UnsafeUnpin for SparseBitset
impl UnwindSafe for SparseBitset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more