ColMut

Type Alias ColMut 

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

Tuple Fields§

§0: Mut<'a, T, Rows, RStride>

Implementations§

Source§

impl<'a, T> ColMut<'a, T>

Source

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

creates a column view over the given element

Source

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

creates a ColMut from slice views over the column vector data, the result has the same number of rows as the length of the input slice

Source§

impl<'a, T, Rows: Shape, RStride: Stride> ColMut<'a, T, Rows, RStride>

Source

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

Source

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

returns a pointer to the column data

Source

pub fn nrows(&self) -> Rows

returns the number of rows of the column

Source

pub fn ncols(&self) -> usize

returns the number of columns of the column (always 1)

Source

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

returns the number of rows and columns of the column

Source

pub fn row_stride(&self) -> RStride

returns the row stride of the column, specified in number of elements, not in bytes

Source

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

returns a raw pointer to the element at the given index

Source

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

pub fn split_at_row( self, row: IdxInc<Rows>, ) -> (ColRef<'a, T, usize, RStride>, ColRef<'a, T, usize, RStride>)

Source

pub fn transpose(self) -> RowRef<'a, T, Rows, RStride>

Source

pub fn conjugate(self) -> ColRef<'a, T::Conj, Rows, RStride>
where T: Conjugate,

Source

pub fn canonical(self) -> ColRef<'a, T::Canonical, Rows, RStride>
where T: Conjugate,

Source

pub fn adjoint(self) -> RowRef<'a, T::Conj, Rows, RStride>
where T: Conjugate,

Source

pub fn get<RowRange>( self, row: RowRange, ) -> <ColRef<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
where ColRef<'a, T, Rows, RStride>: ColIndex<RowRange>,

Source

pub unsafe fn get_unchecked<RowRange>( self, row: RowRange, ) -> <ColRef<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
where ColRef<'a, T, Rows, RStride>: ColIndex<RowRange>,

Source

pub fn reverse_rows(self) -> ColRef<'a, T, Rows, RStride::Rev>

Source

pub fn subrows<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> ColRef<'a, T, V, RStride>

Source

pub fn as_row_shape<V: Shape>(self, nrows: V) -> ColRef<'a, T, V, RStride>

Source

pub fn as_dyn_rows(self) -> ColRef<'a, T, usize, RStride>

Source

pub fn as_dyn_stride(self) -> ColRef<'a, T, Rows, isize>

Source

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

Source

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

Source

