pub type RowMut<'a, T, Cols = usize, CStride = isize> = Row<Mut<'a, T, Cols, CStride>>;Expand description
mutable view over a row vector, similar to a mutable reference to a strided slice
§note
unlike a slice, the data pointed to by RowMut<'_, T> is allowed to be
partially or fully uninitialized under certain conditions. in this case,
care must be taken to not perform any operations that read the uninitialized
values, or form references to them, either directly or indirectly through
any of the numerical library routines, unless it is explicitly permitted
Aliased Type§
#[repr(transparent)]pub struct RowMut<'a, T, Cols = usize, CStride = isize>(/* private fields */);Implementations§
Source§impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>
impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>
Sourcepub const unsafe fn from_raw_parts_mut(
ptr: *mut T,
ncols: Cols,
col_stride: CStride,
) -> Self
pub const unsafe fn from_raw_parts_mut( ptr: *mut T, ncols: Cols, col_stride: CStride, ) -> Self
creates a RowMut from pointers to the column vector data, number of
rows, and row stride
§safety
this function has the same safety requirements as
[MatMut::from_raw_parts_mut(ptr, 1, ncols, 0, col_stride)]
Sourcepub fn col_stride(&self) -> CStride
pub fn col_stride(&self) -> CStride
returns the column stride of the row
pub fn map<U>(&self, f: impl Fn(&T) -> U) -> Row<U, Cols>
pub fn for_each(&self, f: impl Fn(&T))
pub fn map_mut<U>(&mut self, f: impl FnMut(&mut T) -> U) -> Row<U, Cols>
pub fn for_each_mut(&mut self, f: impl FnMut(&mut T))
Sourcepub fn ptr_at(&self, col: IdxInc<Cols>) -> *const T
pub fn ptr_at(&self, col: IdxInc<Cols>) -> *const T
returns a raw pointer to the element at the given index
Sourcepub unsafe fn ptr_inbounds_at(&self, col: Idx<Cols>) -> *const T
pub unsafe fn ptr_inbounds_at(&self, col: Idx<Cols>) -> *const T
returns a raw pointer to the element at the given index, assuming the provided index is within the row bounds
§safety
the behavior is undefined if any of the following conditions are violated:
col < self.ncols()
Sourcepub fn split_at_col(
self,
col: IdxInc<Cols>,
) -> (RowRef<'a, T, usize, CStride>, RowRef<'a, T, usize, CStride>)
pub fn split_at_col( self, col: IdxInc<Cols>, ) -> (RowRef<'a, T, usize, CStride>, RowRef<'a, T, usize, CStride>)
see [RowRef::split_at_col]
Sourcepub fn conjugate(self) -> RowRef<'a, T::Conj, Cols, CStride>where
T: Conjugate,
pub fn conjugate(self) -> RowRef<'a, T::Conj, Cols, CStride>where
T: Conjugate,
see [RowRef::conjugate]
Sourcepub fn canonical(self) -> RowRef<'a, T::Canonical, Cols, CStride>where
T: Conjugate,
pub fn canonical(self) -> RowRef<'a, T::Canonical, Cols, CStride>where
T: Conjugate,
see [RowRef::canonical]
Sourcepub fn adjoint(self) -> ColRef<'a, T::Conj, Cols, CStride>where
T: Conjugate,
pub fn adjoint(self) -> ColRef<'a, T::Conj, Cols, CStride>where
T: Conjugate,
see [RowRef::adjoint]
Sourcepub fn get<ColRange>(
self,
col: ColRange,
) -> <RowRef<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
pub fn get<ColRange>( self, col: ColRange, ) -> <RowRef<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
see [RowRef::get]
Sourcepub unsafe fn get_unchecked<ColRange>(
self,
col: ColRange,
) -> <RowRef<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
pub unsafe fn get_unchecked<ColRange>( self, col: ColRange, ) -> <RowRef<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
see [RowRef::get_unchecked]
Sourcepub fn reverse_cols(self) -> RowRef<'a, T, Cols, CStride::Rev>
pub fn reverse_cols(self) -> RowRef<'a, T, Cols, CStride::Rev>
see [RowRef::reverse_cols]
Sourcepub fn subcols<V: Shape>(
self,
col_start: IdxInc<Cols>,
ncols: V,
) -> RowRef<'a, T, V, CStride>
pub fn subcols<V: Shape>( self, col_start: IdxInc<Cols>, ncols: V, ) -> RowRef<'a, T, V, CStride>
see [RowRef::subcols]
Sourcepub fn as_col_shape<V: Shape>(self, ncols: V) -> RowRef<'a, T, V, CStride>
pub fn as_col_shape<V: Shape>(self, ncols: V) -> RowRef<'a, T, V, CStride>
see [RowRef::as_col_shape]
Sourcepub fn as_dyn_cols(self) -> RowRef<'a, T, usize, CStride>
pub fn as_dyn_cols(self) -> RowRef<'a, T, usize, CStride>
see [RowRef::as_dyn_cols]
Sourcepub fn as_dyn_stride(self) -> RowRef<'a, T, Cols, isize>
pub fn as_dyn_stride(self) -> RowRef<'a, T, Cols, isize>
see [RowRef::as_dyn_stride]
Sourcepub fn iter(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a T>where
Cols: 'a,
pub fn iter(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a T>where
Cols: 'a,
see [RowRef::iter]
Sourcepub fn par_iter(self) -> impl 'a + IndexedParallelIterator<Item = &'a T>where
T: Sync,
Cols: 'a,
pub fn par_iter(self) -> impl 'a + IndexedParallelIterator<Item = &'a T>where
T: Sync,
Cols: 'a,
see [RowRef::par_iter]
Sourcepub fn try_as_row_major(self) -> Option<RowRef<'a, T, Cols, ContiguousFwd>>
pub fn try_as_row_major(self) -> Option<RowRef<'a, T, Cols, ContiguousFwd>>
see [RowRef::try_as_row_major]
Sourcepub fn as_diagonal(self) -> DiagRef<'a, T, Cols, CStride>
pub fn as_diagonal(self) -> DiagRef<'a, T, Cols, CStride>
see [RowRef::as_diagonal]
Sourcepub fn as_mat_mut(self) -> MatMut<'a, T, usize, Cols, isize, CStride>
pub fn as_mat_mut(self) -> MatMut<'a, T, usize, Cols, isize, CStride>
see [RowRef::as_mat]
Source§impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>
impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>
Sourcepub fn as_ptr_mut(&self) -> *mut T
pub fn as_ptr_mut(&self) -> *mut T
see [RowRef::as_ptr]
Sourcepub fn ptr_at_mut(&self, col: IdxInc<Cols>) -> *mut T
pub fn ptr_at_mut(&self, col: IdxInc<Cols>) -> *mut T
see [RowRef::ptr_at]
Sourcepub unsafe fn ptr_inbounds_at_mut(&self, col: Idx<Cols>) -> *mut T
pub unsafe fn ptr_inbounds_at_mut(&self, col: Idx<Cols>) -> *mut T
see [RowRef::ptr_inbounds_at]
Sourcepub fn split_at_col_mut(
self,
col: IdxInc<Cols>,
) -> (RowMut<'a, T, usize, CStride>, RowMut<'a, T, usize, CStride>)
pub fn split_at_col_mut( self, col: IdxInc<Cols>, ) -> (RowMut<'a, T, usize, CStride>, RowMut<'a, T, usize, CStride>)
see [RowRef::split_at_col]
Sourcepub fn transpose_mut(self) -> ColMut<'a, T, Cols, CStride>
pub fn transpose_mut(self) -> ColMut<'a, T, Cols, CStride>
see [RowRef::transpose]
Sourcepub fn conjugate_mut(self) -> RowMut<'a, T::Conj, Cols, CStride>where
T: Conjugate,
pub fn conjugate_mut(self) -> RowMut<'a, T::Conj, Cols, CStride>where
T: Conjugate,
see [RowRef::conjugate]
Sourcepub fn canonical_mut(self) -> RowMut<'a, T::Canonical, Cols, CStride>where
T: Conjugate,
pub fn canonical_mut(self) -> RowMut<'a, T::Canonical, Cols, CStride>where
T: Conjugate,
see [RowRef::canonical]
Sourcepub fn adjoint_mut(self) -> ColMut<'a, T::Conj, Cols, CStride>where
T: Conjugate,
pub fn adjoint_mut(self) -> ColMut<'a, T::Conj, Cols, CStride>where
T: Conjugate,
see [RowRef::adjoint]
Sourcepub fn get_mut<ColRange>(
self,
col: ColRange,
) -> <RowMut<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
pub fn get_mut<ColRange>( self, col: ColRange, ) -> <RowMut<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
see [RowRef::get]
Sourcepub unsafe fn get_mut_unchecked<ColRange>(
self,
col: ColRange,
) -> <RowMut<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
pub unsafe fn get_mut_unchecked<ColRange>( self, col: ColRange, ) -> <RowMut<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
see [RowRef::get]
Sourcepub fn reverse_cols_mut(self) -> RowMut<'a, T, Cols, CStride::Rev>
pub fn reverse_cols_mut(self) -> RowMut<'a, T, Cols, CStride::Rev>
see [RowRef::reverse_cols]
Sourcepub fn subcols_mut<V: Shape>(
self,
col_start: IdxInc<Cols>,
ncols: V,
) -> RowMut<'a, T, V, CStride>
pub fn subcols_mut<V: Shape>( self, col_start: IdxInc<Cols>, ncols: V, ) -> RowMut<'a, T, V, CStride>
see [RowRef::subcols]
Sourcepub fn as_col_shape_mut<V: Shape>(self, ncols: V) -> RowMut<'a, T, V, CStride>
pub fn as_col_shape_mut<V: Shape>(self, ncols: V) -> RowMut<'a, T, V, CStride>
see [RowRef::as_col_shape]
Sourcepub fn as_dyn_cols_mut(self) -> RowMut<'a, T, usize, CStride>
pub fn as_dyn_cols_mut(self) -> RowMut<'a, T, usize, CStride>
see [RowRef::as_dyn_cols]
Sourcepub fn as_dyn_stride_mut(self) -> RowMut<'a, T, Cols, isize>
pub fn as_dyn_stride_mut(self) -> RowMut<'a, T, Cols, isize>
see [RowRef::as_dyn_stride]
Sourcepub fn iter_mut(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a mut T>where
Cols: 'a,
pub fn iter_mut(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a mut T>where
Cols: 'a,
see [RowRef::iter]
Sourcepub fn par_iter_mut(self) -> impl 'a + IndexedParallelIterator<Item = &'a mut T>where
T: Send,
Cols: 'a,
pub fn par_iter_mut(self) -> impl 'a + IndexedParallelIterator<Item = &'a mut T>where
T: Send,
Cols: 'a,
see [RowRef::par_iter]
Sourcepub fn par_partition(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = RowRef<'a, T, usize, CStride>>where
T: Sync,
Cols: 'a,
pub fn par_partition(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = RowRef<'a, T, usize, CStride>>where
T: Sync,
Cols: 'a,
see [RowRef::par_partition]
Sourcepub fn par_partition_mut(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = RowMut<'a, T, usize, CStride>>where
T: Send,
Cols: 'a,
pub fn par_partition_mut(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = RowMut<'a, T, usize, CStride>>where
T: Send,
Cols: 'a,
see [RowRef::par_partition]
Sourcepub fn try_as_row_major_mut(self) -> Option<RowMut<'a, T, Cols, ContiguousFwd>>
pub fn try_as_row_major_mut(self) -> Option<RowMut<'a, T, Cols, ContiguousFwd>>
see [RowRef::try_as_row_major]
Sourcepub fn as_diagonal_mut(self) -> DiagMut<'a, T, Cols, CStride>
pub fn as_diagonal_mut(self) -> DiagMut<'a, T, Cols, CStride>
see [RowRef::as_diagonal]
Source§impl<'a, T, Rows: Shape> RowMut<'a, T, Rows, ContiguousFwd>
impl<'a, T, Rows: Shape> RowMut<'a, T, Rows, ContiguousFwd>
Source§impl<'a, 'ROWS, T> RowMut<'a, T, Dim<'ROWS>, ContiguousFwd>
impl<'a, 'ROWS, T> RowMut<'a, T, Dim<'ROWS>, ContiguousFwd>
Source§impl<'a, T, Cols: Shape> RowMut<'a, T, Cols, ContiguousFwd>
impl<'a, T, Cols: Shape> RowMut<'a, T, Cols, ContiguousFwd>
Sourcepub fn as_slice_mut(self) -> &'a mut [T]
pub fn as_slice_mut(self) -> &'a mut [T]
returns a reference over the elements as a slice
Source§impl<'a, 'COLS, T> RowMut<'a, T, Dim<'COLS>, ContiguousFwd>
impl<'a, 'COLS, T> RowMut<'a, T, Dim<'COLS>, ContiguousFwd>
Sourcepub fn as_array_mut(self) -> &'a mut Array<'COLS, T>
pub fn as_array_mut(self) -> &'a mut Array<'COLS, T>
returns a reference over the elements as a lifetime-bound slice
Trait Implementations§
Source§impl<'b, T, Len: Shape, Strd: Stride> MatIndex for RowMut<'b, T, Len, Strd>
impl<'b, T, Len: Shape, Strd: Stride> MatIndex for RowMut<'b, T, Len, Strd>
type Kind = Row
Source§type LayoutTransform = VecLayoutTransform
type LayoutTransform = VecLayoutTransform
type Slice = SliceMut<'b, T>
Source§unsafe fn get_slice_unchecked<'a>(
this: &'a mut Self,
idx: Self::Index,
n_elems: usize,
) -> <Self::Slice as SliceFamily<'a, Self::Item>>::Slice
unsafe fn get_slice_unchecked<'a>( this: &'a mut Self, idx: Self::Index, n_elems: usize, ) -> <Self::Slice as SliceFamily<'a, Self::Item>>::Slice
n_elems