pub struct GfMatrix { /* private fields */ }Expand description
Row-major GF(2⁸) matrix backed by a 64-byte aligned AlignedBuffer.
Each row occupies stride bytes where stride is cols rounded up to
the next multiple of ALIGN (64). Padding bytes at the end of each row
are always zero and are never used in arithmetic.
Implementations§
Source§impl GfMatrix
impl GfMatrix
Sourcepub fn padded_stride(cols: usize) -> usize
pub fn padded_stride(cols: usize) -> usize
Compute the padded row stride for cols data columns.
Sourcepub fn zeros(rows: usize, cols: usize) -> Self
pub fn zeros(rows: usize, cols: usize) -> Self
Allocate a zero matrix of size rows × cols with aligned rows.
Sourcepub fn row(&self, r: usize) -> &[u8] ⓘ
pub fn row(&self, r: usize) -> &[u8] ⓘ
Raw access to row r as a data slice (length = cols, 64-byte aligned).
Sourcepub fn row_axpy(&mut self, dst: usize, c: u8, src: usize)
pub fn row_axpy(&mut self, dst: usize, c: u8, src: usize)
dst_row[i] ^= c * src_row[i] — both rows are 64-byte aligned,
so the SIMD kernel always takes the aligned fast path.
§Panics
Panics if dst == src (would create overlapping views).
Sourcepub fn row_scale(&mut self, r: usize, c: u8)
pub fn row_scale(&mut self, r: usize, c: u8)
Scale row r by scalar c using SIMD kernel::scale_inplace.
Sourcepub fn gaussian_elimination(&mut self) -> usize
pub fn gaussian_elimination(&mut self) -> usize
In-place Gaussian elimination (full RREF). Returns the rank.
Sourcepub fn is_full_rank(&self) -> bool
pub fn is_full_rank(&self) -> bool
True if no row is all-zero (quick non-full-rank check).