Struct rustc_data_structures::bitvec::BitMatrix
[−]
[src]
pub struct BitMatrix { // some fields omitted }
rustc_private
)A "bit matrix" is basically a square matrix of booleans
represented as one gigantic bitvector. In other words, it is as if
you have N bitvectors, each of length N. Note that elements
here is N
/
Methods
impl BitMatrix
[src]
fn new(elements: usize) -> BitMatrix
fn add(&mut self, source: usize, target: usize) -> bool
fn contains(&self, source: usize, target: usize) -> bool
rustc_private
)Do the bits from source
contain target
?
Put another way, if the matrix represents (transitive)
reachability, can source
reach target
?
fn intersection(&self, a: usize, b: usize) -> Vec<usize>
rustc_private
)Returns those indices that are reachable from both a
and
b
. This is an O(n) operation where n
is the number of
elements (somewhat independent from the actual size of the
intersection, in particular).
fn merge(&mut self, read: usize, write: usize) -> bool
rustc_private
)Add the bits from read
to the bits from 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).
Trait Implementations
Derived Implementations
impl Clone for BitMatrix
[src]
fn clone(&self) -> BitMatrix
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more