[−][src]Struct bit_matrix::matrix::BitMatrix
A matrix of bits.
Methods
impl BitMatrix
[src]
pub fn new(rows: usize, row_bits: usize) -> Self
[src]
Create a new BitMatrix with specific numbers of bits in columns and rows.
pub fn size(&self) -> (usize, usize)
[src]
Returns the matrix's size as (rows, columns)
.
pub fn set(&mut self, row: usize, col: usize, enabled: bool)
[src]
pub fn set_all(&mut self, enabled: bool)
[src]
Sets the value of all bits.
pub fn grow(&mut self, num_rows: usize, value: bool)
[src]
Grows the matrix in-place, adding num_rows
rows filled with value
.
pub fn truncate(&mut self, num_rows: usize)
[src]
Truncates the matrix.
pub fn sub_matrix(&self, range: Range<usize>) -> BitSubMatrix
[src]
Returns a slice of the matrix's rows.
pub fn split_at(&self, row: usize) -> (BitSubMatrix, &BitVecSlice, BitSubMatrix)
[src]
Given a row's index, returns a slice of all rows above that row, a reference to said row, and a slice of all rows below.
Functionally equivalent to (self.sub_matrix(0..row), &self[row], self.sub_matrix(row..self.num_rows()))
.
pub fn split_at_mut(
&mut self,
row: usize
) -> (BitSubMatrixMut, &mut BitVecSlice, BitSubMatrixMut)
[src]
&mut self,
row: usize
) -> (BitSubMatrixMut, &mut BitVecSlice, BitSubMatrixMut)
Given a row's index, returns a slice of all rows above that row, a reference to said row, and a slice of all rows below.
ⓘImportant traits for Iter<'a>pub fn iter_row(&self, row: usize) -> Iter
[src]
Iterate over bits in the specified row.
pub fn transitive_closure(&mut self)
[src]
Computes the transitive closure of the binary relation represented by the matrix.
Uses the Warshall's algorithm.
pub fn reflexive_closure(&mut self)
[src]
Computes the reflexive closure of the binary relation represented by the matrix.
Trait Implementations
impl Debug for BitMatrix
[src]
impl PartialEq<BitMatrix> for BitMatrix
[src]
impl Eq for BitMatrix
[src]
impl Ord for BitMatrix
[src]
fn cmp(&self, other: &BitMatrix) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialOrd<BitMatrix> for BitMatrix
[src]
fn partial_cmp(&self, other: &BitMatrix) -> Option<Ordering>
[src]
fn lt(&self, other: &BitMatrix) -> bool
[src]
fn le(&self, other: &BitMatrix) -> bool
[src]
fn gt(&self, other: &BitMatrix) -> bool
[src]
fn ge(&self, other: &BitMatrix) -> bool
[src]
impl Index<usize> for BitMatrix
[src]
Returns the matrix's row in the form of an immutable slice.
type Output = BitVecSlice
The returned type after indexing.
fn index(&self, row: usize) -> &BitVecSlice
[src]
impl Index<(usize, usize)> for BitMatrix
[src]
Returns true
if a bit is enabled in the matrix, or false
otherwise.
type Output = bool
The returned type after indexing.
fn index(&self, (row, col): (usize, usize)) -> &bool
[src]
impl IndexMut<usize> for BitMatrix
[src]
Returns the matrix's row in the form of a mutable slice.
fn index_mut(&mut self, row: usize) -> &mut BitVecSlice
[src]
impl Hash for BitMatrix
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl StructuralPartialEq for BitMatrix
[src]
impl StructuralEq for BitMatrix
[src]
impl Clone for BitMatrix
[src]
impl Default for BitMatrix
[src]
Auto Trait Implementations
impl Unpin for BitMatrix
impl Send for BitMatrix
impl Sync for BitMatrix
impl UnwindSafe for BitMatrix
impl RefUnwindSafe for BitMatrix
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,