pub enum MatrixLayout {
RowMajor,
ColMajor,
Blocked(Box<MatrixLayout>, usize),
Packed,
}Expand description
Target memory layout for a MatrixTransformer layout conversion.
The Matrix.data buffer is always a flat Vec<f64>; the layout describes
how logical element (i, j) is addressed within that buffer. Converting
between layouts reorganises the buffer in place and updates
Matrix.storage_format accordingly.
Variants§
RowMajor
Row-major storage: element (i, j) lives at data[i * cols + j].
This is the canonical layout used throughout the linear-algebra
library and the default for sequential row-wise access.
ColMajor
Column-major storage: element (i, j) lives at data[j * rows + i].
Preferred for column-heavy (strided) access patterns.
Blocked(Box<MatrixLayout>, usize)
Cache-friendly blocked (tiled) storage. The matrix is partitioned into
block_size x block_size sub-blocks. Blocks themselves are laid out
in row-major block order (block row, then block column); within each
block the element order follows inner (typically RowMajor).
Edge blocks that fall outside the matrix dimensions contain only the
valid elements, so the total buffer length remains rows * cols.
Packed
SIMD-packed storage: each row is zero-padded to a multiple of
[SIMD_WIDTH] so that a full SIMD vector load never crosses a row
boundary. Element (i, j) lives at data[i * stride + j] where
stride = ceil(cols / SIMD_WIDTH) * SIMD_WIDTH; padding slots are 0.0.
Trait Implementations§
Source§impl Clone for MatrixLayout
impl Clone for MatrixLayout
Source§fn clone(&self) -> MatrixLayout
fn clone(&self) -> MatrixLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MatrixLayout
impl Debug for MatrixLayout
Source§impl PartialEq for MatrixLayout
impl PartialEq for MatrixLayout
Source§fn eq(&self, other: &MatrixLayout) -> bool
fn eq(&self, other: &MatrixLayout) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MatrixLayout
Auto Trait Implementations§
impl Freeze for MatrixLayout
impl RefUnwindSafe for MatrixLayout
impl Send for MatrixLayout
impl Sync for MatrixLayout
impl Unpin for MatrixLayout
impl UnsafeUnpin for MatrixLayout
impl UnwindSafe for MatrixLayout
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more