[][src]Struct bit_matrix::matrix::BitMatrix

pub struct BitMatrix { /* fields omitted */ }

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]

Sets the value of a bit.

Panics

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

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]

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]

impl PartialOrd<BitMatrix> for BitMatrix[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.

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.

impl IndexMut<usize> for BitMatrix[src]

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

impl Hash for BitMatrix[src]

impl StructuralPartialEq for BitMatrix[src]

impl StructuralEq for BitMatrix[src]

impl Clone for BitMatrix[src]

impl Default for BitMatrix[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.