RowMut

Type Alias RowMut 

Source
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>(pub Mut<'a, T, Cols, CStride>);

Tuple Fields§

§0: Mut<'a, T, Cols, CStride>

Implementations§

Source§

impl<'a, T> RowMut<'a, T>

Source

pub fn from_mut(value: &'a mut T) -> Self

creates a row view over the given element

Source

pub fn from_slice_mut(slice: &'a mut [T]) -> Self

creates a RowMut from slice views over the row vector data, the result has the same number of columns as the length of the input slice

Source§

impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>

Source

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)]

Source

pub fn as_ptr(&self) -> *const T

returns a pointer to the row data

Source

pub fn nrows(&self) -> usize

returns the number of rows of the row (always 1)

Source

pub fn ncols(&self) -> Cols

returns the number of columns of the row

Source

pub fn shape(&self) -> (usize, Cols)

returns the number of rows and columns of the row

Source

pub fn col_stride(&self) -> CStride

returns the column stride of the row

Source

pub fn ptr_at(&self, col: IdxInc<Cols>) -> *const T

returns a raw pointer to the element at the given index

Source

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()
Source

pub fn split_at_col( self, col: IdxInc<Cols>, ) -> (RowRef<'a, T, usize, CStride>, RowRef<'a, T, usize, CStride>)

Source

pub fn transpose(self) -> ColRef<'a, T, Cols, CStride>

Source

pub fn conjugate(self) -> RowRef<'a, T::Conj, Cols, CStride>
where T: Conjugate,

Source

pub fn canonical(self) -> RowRef<'a, T::Canonical, Cols, CStride>
where T: Conjugate,

Source

pub fn adjoint(self) -> ColRef<'a, T::Conj, Cols, CStride>
where T: Conjugate,

Source

pub fn get<ColRange>( self, col: ColRange, ) -> <RowRef<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
where RowRef<'a, T, Cols, CStride>: RowIndex<ColRange>,

Source

pub unsafe fn get_unchecked<ColRange>( self, col: ColRange, ) -> <RowRef<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
where RowRef<'a, T, Cols, CStride>: RowIndex<ColRange>,

Source

pub fn reverse_cols(self) -> RowRef<'a, T, Cols, CStride::Rev>

Source

pub fn subcols<V: Shape>( self, col_start: IdxInc<Cols>, ncols: V, ) -> RowRef<'a, T, V, CStride>

Source

pub fn as_col_shape<V: Shape>(self, ncols: V) -> RowRef<'a, T, V, CStride>

Source

pub fn as_dyn_cols(self) -> RowRef<'a, T, usize, CStride>

Source

pub fn as_dyn_stride(self) -> RowRef<'a, T, Cols, isize>

Source

pub fn iter( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a T>
where Cols: 'a,

Source

pub fn par_iter(self) -> impl 'a + IndexedParallelIterator<Item = &'a T>
where T: Sync, Cols: 'a,

Source

pub fn try_as_row_major(self) -> Option<RowRef<'a, T, Cols, ContiguousFwd>>

Source

pub fn as_diagonal(self) -> DiagRef<'a, T, Cols, CStride>

Source

pub fn as_mat(self) -> MatRef<'a, T, usize, Cols, isize, CStride>

Source

pub fn as_mat_mut(self) -> MatMut<'a, T, usize, Cols, isize, CStride>

Source§

impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>

Source

pub fn as_ptr_mut(&self) -> *mut T

Source

pub fn ptr_at_mut(&self, col: IdxInc<Cols>) -> *mut T

Source

pub unsafe fn ptr_inbounds_at_mut(&self, col: Idx<Cols>) -> *mut T

Source

pub fn split_at_col_mut( self, col: IdxInc<Cols>, ) -> (RowMut<'a, T, usize, CStride>, RowMut<'a, T, usize, CStride>)

Source

pub fn transpose_mut(self) -> ColMut<'a, T, Cols, CStride>

Source

pub fn conjugate_mut(self) -> RowMut<'a, T::Conj, Cols, CStride>
where T: Conjugate,

Source

pub fn canonical_mut(self) -> RowMut<'a, T::Canonical, Cols, CStride>
where T: Conjugate,

Source

pub fn adjoint_mut(self) -> ColMut<'a, T::Conj, Cols, CStride>
where T: Conjugate,

Source

pub fn get_mut<ColRange>( self, col: ColRange, ) -> <RowMut<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
where RowMut<'a, T, Cols, CStride>: RowIndex<ColRange>,

Source

pub unsafe fn get_mut_unchecked<ColRange>( self, col: ColRange, ) -> <RowMut<'a, T, Cols, CStride> as RowIndex<ColRange>>::Target
where RowMut<'a, T, Cols, CStride>: RowIndex<ColRange>,

Source

pub fn reverse_cols_mut(self) -> RowMut<'a, T, Cols, CStride::Rev>

Source

pub fn subcols_mut<V: Shape>( self, col_start: IdxInc<Cols>, ncols: V, ) -> RowMut<'a, T, V, CStride>

Source

pub fn as_col_shape_mut<V: Shape>(self, ncols: V) -> RowMut<'a, T, V, CStride>

Source

pub fn as_dyn_cols_mut(self) -> RowMut<'a, T, usize, CStride>

Source

pub fn as_dyn_stride_mut(self) -> RowMut<'a, T, Cols, isize>

Source

pub fn iter_mut( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = &'a mut T>
where Cols: 'a,

Source

pub fn par_iter_mut(self) -> impl 'a + IndexedParallelIterator<Item = &'a mut T>
where T: Send, Cols: 'a,

Source

pub fn par_partition( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = RowRef<'a, T, usize, CStride>>
where T: Sync, Cols: 'a,

Source

pub fn par_partition_mut( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = RowMut<'a, T, usize, CStride>>
where T: Send, Cols: 'a,

Source

pub fn try_as_row_major_mut(self) -> Option<RowMut<'a, T, Cols, ContiguousFwd>>

Source

pub fn as_diagonal_mut(self) -> DiagMut<'a, T, Cols, CStride>

Source§

impl<'a, T, Rows: Shape> RowMut<'a, T, Rows, ContiguousFwd>

Source

pub fn as_slice(self) -> &'a [T]

returns a reference over the elements as a slice

Source§

impl<'a, 'ROWS, T> RowMut<'a, T, Dim<'ROWS>, ContiguousFwd>

Source

pub fn as_array(self) -> &'a Array<'ROWS, T>

returns a reference over the elements as a lifetime-bound slice

Source§

impl<'a, T, Cols: Shape> RowMut<'a, T, Cols, ContiguousFwd>

Source

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>

Source

pub fn as_array_mut(self) -> &'a mut Array<'COLS, T>

returns a reference over the elements as a lifetime-bound slice

Source§

impl<'a, T, Cols: Shape, CStride: Stride> RowMut<'a, T, Cols, CStride>
where T: RealField,

Source

pub fn max(&self) -> Option<T>

Returns the maximum element in the row, or None if the row is empty

Source

pub fn min(&self) -> Option<T>

Returns the minimum element in the row, or None if the row is empty

Trait Implementations§

Source§

impl<T, Cols: Shape, Rs: Stride> AsMatMut for RowMut<'_, T, Cols, Rs>

Source§

fn as_mat_mut(&mut self) -> MatMut<'_, Self::T, One, Self::Cols>

returns a view over self
Source§

impl<T, Cols: Shape, Rs: Stride> AsMatRef for RowMut<'_, T, Cols, Rs>

Source§

type Cols = Cols

column dimension type
Source§

type Owned = Row<Own<T, Cols>>

owned matrix type
Source§

type Rows = One

row dimension type
Source§

type T = T

scalar type
Source§

fn as_mat_ref(&self) -> MatRef<'_, Self::T, One, Self::Cols>

returns a view over self
Source§

impl<'a, T, Cols: Shape, CStride: Stride> IntoView for &'a RowMut<'_, T, Cols, CStride>

Source§

type Target = Row<Ref<'a, T, Cols, CStride>>

Source§

fn into_view(self) -> Self::Target

Source§

impl<'a, T, Cols: Shape, CStride: Stride> IntoView for &'a mut RowMut<'_, T, Cols, CStride>

Source§

type Target = Row<Mut<'a, T, Cols, CStride>>

Source§

fn into_view(self) -> Self::Target

Source§

impl<'a, T, Cols: Shape, CStride: Stride> IntoView for RowMut<'a, T, Cols, CStride>

Source§

type Target = Row<Mut<'a, T, Cols, CStride>>

Source§

fn into_view(self) -> Self::Target

Source§

impl<'b, T, Len: Shape, Strd: Stride> MatIndex for RowMut<'b, T, Len, Strd>

Source§

type Cols = Len

type of columns
Source§

type Dyn = Row<Mut<'b, T>>

matrix type with type erased dimensions
Source§

type Index = <Len as ShapeIdx>::Idx<usize>

indexing type
Source§

type Item = &'b mut T

item produced by the zip views
Source§

type Kind = Row

Source§

type LayoutTransform = VecLayoutTransform

layout transformation type
Source§

type Rows = ()

type of rows
Source§

type Slice = SliceMut<'b, T>

Source§

fn nrows(_: &Self) -> Self::Rows

returns the number of rows
Source§

fn ncols(this: &Self) -> Self::Cols

returns the number of columns
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

returns slice at index of length n_elems
Source§

unsafe fn from_dyn_idx(idx: <Self::Dyn as MatIndex>::Index) -> Self::Index

converts a type erased index back to its original representation
Source§

unsafe fn get_unchecked(this: &mut Self, i: Self::Index) -> Self::Item

get the item at the given index, skipping bound checks
Source§

unsafe fn next_unchecked<'a>( slice: &mut <Self::Slice as SliceFamily<'a, Self::Item>>::Slice, ) -> Self::Item

get the item at the given slice position, skipping bound checks
Source§

fn is_contiguous(this: &Self) -> bool

checks if the zip matrices are contiguous
Source§

fn preferred_layout(this: &Self) -> Self::LayoutTransform

computes the preferred iteration layout of the matrices
Source§

fn with_layout(this: Self, layout: Self::LayoutTransform) -> Self::Dyn

applies the layout transformation to the matrices
Source§

impl<'a, 'N, T, Cs: Stride> RowIndex<<Dim<'N> as ShapeIdx>::Idx<usize>> for RowMut<'a, T, Dim<'N>, Cs>

Source§

type Target = &'a mut T

sliced view type
Source§

fn get(this: Self, col: Idx<Dim<'N>>) -> Self::Target

slice this using col
Source§

unsafe fn get_unchecked(this: Self, col: Idx<Dim<'N>>) -> Self::Target

slice this using col without bound checks
Source§

impl<'a, T, Cs: Stride> RowIndex<<usize as ShapeIdx>::Idx<usize>> for RowMut<'a, T, usize, Cs>

Source§

type Target = &'a mut T

sliced view type
Source§

fn get(this: Self, col: Idx<usize>) -> Self::Target

slice this using col
Source§

unsafe fn get_unchecked(this: Self, col: Idx<usize>) -> Self::Target

slice this using col without bound checks
Source§

impl<'a, C: Shape, T, Cs: Stride, ColRange: IntoRange<IdxInc<C>, Len<C>: 'a>> RowIndex<ColRange> for RowMut<'a, T, C, Cs>

Source§

type Target = Row<Mut<'a, T, <ColRange as IntoRange<<C as ShapeIdx>::IdxInc<usize>>>::Len<C>, Cs>>

sliced view type
Source§

fn get(this: Self, col: ColRange) -> Self::Target

slice this using col
Source§

unsafe fn get_unchecked(this: Self, col: ColRange) -> Self::Target

slice this using col without bound checks