pub struct AlignedMatrix<T>where
T: Copy,{ /* private fields */ }Expand description
Cache-friendly matrix storage with aligned memory
Implementations§
Source§impl<T> AlignedMatrix<T>
impl<T> AlignedMatrix<T>
Sourcepub fn new(rows: usize, cols: usize, alignment: usize) -> Result<Self>
pub fn new(rows: usize, cols: usize, alignment: usize) -> Result<Self>
Create a new aligned matrix with specified alignment
Sourcepub fn set(&mut self, row: usize, col: usize, value: T) -> Result<()>
pub fn set(&mut self, row: usize, col: usize, value: T) -> Result<()>
Set element at position (row, col)
Sourcepub fn as_mut_ptr(&mut self) -> *mut T
pub fn as_mut_ptr(&mut self) -> *mut T
Get mutable raw data pointer
Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Get mutable data slice
Sourcepub fn is_aligned(&self) -> bool
pub fn is_aligned(&self) -> bool
Check if memory is properly aligned
Trait Implementations§
Source§impl<T> Drop for AlignedMatrix<T>where
T: Copy,
impl<T> Drop for AlignedMatrix<T>where
T: Copy,
impl<T: Send + Copy> Send for AlignedMatrix<T>
impl<T: Sync + Copy> Sync for AlignedMatrix<T>
Auto Trait Implementations§
impl<T> Freeze for AlignedMatrix<T>
impl<T> RefUnwindSafe for AlignedMatrix<T>where
T: RefUnwindSafe,
impl<T> Unpin for AlignedMatrix<T>
impl<T> UnwindSafe for AlignedMatrix<T>where
T: RefUnwindSafe,
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
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>
Converts
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>
Converts
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