Struct ratio_matrix::Matrix
source · pub struct Matrix<C> { /* private fields */ }
Expand description
Two-dimensional matrix.
Implementations§
source§impl<C> Matrix<C>
impl<C> Matrix<C>
sourcepub fn index<T: Into<MatrixCoordinates>>(
&self,
coordinates: T,
) -> Result<usize, CoordinatesOutOfBoundsError>
pub fn index<T: Into<MatrixCoordinates>>( &self, coordinates: T, ) -> Result<usize, CoordinatesOutOfBoundsError>
Get the vector index based on a set of coordinates.
sourcepub fn slice(
&self,
range: MatrixRange,
) -> Result<MatrixSlice<'_, C>, MatrixSliceError>
pub fn slice( &self, range: MatrixRange, ) -> Result<MatrixSlice<'_, C>, MatrixSliceError>
Slice this matrix to these rows and columns.
Trait Implementations§
source§impl<'de, C> Deserialize<'de> for Matrix<C>
impl<'de, C> Deserialize<'de> for Matrix<C>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<C> Domain2D for Matrix<C>
impl<C> Domain2D for Matrix<C>
source§fn range(&self) -> MatrixRange
fn range(&self) -> MatrixRange
The area spanned by this domain.
source§fn start(&self) -> MatrixCoordinates
fn start(&self) -> MatrixCoordinates
Starting coordinate of this domain (inclusive).
source§fn end(&self) -> MatrixCoordinates
fn end(&self) -> MatrixCoordinates
Ending coordinate of this domain (exclusive).
source§impl<C> MatrixMut<C> for Matrix<C>
impl<C> MatrixMut<C> for Matrix<C>
source§fn set<T: Into<MatrixCoordinates>>(
&mut self,
coordinates: T,
value: C,
) -> Result<C, CoordinatesOutOfBoundsError>
fn set<T: Into<MatrixCoordinates>>( &mut self, coordinates: T, value: C, ) -> Result<C, CoordinatesOutOfBoundsError>
Set a certain cell’s value.
source§impl<C> MatrixRef<C> for Matrix<C>
impl<C> MatrixRef<C> for Matrix<C>
source§fn get<T: Into<MatrixCoordinates>>(
&self,
coordinates: T,
) -> Result<&C, CoordinatesOutOfBoundsError>
fn get<T: Into<MatrixCoordinates>>( &self, coordinates: T, ) -> Result<&C, CoordinatesOutOfBoundsError>
Get a matrix value at this coordinate.
impl<C> StructuralPartialEq for Matrix<C>
Auto Trait Implementations§
impl<C> Freeze for Matrix<C>
impl<C> RefUnwindSafe for Matrix<C>where
C: RefUnwindSafe,
impl<C> Send for Matrix<C>where
C: Send,
impl<C> Sync for Matrix<C>where
C: Sync,
impl<C> Unpin for Matrix<C>where
C: Unpin,
impl<C> UnwindSafe for Matrix<C>where
C: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)