pub type ColMut<'a, T, Rows = usize, RStride = isize> = Col<Mut<'a, T, Rows, RStride>>;Expand description
mutable view over a column vector, similar to a mutable reference to a strided slice
§note
unlike a slice, the data pointed to by ColMut<'_, 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 ColMut<'a, T, Rows = usize, RStride = isize>(/* private fields */);Implementations§
Source§impl<'a, T, Rows: Shape, RStride: Stride> ColMut<'a, T, Rows, RStride>
impl<'a, T, Rows: Shape, RStride: Stride> ColMut<'a, T, Rows, RStride>
Sourcepub const unsafe fn from_raw_parts_mut(
ptr: *mut T,
nrows: Rows,
row_stride: RStride,
) -> Self
pub const unsafe fn from_raw_parts_mut( ptr: *mut T, nrows: Rows, row_stride: RStride, ) -> Self
creates a ColMut 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(ptr, nrows, 1, row_stride, 0)]
Sourcepub fn row_stride(&self) -> RStride
pub fn row_stride(&self) -> RStride
returns the row stride of the column, specified in number of elements, not in bytes
pub fn map<U>(&self, f: impl Fn(&T) -> U) -> Col<U, Rows>
pub fn for_each(&self, f: impl Fn(&T))
pub fn map_mut<U>(&mut self, f: impl FnMut(&mut T) -> U) -> Col<U, Rows>
pub fn for_each_mut(&mut self, f: impl FnMut(&mut T))
Sourcepub fn ptr_at(&self, row: IdxInc<Rows>) -> *const T
pub fn ptr_at(&self, row: IdxInc<Rows>) -> *const T
returns a raw pointer to the element at the given index
Sourcepub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>) -> *const T
pub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>) -> *const T
returns a raw pointer to the element at the given index, assuming the provided index is within the column bounds
§safety
the behavior is undefined if any of the following conditions are violated:
row < self.nrows()
Sourcepub fn split_at_row(
self,
row: IdxInc<Rows>,
) -> (ColRef<'a, T, usize, RStride>, ColRef<'a, T, usize, RStride>)
pub fn split_at_row( self, row: IdxInc<Rows>, ) -> (ColRef<'a, T, usize, RStride>, ColRef<'a, T, usize, RStride>)
see [ColRef::split_at_row]
Sourcepub fn conjugate(self) -> ColRef<'a, T::Conj, Rows, RStride>where
T: Conjugate,
pub fn conjugate(self) -> ColRef<'a, T::Conj, Rows, RStride>where
T: Conjugate,
see [ColRef::conjugate]
Sourcepub fn canonical(self) -> ColRef<'a, T::Canonical, Rows, RStride>where
T: Conjugate,
pub fn canonical(self) -> ColRef<'a, T::Canonical, Rows, RStride>where
T: Conjugate,
see [ColRef::canonical]
Sourcepub fn adjoint(self) -> RowRef<'a, T::Conj, Rows, RStride>where
T: Conjugate,
pub fn adjoint(self) -> RowRef<'a, T::Conj, Rows, RStride>where
T: Conjugate,
see [ColRef::adjoint]
Sourcepub fn get<RowRange>(
self,
row: RowRange,
) -> <ColRef<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
pub fn get<RowRange>( self, row: RowRange, ) -> <ColRef<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
see [ColRef::get]
Sourcepub unsafe fn get_unchecked<RowRange>(
self,
row: RowRange,
) -> <ColRef<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
pub unsafe fn get_unchecked<RowRange>( self, row: RowRange, ) -> <ColRef<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
see [ColRef::get_unchecked]
Sourcepub fn reverse_rows(self) -> ColRef<'a, T, Rows, RStride::Rev>
pub fn reverse_rows(self) -> ColRef<'a, T, Rows, RStride::Rev>
see [ColRef::reverse_rows]
Sourcepub fn subrows<V: Shape>(
self,
row_start: IdxInc<Rows>,
nrows: V,
) -> ColRef<'a, T, V, RStride>
pub fn subrows<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> ColRef<'a, T, V, RStride>
see [ColRef::subrows]
Sourcepub fn as_row_shape<V: Shape>(self, nrows: V) -> ColRef<'a, T, V, RStride>
pub fn as_row_shape<V: Shape>(self, nrows: V) -> ColRef<'a, T, V, RStride>
see [ColRef::as_row_shape]
Sourcepub fn as_dyn_rows(self) -> ColRef<'a, T, usize, RStride>
pub fn as_dyn_rows(self) -> ColRef<'a, T, usize, RStride>
see [ColRef::as_dyn_rows]
Sourcepub fn as_dyn_stride(self) -> ColRef<'a, T, Rows, isize>
pub fn as_dyn_stride(self) -> ColRef<'a, T, Rows, isize>
see [ColRef::as_dyn_stride]
Sourcepub fn iter(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a T>where
Rows: 'a,
pub fn iter(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a T>where
Rows: 'a,
see [ColRef::iter]
Sourcepub fn par_iter(self) -> impl 'a + IndexedParallelIterator<Item = &'a T>where
T: Sync,
Rows: 'a,
pub fn par_iter(self) -> impl 'a + IndexedParallelIterator<Item = &'a T>where
T: Sync,
Rows: 'a,
see [ColRef::par_iter]
Sourcepub fn par_partition(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = ColRef<'a, T, usize, RStride>>where
T: Sync,
Rows: 'a,
pub fn par_partition(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = ColRef<'a, T, usize, RStride>>where
T: Sync,
Rows: 'a,
see [ColRef::par_partition]
Sourcepub fn try_as_col_major(self) -> Option<ColRef<'a, T, Rows, ContiguousFwd>>
pub fn try_as_col_major(self) -> Option<ColRef<'a, T, Rows, ContiguousFwd>>
see [ColRef::try_as_col_major]
Sourcepub fn try_as_col_major_mut(self) -> Option<ColMut<'a, T, Rows, ContiguousFwd>>
pub fn try_as_col_major_mut(self) -> Option<ColMut<'a, T, Rows, ContiguousFwd>>
see [ColRef::try_as_col_major]
Sourcepub fn as_mat_mut(self) -> MatMut<'a, T, Rows, usize, RStride, isize>
pub fn as_mat_mut(self) -> MatMut<'a, T, Rows, usize, RStride, isize>
see [ColRef::as_mat]
Sourcepub fn as_diagonal(self) -> DiagRef<'a, T, Rows, RStride>
pub fn as_diagonal(self) -> DiagRef<'a, T, Rows, RStride>
see [ColRef::as_diagonal]
Source§impl<'a, T, Rows: Shape, RStride: Stride> ColMut<'a, T, Rows, RStride>
impl<'a, T, Rows: Shape, RStride: Stride> ColMut<'a, T, Rows, RStride>
Sourcepub fn as_ptr_mut(&self) -> *mut T
pub fn as_ptr_mut(&self) -> *mut T
see [ColRef::as_ptr]
Sourcepub fn ptr_at_mut(&self, row: IdxInc<Rows>) -> *mut T
pub fn ptr_at_mut(&self, row: IdxInc<Rows>) -> *mut T
see [ColRef::ptr_at]
Sourcepub unsafe fn ptr_inbounds_at_mut(&self, row: Idx<Rows>) -> *mut T
pub unsafe fn ptr_inbounds_at_mut(&self, row: Idx<Rows>) -> *mut T
see [ColRef::ptr_inbounds_at]
Sourcepub fn split_at_row_mut(
self,
row: IdxInc<Rows>,
) -> (ColMut<'a, T, usize, RStride>, ColMut<'a, T, usize, RStride>)
pub fn split_at_row_mut( self, row: IdxInc<Rows>, ) -> (ColMut<'a, T, usize, RStride>, ColMut<'a, T, usize, RStride>)
see [ColRef::split_at_row]
Sourcepub fn transpose_mut(self) -> RowMut<'a, T, Rows, RStride>
pub fn transpose_mut(self) -> RowMut<'a, T, Rows, RStride>
see [ColRef::transpose]
Sourcepub fn conjugate_mut(self) -> ColMut<'a, T::Conj, Rows, RStride>where
T: Conjugate,
pub fn conjugate_mut(self) -> ColMut<'a, T::Conj, Rows, RStride>where
T: Conjugate,
see [ColRef::conjugate]
Sourcepub fn canonical_mut(self) -> ColMut<'a, T::Canonical, Rows, RStride>where
T: Conjugate,
pub fn canonical_mut(self) -> ColMut<'a, T::Canonical, Rows, RStride>where
T: Conjugate,
see [ColRef::canonical]
Sourcepub fn adjoint_mut(self) -> RowMut<'a, T::Conj, Rows, RStride>where
T: Conjugate,
pub fn adjoint_mut(self) -> RowMut<'a, T::Conj, Rows, RStride>where
T: Conjugate,
see [ColRef::adjoint]
Sourcepub fn get_mut<RowRange>(
self,
row: RowRange,
) -> <ColMut<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
pub fn get_mut<RowRange>( self, row: RowRange, ) -> <ColMut<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
see [ColRef::get]
Sourcepub unsafe fn get_mut_unchecked<RowRange>(
self,
row: RowRange,
) -> <ColMut<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
pub unsafe fn get_mut_unchecked<RowRange>( self, row: RowRange, ) -> <ColMut<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
see [ColRef::get_unchecked]
Sourcepub fn reverse_rows_mut(self) -> ColMut<'a, T, Rows, RStride::Rev>
pub fn reverse_rows_mut(self) -> ColMut<'a, T, Rows, RStride::Rev>
see [ColRef::reverse_rows]
Sourcepub fn subrows_mut<V: Shape>(
self,
row_start: IdxInc<Rows>,
nrows: V,
) -> ColMut<'a, T, V, RStride>
pub fn subrows_mut<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> ColMut<'a, T, V, RStride>
see [ColRef::subrows]
Sourcepub fn as_row_shape_mut<V: Shape>(self, nrows: V) -> ColMut<'a, T, V, RStride>
pub fn as_row_shape_mut<V: Shape>(self, nrows: V) -> ColMut<'a, T, V, RStride>
see [ColRef::as_row_shape]
Sourcepub fn as_dyn_rows_mut(self) -> ColMut<'a, T, usize, RStride>
pub fn as_dyn_rows_mut(self) -> ColMut<'a, T, usize, RStride>
see [ColRef::as_dyn_rows]
Sourcepub fn as_dyn_stride_mut(self) -> ColMut<'a, T, Rows, isize>
pub fn as_dyn_stride_mut(self) -> ColMut<'a, T, Rows, isize>
see [ColRef::as_dyn_stride]
Sourcepub fn iter_mut(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a mut T>where
Rows: 'a,
pub fn iter_mut(
self,
) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a mut T>where
Rows: 'a,
see [ColRef::iter]
Sourcepub fn par_iter_mut(self) -> impl 'a + IndexedParallelIterator<Item = &'a mut T>where
T: Send,
Rows: 'a,
pub fn par_iter_mut(self) -> impl 'a + IndexedParallelIterator<Item = &'a mut T>where
T: Send,
Rows: 'a,
see [ColRef::par_iter]
Sourcepub fn par_partition_mut(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = ColMut<'a, T, usize, RStride>>where
T: Send,
Rows: 'a,
pub fn par_partition_mut(
self,
count: usize,
) -> impl 'a + IndexedParallelIterator<Item = ColMut<'a, T, usize, RStride>>where
T: Send,
Rows: 'a,
see [ColRef::par_partition]
Sourcepub fn as_diagonal_mut(self) -> DiagMut<'a, T, Rows, RStride>
pub fn as_diagonal_mut(self) -> DiagMut<'a, T, Rows, RStride>
see [ColRef::as_diagonal]
Source§impl<'a, T, Rows: Shape> ColMut<'a, T, Rows, ContiguousFwd>
impl<'a, T, Rows: Shape> ColMut<'a, T, Rows, 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, 'ROWS, T> ColMut<'a, T, Dim<'ROWS>, ContiguousFwd>
impl<'a, 'ROWS, T> ColMut<'a, T, Dim<'ROWS>, ContiguousFwd>
Sourcepub fn as_array_mut(self) -> &'a mut Array<'ROWS, T>
pub fn as_array_mut(self) -> &'a mut Array<'ROWS, T>
returns a reference over the elements as a lifetime-bound slice
Trait Implementations§
Source§impl<'a, 'N, T, Rs: Stride> ColIndex<<Dim<'N> as ShapeIdx>::Idx<usize>> for ColMut<'a, T, Dim<'N>, Rs>
impl<'a, 'N, T, Rs: Stride> ColIndex<<Dim<'N> as ShapeIdx>::Idx<usize>> for ColMut<'a, T, Dim<'N>, Rs>
Source§impl<'a, T, Rs: Stride> ColIndex<<usize as ShapeIdx>::Idx<usize>> for ColMut<'a, T, usize, Rs>
impl<'a, T, Rs: Stride> ColIndex<<usize as ShapeIdx>::Idx<usize>> for ColMut<'a, T, usize, Rs>
Source§impl<'a, R: Shape, T, Rs: Stride, RowRange: IntoRange<IdxInc<R>, Len<R>: 'a>> ColIndex<RowRange> for ColMut<'a, T, R, Rs>
impl<'a, R: Shape, T, Rs: Stride, RowRange: IntoRange<IdxInc<R>, Len<R>: 'a>> ColIndex<RowRange> for ColMut<'a, T, R, Rs>
Source§impl<'b, T, Len: Shape, Strd: Stride> MatIndex for ColMut<'b, T, Len, Strd>
impl<'b, T, Len: Shape, Strd: Stride> MatIndex for ColMut<'b, T, Len, Strd>
type Kind = Col
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