pub struct BinaryMatrix64 { /* private fields */ }Expand description
A dense, binary matrix implementation by packing bits into u64 elements. Column-oriented.
Implementations§
Source§impl BinaryMatrix64
impl BinaryMatrix64
Sourcepub fn new() -> Box<BinaryMatrix64>
pub fn new() -> Box<BinaryMatrix64>
Returns a new, empty matrix with zero rows and columns.
Sourcepub fn zero(rows: usize, cols: usize) -> Box<BinaryMatrix64>
pub fn zero(rows: usize, cols: usize) -> Box<BinaryMatrix64>
Returns a new, zero matrix the given number of rows and columns.
Sourcepub fn identity(rows: usize) -> Box<BinaryMatrix64>
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
impl BinaryMatrix for BinaryMatrix64
Source§fn column_part_all_zero(&self, c: usize, maxr: usize) -> bool
fn column_part_all_zero(&self, c: usize, maxr: usize) -> bool
Returns true if the given column is zero between 0 < maxr.
Source§fn expand(&mut self, new_rows: usize, new_cols: usize)
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>
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
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)
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>
fn copy(&self) -> Box<dyn BinaryMatrix>
Returns a copy of this matrix.
Source§fn col(&self, c: usize) -> BinaryDenseVector
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)
fn swap_columns(&mut self, c1: usize, c2: usize)
Swaps the columns of the matrix.
Source§fn left_kernel(&self) -> Option<Vec<BinaryDenseVector>>
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>>
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§impl Clone for BinaryMatrix64
impl Clone for BinaryMatrix64
Source§fn clone(&self) -> BinaryMatrix64
fn clone(&self) -> BinaryMatrix64
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryMatrix64
impl Debug for BinaryMatrix64
Source§impl PartialEq for BinaryMatrix64
impl PartialEq for BinaryMatrix64
impl StructuralPartialEq for BinaryMatrix64
Auto Trait Implementations§
impl Freeze for BinaryMatrix64
impl RefUnwindSafe for BinaryMatrix64
impl Send for BinaryMatrix64
impl Sync for BinaryMatrix64
impl Unpin for BinaryMatrix64
impl UnwindSafe for BinaryMatrix64
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more