pub struct RectangularBinaryMatrix { /* private fields */ }Expand description
A rectangular binary matrix over GF(2), used by Jellyfish for hash position computation.
The matrix has dimensions rows × cols where rows ≤ 64. It is stored in
column-major format: each column is a single u64 word. Matrix-vector
multiplication is done using XOR operations.
This is used to compute the expected position of a k-mer in the binary/sorted file format, enabling efficient binary search for random access queries.
Implementations§
Source§impl RectangularBinaryMatrix
impl RectangularBinaryMatrix
Sourcepub fn new(rows: usize, cols: usize, columns: Vec<u64>) -> Result<Self>
pub fn new(rows: usize, cols: usize, columns: Vec<u64>) -> Result<Self>
Create a new matrix with the given dimensions and column data.
Sourcepub fn from_json(value: &Value) -> Result<Self>
pub fn from_json(value: &Value) -> Result<Self>
Parse a matrix from the JSON header representation.
In the Jellyfish header, a matrix is stored as an array of integers representing the column values, preceded by dimension information.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Whether this is an identity matrix.
Trait Implementations§
Source§impl Clone for RectangularBinaryMatrix
impl Clone for RectangularBinaryMatrix
Source§fn clone(&self) -> RectangularBinaryMatrix
fn clone(&self) -> RectangularBinaryMatrix
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 moreAuto Trait Implementations§
impl Freeze for RectangularBinaryMatrix
impl RefUnwindSafe for RectangularBinaryMatrix
impl Send for RectangularBinaryMatrix
impl Sync for RectangularBinaryMatrix
impl Unpin for RectangularBinaryMatrix
impl UnsafeUnpin for RectangularBinaryMatrix
impl UnwindSafe for RectangularBinaryMatrix
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