UnitDerivationMatrix

Struct UnitDerivationMatrix 

Source
pub struct UnitDerivationMatrix(/* private fields */);

Methods from Deref<Target = SymbolBitMatrix>§

Source

pub fn iter_row_syms(&self, row: Symbol) -> impl Iterator<Item = Symbol> + '_

Methods from Deref<Target = BitMatrix>§

Source

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

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

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 set_all(&mut self, enabled: bool)

Sets the value of all bits.

Source

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

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

Source

pub fn truncate(&mut self, num_rows: usize)

Truncates the matrix.

Source

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

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 iter_row(&self, row: usize) -> Iter<'_>

Iterate over bits in the specified row.

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.

Trait Implementations§

Source§

impl Deref for UnitDerivationMatrix

Source§

type Target = SymbolBitMatrix

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for UnitDerivationMatrix

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<UnitDerivationMatrix> for SymbolBitMatrix

Source§

fn from(value: UnitDerivationMatrix) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

Source§

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.