pub struct ColumnMut<'a, T: 'a> { /* private fields */ }
Expand description
Mutable column of a matrix.
This struct points to a MatrixSliceMut
making up a column in a matrix.
You can deref this struct to retrieve
the raw column MatrixSliceMut
.
Example
use rulinalg::matrix::BaseMatrixMut;
let mut mat = matrix![1.0, 2.0;
3.0, 4.0];
{
let mut column = mat.col_mut(1);
*column += 2.0;
}
let expected = matrix![1.0, 4.0;
3.0, 6.0];
assert_matrix_eq!(mat, expected);
Implementations
sourceimpl<'a, T> ColumnMut<'a, T>where
T: Clone,
impl<'a, T> ColumnMut<'a, T>where
T: Clone,
sourcepub fn clone_from_slice(&mut self, slice: &[T])
pub fn clone_from_slice(&mut self, slice: &[T])
Clones the elements of the given slice of compatible size into this column.
Panics
- The slice does not have the same length as the number of rows in the column.
sourcepub fn clone_into_slice(&self, slice: &mut [T])
pub fn clone_into_slice(&self, slice: &mut [T])
Clones the elements of this column into a slice of compatible size.
Panics
- The slice does not have the same length as the number of rows in the column.
Trait Implementations
sourceimpl<'a, T> BaseMatrix<T> for ColumnMut<'a, T>
impl<'a, T> BaseMatrix<T> for ColumnMut<'a, T>
sourcefn row_stride(&self) -> usize
fn row_stride(&self) -> usize
Row stride in the matrix.
sourcefn as_slice(&self) -> MatrixSlice<'_, T>
fn as_slice(&self) -> MatrixSlice<'_, T>
Returns a
MatrixSlice
over the whole matrix. Read moresourceunsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
Get a reference to an element in the matrix without bounds checking.
sourcefn get(&self, index: [usize; 2]) -> Option<&T>
fn get(&self, index: [usize; 2]) -> Option<&T>
Get a reference to an element in the matrix. Read more
sourcefn col(&self, index: usize) -> Column<'_, T>
fn col(&self, index: usize) -> Column<'_, T>
Returns the column of a matrix at the given index.
None
if the index is out of bounds. Read moresourceunsafe fn col_unchecked(&self, index: usize) -> Column<'_, T>
unsafe fn col_unchecked(&self, index: usize) -> Column<'_, T>
Returns the column of a matrix at the given
index without doing a bounds check. Read more
sourcefn row(&self, index: usize) -> Row<'_, T>
fn row(&self, index: usize) -> Row<'_, T>
Returns the row of a matrix at the given index. Read more
sourceunsafe fn row_unchecked(&self, index: usize) -> Row<'_, T>
unsafe fn row_unchecked(&self, index: usize) -> Row<'_, T>
Returns the row of a matrix at the given index without doing unbounds checking Read more
sourcefn iter<'a>(&self) -> SliceIter<'a, T>ⓘNotable traits for SliceIter<'a, T>impl<'a, T> Iterator for SliceIter<'a, T> type Item = &'a T;
where
T: 'a,
fn iter<'a>(&self) -> SliceIter<'a, T>ⓘNotable traits for SliceIter<'a, T>impl<'a, T> Iterator for SliceIter<'a, T> type Item = &'a T;
where
T: 'a,
Returns an iterator over the matrix data. Read more
sourcefn col_iter(&self) -> Cols<'_, T>ⓘNotable traits for Cols<'a, T>impl<'a, T> Iterator for Cols<'a, T> type Item = Column<'a, T>;
fn col_iter(&self) -> Cols<'_, T>ⓘNotable traits for Cols<'a, T>impl<'a, T> Iterator for Cols<'a, T> type Item = Column<'a, T>;
Iterate over the columns of the matrix. Read more
sourcefn row_iter(&self) -> Rows<'_, T>ⓘNotable traits for Rows<'a, T>impl<'a, T> Iterator for Rows<'a, T> type Item = Row<'a, T>;
fn row_iter(&self) -> Rows<'_, T>ⓘNotable traits for Rows<'a, T>impl<'a, T> Iterator for Rows<'a, T> type Item = Row<'a, T>;
Iterate over the rows of the matrix. Read more
sourcefn diag_iter(&self, k: DiagOffset) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
fn diag_iter(&self, k: DiagOffset) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
Iterate over diagonal entries Read more
sourcefn metric<'a, 'b, B, M>(&'a self, mat: &'b B, metric: M) -> Twhere
B: 'b + BaseMatrix<T>,
M: MatrixMetric<'a, 'b, T, Self, B>,
fn metric<'a, 'b, B, M>(&'a self, mat: &'b B, metric: M) -> Twhere
B: 'b + BaseMatrix<T>,
M: MatrixMetric<'a, 'b, T, Self, B>,
Compute the metric distance between two matrices. Read more
sourcefn diag(&self) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
fn diag(&self) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
Extract the diagonal of the matrix Read more
sourcefn split_at(
&self,
mid: usize,
axis: Axes
) -> (MatrixSlice<'_, T>, MatrixSlice<'_, T>)
fn split_at(
&self,
mid: usize,
axis: Axes
) -> (MatrixSlice<'_, T>, MatrixSlice<'_, T>)
Split the matrix at the specified axis returning two
MatrixSlice
s. Read moresourceimpl<'a, T> BaseMatrixMut<T> for ColumnMut<'a, T>
impl<'a, T> BaseMatrixMut<T> for ColumnMut<'a, T>
sourcefn as_mut_ptr(&mut self) -> *mut T
fn as_mut_ptr(&mut self) -> *mut T
Top left index of the slice.
sourcefn as_mut_slice(&mut self) -> MatrixSliceMut<'_, T>
fn as_mut_slice(&mut self) -> MatrixSliceMut<'_, T>
Returns a
MatrixSliceMut
over the whole matrix. Read moresourceunsafe fn get_unchecked_mut(&mut self, index: [usize; 2]) -> &mut T
unsafe fn get_unchecked_mut(&mut self, index: [usize; 2]) -> &mut T
Get a mutable reference to an element in the matrix without bounds checks.
sourcefn get_mut(&mut self, index: [usize; 2]) -> Option<&mut T>
fn get_mut(&mut self, index: [usize; 2]) -> Option<&mut T>
Get a mutable reference to an element in the matrix. Read more
sourcefn iter_mut<'a>(&mut self) -> SliceIterMut<'a, T>ⓘNotable traits for SliceIterMut<'a, T>impl<'a, T> Iterator for SliceIterMut<'a, T> type Item = &'a mut T;
where
T: 'a,
fn iter_mut<'a>(&mut self) -> SliceIterMut<'a, T>ⓘNotable traits for SliceIterMut<'a, T>impl<'a, T> Iterator for SliceIterMut<'a, T> type Item = &'a mut T;
where
T: 'a,
Returns a mutable iterator over the matrix. Read more
sourcefn col_mut(&mut self, index: usize) -> ColumnMut<'_, T>
fn col_mut(&mut self, index: usize) -> ColumnMut<'_, T>
Returns a mutable reference to the column of a matrix at the given index.
None
if the index is out of bounds. Read moresourceunsafe fn col_unchecked_mut(&mut self, index: usize) -> ColumnMut<'_, T>
unsafe fn col_unchecked_mut(&mut self, index: usize) -> ColumnMut<'_, T>
Returns a mutable reference to the column of a matrix at the given index
without doing a bounds check. Read more
sourcefn row_mut(&mut self, index: usize) -> RowMut<'_, T>
fn row_mut(&mut self, index: usize) -> RowMut<'_, T>
Returns a mutable reference to the row of a matrix at the given index.
None
if the index is out of bounds. Read moresourceunsafe fn row_unchecked_mut(&mut self, index: usize) -> RowMut<'_, T>
unsafe fn row_unchecked_mut(&mut self, index: usize) -> RowMut<'_, T>
Returns a mutable reference to the row of a matrix at the given index
without doing a bounds check. Read more
sourcefn col_iter_mut(&mut self) -> ColsMut<'_, T>ⓘNotable traits for ColsMut<'a, T>impl<'a, T> Iterator for ColsMut<'a, T> type Item = ColumnMut<'a, T>;
fn col_iter_mut(&mut self) -> ColsMut<'_, T>ⓘNotable traits for ColsMut<'a, T>impl<'a, T> Iterator for ColsMut<'a, T> type Item = ColumnMut<'a, T>;
Iterate over the mutable columns of the matrix. Read more
sourcefn row_iter_mut(&mut self) -> RowsMut<'_, T>ⓘNotable traits for RowsMut<'a, T>impl<'a, T> Iterator for RowsMut<'a, T> type Item = RowMut<'a, T>;
fn row_iter_mut(&mut self) -> RowsMut<'_, T>ⓘNotable traits for RowsMut<'a, T>impl<'a, T> Iterator for RowsMut<'a, T> type Item = RowMut<'a, T>;
Iterate over the mutable rows of the matrix. Read more
sourcefn diag_iter_mut(&mut self, k: DiagOffset) -> DiagonalMut<'_, T, Self>ⓘNotable traits for DiagonalMut<'a, T, M>impl<'a, T, M: BaseMatrixMut<T>> Iterator for DiagonalMut<'a, T, M> type Item = &'a mut T;
fn diag_iter_mut(&mut self, k: DiagOffset) -> DiagonalMut<'_, T, Self>ⓘNotable traits for DiagonalMut<'a, T, M>impl<'a, T, M: BaseMatrixMut<T>> Iterator for DiagonalMut<'a, T, M> type Item = &'a mut T;
Iterate over diagonal entries mutably Read more
sourcefn split_at_mut(
&mut self,
mid: usize,
axis: Axes
) -> (MatrixSliceMut<'_, T>, MatrixSliceMut<'_, T>)
fn split_at_mut(
&mut self,
mid: usize,
axis: Axes
) -> (MatrixSliceMut<'_, T>, MatrixSliceMut<'_, T>)
Split the matrix at the specified axis returning two
MatrixSliceMut
s. Read moresourcefn sub_slice_mut<'a>(
&mut self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSliceMut<'a, T>where
T: 'a,
fn sub_slice_mut<'a>(
&mut self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSliceMut<'a, T>where
T: 'a,
Produce a
MatrixSliceMut
from an existing matrix. Read moresourceimpl<'a, T: 'a> Deref for ColumnMut<'a, T>
impl<'a, T: 'a> Deref for ColumnMut<'a, T>
type Target = MatrixSliceMut<'a, T>
type Target = MatrixSliceMut<'a, T>
The resulting type after dereferencing.
sourcefn deref(&self) -> &MatrixSliceMut<'a, T>
fn deref(&self) -> &MatrixSliceMut<'a, T>
Dereferences the value.
sourceimpl<'a, T: 'a> DerefMut for ColumnMut<'a, T>
impl<'a, T: 'a> DerefMut for ColumnMut<'a, T>
sourcefn deref_mut(&mut self) -> &mut MatrixSliceMut<'a, T>
fn deref_mut(&mut self) -> &mut MatrixSliceMut<'a, T>
Mutably dereferences the value.
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for ColumnMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for ColumnMut<'a, T>
impl<'a, T> !Sync for ColumnMut<'a, T>
impl<'a, T> Unpin for ColumnMut<'a, T>
impl<'a, T> !UnwindSafe for ColumnMut<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more