Struct matrixable::access::AccessMut
source · pub struct AccessMut<'a, M: MatrixExt, S: AccessStrategy<M>> { /* private fields */ }
Expand description
A MatrixMutExt
which provides mutable access to another matrix by following a certain access strategy.
This struct
is created by the access_mut
method on MatrixMutExt
. See its documentation for more.
Implementations§
source§impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> AccessMut<'a, M, S>
impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> AccessMut<'a, M, S>
Trait Implementations§
source§impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> MatrixExt for AccessMut<'a, M, S>
impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> MatrixExt for AccessMut<'a, M, S>
source§fn get(&self, row: usize, column: usize) -> Option<&Self::Element>
fn get(&self, row: usize, column: usize) -> Option<&Self::Element>
Returns a reference to an element inside the matrix, at the intersection of the
i
-th row and the j
-th column. Read moresource§unsafe fn get_unchecked(&self, row: usize, column: usize) -> &Self::Element
unsafe fn get_unchecked(&self, row: usize, column: usize) -> &Self::Element
Returns a reference to an element, without doing bounds checking. Read more
source§fn get_nth(&self, n: usize) -> Option<&Self::Element>
fn get_nth(&self, n: usize) -> Option<&Self::Element>
Gets a reference to an element inside a matrix, given its order of disposition in Row Major Order. Read more
source§unsafe fn get_nth_unchecked(&self, n: usize) -> &Self::Element
unsafe fn get_nth_unchecked(&self, n: usize) -> &Self::Element
Returns a reference to an element given its linear order, without doing bound checking. Read more
source§fn check(&self, i: usize, j: usize) -> bool
fn check(&self, i: usize, j: usize) -> bool
Checks if the provided subscripts point to an element inside the matrix. Read more
source§fn check_nth(&self, n: usize) -> bool
fn check_nth(&self, n: usize) -> bool
Checks if the provided linear index point to an element inside the matrix. Read more
source§fn index_from(&self, (i, j): (usize, usize)) -> usize
fn index_from(&self, (i, j): (usize, usize)) -> usize
Use matrix as a subscripts-to-index converter. Read more
source§fn subscripts_from(&self, n: usize) -> (usize, usize)
fn subscripts_from(&self, n: usize) -> (usize, usize)
Use matrix as a index-to-subscripts converter. Read more
source§fn checked_index_from(&self, (i, j): (usize, usize)) -> Option<usize>
fn checked_index_from(&self, (i, j): (usize, usize)) -> Option<usize>
Checked index calculation. Read more
source§fn checked_subscripts_from(&self, n: usize) -> Option<(usize, usize)>
fn checked_subscripts_from(&self, n: usize) -> Option<(usize, usize)>
Checked indexes calculation. Read more
source§fn iter(&self) -> Iter<'_, Self> ⓘwhere
Self: Sized,
fn iter(&self) -> Iter<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the elements of the matrix. Read more
source§fn row(&self, i: usize) -> Option<Row<'_, Self>>where
Self: Sized,
fn row(&self, i: usize) -> Option<Row<'_, Self>>where
Self: Sized,
Returns an iterator over the elements of the
i
-th row. Read moresource§fn col(&self, j: usize) -> Option<Column<'_, Self>>where
Self: Sized,
fn col(&self, j: usize) -> Option<Column<'_, Self>>where
Self: Sized,
Returns an iterator over elements of the
j
-th column. Read moresource§fn diag(&self, n: usize) -> Option<Diag<'_, Self>>where
Self: Sized,
fn diag(&self, n: usize) -> Option<Diag<'_, Self>>where
Self: Sized,
Returns an iterator over element of the n-th diagonal of the matrix,
starting from bottom-left to top-right. Read more
source§fn main_diag(&self) -> Diag<'_, Self> ⓘwhere
Self: Sized,
fn main_diag(&self) -> Diag<'_, Self> ⓘwhere
Self: Sized,
Returns the main diagonal i.e. all elements at position
(i, i)
. Read moresource§fn enumerate(&self) -> Enumerator<Iter<'_, Self>> ⓘwhere
Self: Sized,
fn enumerate(&self) -> Enumerator<Iter<'_, Self>> ⓘwhere
Self: Sized,
Returns an iterator which gives the current subscripts of the current element as well as its value. Read more
source§fn rows(&self) -> Rows<'_, Self> ⓘwhere
Self: Sized,
fn rows(&self) -> Rows<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the rows with immutable access to elements. Read more
source§fn cols(&self) -> Columns<'_, Self> ⓘwhere
Self: Sized,
fn cols(&self) -> Columns<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the columns with immutable access to elements. Read more
source§fn diags(&self) -> Diags<'_, Self> ⓘwhere
Self: Sized,
fn diags(&self) -> Diags<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the diagonals with immutable access to elements.
Examples Read more
source§fn access<S: AccessStrategy<Self>>(&self, strategy: S) -> Access<'_, Self, S>where
Self: Sized,
fn access<S: AccessStrategy<Self>>(&self, strategy: S) -> Access<'_, Self, S>where
Self: Sized,
Creates a matrix to access elements of this matrix following an
AccessStrategy
. Read moresource§fn transform<S: TransformStrategy<Self>>(self, strategy: &S) -> S::Outputwhere
Self: Sized,
fn transform<S: TransformStrategy<Self>>(self, strategy: &S) -> S::Outputwhere
Self: Sized,
Consumes the matrix an returns an output defined by a
TransformStrategy
. source§fn is_square(&self) -> bool
fn is_square(&self) -> bool
Checks if the matrix is a square matrix (a matrix with equal number of rows and columns). Read more
source§fn is_one_dimension(&self) -> bool
fn is_one_dimension(&self) -> bool
source§fn is_singleton(&self) -> bool
fn is_singleton(&self) -> bool
Checks if the matrix is a singleton i.e. dimensions are equal to
(1, 1)
. Read moresource§fn is_horizontal(&self) -> bool
fn is_horizontal(&self) -> bool
Checks if the matrix is horizontal (number of rows of the matrix is lower than number of columns). Read more
source§fn is_vertical(&self) -> bool
fn is_vertical(&self) -> bool
Checks if the matrix is vertical (number of rows of the matrix is greater than number of columns). Read more
source§impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> MatrixMutExt for AccessMut<'a, M, S>
impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> MatrixMutExt for AccessMut<'a, M, S>
source§fn get_mut(&mut self, row: usize, column: usize) -> Option<&mut Self::Element>
fn get_mut(&mut self, row: usize, column: usize) -> Option<&mut Self::Element>
Returns a mutable reference to a value inside the matrix, at the intersection of the
i
-th row and the j
-th column.source§unsafe fn get_unchecked_mut(
&mut self,
row: usize,
column: usize
) -> &mut Self::Element
unsafe fn get_unchecked_mut( &mut self, row: usize, column: usize ) -> &mut Self::Element
Returns a mutable reference to an element, without doing
bounds checking. Read more
source§unsafe fn get_nth_unchecked_mut(&mut self, n: usize) -> &mut Self::Element
unsafe fn get_nth_unchecked_mut(&mut self, n: usize) -> &mut Self::Element
Returns mutable a reference to an element given its linear order, without doing bound checking. Read more
source§fn set(
&mut self,
(i, j): (usize, usize),
val: Self::Element
) -> Result<(), &'static str>
fn set( &mut self, (i, j): (usize, usize), val: Self::Element ) -> Result<(), &'static str>
Changes the value of an element at the intersection of the
i
-th row and the j
-th column of the matrix. Read moresource§fn set_nth(&mut self, n: usize, val: Self::Element) -> Result<(), &'static str>
fn set_nth(&mut self, n: usize, val: Self::Element) -> Result<(), &'static str>
Changes the value of the
n
-th element of the matrix. Read moresource§fn swap(&mut self, a: (usize, usize), b: (usize, usize))
fn swap(&mut self, a: (usize, usize), b: (usize, usize))
Swaps two elements in the matrix identified by their subscripts. Read more
source§fn swapn(&mut self, a: usize, b: usize)
fn swapn(&mut self, a: usize, b: usize)
Swaps two elements in the matrix identified by their linear position following the Row Major Order. Read more
source§fn iter_mut(&mut self) -> IterMut<'_, Self> ⓘwhere
Self: Sized,
fn iter_mut(&mut self) -> IterMut<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator that allows modifying each element. Read more
source§fn row_mut(&mut self, i: usize) -> Option<RowMut<'_, Self>>where
Self: Sized,
fn row_mut(&mut self, i: usize) -> Option<RowMut<'_, Self>>where
Self: Sized,
Returns an iterator that allows modifying each element of the
i
-th row . Read moresource§fn col_mut(&mut self, j: usize) -> Option<ColumnMut<'_, Self>>where
Self: Sized,
fn col_mut(&mut self, j: usize) -> Option<ColumnMut<'_, Self>>where
Self: Sized,
Returns an iterator over that allows modifying each element of the
j
-th column. Read moresource§fn diag_mut(&mut self, n: usize) -> Option<DiagMut<'_, Self>>where
Self: Sized,
fn diag_mut(&mut self, n: usize) -> Option<DiagMut<'_, Self>>where
Self: Sized,
Returns an iterator over that allows modifying each element of the
n
-th diagonal. Read moresource§fn main_diag_mut(&mut self) -> DiagMut<'_, Self> ⓘwhere
Self: Sized,
fn main_diag_mut(&mut self) -> DiagMut<'_, Self> ⓘwhere
Self: Sized,
Returns the main diagonal (mutable). Read more
source§fn enumerate_mut(&mut self) -> Enumerator<IterMut<'_, Self>> ⓘwhere
Self: Sized,
fn enumerate_mut(&mut self) -> Enumerator<IterMut<'_, Self>> ⓘwhere
Self: Sized,
[
.enumerate()
] with mutable access to each element. Read moresource§fn rows_mut(&mut self) -> RowsMut<'_, Self> ⓘwhere
Self: Sized,
fn rows_mut(&mut self) -> RowsMut<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the rows with mutable access to elements. Read more
source§fn cols_mut(&mut self) -> ColumnsMut<'_, Self> ⓘwhere
Self: Sized,
fn cols_mut(&mut self) -> ColumnsMut<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the columns of the matrix with mutable access to elements. Read more
source§fn diags_mut(&mut self) -> DiagsMut<'_, Self> ⓘwhere
Self: Sized,
fn diags_mut(&mut self) -> DiagsMut<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator over the diagonals with mutable access to elements. Read more
source§fn access_mut<S: AccessStrategy<Self>>(
&mut self,
strategy: S
) -> AccessMut<'_, Self, S>where
Self: Sized,
fn access_mut<S: AccessStrategy<Self>>(
&mut self,
strategy: S
) -> AccessMut<'_, Self, S>where
Self: Sized,
Creates a matrix to mutably access elements of this matrix following an
AccessStrategy
. Read moreAuto Trait Implementations§
impl<'a, M, S> RefUnwindSafe for AccessMut<'a, M, S>where
M: RefUnwindSafe,
S: RefUnwindSafe,
impl<'a, M, S> Send for AccessMut<'a, M, S>
impl<'a, M, S> Sync for AccessMut<'a, M, S>
impl<'a, M, S> Unpin for AccessMut<'a, M, S>where
S: Unpin,
impl<'a, M, S> !UnwindSafe for AccessMut<'a, M, S>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more