pub fn par_partition( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = ColRef<'a, T, usize, RStride>>
where T: Sync, Rows: 'a,

Source

pub fn try_as_col_major(self) -> Option<ColRef<'a, T, Rows, ContiguousFwd>>

Source

pub fn try_as_col_major_mut(self) -> Option<ColMut<'a, T, Rows, ContiguousFwd>>

Source

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

Source

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

Source

pub fn as_diagonal(self) -> DiagRef<'a, T, Rows, RStride>

Source§

impl<'a, T, Rows: Shape, RStride: Stride> ColMut<'a, T, Rows, RStride>

Source

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

Source

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

Source

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

Source

pub fn split_at_row_mut( self, row: IdxInc<Rows>, ) -> (ColMut<'a, T, usize, RStride>, ColMut<'a, T, usize, RStride>)

Source

pub fn transpose_mut(self) -> RowMut<'a, T, Rows, RStride>

Source

pub fn conjugate_mut(self) -> ColMut<'a, T::Conj, Rows, RStride>
where T: Conjugate,

Source

pub fn canonical_mut(self) -> ColMut<'a, T::Canonical, Rows, RStride>
where T: Conjugate,

Source

pub fn adjoint_mut(self) -> RowMut<'a, T::Conj, Rows, RStride>
where T: Conjugate,

Source

pub fn get_mut<RowRange>( self, row: RowRange, ) -> <ColMut<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
where ColMut<'a, T, Rows, RStride>: ColIndex<RowRange>,

Source

pub unsafe fn get_mut_unchecked<RowRange>( self, row: RowRange, ) -> <ColMut<'a, T, Rows, RStride> as ColIndex<RowRange>>::Target
where ColMut<'a, T, Rows, RStride>: ColIndex<RowRange>,

Source

pub fn reverse_rows_mut(self) -> ColMut<'a, T, Rows, RStride::Rev>

Source

pub fn subrows_mut<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> ColMut<'a, T, V, RStride>

Source

pub fn as_row_shape_mut<V: Shape>(self, nrows: V) -> ColMut<'a, T, V, RStride>

Source

pub fn as_dyn_rows_mut(self) -> ColMut<'a, T, usize, RStride>

Source

pub fn as_dyn_stride_mut(self) -> ColMut<'a, T, Rows, isize>

Source

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

Source

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

Source

pub fn par_partition_mut( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = ColMut<'a, T, usize, RStride>>
where T: Send, Rows: 'a,

Source

pub fn as_diagonal_mut(self) -> DiagMut<'a, T, Rows, RStride>

Source§

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

Source

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>

Source

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

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

Source§

impl<'a, T, Rows: Shape> ColMut<'a, T, Rows>
where T: RealField,

Source

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

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

Source

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

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

Trait Implementations§

Source§

impl<T, Rows: Shape, Rs: Stride> AsMatMut for ColMut<'_, T, Rows, Rs>

Source§

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

returns a view over self
Source§

impl<T, Rows: Shape, Rs: Stride> AsMatRef for ColMut<'_, T, Rows, Rs>

Source§

type Cols = One

column dimension type
Source§

type Owned = Col<Own<T, Rows>>

owned matrix type
Source§

type Rows = Rows

row dimension type
Source§

type T = T

scalar type
Source§

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

returns a view over self
Source§

impl<'a, 'N, T, Rs: Stride> ColIndex<<Dim<'N> as ShapeIdx>::Idx<usize>> for ColMut<'a, T, Dim<'N>, Rs>

Source§

type Target = &'a mut T

sliced view type
Source§

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

slice this using row
Source§

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

slice this using row, without bound checks
Source§

impl<'a, T, Rs: Stride> ColIndex<<usize as ShapeIdx>::Idx<usize>> for ColMut<'a, T, usize, Rs>

Source§

type Target = &'a mut T

sliced view type
Source§

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

slice this using row
Source§

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

slice this using row, without bound checks
Source§

impl<'a, R: Shape, T, Rs: Stride, RowRange: IntoRange<IdxInc<R>, Len<R>: 'a>> ColIndex<RowRange> for ColMut<'a, T, R, Rs>

Source§

type Target = Col<Mut<'a, T, <RowRange as IntoRange<<R as ShapeIdx>::IdxInc<usize>>>::Len<R>, Rs>>

sliced view type
Source§

fn get(this: Self, row: RowRange) -> Self::Target

slice this using row
Source§

unsafe fn get_unchecked(this: Self, row: RowRange) -> Self::Target

slice this using row, without bound checks
Source§

impl<'a, T, Rows: Shape, RStride: Stride> IntoView for &'a ColMut<'_, T, Rows, RStride>

Source§

type Target = Col<Ref<'a, T, Rows, RStride>>

Source§

fn into_view(self) -> Self::Target

Source§

impl<'a, T, Rows: Shape, RStride: Stride> IntoView for &'a mut ColMut<'_, T, Rows, RStride>

Source§

type Target = Col<Mut<'a, T, Rows, RStride>>

Source§

fn into_view(self) -> Self::Target

Source§

impl<'a, T, Rows: Shape, RStride: Stride> IntoView for ColMut<'a, T, Rows, RStride>

Source§

type Target = Col<Mut<'a, T, Rows, RStride>>

Source§

fn into_view(self) -> Self::Target

Source§

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

Source§

type Cols = ()

type of columns
Source§

type Dyn = Col<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 LayoutTransform = VecLayoutTransform

layout transformation type
Source§

type Rows = Len

type of rows
Source§

type Slice = SliceMut<'b, T>

Source§

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

returns the number of rows
Source§

fn ncols(_: &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