Struct binary_matrix::BinaryMatrix64
source · 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 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§fn left_mul(&self, result_vector: &BinaryDenseVector) -> BinaryDenseVector
fn left_mul(&self, result_vector: &BinaryDenseVector) -> BinaryDenseVector
Multiplies the given matrix on the left by the dense vector.
source§impl Clone for BinaryMatrix64
impl Clone for BinaryMatrix64
source§fn clone(&self) -> BinaryMatrix64
fn clone(&self) -> BinaryMatrix64
Returns a copy 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
source§fn eq(&self, other: &BinaryMatrix64) -> bool
fn eq(&self, other: &BinaryMatrix64) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for BinaryMatrix64
Auto Trait Implementations§
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