pub type Row<T, Cols = usize> = Row<Own<T, Cols>>;Expand description
heap allocated resizable row vector.
§note
the memory layout of Row is guaranteed to be row-major, meaning that it
has a column stride of 1.
Aliased Type§
#[repr(transparent)]pub struct Row<T, Cols = usize>(/* private fields */);Implementations§
Source§impl<T, Cols: Shape> Row<T, Cols>
impl<T, Cols: Shape> Row<T, Cols>
Sourcepub fn from_fn(ncols: Cols, f: impl FnMut(Idx<Cols>) -> T) -> Self
pub fn from_fn(ncols: Cols, f: impl FnMut(Idx<Cols>) -> T) -> Self
returns a new row with dimension ncols, filled with the provided
function
Sourcepub fn zeros(ncols: Cols) -> Selfwhere
T: ComplexField,
pub fn zeros(ncols: Cols) -> Selfwhere
T: ComplexField,
returns a new row with dimension ncols, filled with zeros
Sourcepub fn ones(ncols: Cols) -> Selfwhere
T: ComplexField,
pub fn ones(ncols: Cols) -> Selfwhere
T: ComplexField,
returns a new row with dimension ncols, filled with ones
Sourcepub fn full(ncols: Cols, value: T) -> Selfwhere
T: Clone,
pub fn full(ncols: Cols, value: T) -> Selfwhere
T: Clone,
returns a new row with dimension ncols, filled with value
Sourcepub fn try_reserve(
&mut self,
new_row_capacity: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve( &mut self, new_row_capacity: usize, ) -> Result<(), TryReserveError>
reserves the minimum capacity for col_capacity columns without
reallocating, or returns an error in case of failure. does nothing if
the capacity is already sufficient
Sourcepub fn reserve(&mut self, new_row_capacity: usize)
pub fn reserve(&mut self, new_row_capacity: usize)
reserves the minimum capacity for col_capacity columns without
reallocating. does nothing if the capacity is already sufficient
Sourcepub fn resize_with(&mut self, new_ncols: Cols, f: impl FnMut(Idx<Cols>) -> T)
pub fn resize_with(&mut self, new_ncols: Cols, f: impl FnMut(Idx<Cols>) -> T)
resizes the row in-place so that the new dimension is new_ncols.
new elements are created with the given function f, so that elements
at index j are created by calling f(j)
Sourcepub fn truncate(&mut self, new_ncols: Cols)
pub fn truncate(&mut self, new_ncols: Cols)
truncates the row so that its new dimensions are new_ncols.
the new dimension must be smaller than or equal to the current dimension
§panics
the function panics if any of the following conditions are violated:
new_ncols > self.ncols()
Sourcepub fn into_col_shape<V: Shape>(self, ncols: V) -> Row<T, V>
pub fn into_col_shape<V: Shape>(self, ncols: V) -> Row<T, V>
see [RowRef::as_col_shape]
Sourcepub fn into_diagonal(self) -> Diag<T, Cols>
pub fn into_diagonal(self) -> Diag<T, Cols>
see [RowRef::as_diagonal]
Sourcepub fn into_transpose(self) -> Col<T, Cols>
pub fn into_transpose(self) -> Col<T, Cols>
see [RowRef::transpose]
Source§impl<T, Cols: Shape> Row<T, Cols>
impl<T, Cols: Shape> Row<T, Cols>
Sourcepub fn col_stride(&self) -> isize
pub fn col_stride(&self) -> isize
see [RowRef::col_stride]
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 unsafe fn ptr_inbounds_at(&self, col: Idx<Cols>) -> *const T
pub unsafe fn ptr_inbounds_at(&self, col: Idx<Cols>) -> *const T
see [RowRef::ptr_inbounds_at]
Sourcepub fn split_at_col(
&self,
col: IdxInc<Cols>,
) -> (RowRef<'_, T, usize>, RowRef<'_, T, usize>)
pub fn split_at_col( &self, col: IdxInc<Cols>, ) -> (RowRef<'_, T, usize>, RowRef<'_, T, usize>)
see [RowRef::split_at_col]
Sourcepub fn conjugate(&self) -> RowRef<'_, T::Conj, Cols>where
T: Conjugate,
pub fn conjugate(&self) -> RowRef<'_, T::Conj, Cols>where
T: Conjugate,
see [RowRef::conjugate]
Sourcepub fn canonical(&self) -> RowRef<'_, T::Canonical, Cols>where
T: Conjugate,
pub fn canonical(&self) -> RowRef<'_, T::Canonical, Cols>where
T: Conjugate,
see [RowRef::canonical]
Sourcepub fn get<ColRange>(
&self,
col: ColRange,
) -> <RowRef<'_, T, Cols> as RowIndex<ColRange>>::Target
pub fn get<ColRange>( &self, col: ColRange, ) -> <RowRef<'_, T, Cols> as RowIndex<ColRange>>::Target
see [RowRef::get]
Sourcepub unsafe fn get_unchecked<ColRange>(
&self,
col: ColRange,
) -> <RowRef<'_, T, Cols> as RowIndex<ColRange>>::Target
pub unsafe fn get_unchecked<ColRange>( &self, col: ColRange, ) -> <RowRef<'_, T, Cols> as RowIndex<ColRange>>::Target
see [RowRef::get_unchecked]
Sourcepub fn reverse_cols(&self) -> RowRef<'_, T, Cols>
pub fn reverse_cols(&self) -> RowRef<'_, T, Cols>
see [RowRef::reverse_cols]
Sourcepub fn subcols<V: Shape>(
&self,
col_start: IdxInc<Cols>,
ncols: V,
) -> RowRef<'_, T, V>
pub fn subcols<V: Shape>( &self, col_start: IdxInc<Cols>, ncols: V, ) -> RowRef<'_, T, V>
see [RowRef::subcols]
Sourcepub fn as_col_shape<V: Shape>(&self, ncols: V) -> RowRef<'_, T, V>
pub fn as_col_shape<V: Shape>(&self, ncols: V) -> RowRef<'_, T, V>
see [RowRef::as_col_shape]
Sourcepub fn as_dyn_cols(&self) -> RowRef<'_, T, usize>
pub fn as_dyn_cols(&self) -> RowRef<'_, T, usize>
see [RowRef::as_dyn_cols]
Sourcepub fn as_dyn_stride(&self) -> RowRef<'_, T, Cols, isize>
pub fn as_dyn_stride(&self) -> RowRef<'_, T, Cols, isize>
see [RowRef::as_dyn_stride]
Sourcepub fn iter(
&self,
) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &T>
pub fn iter( &self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &T>
see [RowRef::iter]
Sourcepub fn par_iter(&self) -> impl '_ + IndexedParallelIterator<Item = &T>where
T: Sync,
pub fn par_iter(&self) -> impl '_ + IndexedParallelIterator<Item = &T>where
T: Sync,
see [RowRef::par_iter]
Sourcepub fn try_as_row_major(&self) -> Option<RowRef<'_, T, Cols, ContiguousFwd>>
pub fn try_as_row_major(&self) -> Option<RowRef<'_, T, Cols, ContiguousFwd>>
see [RowRef::try_as_row_major]
Sourcepub fn as_diagonal(&self) -> DiagRef<'_, T, Cols>
pub fn as_diagonal(&self) -> DiagRef<'_, T, Cols>
see [RowRef::as_diagonal]
Sourcepub unsafe fn const_cast(&self) -> RowMut<'_, T, Cols>
pub unsafe fn const_cast(&self) -> RowMut<'_, T, Cols>
see [RowRef::const_cast]
Sourcepub fn as_mat_mut(&mut self) -> MatMut<'_, T, usize, Cols, isize>
pub fn as_mat_mut(&mut self) -> MatMut<'_, T, usize, Cols, isize>
see [RowRef::as_mat]
Source§impl<T, Cols: Shape> Row<T, Cols>
impl<T, Cols: Shape> Row<T, Cols>
Sourcepub fn as_ptr_mut(&mut self) -> *mut T
pub fn as_ptr_mut(&mut self) -> *mut T
see [RowMut::as_ptr_mut]
Sourcepub fn ptr_at_mut(&mut self, col: IdxInc<Cols>) -> *mut T
pub fn ptr_at_mut(&mut self, col: IdxInc<Cols>) -> *mut T
see [RowMut::ptr_at_mut]
Sourcepub unsafe fn ptr_inbounds_at_mut(&mut self, col: Idx<Cols>) -> *mut T
pub unsafe fn ptr_inbounds_at_mut(&mut self, col: Idx<Cols>) -> *mut T
see [RowMut::ptr_inbounds_at_mut]
Sourcepub fn split_at_col_mut(
&mut self,
col: IdxInc<Cols>,
) -> (RowMut<'_, T, usize>, RowMut<'_, T, usize>)
pub fn split_at_col_mut( &mut self, col: IdxInc<Cols>, ) -> (RowMut<'_, T, usize>, RowMut<'_, T, usize>)
see [RowMut::split_at_col_mut]
Sourcepub fn transpose_mut(&mut self) -> ColMut<'_, T, Cols>
pub fn transpose_mut(&mut self) -> ColMut<'_, T, Cols>
see [RowMut::transpose_mut]
Sourcepub fn conjugate_mut(&mut self) -> RowMut<'_, T::Conj, Cols>where
T: Conjugate,
pub fn conjugate_mut(&mut self) -> RowMut<'_, T::Conj, Cols>where
T: Conjugate,
see [RowMut::conjugate_mut]
Sourcepub fn canonical_mut(&mut self) -> RowMut<'_, T::Canonical, Cols>where
T: Conjugate,
pub fn canonical_mut(&mut self) -> RowMut<'_, T::Canonical, Cols>where
T: Conjugate,
see [RowMut::canonical_mut]
Sourcepub fn adjoint_mut(&mut self) -> ColMut<'_, T::Conj, Cols>where
T: Conjugate,
pub fn adjoint_mut(&mut self) -> ColMut<'_, T::Conj, Cols>where
T: Conjugate,
see [RowMut::adjoint_mut]
Sourcepub fn get_mut<ColRange>(
&mut self,
col: ColRange,
) -> <RowMut<'_, T, Cols> as RowIndex<ColRange>>::Target
pub fn get_mut<ColRange>( &mut self, col: ColRange, ) -> <RowMut<'_, T, Cols> as RowIndex<ColRange>>::Target
see [RowMut::get_mut]
Sourcepub unsafe fn get_mut_unchecked<ColRange>(
&mut self,
col: ColRange,
) -> <RowMut<'_, T, Cols> as RowIndex<ColRange>>::Target
pub unsafe fn get_mut_unchecked<ColRange>( &mut self, col: ColRange, ) -> <RowMut<'_, T, Cols> as RowIndex<ColRange>>::Target
see [RowMut::get_mut_unchecked]
Sourcepub fn reverse_cols_mut(&mut self) -> RowMut<'_, T, Cols>
pub fn reverse_cols_mut(&mut self) -> RowMut<'_, T, Cols>
see [RowMut::reverse_cols_mut]
Sourcepub fn subcols_mut<V: Shape>(
&mut self,
col_start: IdxInc<Cols>,
ncols: V,
) -> RowMut<'_, T, V>
pub fn subcols_mut<V: Shape>( &mut self, col_start: IdxInc<Cols>, ncols: V, ) -> RowMut<'_, T, V>
see [RowMut::subcols_mut]
Sourcepub fn as_col_shape_mut<V: Shape>(&mut self, ncols: V) -> RowMut<'_, T, V>
pub fn as_col_shape_mut<V: Shape>(&mut self, ncols: V) -> RowMut<'_, T, V>
see [RowMut::as_col_shape_mut]
Sourcepub fn as_dyn_cols_mut(&mut self) -> RowMut<'_, T, usize>
pub fn as_dyn_cols_mut(&mut self) -> RowMut<'_, T, usize>
see [RowMut::as_dyn_cols_mut]
Sourcepub fn as_dyn_stride_mut(&mut self) -> RowMut<'_, T, Cols, isize>
pub fn as_dyn_stride_mut(&mut self) -> RowMut<'_, T, Cols, isize>
see [RowMut::as_dyn_stride_mut]
Sourcepub fn iter_mut(
&mut self,
) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &mut T>
pub fn iter_mut( &mut self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &mut T>
see [RowMut::iter_mut]
Sourcepub fn par_iter_mut(
&mut self,
) -> impl '_ + IndexedParallelIterator<Item = &mut T>where
T: Send,
pub fn par_iter_mut(
&mut self,
) -> impl '_ + IndexedParallelIterator<Item = &mut T>where
T: Send,
see [RowMut::par_iter_mut]
Sourcepub fn try_as_row_major_mut(
&mut self,
) -> Option<RowMut<'_, T, Cols, ContiguousFwd>>
pub fn try_as_row_major_mut( &mut self, ) -> Option<RowMut<'_, T, Cols, ContiguousFwd>>
see [RowMut::try_as_row_major_mut]
Sourcepub fn as_diagonal_mut(&mut self) -> DiagMut<'_, T, Cols>
pub fn as_diagonal_mut(&mut self) -> DiagMut<'_, T, Cols>
see [RowMut::as_diagonal_mut]