pub type ColMut<'a, E> = Matrix<DenseColMut<'a, E>>;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<'_, E> 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
through ColMut::read, or indirectly through any of the numerical library routines, unless
it is explicitly permitted.
Aliased Type§
pub struct ColMut<'a, E> { /* private fields */ }Implementations§
Source§impl<'a, E: Entity> ColMut<'a, E>
impl<'a, E: Entity> ColMut<'a, E>
Sourcepub fn ncols(&self) -> usize
pub fn ncols(&self) -> usize
Returns the number of columns of the column. This is always equal to 1.
Sourcepub fn as_ptr_mut(self) -> GroupFor<E, *mut E::Unit>
pub fn as_ptr_mut(self) -> GroupFor<E, *mut E::Unit>
Returns pointers to the matrix data.
Sourcepub fn row_stride(&self) -> isize
pub fn row_stride(&self) -> isize
Returns the row stride of the matrix, specified in number of elements, not in bytes.
Sourcepub fn ptr_at_mut(self, row: usize) -> GroupFor<E, *mut E::Unit>
pub fn ptr_at_mut(self, row: usize) -> GroupFor<E, *mut E::Unit>
Returns raw pointers to the element at the given index.
Sourcepub unsafe fn ptr_inbounds_at_mut(self, row: usize) -> GroupFor<E, *mut E::Unit>
pub unsafe fn ptr_inbounds_at_mut(self, row: usize) -> GroupFor<E, *mut E::Unit>
Returns raw pointers to the element at the given index, assuming the provided index is within the size of the vector.
§Safety
The behavior is undefined if any of the following conditions are violated:
row < self.nrows().
Sourcepub unsafe fn split_at_mut_unchecked(self, row: usize) -> (Self, Self)
pub unsafe fn split_at_mut_unchecked(self, row: usize) -> (Self, Self)
Splits the column vector at the given index into two parts and returns an array of each subvector, in the following order:
- top.
- bottom.
§Safety
The behavior is undefined if any of the following conditions are violated:
row <= self.nrows().
Sourcepub fn split_at_mut(self, row: usize) -> (Self, Self)
pub fn split_at_mut(self, row: usize) -> (Self, Self)
Splits the column vector at the given index into two parts and returns an array of each subvector, in the following order:
- top.
- bottom.
§Panics
The function panics if any of the following conditions are violated:
row <= self.nrows().
Sourcepub unsafe fn get_unchecked_mut<RowRange>(
self,
row: RowRange,
) -> <Self as ColIndex<RowRange>>::Targetwhere
Self: ColIndex<RowRange>,
pub unsafe fn get_unchecked_mut<RowRange>(
self,
row: RowRange,
) -> <Self as ColIndex<RowRange>>::Targetwhere
Self: ColIndex<RowRange>,
Returns references to the element at the given index, or subvector if row is a
range.
§Note
The values pointed to by the references are expected to be initialized, even if the pointed-to value is not read, otherwise the behavior is undefined.
§Safety
The behavior is undefined if any of the following conditions are violated:
rowmust be contained in[0, self.nrows()).
Sourcepub fn get_mut<RowRange>(
self,
row: RowRange,
) -> <Self as ColIndex<RowRange>>::Targetwhere
Self: ColIndex<RowRange>,
pub fn get_mut<RowRange>(
self,
row: RowRange,
) -> <Self as ColIndex<RowRange>>::Targetwhere
Self: ColIndex<RowRange>,
Returns references to the element at the given index, or subvector if row is a
range, with bound checks.
§Note
The values pointed to by the references are expected to be initialized, even if the pointed-to value is not read, otherwise the behavior is undefined.
§Panics
The function panics if any of the following conditions are violated:
rowmust be contained in[0, self.nrows()).
Sourcepub unsafe fn read_unchecked(&self, row: usize) -> E
pub unsafe fn read_unchecked(&self, row: usize) -> E
Reads the value of the element at the given index.
§Safety
The behavior is undefined if any of the following conditions are violated:
row < self.nrows().
Sourcepub fn read(&self, row: usize) -> E
pub fn read(&self, row: usize) -> E
Reads the value of the element at the given index, with bound checks.
§Panics
The function panics if any of the following conditions are violated:
row < self.nrows().
Sourcepub unsafe fn write_unchecked(&mut self, row: usize, value: E)
pub unsafe fn write_unchecked(&mut self, row: usize, value: E)
Writes the value to the element at the given index.
§Safety
The behavior is undefined if any of the following conditions are violated:
row < self.nrows().
Sourcepub fn write(&mut self, row: usize, value: E)
pub fn write(&mut self, row: usize, value: E)
Writes the value to the element at the given index, with bound checks.
§Panics
The function panics if any of the following conditions are violated:
row < self.nrows().
Sourcepub fn copy_from(&mut self, other: impl AsColRef<E>)
pub fn copy_from(&mut self, other: impl AsColRef<E>)
Copies the values from other into self.
§Panics
The function panics if any of the following conditions are violated:
self.nrows() == other.nrows().self.ncols() == other.ncols().
Sourcepub fn fill_zero(&mut self)where
E: ComplexField,
pub fn fill_zero(&mut self)where
E: ComplexField,
Fills the elements of self with zeros.
Sourcepub fn transpose_mut(self) -> RowMut<'a, E>
pub fn transpose_mut(self) -> RowMut<'a, E>
Returns a view over the transpose of self.
Sourcepub fn conjugate_mut(self) -> ColMut<'a, E::Conj>where
E: Conjugate,
pub fn conjugate_mut(self) -> ColMut<'a, E::Conj>where
E: Conjugate,
Returns a view over the conjugate of self.
Sourcepub fn adjoint_mut(self) -> RowMut<'a, E::Conj>where
E: Conjugate,
pub fn adjoint_mut(self) -> RowMut<'a, E::Conj>where
E: Conjugate,
Returns a view over the conjugate transpose of self.
Sourcepub fn canonicalize_mut(self) -> (ColMut<'a, E::Canonical>, Conj)where
E: Conjugate,
pub fn canonicalize_mut(self) -> (ColMut<'a, E::Canonical>, Conj)where
E: Conjugate,
Returns a view over the canonical representation of self, as well as a flag declaring
whether self is implicitly conjugated or not.
Sourcepub fn reverse_rows_mut(self) -> Self
pub fn reverse_rows_mut(self) -> Self
Returns a view over the self, with the rows in reversed order.
Sourcepub unsafe fn subrows_mut_unchecked(
self,
row_start: usize,
nrows: usize,
) -> Self
pub unsafe fn subrows_mut_unchecked( self, row_start: usize, nrows: usize, ) -> Self
Returns a view over the subvector starting at row row_start, and with number of rows
nrows.
§Safety
The behavior is undefined if any of the following conditions are violated:
row_start <= self.nrows().nrows <= self.nrows() - row_start.
Sourcepub fn subrows_mut(self, row_start: usize, nrows: usize) -> Self
pub fn subrows_mut(self, row_start: usize, nrows: usize) -> Self
Returns a view over the subvector starting at row row_start, and with number of rows
nrows.
§Safety
The behavior is undefined if any of the following conditions are violated:
row_start <= self.nrows().nrows <= self.nrows() - row_start.
Sourcepub fn column_vector_as_diagonal(self) -> Matrix<DiagMut<'a, E>>
pub fn column_vector_as_diagonal(self) -> Matrix<DiagMut<'a, E>>
Given a matrix with a single column, returns an object that interprets the column as a diagonal matrix, whoes diagonal elements are values in the column.
Sourcepub fn to_owned(&self) -> Col<E::Canonical>where
E: Conjugate,
pub fn to_owned(&self) -> Col<E::Canonical>where
E: Conjugate,
Returns an owning Col of the data.
Sourcepub fn has_nan(&self) -> boolwhere
E: ComplexField,
pub fn has_nan(&self) -> boolwhere
E: ComplexField,
Returns true if any of the elements is NaN, otherwise returns false.
Sourcepub fn is_all_finite(&self) -> boolwhere
E: ComplexField,
pub fn is_all_finite(&self) -> boolwhere
E: ComplexField,
Returns true if all of the elements are finite, otherwise returns false.
Sourcepub fn norm_max(&self) -> E::Realwhere
E: ComplexField,
pub fn norm_max(&self) -> E::Realwhere
E: ComplexField,
Returns the maximum norm of self.
Sourcepub fn norm_l2(&self) -> E::Realwhere
E: ComplexField,
pub fn norm_l2(&self) -> E::Realwhere
E: ComplexField,
Returns the L2 norm of self.
Sourcepub fn sum(&self) -> Ewhere
E: ComplexField,
pub fn sum(&self) -> Ewhere
E: ComplexField,
Returns the sum of self.
Trait Implementations§
Source§impl<E: Entity> AsColMut<E> for &mut ColMut<'_, E>
impl<E: Entity> AsColMut<E> for &mut ColMut<'_, E>
Source§fn as_col_mut(&mut self) -> ColMut<'_, E>
fn as_col_mut(&mut self) -> ColMut<'_, E>
Source§impl<E: Entity> AsColMut<E> for ColMut<'_, E>
impl<E: Entity> AsColMut<E> for ColMut<'_, E>
Source§fn as_col_mut(&mut self) -> ColMut<'_, E>
fn as_col_mut(&mut self) -> ColMut<'_, E>
Source§impl<E: Entity> AsColRef<E> for &ColMut<'_, E>
impl<E: Entity> AsColRef<E> for &ColMut<'_, E>
Source§fn as_col_ref(&self) -> ColRef<'_, E>
fn as_col_ref(&self) -> ColRef<'_, E>
Source§impl<E: Entity> AsColRef<E> for ColMut<'_, E>
impl<E: Entity> AsColRef<E> for ColMut<'_, E>
Source§fn as_col_ref(&self) -> ColRef<'_, E>
fn as_col_ref(&self) -> ColRef<'_, E>
Source§impl<E: Entity> ColIndex<RangeInclusive<usize>> for ColMut<'_, E>
impl<E: Entity> ColIndex<RangeInclusive<usize>> for ColMut<'_, E>
Source§type Target = Matrix<DenseColMut<'_, E>>
type Target = Matrix<DenseColMut<'_, E>>
Source§fn get(this: Self, row: RangeInclusive<usize>) -> Self
fn get(this: Self, row: RangeInclusive<usize>) -> Self
row.Source§unsafe fn get_unchecked(this: Self, row: RowRange) -> Self::Target
unsafe fn get_unchecked(this: Self, row: RowRange) -> Self::Target
row, without bound checks.Source§impl<E: Entity> ColIndex<RangeToInclusive<usize>> for ColMut<'_, E>
impl<E: Entity> ColIndex<RangeToInclusive<usize>> for ColMut<'_, E>
Source§type Target = Matrix<DenseColMut<'_, E>>
type Target = Matrix<DenseColMut<'_, E>>
Source§fn get(this: Self, row: RangeToInclusive<usize>) -> Self
fn get(this: Self, row: RangeToInclusive<usize>) -> Self
row.Source§unsafe fn get_unchecked(this: Self, row: RowRange) -> Self::Target
unsafe fn get_unchecked(this: Self, row: RowRange) -> Self::Target
row, without bound checks.