Struct rustc_data_structures::bitvec::BitMatrix [−][src]
pub struct BitMatrix<R: Idx, C: Idx> { columns: usize, vector: Vec<u128>, phantom: PhantomData<(R, C)>, }
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A "bit matrix" is basically a matrix of booleans represented as
one gigantic bitvector. In other words, it is as if you have
rows bitvectors, each of length columns.
Fields
columns: usize
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
vector: Vec<u128>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
phantom: PhantomData<(R, C)>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<R: Idx, C: Idx> BitMatrix<R, C>[src]
impl<R: Idx, C: Idx> BitMatrix<R, C>pub fn new(rows: usize, columns: usize) -> BitMatrix<R, C>[src]
pub fn new(rows: usize, columns: usize) -> BitMatrix<R, C>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Create a new rows x columns matrix, initially empty.
fn range(&self, row: R) -> (usize, usize)[src]
fn range(&self, row: R) -> (usize, usize)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The range of bits for a given row.
pub fn add(&mut self, row: R, column: R) -> bool[src]
pub fn add(&mut self, row: R, column: R) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Sets the cell at (row, column) to true. Put another way, add
column to the bitset for row.
Returns true if this changed the matrix, and false otherwise.
pub fn contains(&self, row: R, column: R) -> bool[src]
pub fn contains(&self, row: R, column: R) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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 intersection(&self, a: R, b: R) -> Vec<C>[src]
pub fn intersection(&self, a: R, b: R) -> Vec<C>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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).
pub fn merge(&mut self, read: R, write: R) -> bool[src]
pub fn merge(&mut self, read: R, write: R) -> bool🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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).
ⓘImportant traits for BitVectorIter<'a, C>pub fn iter<'a>(&'a self, row: R) -> BitVectorIter<'a, C>[src]
pub fn iter<'a>(&'a self, row: R) -> BitVectorIter<'a, C>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Iterates through all the columns set to true in a given row of the matrix.
Trait Implementations
impl<R: Clone + Idx, C: Clone + Idx> Clone for BitMatrix<R, C>[src]
impl<R: Clone + Idx, C: Clone + Idx> Clone for BitMatrix<R, C>fn clone(&self) -> BitMatrix<R, C>[src]
fn clone(&self) -> BitMatrix<R, C>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<R: Debug + Idx, C: Debug + Idx> Debug for BitMatrix<R, C>[src]
impl<R: Debug + Idx, C: Debug + Idx> Debug for BitMatrix<R, C>