pub struct MatrixAddress<I>where
I: Coordinate,{
pub row: I,
pub column: I,
}Expand description
MatrixAddress references a cell in a matrix by its row and column. Rows are numbered from zero at the top, and columns are numbered from zero at the left. Thus (0, 0), the origin, is positioned at the upper-left of the matrix. Any built in numeric or character type that fits in usize can be used as the index (thus in practice up to i16 / u16).
Fields§
§row: I§column: IImplementations§
Source§impl<I> MatrixAddress<I>where
I: Coordinate,
impl<I> MatrixAddress<I>where
I: Coordinate,
pub fn neighbors<'a, T>(
&self,
matrix: &dyn Matrix<'a, T, I>,
) -> Vec<MatrixAddress<I>>where
T: 'static,
I: Coordinate,
pub fn transpose(&self) -> MatrixAddress<I>
Trait Implementations§
Source§impl<I> Add for MatrixAddress<I>where
I: Coordinate,
impl<I> Add for MatrixAddress<I>where
I: Coordinate,
Source§impl<I> Clone for MatrixAddress<I>where
I: Coordinate + Clone,
impl<I> Clone for MatrixAddress<I>where
I: Coordinate + Clone,
Source§fn clone(&self) -> MatrixAddress<I>
fn clone(&self) -> MatrixAddress<I>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<I> Debug for MatrixAddress<I>where
I: Coordinate + Debug,
impl<I> Debug for MatrixAddress<I>where
I: Coordinate + Debug,
Source§impl<I> Default for MatrixAddress<I>where
I: Coordinate,
impl<I> Default for MatrixAddress<I>where
I: Coordinate,
Source§impl<I> Display for MatrixAddress<I>where
I: Coordinate,
impl<I> Display for MatrixAddress<I>where
I: Coordinate,
Source§impl<I> From<[I; 2]> for MatrixAddress<I>where
I: Coordinate,
impl<I> From<[I; 2]> for MatrixAddress<I>where
I: Coordinate,
Source§impl<I> From<MatrixAddress<I>> for [I; 2]where
I: Coordinate,
impl<I> From<MatrixAddress<I>> for [I; 2]where
I: Coordinate,
Source§fn from(value: MatrixAddress<I>) -> Self
fn from(value: MatrixAddress<I>) -> Self
Converts to this type from the input type.
Source§impl<I> Hash for MatrixAddress<I>where
I: Coordinate + Hash,
impl<I> Hash for MatrixAddress<I>where
I: Coordinate + Hash,
Source§impl<I> Index<LogicalDimension> for MatrixAddress<I>where
I: Coordinate,
impl<I> Index<LogicalDimension> for MatrixAddress<I>where
I: Coordinate,
Source§impl<'a, T, I> Index<MatrixAddress<I>> for DenseMatrix<T, I>where
I: Coordinate,
impl<'a, T, I> Index<MatrixAddress<I>> for DenseMatrix<T, I>where
I: Coordinate,
Source§impl<I> Index<usize> for MatrixAddress<I>where
I: Coordinate,
impl<I> Index<usize> for MatrixAddress<I>where
I: Coordinate,
Source§impl<T, I> IndexMut<MatrixAddress<I>> for DenseMatrix<T, I>where
I: Coordinate,
impl<T, I> IndexMut<MatrixAddress<I>> for DenseMatrix<T, I>where
I: Coordinate,
Source§impl<I> Ord for MatrixAddress<I>where
I: Coordinate + Ord,
impl<I> Ord for MatrixAddress<I>where
I: Coordinate + Ord,
Source§fn cmp(&self, other: &MatrixAddress<I>) -> Ordering
fn cmp(&self, other: &MatrixAddress<I>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<I> PartialEq for MatrixAddress<I>where
I: Coordinate + PartialEq,
impl<I> PartialEq for MatrixAddress<I>where
I: Coordinate + PartialEq,
Source§impl<I> PartialOrd for MatrixAddress<I>where
I: Coordinate + PartialOrd,
impl<I> PartialOrd for MatrixAddress<I>where
I: Coordinate + PartialOrd,
Source§impl<I> Sub for MatrixAddress<I>where
I: Coordinate,
impl<I> Sub for MatrixAddress<I>where
I: Coordinate,
Source§impl<'a, T: 'a, I> Tensor<T, I, MatrixAddress<I>, 2> for DenseMatrix<T, I>where
I: Coordinate,
impl<'a, T: 'a, I> Tensor<T, I, MatrixAddress<I>, 2> for DenseMatrix<T, I>where
I: Coordinate,
Source§fn range(&self) -> Range<MatrixAddress<I>>
fn range(&self) -> Range<MatrixAddress<I>>
range provides the bounds of the address space for the Tensor.
The lower (inclusive bound) is the origin, conceptually placed at the left of
a vector, the upper left of a matrix, and so on.
That lower bound is conventionally zero-based, but does not
have to be. The upper bound (exclusive) is the right side of the vector,
the lower right of the matrix, etc. Be aware that while Range provides
iterator functionality, once you move beyond single-dimension Tensors,
that iterator does not provide the correct iteration of available
addresses.
Source§fn get(&self, address: MatrixAddress<I>) -> Option<&T>
fn get(&self, address: MatrixAddress<I>) -> Option<&T>
An out-of-range-safe version of the Index trait.
impl<I> Address<I, 2> for MatrixAddress<I>where
I: Coordinate,
impl<I> Copy for MatrixAddress<I>where
I: Coordinate + Copy,
impl<I> Eq for MatrixAddress<I>where
I: Coordinate + Eq,
impl<I> StructuralPartialEq for MatrixAddress<I>where
I: Coordinate,
Auto Trait Implementations§
impl<I> Freeze for MatrixAddress<I>where
I: Freeze,
impl<I> RefUnwindSafe for MatrixAddress<I>where
I: RefUnwindSafe,
impl<I> Send for MatrixAddress<I>where
I: Send,
impl<I> Sync for MatrixAddress<I>where
I: Sync,
impl<I> Unpin for MatrixAddress<I>where
I: Unpin,
impl<I> UnwindSafe for MatrixAddress<I>where
I: 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