Struct m4ri_rust::friendly::BinMatrix [−][src]
Structure to represent matrices
Implementations
impl BinMatrix
[src]
pub fn zero(rows: usize, cols: usize) -> BinMatrix
[src]
Create a zero matrix
pub fn new(rows: Vec<BinVector>) -> BinMatrix
[src]
Create a new matrix
pub fn from_slices<T: AsRef<[u64]>>(rows: &[T], rowlen: usize) -> BinMatrix
[src]
Create a new matrix from slices
pub fn count_ones(&self) -> u32
[src]
Get the hamming weight for single-row or single-column matrices (ie. vectors)
Panics if nrows > 1 && ncols > 1
pub fn random(rows: usize, columns: usize) -> BinMatrix
[src]
Construct a randomized matrix
pub fn from_mzd(mzd: *mut Mzd) -> BinMatrix
[src]
Construct a BinMatrix from the raw mzd pointer
pub fn identity(rows: usize) -> BinMatrix
[src]
Get an identity matrix
pub fn augmented(&self, other: &BinMatrix) -> BinMatrix
[src]
Augment the matrix:
[A] [B] => [A B]
pub fn stacked(&self, other: &BinMatrix) -> BinMatrix
[src]
Stack the matrix with another and return the result
pub fn rank(&self) -> usize
[src]
Get the rank of the matrix
Does an echelonization and throws it away!
pub fn echelonize(&mut self) -> usize
[src]
Echelonize this matrix in-place
Return: the rank of the matrix
pub fn inverted(&self) -> BinMatrix
[src]
Compute the inverse of this matrix, returns a new matrix
pub fn transposed(&self) -> BinMatrix
[src]
Compute the transpose of the matrix
pub fn nrows(&self) -> usize
[src]
Get the number of rows
O(1)
pub fn ncols(&self) -> usize
[src]
Get the number of columns
O(1)
pub fn get_word(&self, row: usize, column: usize) -> Word
[src]
Get a single word from the matrix at a certain offset
pub unsafe fn get_word_unchecked(&self, row: usize, column: usize) -> Word
[src]
Get a particular word from the matrix Does not do any bounds checking!
pub fn get_word_mut(&self, row: usize, column: usize) -> &mut Word
[src]
Get a mutable reference to a particular word in the matrix
pub unsafe fn get_word_mut_unchecked(
&self,
row: usize,
column: usize
) -> &mut Word
[src]
&self,
row: usize,
column: usize
) -> &mut Word
Get a mutable reference to a particular word in the matrix without bounds checking.
pub fn as_vector(&self) -> BinVector
[src]
Get as a vector
Works both on single-column and single-row matrices
pub fn bit(&self, row: usize, col: usize) -> bool
[src]
Get a certain bit
pub fn get_window(
&self,
start_row: usize,
start_col: usize,
high_row: usize,
high_col: usize
) -> BinMatrix
[src]
&self,
start_row: usize,
start_col: usize,
high_row: usize,
high_col: usize
) -> BinMatrix
Get a window from the matrix. Makes a copy.
pub fn set_window(
&mut self,
start_row: usize,
start_col: usize,
other: &BinMatrix
)
[src]
&mut self,
start_row: usize,
start_col: usize,
other: &BinMatrix
)
Set a window in the matrix to another matrix
Currently does bit-by-bit, should use more optimal means if alignment allows it
pub fn mul_slice(&self, other: &[u64]) -> BinMatrix
[src]
Multiply a matrix by a vector represented as a u64
Trait Implementations
impl<'a> Add<&'a BinMatrix> for &'a BinMatrix
[src]
type Output = BinMatrix
The resulting type after applying the +
operator.
fn add(self, other: &BinMatrix) -> Self::Output
[src]
Add up two matrices
impl Add<BinMatrix> for BinMatrix
[src]
type Output = BinMatrix
The resulting type after applying the +
operator.
fn add(self, other: BinMatrix) -> Self::Output
[src]
Add up two matrices, re-uses memory of A
impl<'a> AddAssign<&'a BinMatrix> for BinMatrix
[src]
fn add_assign(&mut self, other: &BinMatrix)
[src]
Add up two matrices, re-uses memory of A
impl AddAssign<BinMatrix> for BinMatrix
[src]
fn add_assign(&mut self, other: BinMatrix)
[src]
Add up two matrices, re-uses memory of A
impl Clone for BinMatrix
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BinMatrix
[src]
impl Drop for BinMatrix
[src]
impl Eq for BinMatrix
[src]
impl<'a> Mul<&'a BinMatrix> for &'a BinMatrix
[src]
type Output = BinMatrix
The resulting type after applying the *
operator.
fn mul(self, other: &BinMatrix) -> Self::Output
[src]
Computes the product of two matrices
impl<'a> Mul<&'a BinMatrix> for &'a BinVector
[src]
type Output = BinVector
The resulting type after applying the *
operator.
fn mul(self, other: &BinMatrix) -> Self::Output
[src]
computes v^T * A
impl<'a> Mul<&'a BinVector> for &'a BinMatrix
[src]
type Output = BinVector
The resulting type after applying the *
operator.
fn mul(self, other: &BinVector) -> Self::Output
[src]
Computes (A * v^T)
impl Mul<BinMatrix> for BinMatrix
[src]
type Output = BinMatrix
The resulting type after applying the *
operator.
fn mul(self, other: BinMatrix) -> Self::Output
[src]
Computes the product of two matrices
impl Mul<BinMatrix> for BinVector
[src]
type Output = BinVector
The resulting type after applying the *
operator.
fn mul(self, other: BinMatrix) -> Self::Output
[src]
computes v^T * A
impl Mul<BinVector> for BinMatrix
[src]
type Output = BinVector
The resulting type after applying the *
operator.
fn mul(self, other: BinVector) -> Self::Output
[src]
Computes (A * v^T)
impl PartialEq<BinMatrix> for BinMatrix
[src]
fn eq(&self, other: &BinMatrix) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Send for BinMatrix
[src]
impl Sync for BinMatrix
[src]
Auto Trait Implementations
impl RefUnwindSafe for BinMatrix
[src]
impl Unpin for BinMatrix
[src]
impl UnwindSafe for BinMatrix
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,