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>

source

pub fn new(slice: &mut [Block], row_bits: usize) -> BitSubMatrixMut<'_>

Returns a new BitSubMatrixMut.

source

pub unsafe fn from_raw_parts( ptr: *mut Block, rows: usize, row_bits: usize ) -> Self

Forms a BitSubMatrix from a pointer and dimensions.

source

pub fn set(&mut self, row: usize, col: usize, enabled: bool)

Sets the value of a bit.

§Panics

Panics if (row, col) is out of bounds.

source

pub fn sub_matrix(&self, range: Range<usize>) -> BitSubMatrix<'_>

Returns a slice of the matrix’s rows.

source

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())).

source

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.

source

pub fn transitive_closure(&mut self)

Computes the transitive closure of the binary relation represented by the matrix.

Uses the Warshall’s algorithm.

source

pub fn reflexive_closure(&mut self)

Computes the reflexive closure of the binary relation represented by the matrix.

source

pub fn iter_mut( &mut self ) -> Map<ChunksMut<'_, Block>, fn(_: &mut [Block]) -> &mut BitSlice>

Iterates over the matrix’s rows in the form of mutable slices.

Trait Implementations§

source§

impl<'a> Index<usize> for BitSubMatrixMut<'a>

Returns the matrix’s row in the form of a mutable slice.

§

type Output = BitSlice

The returned type after indexing.
source§

fn index(&self, row: usize) -> &BitSlice

Performs the indexing (container[index]) operation. Read more
source§

impl<'a> IndexMut<usize> for BitSubMatrixMut<'a>

Returns the matrix’s row in the form of a mutable slice.

source§

fn index_mut(&mut self, row: usize) -> &mut BitSlice

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for BitSubMatrixMut<'a>

§

impl<'a> RefUnwindSafe for BitSubMatrixMut<'a>

§

impl<'a> Send for BitSubMatrixMut<'a>

§

impl<'a> Sync for BitSubMatrixMut<'a>

§

impl<'a> Unpin for BitSubMatrixMut<'a>

§

impl<'a> !UnwindSafe for BitSubMatrixMut<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.