pub type RowMut<'a, E> = Matrix<DenseRowMut<'a, E>>;
Expand description
Mutable view over a row vector, similar to a mutable reference to a strided slice.
§Note
Unlike a slice, the data pointed to by RowMut<'_, 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 RowMut::read
, or indirectly through any of the numerical library routines, unless
it is explicitly permitted.
Aliased Type§
struct RowMut<'a, E> { /* private fields */ }
Implementations§
source§impl<'a, E: Entity> RowMut<'a, E>
impl<'a, E: Entity> RowMut<'a, E>
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 col_stride(&self) -> isize
pub fn col_stride(&self) -> isize
Returns the column stride of the matrix, specified in number of elements, not in bytes.
sourcepub fn ptr_at_mut(self, col: usize) -> GroupFor<E, *mut E::Unit>
pub fn ptr_at_mut(self, col: usize) -> GroupFor<E, *mut E::Unit>
Returns raw pointers to the element at the given index.
sourcepub unsafe fn ptr_inbounds_at_mut(self, col: usize) -> GroupFor<E, *mut E::Unit>
pub unsafe fn ptr_inbounds_at_mut(self, col: 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:
col < self.ncols()
.
sourcepub unsafe fn split_at_mut_unchecked(self, col: usize) -> (Self, Self)
pub unsafe fn split_at_mut_unchecked(self, col: 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:
- left.
- right.
§Safety
The behavior is undefined if any of the following conditions are violated:
col <= self.ncols()
.
sourcepub fn split_at_mut(self, col: usize) -> (Self, Self)
pub fn split_at_mut(self, col: 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:
col <= self.ncols()
.
sourcepub unsafe fn get_mut_unchecked<ColRange>(
self,
col: ColRange
) -> <Self as RowIndex<ColRange>>::Targetwhere
Self: RowIndex<ColRange>,
pub unsafe fn get_mut_unchecked<ColRange>(
self,
col: ColRange
) -> <Self as RowIndex<ColRange>>::Targetwhere
Self: RowIndex<ColRange>,
Returns references to the element at the given index, or subvector if col
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:
col
must be contained in[0, self.ncols())
.
sourcepub fn get_mut<ColRange>(
self,
col: ColRange
) -> <Self as RowIndex<ColRange>>::Targetwhere
Self: RowIndex<ColRange>,
pub fn get_mut<ColRange>(
self,
col: ColRange
) -> <Self as RowIndex<ColRange>>::Targetwhere
Self: RowIndex<ColRange>,
Returns references to the element at the given index, or subvector if col
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:
col
must be contained in[0, self.ncols())
.
sourcepub unsafe fn read_unchecked(&self, col: usize) -> E
pub unsafe fn read_unchecked(&self, col: 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:
col < self.ncols()
.
sourcepub fn read(&self, col: usize) -> E
pub fn read(&self, col: 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:
col < self.ncols()
.
sourcepub unsafe fn write_unchecked(&mut self, col: usize, value: E)
pub unsafe fn write_unchecked(&mut self, col: 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:
col < self.ncols()
.
sourcepub fn write(&mut self, col: usize, value: E)
pub fn write(&mut self, col: 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:
col < self.ncols()
.
sourcepub fn copy_from(&mut self, other: impl AsRowRef<E>)
pub fn copy_from(&mut self, other: impl AsRowRef<E>)
Copies the values from other
into self
.
§Panics
The function panics if any of the following conditions are violated:
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) -> ColMut<'a, E>
pub fn transpose_mut(self) -> ColMut<'a, E>
Returns a view over the transpose of self
.
sourcepub fn conjugate_mut(self) -> RowMut<'a, E::Conj>where
E: Conjugate,
pub fn conjugate_mut(self) -> RowMut<'a, E::Conj>where
E: Conjugate,
Returns a view over the conjugate of self
.
sourcepub fn adjoint_mut(self) -> ColMut<'a, E::Conj>where
E: Conjugate,
pub fn adjoint_mut(self) -> ColMut<'a, E::Conj>where
E: Conjugate,
Returns a view over the conjugate transpose of self
.
sourcepub fn canonicalize_mut(self) -> (RowMut<'a, E::Canonical>, Conj)where
E: Conjugate,
pub fn canonicalize_mut(self) -> (RowMut<'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_cols_mut(self) -> Self
pub fn reverse_cols_mut(self) -> Self
Returns a view over the self
, with the columnss in reversed order.
sourcepub unsafe fn subcols_mut_unchecked(
self,
col_start: usize,
ncols: usize
) -> Self
pub unsafe fn subcols_mut_unchecked( self, col_start: usize, ncols: usize ) -> Self
Returns a view over the subvector starting at col col_start
, and with number of
columns ncols
.
§Safety
The behavior is undefined if any of the following conditions are violated:
col_start <= self.ncols()
.ncols <= self.ncols() - col_start
.
sourcepub fn subcols_mut(self, col_start: usize, ncols: usize) -> Self
pub fn subcols_mut(self, col_start: usize, ncols: usize) -> Self
Returns a view over the subvector starting at col col_start
, and with number of
columns ncols
.
§Safety
The behavior is undefined if any of the following conditions are violated:
col_start <= self.ncols()
.ncols <= self.ncols() - col_start
.
sourcepub fn to_owned(&self) -> Row<E::Canonical>where
E: Conjugate,
pub fn to_owned(&self) -> Row<E::Canonical>where
E: Conjugate,
Returns an owning Row
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> AsRowMut<E> for &mut RowMut<'_, E>
impl<E: Entity> AsRowMut<E> for &mut RowMut<'_, E>
source§fn as_row_mut(&mut self) -> RowMut<'_, E>
fn as_row_mut(&mut self) -> RowMut<'_, E>
source§impl<E: Entity> AsRowMut<E> for RowMut<'_, E>
impl<E: Entity> AsRowMut<E> for RowMut<'_, E>
source§fn as_row_mut(&mut self) -> RowMut<'_, E>
fn as_row_mut(&mut self) -> RowMut<'_, E>
source§impl<E: Entity> AsRowRef<E> for &RowMut<'_, E>
impl<E: Entity> AsRowRef<E> for &RowMut<'_, E>
source§fn as_row_ref(&self) -> RowRef<'_, E>
fn as_row_ref(&self) -> RowRef<'_, E>
source§impl<E: Entity> AsRowRef<E> for RowMut<'_, E>
impl<E: Entity> AsRowRef<E> for RowMut<'_, E>
source§fn as_row_ref(&self) -> RowRef<'_, E>
fn as_row_ref(&self) -> RowRef<'_, E>
source§impl<'a, E: Entity> IntoConst for RowMut<'a, E>
impl<'a, E: Entity> IntoConst for RowMut<'a, E>
type Target = Matrix<DenseRowRef<'a, E>>
fn into_const(self) -> Self::Target
source§impl<'a, E: Entity> MatIndex<'a> for RowMut<'_, E>
impl<'a, E: Entity> MatIndex<'a> for RowMut<'_, E>
source§unsafe fn get_unchecked(&'a mut self, (_, j): Self::Index) -> Self::Item
unsafe fn get_unchecked(&'a mut self, (_, j): Self::Index) -> Self::Item
source§unsafe fn get_from_slice_unchecked(
slice: &'a mut Self::Slice,
idx: usize
) -> Self::Item
unsafe fn get_from_slice_unchecked( slice: &'a mut Self::Slice, idx: usize ) -> Self::Item
source§fn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
source§fn preferred_layout(&self) -> Self::LayoutTransform
fn preferred_layout(&self) -> Self::LayoutTransform
source§fn with_layout(self, layout: Self::LayoutTransform) -> Self
fn with_layout(self, layout: Self::LayoutTransform) -> Self
source§impl<E: Entity> MaybeContiguous for RowMut<'_, E>
impl<E: Entity> MaybeContiguous for RowMut<'_, E>
§type Slice = <<E as Entity>::Group as ForType>::FaerOf<&'static mut [MaybeUninit<<E as Entity>::Unit>]>
type Slice = <<E as Entity>::Group as ForType>::FaerOf<&'static mut [MaybeUninit<<E as Entity>::Unit>]>
§type LayoutTransform = VecLayoutTransform
type LayoutTransform = VecLayoutTransform
source§impl<'short, 'a, E: Entity> ReborrowMut<'short> for RowMut<'a, E>
impl<'short, 'a, E: Entity> ReborrowMut<'short> for RowMut<'a, E>
source§impl<E: Entity> RowIndex<RangeInclusive<usize>> for RowMut<'_, E>
impl<E: Entity> RowIndex<RangeInclusive<usize>> for RowMut<'_, E>
§type Target = Matrix<DenseRowMut<'_, E>>
type Target = Matrix<DenseRowMut<'_, E>>
source§fn get(this: Self, col: RangeInclusive<usize>) -> Self
fn get(this: Self, col: RangeInclusive<usize>) -> Self
col
.source§unsafe fn get_unchecked(this: Self, col: ColRange) -> Self::Target
unsafe fn get_unchecked(this: Self, col: ColRange) -> Self::Target
col
, without bound checks.source§impl<E: Entity> RowIndex<RangeToInclusive<usize>> for RowMut<'_, E>
impl<E: Entity> RowIndex<RangeToInclusive<usize>> for RowMut<'_, E>
§type Target = Matrix<DenseRowMut<'_, E>>
type Target = Matrix<DenseRowMut<'_, E>>
source§fn get(this: Self, col: RangeToInclusive<usize>) -> Self
fn get(this: Self, col: RangeToInclusive<usize>) -> Self
col
.source§unsafe fn get_unchecked(this: Self, col: ColRange) -> Self::Target
unsafe fn get_unchecked(this: Self, col: ColRange) -> Self::Target
col
, without bound checks.