Struct matrixable::access::Observer

source ·
pub struct Observer { /* private fields */ }
Expand description

Implementations§

source§

impl Observer

source

pub fn new(dimensions: (usize, usize)) -> Self

source

pub fn update_dimensions(&mut self, s: &dyn AccessStrategy<Self>)

Trait Implementations§

source§

impl Clone for Observer

source§

fn clone(&self) -> Observer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Observer

source§

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

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

impl Default for Observer

source§

fn default() -> Observer

Returns the “default value” for a type. Read more
source§

impl Hash for Observer

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 MatrixExt for Observer

§

type 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, 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 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_symmetric(&self) -> bool
where Self::Element: PartialEq,

Checks if the matrix is symmetric i.e. it does not change when transposed. 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§

fn is_diagonal(&self) -> (bool, Option<&Self::Element>)
where Self: Sized, for<'a> &'a Self::Element: PartialEq,

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>)
where Self: Sized, for<'a> &'a Self::Element: PartialEq,

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

fn is_constant(&self) -> (bool, Option<&Self::Element>)
where Self::Element: PartialEq,

Returns a boolean indicating if all elements of the matrix are equal, and that element if it the check value is true. Read more
source§

impl Ord for Observer

source§

fn cmp(&self, other: &Observer) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Observer

source§

fn eq(&self, other: &Observer) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Observer

source§

fn partial_cmp(&self, other: &Observer) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Observer

source§

impl Eq for Observer

source§

impl StructuralPartialEq for Observer

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.