pub struct BitMatrix { /* private fields */ }Implementations§
Source§impl BitMatrix
impl BitMatrix
Sourcepub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Count number of set bits in the matrix.
Sourcepub fn bitand(&self, other: &Self) -> Self
pub fn bitand(&self, other: &Self) -> Self
Bitwise AND producing a new matrix. Requires same shape.
Sourcepub fn bitand_assign(&mut self, other: &Self)
pub fn bitand_assign(&mut self, other: &Self)
In-place AND with other.
Sourcepub fn bitor_assign(&mut self, other: &Self)
pub fn bitor_assign(&mut self, other: &Self)
In-place OR with other.
Sourcepub fn bitxor_assign(&mut self, other: &Self)
pub fn bitxor_assign(&mut self, other: &Self)
In-place XOR with other.
Sourcepub fn row_and_assign(&mut self, dst_row: usize, src_row: usize)
pub fn row_and_assign(&mut self, dst_row: usize, src_row: usize)
Fast in-place row-wise AND: dst_row &= src_row.
Sourcepub fn row_or_assign(&mut self, dst_row: usize, src_row: usize)
pub fn row_or_assign(&mut self, dst_row: usize, src_row: usize)
Fast in-place row-wise OR: dst_row |= src_row.
Sourcepub fn row_xor_assign(&mut self, dst_row: usize, src_row: usize)
pub fn row_xor_assign(&mut self, dst_row: usize, src_row: usize)
Fast in-place row-wise XOR: dst_row ^= src_row.
Sourcepub fn col_and_assign(&mut self, dst_col: usize, src_col: usize)
pub fn col_and_assign(&mut self, dst_col: usize, src_col: usize)
In-place column-wise AND: for each row r, dst_col[r] &= src_col[r].
Sourcepub fn col_or_assign(&mut self, dst_col: usize, src_col: usize)
pub fn col_or_assign(&mut self, dst_col: usize, src_col: usize)
In-place column-wise OR: for each row r, dst_col[r] |= src_col[r].
Sourcepub fn col_xor_assign(&mut self, dst_col: usize, src_col: usize)
pub fn col_xor_assign(&mut self, dst_col: usize, src_col: usize)
In-place column-wise XOR: for each row r, dst_col[r] ^= src_col[r].
Sourcepub fn column(&self, col: usize) -> Vec<bool>
pub fn column(&self, col: usize) -> Vec<bool>
Get a column as a Vec
Sourcepub fn set_column(&mut self, col: usize, src: &[bool])
pub fn set_column(&mut self, col: usize, src: &[bool])
Set a column from a slice of bools.
Sourcepub fn iter_row(&self, row: usize) -> RowIter<'_> ⓘ
pub fn iter_row(&self, row: usize) -> RowIter<'_> ⓘ
Row iterator (yields booleans across columns for a row).
Trait Implementations§
impl Eq for BitMatrix
impl StructuralPartialEq for BitMatrix
Auto Trait Implementations§
impl Freeze for BitMatrix
impl RefUnwindSafe for BitMatrix
impl Send for BitMatrix
impl Sync for BitMatrix
impl Unpin for BitMatrix
impl UnwindSafe for BitMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more