pub struct MatrixView<'a, T> { /* private fields */ }Expand description
Read-only 2-D view with arbitrary (possibly negative) element strides.
Implementations§
Source§impl<'a, T: Copy> MatrixView<'a, T>
impl<'a, T: Copy> MatrixView<'a, T>
Sourcepub fn from_row_major(
data: &'a [T],
rows: usize,
cols: usize,
) -> Result<Self, LapError>
pub fn from_row_major( data: &'a [T], rows: usize, cols: usize, ) -> Result<Self, LapError>
C-contiguous rows x cols matrix; data may be longer than needed.
Sourcepub fn from_strided(
data: &'a [T],
offset: usize,
rows: usize,
cols: usize,
row_stride: isize,
col_stride: isize,
) -> Result<Self, LapError>
pub fn from_strided( data: &'a [T], offset: usize, rows: usize, cols: usize, row_stride: isize, col_stride: isize, ) -> Result<Self, LapError>
General strided view: element (i, j) is data[offset + i*row_stride + j*col_stride].
Strides are in elements, not bytes.
pub fn rows(&self) -> usize
pub fn cols(&self) -> usize
Trait Implementations§
Source§impl<'a, T: Clone> Clone for MatrixView<'a, T>
impl<'a, T: Clone> Clone for MatrixView<'a, T>
impl<'a, T: Copy> Copy for MatrixView<'a, T>
Auto Trait Implementations§
impl<'a, T> Forget for MatrixView<'a, T>
impl<'a, T> Freeze for MatrixView<'a, T>
impl<'a, T> Move for MatrixView<'a, T>
impl<'a, T> RefUnwindSafe for MatrixView<'a, T>where
&'a [T]: RefUnwindSafe,
impl<'a, T> Send for MatrixView<'a, T>
impl<'a, T> Sync for MatrixView<'a, T>
impl<'a, T> Unpin for MatrixView<'a, T>
impl<'a, T> UnsafeUnpin for MatrixView<'a, T>where
&'a [T]: UnsafeUnpin,
impl<'a, T> UnwindSafe for MatrixView<'a, T>where
&'a [T]: UnwindSafe,
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