pub struct GF2Matrix { /* private fields */ }Expand description
A matrix over GF(2), stored as row vectors.
Supports Gaussian elimination, rank computation, null space extraction, and matrix-vector multiplication — all via bitwise operations.
Implementations§
Source§impl GF2Matrix
impl GF2Matrix
Sourcepub fn from_rows(rows: Vec<GF2Vector>) -> Self
pub fn from_rows(rows: Vec<GF2Vector>) -> Self
Create from row vectors. All rows must have the same dimension.
Sourcepub fn reduced_row_echelon(&mut self) -> Vec<usize>
pub fn reduced_row_echelon(&mut self) -> Vec<usize>
Reduced row echelon form (in-place). Returns pivot column indices.
Sourcepub fn row_echelon(&mut self) -> Vec<usize>
pub fn row_echelon(&mut self) -> Vec<usize>
Row echelon form (in-place). Returns pivot column indices.
Over GF(2), this produces the same result as reduced_row_echelon since
the elimination above and below is equivalent when the only nonzero scalar is 1.
Sourcepub fn null_space(&self) -> Vec<GF2Vector>
pub fn null_space(&self) -> Vec<GF2Vector>
Null space basis vectors (kernel of the matrix).
Sourcepub fn determinant(&self) -> CoreResult<GF2>
pub fn determinant(&self) -> CoreResult<GF2>
Determinant (only for square matrices).
Sourcepub fn column_space(&self) -> Vec<GF2Vector>
pub fn column_space(&self) -> Vec<GF2Vector>
Column space basis vectors (image of the matrix).
Sourcepub fn in_column_space(&self, v: &GF2Vector) -> bool
pub fn in_column_space(&self, v: &GF2Vector) -> bool
Check if a vector is in the column space.
Trait Implementations§
impl Eq for GF2Matrix
impl StructuralPartialEq for GF2Matrix
Auto Trait Implementations§
impl Freeze for GF2Matrix
impl RefUnwindSafe for GF2Matrix
impl Send for GF2Matrix
impl Sync for GF2Matrix
impl Unpin for GF2Matrix
impl UnsafeUnpin for GF2Matrix
impl UnwindSafe for GF2Matrix
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