Struct matrixable::access::Observer
source · pub struct Observer { /* private fields */ }
Expand description
Used by AccessStrategySet
.
Implementations§
source§impl Observer
impl Observer
pub fn new(dimensions: (usize, usize)) -> Self
pub fn update_dimensions(&mut self, s: &dyn AccessStrategy<Self>)
Trait Implementations§
source§impl MatrixExt for Observer
impl MatrixExt for Observer
source§fn get(&self, i: usize, j: usize) -> Option<&()>
fn get(&self, i: usize, j: usize) -> Option<&()>
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_symmetric(&self) -> bool
fn is_symmetric(&self) -> bool
Checks if the matrix is symmetric i.e. it does not change when transposed. Read more
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§fn is_diagonal(&self) -> (bool, Option<&Self::Element>)
fn is_diagonal(&self) -> (bool, Option<&Self::Element>)
Returns a boolean indicating if the matrix looks like a diagonal matrix (a matrix which entries outside the main diagonal are all zero), along with the reference to the element that may serve as zero in that matrix if the check was correct. Read more
source§fn is_scalar(&self) -> (bool, Option<&Self::Element>, Option<&Self::Element>)
fn is_scalar(&self) -> (bool, Option<&Self::Element>, Option<&Self::Element>)
Returns a boolean indicating if matrix is a square diagonal matrix having the
same elements on its diagonal (assumed to be the first element of the matrix, at (0, 0)),
along with that element and the element considered as zero (that is the second element of matrix, at index
0, 1
). Read moresource§impl Ord for Observer
impl Ord for Observer
source§impl PartialEq for Observer
impl PartialEq for Observer
source§impl PartialOrd for Observer
impl PartialOrd for Observer
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Observer
impl Eq for Observer
impl StructuralPartialEq for Observer
Auto Trait Implementations§
impl RefUnwindSafe for Observer
impl Send for Observer
impl Sync for Observer
impl Unpin for Observer
impl UnwindSafe for Observer
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