pub struct BinaryMatrix64 { /* private fields */ }
Expand description

A dense, binary matrix implementation by packing bits into u64 elements. Column-oriented.

Implementations§

source§

impl BinaryMatrix64

source

pub fn new() -> Box<BinaryMatrix64>

Returns a new, empty matrix with zero rows and columns.

source

pub fn zero(rows: usize, cols: usize) -> Box<BinaryMatrix64>

Returns a new, zero matrix the given number of rows and columns.

source

pub fn identity(rows: usize) -> Box<BinaryMatrix64>

Returns a new, square matrix the given number of rows and the diagonals set to 1.

Trait Implementations§

source§

impl BinaryMatrix for BinaryMatrix64

source§

fn nrows(&self) -> usize

Number of rows.
source§

fn ncols(&self) -> usize

Number of columns.
source§

fn expand(&mut self, new_rows: usize, new_cols: usize)

Adds more rows and columns to the matrix.
source§

fn transpose(&self) -> Box<dyn BinaryMatrix>

Returns a new matrix that is the transpose of this matrix.
source§

fn get(&self, r: usize, c: usize) -> u8

Gets the value of the matrix at the row r and column c.
source§

fn set(&mut self, r: usize, c: usize, val: u8)

Sets the value of the matrix at the row r and column c to val.
source§

fn copy(&self) -> Box<dyn BinaryMatrix>

Returns a copy of this matrix.
source§

fn col(&self, c: usize) -> BinaryDenseVector

Returns a copy of the column as a BinaryDenseVector.
source§

fn swap_columns(&mut self, c1: usize, c2: usize)

Swaps the columns of the matrix.
source§

fn xor_col(&mut self, c1: usize, c2: usize)

XORs the values of columns c2 into c1.
source§

fn left_kernel(&self) -> Option<Vec<BinaryDenseVector>>

Compute the left kernel of the matrix. Uses using basic algorithm, using Gaussian elimination, from https://en.wikipedia.org/wiki/Kernel_(linear_algebra)#Computation_by_Gaussian_elimination
source§

fn kernel(&self) -> Option<Vec<BinaryDenseVector>>

Compute the kernel (right nullspace) of the matrix. Uses the basic algorithm, using Gaussian elimination, from https://en.wikipedia.org/wiki/Kernel_(linear_algebra)#Computation_by_Gaussian_elimination
source§

fn left_mul(&self, result_vector: &BinaryDenseVector) -> BinaryDenseVector

Multiplies the given matrix on the left by the dense vector.
source§

fn add_col(&mut self, c1: usize, c2: usize)

Alias for xor_col.
source§

fn column_part_all_zero(&self, c: usize, maxr: usize) -> bool

Returns true if the given column is zero between 0 < maxr.
source§

fn extract_column_part( &self, c: usize, maxr: usize, size: usize ) -> BinaryDenseVector

Returns a vector of the given column from maxr < maxr+size.
source§

impl Clone for BinaryMatrix64

source§

fn clone(&self) -> BinaryMatrix64

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for BinaryMatrix64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Index<(usize, usize)> for &BinaryMatrix64

§

type Output = u8

The returned type after indexing.
source§

fn index(&self, index: (usize, usize)) -> &Self::Output

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

impl PartialEq for BinaryMatrix64

source§

fn eq(&self, other: &BinaryMatrix64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for BinaryMatrix64

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.