pub type Col<T, Rows = usize> = Col<Own<T, Rows>>;Expand description
heap allocated resizable column vector.
§note
the memory layout of Col is guaranteed to be column-major, meaning that it
has a row stride of 1.
Aliased Type§
#[repr(transparent)]pub struct Col<T, Rows = usize>(/* private fields */);Implementations§
Source§impl<T, Rows: Shape> Col<T, Rows>
impl<T, Rows: Shape> Col<T, Rows>
Sourcepub fn from_fn(nrows: Rows, f: impl FnMut(Idx<Rows>) -> T) -> Self
pub fn from_fn(nrows: Rows, f: impl FnMut(Idx<Rows>) -> T) -> Self
returns a new column with dimension nrows, filled with the provided
function
Sourcepub fn zeros(nrows: Rows) -> Selfwhere
T: ComplexField,
pub fn zeros(nrows: Rows) -> Selfwhere
T: ComplexField,
returns a new column with dimension nrows, filled with zeros
Sourcepub fn ones(nrows: Rows) -> Selfwhere
T: ComplexField,
pub fn ones(nrows: Rows) -> Selfwhere
T: ComplexField,
returns a new column with dimension nrows, filled with ones
Sourcepub fn full(nrows: Rows, value: T) -> Selfwhere
T: Clone,
pub fn full(nrows: Rows, value: T) -> Selfwhere
T: Clone,
returns a new column with dimension nrows, 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 row_capacity rows 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 row_capacity rows without
reallocating. does nothing if the capacity is already sufficient
Sourcepub fn resize_with(&mut self, new_nrows: Rows, f: impl FnMut(Idx<Rows>) -> T)
pub fn resize_with(&mut self, new_nrows: Rows, f: impl FnMut(Idx<Rows>) -> T)
resizes the column in-place so that the new dimension is new_nrows.
new elements are created with the given function f, so that elements
at index i are created by calling f(i)
Sourcepub fn truncate(&mut self, new_nrows: Rows)
pub fn truncate(&mut self, new_nrows: Rows)
truncates the column so that its new dimensions are new_nrows.
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_nrows > self.nrows()
Sourcepub fn into_row_shape<V: Shape>(self, nrows: V) -> Col<T, V>
pub fn into_row_shape<V: Shape>(self, nrows: V) -> Col<T, V>
see [ColRef::as_row_shape]
Sourcepub fn into_diagonal(self) -> Diag<T, Rows>
pub fn into_diagonal(self) -> Diag<T, Rows>
see [ColRef::as_diagonal]
Sourcepub fn into_transpose(self) -> Row<T, Rows>
pub fn into_transpose(self) -> Row<T, Rows>
see [ColRef::transpose]
Source§impl<T, Rows: Shape> Col<T, Rows>
impl<T, Rows: Shape> Col<T, Rows>
Sourcepub fn row_stride(&self) -> isize
pub fn row_stride(&self) -> isize
see [ColRef::row_stride]
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 unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>) -> *const T
pub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>) -> *const T
see [ColRef::ptr_inbounds_at]
Sourcepub fn split_at_row(
&self,
row: IdxInc<Rows>,
) -> (ColRef<'_, T, usize>, ColRef<'_, T, usize>)
pub fn split_at_row( &self, row: IdxInc<Rows>, ) -> (ColRef<'_, T, usize>, ColRef<'_, T, usize>)
see [ColRef::split_at_row]
Sourcepub fn conjugate(&self) -> ColRef<'_, T::Conj, Rows>where
T: Conjugate,
pub fn conjugate(&self) -> ColRef<'_, T::Conj, Rows>where
T: Conjugate,
see [ColRef::conjugate]
Sourcepub fn canonical(&self) -> ColRef<'_, T::Canonical, Rows>where
T: Conjugate,
pub fn canonical(&self) -> ColRef<'_, T::Canonical, Rows>where
T: Conjugate,
see [ColRef::canonical]
Sourcepub fn get<RowRange>(
&self,
row: RowRange,
) -> <ColRef<'_, T, Rows> as ColIndex<RowRange>>::Target
pub fn get<RowRange>( &self, row: RowRange, ) -> <ColRef<'_, T, Rows> as ColIndex<RowRange>>::Target
see [ColRef::get]
Sourcepub unsafe fn get_unchecked<RowRange>(
&self,
row: RowRange,
) -> <ColRef<'_, T, Rows> as ColIndex<RowRange>>::Target
pub unsafe fn get_unchecked<RowRange>( &self, row: RowRange, ) -> <ColRef<'_, T, Rows> as ColIndex<RowRange>>::Target
see [ColRef::get_unchecked]
Sourcepub fn reverse_rows(&self) -> ColRef<'_, T, Rows>
pub fn reverse_rows(&self) -> ColRef<'_, T, Rows>
see [ColRef::reverse_rows]
Sourcepub fn subrows<V: Shape>(
&self,
row_start: IdxInc<Rows>,
nrows: V,
) -> ColRef<'_, T, V>
pub fn subrows<V: Shape>( &self, row_start: IdxInc<Rows>, nrows: V, ) -> ColRef<'_, T, V>
see [ColRef::subrows]
Sourcepub fn as_row_shape<V: Shape>(&self, nrows: V) -> ColRef<'_, T, V>
pub fn as_row_shape<V: Shape>(&self, nrows: V) -> ColRef<'_, T, V>
see [ColRef::as_row_shape]
Sourcepub fn as_dyn_rows(&self) -> ColRef<'_, T, usize>
pub fn as_dyn_rows(&self) -> ColRef<'_, T, usize>
see [ColRef::as_dyn_rows]
Sourcepub fn as_dyn_stride(&self) -> ColRef<'_, T, Rows, isize>
pub fn as_dyn_stride(&self) -> ColRef<'_, T, Rows, isize>
see [ColRef::as_dyn_stride]
Sourcepub fn iter(
&self,
) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &T>
pub fn iter( &self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &T>
see [ColRef::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 [ColRef::par_iter]
Sourcepub fn par_partition(
&self,
count: usize,
) -> impl '_ + IndexedParallelIterator<Item = ColRef<'_, T, usize>>where
T: Sync,
pub fn par_partition(
&self,
count: usize,
) -> impl '_ + IndexedParallelIterator<Item = ColRef<'_, T, usize>>where
T: Sync,
see [ColRef::par_partition]
Sourcepub fn try_as_col_major(&self) -> Option<ColRef<'_, T, Rows, ContiguousFwd>>
pub fn try_as_col_major(&self) -> Option<ColRef<'_, T, Rows, ContiguousFwd>>
see [ColRef::try_as_col_major]
Sourcepub fn try_as_col_major_mut(
&mut self,
) -> Option<ColMut<'_, T, Rows, ContiguousFwd>>
pub fn try_as_col_major_mut( &mut self, ) -> Option<ColMut<'_, T, Rows, ContiguousFwd>>
see [ColRef::try_as_col_major]
Sourcepub fn as_mat_mut(&mut self) -> MatMut<'_, T, Rows, usize, isize>
pub fn as_mat_mut(&mut self) -> MatMut<'_, T, Rows, usize, isize>
see [ColRef::as_mat]
Sourcepub fn as_diagonal(&self) -> DiagRef<'_, T, Rows>
pub fn as_diagonal(&self) -> DiagRef<'_, T, Rows>
see [ColRef::as_diagonal]
Source§impl<T, Rows: Shape> Col<T, Rows>
impl<T, Rows: Shape> Col<T, Rows>
Sourcepub fn as_ptr_mut(&mut self) -> *mut T
pub fn as_ptr_mut(&mut self) -> *mut T
see [ColMut::as_ptr_mut]
Sourcepub fn ptr_at_mut(&mut self, row: IdxInc<Rows>) -> *mut T
pub fn ptr_at_mut(&mut self, row: IdxInc<Rows>) -> *mut T
see [ColMut::ptr_at_mut]
Sourcepub unsafe fn ptr_inbounds_at_mut(&mut self, row: Idx<Rows>) -> *mut T
pub unsafe fn ptr_inbounds_at_mut(&mut self, row: Idx<Rows>) -> *mut T
see [ColMut::ptr_inbounds_at_mut]
Sourcepub fn split_at_row_mut(
&mut self,
row: IdxInc<Rows>,
) -> (ColMut<'_, T, usize>, ColMut<'_, T, usize>)
pub fn split_at_row_mut( &mut self, row: IdxInc<Rows>, ) -> (ColMut<'_, T, usize>, ColMut<'_, T, usize>)
see [ColMut::split_at_row_mut]
Sourcepub fn transpose_mut(&mut self) -> RowMut<'_, T, Rows>
pub fn transpose_mut(&mut self) -> RowMut<'_, T, Rows>
see [ColMut::transpose_mut]
Sourcepub fn conjugate_mut(&mut self) -> ColMut<'_, T::Conj, Rows>where
T: Conjugate,
pub fn conjugate_mut(&mut self) -> ColMut<'_, T::Conj, Rows>where
T: Conjugate,
see [ColMut::conjugate_mut]
Sourcepub fn canonical_mut(&mut self) -> ColMut<'_, T::Canonical, Rows>where
T: Conjugate,
pub fn canonical_mut(&mut self) -> ColMut<'_, T::Canonical, Rows>where
T: Conjugate,
see [ColMut::canonical_mut]
Sourcepub fn adjoint_mut(&mut self) -> RowMut<'_, T::Conj, Rows>where
T: Conjugate,
pub fn adjoint_mut(&mut self) -> RowMut<'_, T::Conj, Rows>where
T: Conjugate,
see [ColMut::adjoint_mut]
Sourcepub fn get_mut<RowRange>(
&mut self,
row: RowRange,
) -> <ColMut<'_, T, Rows> as ColIndex<RowRange>>::Target
pub fn get_mut<RowRange>( &mut self, row: RowRange, ) -> <ColMut<'_, T, Rows> as ColIndex<RowRange>>::Target
see [ColMut::get_mut]
Sourcepub unsafe fn get_mut_unchecked<RowRange>(
&mut self,
row: RowRange,
) -> <ColMut<'_, T, Rows> as ColIndex<RowRange>>::Target
pub unsafe fn get_mut_unchecked<RowRange>( &mut self, row: RowRange, ) -> <ColMut<'_, T, Rows> as ColIndex<RowRange>>::Target
see [ColMut::get_mut_unchecked]
Sourcepub fn reverse_rows_mut(&mut self) -> ColMut<'_, T, Rows>
pub fn reverse_rows_mut(&mut self) -> ColMut<'_, T, Rows>
see [ColMut::reverse_rows_mut]
Sourcepub fn subrows_mut<V: Shape>(
&mut self,
row_start: IdxInc<Rows>,
nrows: V,
) -> ColMut<'_, T, V>
pub fn subrows_mut<V: Shape>( &mut self, row_start: IdxInc<Rows>, nrows: V, ) -> ColMut<'_, T, V>
see [ColMut::subrows_mut]
Sourcepub fn as_row_shape_mut<V: Shape>(&mut self, nrows: V) -> ColMut<'_, T, V>
pub fn as_row_shape_mut<V: Shape>(&mut self, nrows: V) -> ColMut<'_, T, V>
see [ColMut::as_row_shape_mut]
Sourcepub fn as_dyn_rows_mut(&mut self) -> ColMut<'_, T, usize>
pub fn as_dyn_rows_mut(&mut self) -> ColMut<'_, T, usize>
see [ColMut::as_dyn_rows_mut]
Sourcepub fn as_dyn_stride_mut(&mut self) -> ColMut<'_, T, Rows, isize>
pub fn as_dyn_stride_mut(&mut self) -> ColMut<'_, T, Rows, isize>
see [ColMut::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 [ColMut::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 [ColMut::par_iter_mut]
Sourcepub fn par_partition_mut(
&mut self,
count: usize,
) -> impl '_ + IndexedParallelIterator<Item = ColMut<'_, T, usize>>where
T: Send,
pub fn par_partition_mut(
&mut self,
count: usize,
) -> impl '_ + IndexedParallelIterator<Item = ColMut<'_, T, usize>>where
T: Send,
see [ColMut::par_partition_mut]
Sourcepub fn as_diagonal_mut(&mut self) -> DiagMut<'_, T, Rows>
pub fn as_diagonal_mut(&mut self) -> DiagMut<'_, T, Rows>
see [ColMut::as_diagonal_mut]