Struct rustc_data_structures::bitvec::SparseBitMatrix
[−]
[src]
pub struct SparseBitMatrix<R, C> where
R: Idx,
C: Idx, { /* fields omitted */ }
Methods
impl<R: Idx, C: Idx> SparseBitMatrix<R, C>[src]
pub fn new(rows: R, _columns: C) -> SparseBitMatrix<R, C>[src]
Create a new rows x columns matrix, initially empty.
pub fn add(&mut self, row: R, column: C) -> bool[src]
Sets the cell at (row, column) to true. Put another way, insert
column to the bitset for row.
Returns true if this changed the matrix, and false otherwise.
pub fn contains(&self, row: R, column: C) -> bool[src]
Do the bits from row contain column? Put another way, is
the matrix cell at (row, column) true? Put yet another way,
if the matrix represents (transitive) reachability, can
row reach column?
pub fn merge(&mut self, read: R, write: R) -> bool[src]
Add the bits from row read to the bits from row write,
return true if anything changed.
This is used when computing transitive reachability because if
you have an edge write -> read, because in that case
write can reach everything that read can (and
potentially more).
pub fn iter<'a>(&'a self, row: R) -> impl Iterator<Item = C> + 'a[src]
Iterates through all the columns set to true in a given row of the matrix.
Trait Implementations
impl<R: Clone, C: Clone> Clone for SparseBitMatrix<R, C> where
R: Idx,
C: Idx, [src]
R: Idx,
C: Idx,
fn clone(&self) -> SparseBitMatrix<R, C>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<R: Debug, C: Debug> Debug for SparseBitMatrix<R, C> where
R: Idx,
C: Idx, [src]
R: Idx,
C: Idx,
Auto Trait Implementations
impl<R, C> Send for SparseBitMatrix<R, C> where
C: Send,
C: Send,
impl<R, C> Sync for SparseBitMatrix<R, C> where
C: Sync,
C: Sync,