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>

source

pub fn clone_into(&self) -> M
where M: Clone, <M as MatrixExt>::Element: Clone,

Trait Implementations§

source§

impl<'a, M: Debug + MatrixExt, S: Debug + AccessStrategy<M>> Debug for AccessMut<'a, M, S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, M: Hash + MatrixExt, S: Hash + AccessStrategy<M>> Hash for AccessMut<'a, M, S>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, M: MatrixMutExt, S: AccessStrategy<M>> MatrixExt for AccessMut<'a, M, S>

§

type Element = <M as MatrixExt>::Element

The type of the elements of the matrix.
source§

fn num_rows(&self) -> usize

Gets the number of rows of the matrix. Read more
source§

fn num_cols(&self) -> usize

Gets the number of columns of the matrix. Read more
source§

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 more
source§

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>

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

Returns a reference to an element given its linear order, without doing bound checking. Read more
source§

fn size(&self) -> usize

Returns the size of the matrix Read more
source§

fn dimensions(&self) -> (usize, usize)

Returns the dimensions of the matrix Read more
source§

fn num_diags(&self) -> usize

Returns the number of diagonals. Read more
source§

fn row_len(&self) -> usize

Returns the length of a row.
source§

fn col_len(&self) -> usize

Returns the length of a column.
source§

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

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

Use matrix as a subscripts-to-index converter. Read more
source§

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>

Checked index calculation. Read more
source§

fn checked_subscripts_from(&self, n: usize) -> Option<(usize, usize)>

Checked indexes calculation. Read more
source§

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,

Returns an iterator over the elements of the i-th row. Read more
source§

fn col(&self, j: usize) -> Option<Column<'_, Self>>
where Self: Sized,

Returns an iterator over elements of the j-th column. Read more
source§

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,

Returns the main diagonal i.e. all elements at position (i, i). Read more
source§

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,

Returns an iterator over the rows with immutable access to elements. Read more
source§

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,

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,

Creates a matrix to access elements of this matrix following an AccessStrategy. Read more
source§

fn transform<S: TransformStrategy<Self>>(self, strategy: &S) -> S::Output
where Self: Sized,

Consumes the matrix an returns an output defined by a TransformStrategy.
source§

fn is_empty(&self) -> bool

Checks if the matrix is empty. Read more
source§

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

Checks if the matrix has one dimension (number of columns is 1 or number of rows is 1) Read more
source§

fn is_singleton(&self) -> bool

Checks if the matrix is a singleton i.e. dimensions are equal to (1, 1). Read more
source§

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

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>

source§

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

Returns a mutable reference to an element, without doing bounds checking. Read more
source§

fn get_nth_mut(&mut self, n: usize) -> Option<&mut Self::Element>

Example Read more
source§

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>

Changes the value of an element at the intersection of the i-th row and the j-th column of the matrix. Read more
source§

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 more
source§

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)

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,

Returns an iterator that allows modifying each element. Read more
source§

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 more
source§

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 more
source§

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 more
source§

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,

[.enumerate()] with mutable access to each element. Read more
source§

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,

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,

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,

Creates a matrix to mutably access elements of this matrix following an AccessStrategy. Read more
source§

fn in_place<S: InPlace<Self>>(&mut self, strategy: &S)
where Self: Sized,

Modifies the matrix in place according to a certain strategy.

Auto Trait Implementations§

§

impl<'a, M, S> RefUnwindSafe for AccessMut<'a, M, S>

§

impl<'a, M, S> Send for AccessMut<'a, M, S>
where M: Send, S: Send,

§

impl<'a, M, S> Sync for AccessMut<'a, M, S>
where M: Sync, S: Sync,

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.