MatrixMut

Trait MatrixMut 

Source
pub unsafe trait MatrixMut<T>: MatrixRef<T> {
    // Required methods
    fn try_get_reference_mut(
        &mut self,
        row: Row,
        column: Column,
    ) -> Option<&mut T>;
    unsafe fn get_reference_unchecked_mut(
        &mut self,
        row: Row,
        column: Column,
    ) -> &mut T;
}
Expand description

A unique/mutable reference to a matrix (or a portion of it) of some type.

§Safety

See MatrixRef.

Required Methods§

Source

fn try_get_reference_mut(&mut self, row: Row, column: Column) -> Option<&mut T>

Gets a mutable reference to the value at the index, if the index is in range. Otherwise returns None.

Source

unsafe fn get_reference_unchecked_mut( &mut self, row: Row, column: Column, ) -> &mut T

Gets a mutable reference to the value at the index without doing any bounds checking. For a safe alternative see try_get_reference_mut.

§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used. Valid indexes are defined as in MatrixRef.

Trait Implementations§

Source§

impl<T> MatrixMut<T> for Box<dyn MatrixMut<T>>

A box of a dynamic MatrixMut also implements MatrixMut.

Source§

fn try_get_reference_mut(&mut self, row: Row, column: Column) -> Option<&mut T>

Gets a mutable reference to the value at the index, if the index is in range. Otherwise returns None.
Source§

unsafe fn get_reference_unchecked_mut( &mut self, row: Row, column: Column, ) -> &mut T

Gets a mutable reference to the value at the index without doing any bounds checking. For a safe alternative see try_get_reference_mut. Read more
Source§

impl<T> MatrixRef<T> for Box<dyn MatrixMut<T>>

A box of a dynamic MatrixMut also implements MatrixRef.

Source§

fn try_get_reference(&self, row: Row, column: Column) -> Option<&T>

Gets a reference to the value at the index if the index is in range. Otherwise returns None.
Source§

fn view_rows(&self) -> Row

The number of rows that this reference can view. This may be less than the actual number of rows of data stored in the matrix implementation, and could be 0.
Source§

fn view_columns(&self) -> Column

The number of columns that this reference can view. This may be less than the actual number of columns of data stored in the matrix implementation, and could be 0.
Source§

unsafe fn get_reference_unchecked(&self, row: Row, column: Column) -> &T

Gets a reference to the value at the index without doing any bounds checking. For a safe alternative see try_get_reference. Read more
Source§

fn data_layout(&self) -> DataLayout

A hint for the data layout this MatrixView uses to store its data. Read more
Source§

impl<T> NoInteriorMutability for Box<dyn MatrixMut<T>>

A box of a dynamic MatrixMut also implements NoInteriorMutability, since NoInteriorMutability is supertrait of MatrixMut

Implementations on Foreign Types§

Source§

impl<'source, T, S> MatrixMut<T> for &'source mut S
where S: MatrixMut<T>,

If some type implements MatrixMut, then an exclusive reference to it implements MatrixMut as well

Source§

fn try_get_reference_mut(&mut self, row: Row, column: Column) -> Option<&mut T>

Source§

unsafe fn get_reference_unchecked_mut( &mut self, row: Row, column: Column, ) -> &mut T

Source§

impl<T> MatrixMut<T> for Box<dyn MatrixMut<T>>

A box of a dynamic MatrixMut also implements MatrixMut.

Source§

fn try_get_reference_mut(&mut self, row: Row, column: Column) -> Option<&mut T>

Source§

unsafe fn get_reference_unchecked_mut( &mut self, row: Row, column: Column, ) -> &mut T

Source§

impl<T, S> MatrixMut<T> for Box<S>
where S: MatrixMut<T>,

A box of a MatrixMut also implements MatrixMut.

Source§

fn try_get_reference_mut(&mut self, row: Row, column: Column) -> Option<&mut T>

Source§

unsafe fn get_reference_unchecked_mut( &mut self, row: Row, column: Column, ) -> &mut T

Implementors§

Source§

impl<'a, T> MatrixMut<T> for MatrixPart<'a, T>

A MatrixPart implements MatrixMut.

Source§

impl<'a, T, S> MatrixMut<(T, usize)> for RecordMatrix<'a, T, S>
where T: Primitive, S: MatrixMut<(T, Index)>,

RecordMatrix implements MatrixMut when the source does, returning mutable references to the tuples of T and Index.

Source§

impl<T> MatrixMut<T> for Matrix<T>

A Matrix implements MatrixMut.

Source§

impl<T, S> MatrixMut<T> for MatrixRefTensor<T, S>
where S: TensorMut<T, 2>,

Source§

impl<T, S> MatrixMut<T> for MatrixMask<T, S>
where S: MatrixMut<T>,

A MatrixMask of a MatrixMut type implements MatrixMut.

Source§

impl<T, S> MatrixMut<T> for MatrixRange<T, S>
where S: MatrixMut<T>,

A MatrixRange of a MatrixMut type implements MatrixMut.

Source§

impl<T, S> MatrixMut<T> for MatrixReverse<T, S>
where S: MatrixMut<T>,

A MatrixReverse implements MatrixMut, with the dimension names the MatrixReverse was created with iterating in reverse order compared to the dimension names in the original source.