Struct rustc_ap_rustc_index::bit_set::BitMatrix [−][src]
Expand description
A fixed-size 2D bit matrix type with a dense representation.
R
and C
are index types used to identify rows and columns respectively;
typically newtyped usize
wrappers, but they can also just be usize
.
All operations that involve a row and/or column index will panic if the index exceeds the relevant bound.
Implementations
Creates a new rows x columns
matrix, initially empty.
Creates a new matrix, with row
used as the value for every row.
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.
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
?
Returns those indices that are true in rows 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).
Adds the bits from row read
to the bits from row write
, and
returns 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).
Adds the bits from with
to the bits from row write
, and
returns true
if anything changed.
Sets every cell in row
to true.
Iterates through all the columns set to true in a given row of the matrix.
Trait Implementations
Auto Trait Implementations
impl<R, C> RefUnwindSafe for BitMatrix<R, C> where
C: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, C> UnwindSafe for BitMatrix<R, C> where
C: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.