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

pub struct BitMatrix {
    // some fields omitted
}

A matrix of bits.

Methods

impl BitMatrix
[src]

fn new(rows: usize, row_bits: usize) -> Self

Create a new BitMatrix with specific numbers of bits in columns and rows.

fn size(&self) -> (usize, usize)

Returns the matrix's size as (rows, columns).

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.

fn grow(&mut self, num_rows: usize, value: bool)

Grows the matrix in-place, adding num_rows rows filled with value.

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

Returns a slice of the matrix's rows.

fn split_at(&self, row: usize) -> (BitSubMatrix, &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.

Functionally equivalent to (self.sub_matrix(0..row), &self[row], self.sub_matrix(row..self.num_rows())).

fn split_at_mut(&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.

fn iter_row(&self, row: usize) -> Iter

Iterate over bits in the specified row.

fn transitive_closure(&mut self)

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

Uses the Warshall's algorithm.

Trait Implementations

impl Hash for BitMatrix
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Ord for BitMatrix
[src]

fn cmp(&self, __arg_0: &BitMatrix) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialOrd for BitMatrix
[src]

fn partial_cmp(&self, __arg_0: &BitMatrix) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &BitMatrix) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &BitMatrix) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &BitMatrix) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &BitMatrix) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for BitMatrix
[src]

impl PartialEq for BitMatrix
[src]

fn eq(&self, __arg_0: &BitMatrix) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &BitMatrix) -> bool

This method tests for !=.

impl Debug for BitMatrix
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for BitMatrix
[src]

fn clone(&self) -> BitMatrix

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

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

The method for the indexing (Foo[Bar]) operation

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

The method for the indexing (Foo[Bar]) operation

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

The method for the indexing (Foo[Bar]) operation