Struct bit_matrix::submatrix::BitSubMatrixMut
source · pub struct BitSubMatrixMut<'a> { /* private fields */ }
Expand description
Mutable access to a range of matrix’s rows.
Implementations§
source§impl<'a> BitSubMatrixMut<'a>
impl<'a> BitSubMatrixMut<'a>
sourcepub fn new(slice: &mut [Block], row_bits: usize) -> BitSubMatrixMut<'_>
pub fn new(slice: &mut [Block], row_bits: usize) -> BitSubMatrixMut<'_>
Returns a new BitSubMatrixMut.
sourcepub unsafe fn from_raw_parts(
ptr: *mut Block,
rows: usize,
row_bits: usize
) -> Self
pub unsafe fn from_raw_parts( ptr: *mut Block, rows: usize, row_bits: usize ) -> Self
Forms a BitSubMatrix from a pointer and dimensions.
sourcepub fn sub_matrix(&self, range: Range<usize>) -> BitSubMatrix<'_>
pub fn sub_matrix(&self, range: Range<usize>) -> BitSubMatrix<'_>
Returns a slice of the matrix’s rows.
sourcepub fn split_at(&self, row: usize) -> (BitSubMatrix<'_>, BitSubMatrix<'_>)
pub fn split_at(&self, row: usize) -> (BitSubMatrix<'_>, BitSubMatrix<'_>)
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()))
.
sourcepub fn split_at_mut(
&mut self,
row: usize
) -> (BitSubMatrixMut<'_>, BitSubMatrixMut<'_>)
pub fn split_at_mut( &mut self, row: usize ) -> (BitSubMatrixMut<'_>, 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.
sourcepub fn transitive_closure(&mut self)
pub fn transitive_closure(&mut self)
Computes the transitive closure of the binary relation represented by the matrix.
Uses the Warshall’s algorithm.
sourcepub fn reflexive_closure(&mut self)
pub fn reflexive_closure(&mut self)
Computes the reflexive closure of the binary relation represented by the matrix.
Trait Implementations§
source§impl<'a> Index<usize> for BitSubMatrixMut<'a>
impl<'a> Index<usize> for BitSubMatrixMut<'a>
Returns the matrix’s row in the form of a mutable slice.