pub struct Mut<'a, T> { /* private fields */ }Implementations§
Source§impl<'a, T> Mut<'a, T>
impl<'a, T> Mut<'a, T>
Sourcepub fn try_from_data(
data: &'a mut [T],
nrows: usize,
ncols: usize,
) -> Result<Self, TryFromError<&'a mut [T]>>
pub fn try_from_data( data: &'a mut [T], nrows: usize, ncols: usize, ) -> Result<Self, TryFromError<&'a mut [T]>>
Try to construct directly from data.
Returns an error if Layout::new fails for nrows and ncols or data.len()
is not equal to nrows * ncols.
Sourcepub fn row_vector(data: &'a mut [T]) -> Self
pub fn row_vector(data: &'a mut [T]) -> Self
Construct a row vector directly from data.
Sourcepub fn column_vector(data: &'a mut [T]) -> Self
pub fn column_vector(data: &'a mut [T]) -> Self
Construct a column vector directly from data.
Sourcepub fn into_mut_slice(self) -> &'a mut [T]
pub fn into_mut_slice(self) -> &'a mut [T]
Consume self and return the underlying data as a mutable slice.
Trait Implementations§
Source§impl<T> Matrix for Mut<'_, T>
impl<T> Matrix for Mut<'_, T>
Source§fn as_nonnull(&self) -> NonNull<T>
fn as_nonnull(&self) -> NonNull<T>
Return the base pointer for the matrix.
Source§unsafe fn row_unchecked(&self, row: usize) -> &[Self::Element]
unsafe fn row_unchecked(&self, row: usize) -> &[Self::Element]
Returns the requested row without bounds checking. Read more
Source§fn get_row(&self, row: usize) -> Option<&[Self::Element]>
fn get_row(&self, row: usize) -> Option<&[Self::Element]>
Return row
row if row < self.nrows(). Otherwise, return None.Source§fn rows(&self) -> Rows<'_, Self::Element> ⓘ
fn rows(&self) -> Rows<'_, Self::Element> ⓘ
Return a iterator over all rows in the matrix. Read more
Source§unsafe fn element_unchecked(&self, row: usize, col: usize) -> &Self::Element
unsafe fn element_unchecked(&self, row: usize, col: usize) -> &Self::Element
Returns a reference to an element without bounds checking. Read more
Source§fn subview(&self, rows: Range<usize>) -> Option<Ref<'_, Self::Element>>
fn subview(&self, rows: Range<usize>) -> Option<Ref<'_, Self::Element>>
Return a view over the rows in
rows, or None when the range is invalid.Source§fn window_iter(&self, batchsize: NonZeroUsize) -> Windows<'_, Self::Element> ⓘ
fn window_iter(&self, batchsize: NonZeroUsize) -> Windows<'_, Self::Element> ⓘ
Return an iterator that divides the matrix into sub-matrices with (up to)
batchsize rows with self.ncols() columns. Read moreSource§fn to_rowmajor_owned(&self) -> Owned<Self::Element>
fn to_rowmajor_owned(&self) -> Owned<Self::Element>
Return an
Owned with the same shape as self and cloned contents.Source§fn par_rows(&self) -> impl IndexedParallelIterator<Item = &[Self::Element]>
fn par_rows(&self) -> impl IndexedParallelIterator<Item = &[Self::Element]>
Return a parallel iterator over the rows of the matrix.
Source§fn par_window_iter(
&self,
batchsize: usize,
) -> impl IndexedParallelIterator<Item = Ref<'_, Self::Element>>
fn par_window_iter( &self, batchsize: usize, ) -> impl IndexedParallelIterator<Item = Ref<'_, Self::Element>>
Return a parallel iterator that divides the matrix into sub-matrices with (up to)
batchsize rows with self.ncols() columns. Read moreSource§impl<T> MatrixMut for Mut<'_, T>
impl<T> MatrixMut for Mut<'_, T>
Source§fn as_nonnull_mut(&mut self) -> NonNull<T>
fn as_nonnull_mut(&mut self) -> NonNull<T>
Return the base pointer for the matrix. Read more
Source§unsafe fn row_unchecked_mut(&mut self, row: usize) -> &mut [Self::Element]
unsafe fn row_unchecked_mut(&mut self, row: usize) -> &mut [Self::Element]
Returns the requested row without bounds checking. Read more
Source§fn as_mut_ptr(&mut self) -> *mut Self::Element
fn as_mut_ptr(&mut self) -> *mut Self::Element
Return a pointer to the base of the matrix.
Source§fn as_mut_slice(&mut self) -> &mut [Self::Element]
fn as_mut_slice(&mut self) -> &mut [Self::Element]
Return the underlying data as a mutable slice.
Source§fn row_mut(&mut self, row: usize) -> &mut [Self::Element]
fn row_mut(&mut self, row: usize) -> &mut [Self::Element]
Return row
row as a mutable slice. Read moreSource§fn get_row_mut(&mut self, row: usize) -> Option<&mut [Self::Element]>
fn get_row_mut(&mut self, row: usize) -> Option<&mut [Self::Element]>
Return row
row if row < self.nrows(). Otherwise, return None.Source§fn rows_mut(&mut self) -> RowsMut<'_, Self::Element> ⓘ
fn rows_mut(&mut self) -> RowsMut<'_, Self::Element> ⓘ
Return a mutable iterator over all rows in the matrix. Read more
Source§unsafe fn element_unchecked_mut(
&mut self,
row: usize,
col: usize,
) -> &mut Self::Element
unsafe fn element_unchecked_mut( &mut self, row: usize, col: usize, ) -> &mut Self::Element
Returns a mutable reference to an element without bounds checking. Read more
Source§fn as_view_mut(&mut self) -> Mut<'_, Self::Element>
fn as_view_mut(&mut self) -> Mut<'_, Self::Element>
Return a view over the matrix.
Source§fn par_rows_mut(
&mut self,
) -> impl IndexedParallelIterator<Item = &mut [Self::Element]>
fn par_rows_mut( &mut self, ) -> impl IndexedParallelIterator<Item = &mut [Self::Element]>
Return a parallel iterator over the rows of the matrix. Read more
Source§fn par_window_iter_mut(
&mut self,
batchsize: usize,
) -> impl IndexedParallelIterator<Item = Mut<'_, Self::Element>>
fn par_window_iter_mut( &mut self, batchsize: usize, ) -> impl IndexedParallelIterator<Item = Mut<'_, Self::Element>>
Return a parallel iterator that divides the matrix into mutable sub-matrices with
(up to)
batchsize rows with self.ncols() columns. Read moreSource§impl<'a, T> ReborrowMut<'a> for Mut<'_, T>
impl<'a, T> ReborrowMut<'a> for Mut<'_, T>
impl<T> Send for Mut<'_, T>where
T: Send,
impl<T> Sync for Mut<'_, T>where
T: Sync,
Auto Trait Implementations§
impl<'a, T> !UnwindSafe for Mut<'a, T>
impl<'a, T> Freeze for Mut<'a, T>
impl<'a, T> RefUnwindSafe for Mut<'a, T>
impl<'a, T> Unpin for Mut<'a, T>
impl<'a, T> UnsafeUnpin for Mut<'a, T>
Blanket Implementations§
impl<T> AsyncFriendly for T
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