Struct rulinalg::matrix::ColumnMut
[−]
[src]
pub struct ColumnMut<'a, T: 'a> { /* fields omitted */ }
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);
Methods from Deref<Target=MatrixSliceMut<'a, T>>
Trait Implementations
impl<'a, T> BaseMatrix<T> for ColumnMut<'a, T>
[src]
fn rows(&self) -> usize
[−]
Rows in the matrix.
fn cols(&self) -> usize
[−]
Columns in the matrix.
fn row_stride(&self) -> usize
[−]
Row stride in the matrix.
fn as_ptr(&self) -> *const T
[−]
Top left index of the matrix.
fn is_empty(&self) -> bool
[−]
Returns true if the matrix contais no elements
fn as_slice(&self) -> MatrixSlice<T>
[−]
Returns a MatrixSlice
over the whole matrix. Read more
unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
[−]
Get a reference to a point in the matrix without bounds checking.
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 more
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
fn row(&self, index: usize) -> Row<T>
[−]
Returns the row of a matrix at the given index. Read more
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
fn iter<'a>(&self) -> SliceIter<'a, T> where T: 'a
[−]
Returns an iterator over the matrix data. Read more
fn col_iter(&self) -> Cols<T>
[−]
Iterate over the columns of the matrix. Read more
fn row_iter(&self) -> Rows<T>
[−]
Iterate over the rows of the matrix. Read more
fn diag_iter(&self, k: DiagOffset) -> Diagonal<T, Self>
[−]
Iterate over diagonal entries Read more
fn sum_rows(&self) -> Vector<T> where T: Copy + Zero + Add<T, Output=T>
[−]
The sum of the rows of the matrix. Read more
fn sum_cols(&self) -> Vector<T> where T: Copy + Zero + Add<T, Output=T>
[−]
The sum of the columns of the matrix. Read more
fn norm<N: MatrixNorm<T, Self>>(&self, norm: N) -> T where T: Float
[−]
Compute given matrix norm for matrix. Read more
fn metric<'a, 'b, B, M>(&'a self, mat: &'b B, metric: M) -> T where B: 'b + BaseMatrix<T>, M: MatrixMetric<'a, 'b, T, Self, B>
[−]
Compute the metric distance between two matrices. Read more
fn sum(&self) -> T where T: Copy + Zero + Add<T, Output=T>
[−]
The sum of all elements in the matrix Read more
fn min(&self, axis: Axes) -> Vector<T> where T: Copy + PartialOrd
[−]
The min of the specified axis of the matrix. Read more
fn max(&self, axis: Axes) -> Vector<T> where T: Copy + PartialOrd
[−]
The max of the specified axis of the matrix. Read more
fn into_matrix(self) -> Matrix<T> where T: Copy
[−]
Convert the matrix struct into a owned Matrix.
fn select_rows<'a, I>(&self, rows: I) -> Matrix<T> where T: Copy,
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
[−]
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
Select rows from matrix Read more
fn select_cols<'a, I>(&self, cols: I) -> Matrix<T> where T: Copy,
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
[−]
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
Select columns from matrix Read more
fn elemul(&self, m: &Self) -> Matrix<T> where T: Copy + Mul<T, Output=T>
[−]
The elementwise product of two matrices. Read more
fn elediv(&self, m: &Self) -> Matrix<T> where T: Copy + Div<T, Output=T>
[−]
The elementwise division of two matrices. Read more
fn select(&self, rows: &[usize], cols: &[usize]) -> Matrix<T> where T: Copy
[−]
Select block matrix from matrix Read more
fn hcat<S>(&self, m: &S) -> Matrix<T> where T: Copy, S: BaseMatrix<T>
[−]
Horizontally concatenates two matrices. With self on the left. Read more
fn vcat<S>(&self, m: &S) -> Matrix<T> where T: Copy, S: BaseMatrix<T>
[−]
Vertically concatenates two matrices. With self on top. Read more
fn diag(&self) -> Diagonal<T, Self>
[−]
Extract the diagonal of the matrix Read more
fn transpose(&self) -> Matrix<T> where T: Copy
[−]
Tranposes the given matrix Read more
fn is_diag(&self) -> bool where T: Zero + PartialEq
[−]
Checks if matrix is diagonal. Read more
fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> where T: Any + Float
[−]
Solves an upper triangular linear system. Read more
fn solve_l_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> where T: Any + Float
[−]
Solves a lower triangular linear system. Read more
fn split_at(&self, mid: usize, axis: Axes) -> (MatrixSlice<T>, MatrixSlice<T>)
[−]
Split the matrix at the specified axis returning two MatrixSlice
s. Read more
fn sub_slice<'a>(&self,
start: [usize; 2],
rows: usize,
cols: usize)
-> MatrixSlice<'a, T> where T: 'a
[−]
start: [usize; 2],
rows: usize,
cols: usize)
-> MatrixSlice<'a, T> where T: 'a
Produce a MatrixSlice
from an existing matrix. Read more
impl<'a, T> BaseMatrixMut<T> for ColumnMut<'a, T>
[src]
fn as_mut_ptr(&mut self) -> *mut T
[−]
Top left index of the slice.
fn as_mut_slice(&mut self) -> MatrixSliceMut<T>
[−]
Returns a MatrixSliceMut
over the whole matrix. Read more
unsafe fn get_unchecked_mut(&mut self, index: [usize; 2]) -> &mut T
[−]
Get a mutable reference to a point in the matrix without bounds checks.
fn iter_mut<'a>(&mut self) -> SliceIterMut<'a, T> where T: 'a
[−]
Returns a mutable iterator over the matrix. Read more
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 more
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
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 more
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
fn swap_rows(&mut self, a: usize, b: usize)
[−]
Swaps two rows in a matrix. Read more
fn swap_cols(&mut self, a: usize, b: usize)
[−]
Swaps two columns in a matrix. Read more
fn col_iter_mut(&mut self) -> ColsMut<T>
[−]
Iterate over the mutable columns of the matrix. Read more
fn row_iter_mut(&mut self) -> RowsMut<T>
[−]
Iterate over the mutable rows of the matrix. Read more
fn diag_iter_mut(&mut self, k: DiagOffset) -> DiagonalMut<T, Self>
[−]
Iterate over diagonal entries mutably Read more
fn set_to<M: BaseMatrix<T>>(self, target: M) where T: Copy
[−]
Sets the underlying matrix data to the target data. Read more
fn apply(self, f: &Fn(T) -> T) -> Self where T: Copy
[−]
Applies a function to each element in the matrix. Read more
fn split_at_mut(&mut self,
mid: usize,
axis: Axes)
-> (MatrixSliceMut<T>, MatrixSliceMut<T>)
[−]
mid: usize,
axis: Axes)
-> (MatrixSliceMut<T>, MatrixSliceMut<T>)
Split the matrix at the specified axis returning two MatrixSliceMut
s. Read more
fn sub_slice_mut<'a>(&mut self,
start: [usize; 2],
rows: usize,
cols: usize)
-> MatrixSliceMut<'a, T> where T: 'a
[−]
start: [usize; 2],
rows: usize,
cols: usize)
-> MatrixSliceMut<'a, T> where T: 'a
Produce a MatrixSliceMut
from an existing matrix. Read more
impl<'a, T: 'a> Deref for ColumnMut<'a, T>
[src]
type Target = MatrixSliceMut<'a, T>
The resulting type after dereferencing
fn deref(&self) -> &MatrixSliceMut<'a, T>
[−]
The method called to dereference a value
impl<'a, T: 'a> DerefMut for ColumnMut<'a, T>
[src]
fn deref_mut(&mut self) -> &mut MatrixSliceMut<'a, T>
[−]
The method called to mutably dereference a value
impl<'a, T> Index<usize> for ColumnMut<'a, T>
[src]
type Output = T
The returned type after indexing
fn index(&self, idx: usize) -> &T
[−]
The method for the indexing (container[index]
) operation
impl<'a, T> IndexMut<usize> for ColumnMut<'a, T>
[src]
fn index_mut(&mut self, idx: usize) -> &mut T
[−]
The method for the mutable indexing (container[index]
) operation