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>(pub Own<T, Cols>);Tuple Fields§
§0: Own<T, Cols>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>
Sourcepub fn into_diagonal(self) -> Diag<T, Cols>
pub fn into_diagonal(self) -> Diag<T, Cols>
Sourcepub fn into_transpose(self) -> Col<T, Cols>
pub fn into_transpose(self) -> Col<T, Cols>
Source§impl<T, Cols: Shape> Row<T, Cols>
impl<T, Cols: Shape> Row<T, Cols>
Sourcepub fn as_ptr(&self) -> *const T
pub fn as_ptr(&self) -> *const T
see RowRef::as_ptr
Sourcepub fn shape(&self) -> (usize, Cols)
pub fn shape(&self) -> (usize, Cols)
see RowRef::shape
Sourcepub fn col_stride(&self) -> isize
pub fn col_stride(&self) -> isize
Sourcepub fn ptr_at(&self, col: IdxInc<Cols>) -> *const T
pub fn ptr_at(&self, col: IdxInc<Cols>) -> *const T
see RowRef::ptr_at
Sourcepub unsafe fn ptr_inbounds_at(&self, col: Idx<Cols>) -> *const T
pub unsafe fn ptr_inbounds_at(&self, col: Idx<Cols>) -> *const T
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>)
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
Sourcepub fn reverse_cols(&self) -> RowRef<'_, T, Cols>
pub fn reverse_cols(&self) -> RowRef<'_, T, 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>
Sourcepub fn as_dyn_cols(&self) -> RowRef<'_, T, usize>
pub fn as_dyn_cols(&self) -> RowRef<'_, T, usize>
Sourcepub fn as_dyn_stride(&self) -> RowRef<'_, T, Cols, isize>
pub fn as_dyn_stride(&self) -> RowRef<'_, T, Cols, isize>
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>>
Sourcepub fn as_diagonal(&self) -> DiagRef<'_, T, Cols>
pub fn as_diagonal(&self) -> DiagRef<'_, T, Cols>
Sourcepub unsafe fn const_cast(&self) -> RowMut<'_, T, Cols>
pub unsafe fn const_cast(&self) -> RowMut<'_, T, Cols>
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
Sourcepub fn ptr_at_mut(&mut self, col: IdxInc<Cols>) -> *mut T
pub fn ptr_at_mut(&mut self, col: IdxInc<Cols>) -> *mut T
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
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>)
Sourcepub fn transpose_mut(&mut self) -> ColMut<'_, T, Cols>
pub fn transpose_mut(&mut self) -> ColMut<'_, T, Cols>
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,
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,
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,
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
Sourcepub fn reverse_cols_mut(&mut self) -> RowMut<'_, T, Cols>
pub fn reverse_cols_mut(&mut self) -> RowMut<'_, T, Cols>
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>
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>
Sourcepub fn as_dyn_cols_mut(&mut self) -> RowMut<'_, T, usize>
pub fn as_dyn_cols_mut(&mut self) -> RowMut<'_, T, usize>
Sourcepub fn as_dyn_stride_mut(&mut self) -> RowMut<'_, T, Cols, isize>
pub fn as_dyn_stride_mut(&mut self) -> RowMut<'_, T, Cols, isize>
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