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>(pub Own<T, Rows>);Tuple Fields§
§0: Own<T, Rows>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>
Sourcepub fn into_diagonal(self) -> Diag<T, Rows>
pub fn into_diagonal(self) -> Diag<T, Rows>
Sourcepub fn into_transpose(self) -> Row<T, Rows>
pub fn into_transpose(self) -> Row<T, Rows>
Source§impl<T, Rows: Shape> Col<T, Rows>
impl<T, Rows: Shape> Col<T, Rows>
Sourcepub fn as_ptr(&self) -> *const T
pub fn as_ptr(&self) -> *const T
see ColRef::as_ptr
Sourcepub fn shape(&self) -> (Rows, usize)
pub fn shape(&self) -> (Rows, usize)
see ColRef::shape
Sourcepub fn row_stride(&self) -> isize
pub fn row_stride(&self) -> isize
Sourcepub fn ptr_at(&self, row: IdxInc<Rows>) -> *const T
pub fn ptr_at(&self, row: IdxInc<Rows>) -> *const T
see ColRef::ptr_at
Sourcepub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>) -> *const T
pub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>) -> *const T
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>)
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
Sourcepub fn reverse_rows(&self) -> ColRef<'_, T, Rows>
pub fn reverse_rows(&self) -> ColRef<'_, T, 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>
Sourcepub fn as_dyn_rows(&self) -> ColRef<'_, T, usize>
pub fn as_dyn_rows(&self) -> ColRef<'_, T, usize>
Sourcepub fn as_dyn_stride(&self) -> ColRef<'_, T, Rows, isize>
pub fn as_dyn_stride(&self) -> ColRef<'_, T, Rows, isize>
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,
Sourcepub fn try_as_col_major(&self) -> Option<ColRef<'_, T, Rows, ContiguousFwd>>
pub fn try_as_col_major(&self) -> Option<ColRef<'_, T, Rows, ContiguousFwd>>
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>>
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>
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
Sourcepub fn ptr_at_mut(&mut self, row: IdxInc<Rows>) -> *mut T
pub fn ptr_at_mut(&mut self, row: IdxInc<Rows>) -> *mut T
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
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>)
Sourcepub fn transpose_mut(&mut self) -> RowMut<'_, T, Rows>
pub fn transpose_mut(&mut self) -> RowMut<'_, T, Rows>
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,
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,
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,
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
Sourcepub fn reverse_rows_mut(&mut self) -> ColMut<'_, T, Rows>
pub fn reverse_rows_mut(&mut self) -> ColMut<'_, T, Rows>
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>
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>
Sourcepub fn as_dyn_rows_mut(&mut self) -> ColMut<'_, T, usize>
pub fn as_dyn_rows_mut(&mut self) -> ColMut<'_, T, usize>
Sourcepub fn as_dyn_stride_mut(&mut self) -> ColMut<'_, T, Rows, isize>
pub fn as_dyn_stride_mut(&mut self) -> ColMut<'_, T, Rows, 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 ColMut::iter_mut