pub struct DenseMatrix<T, I>where
I: Coordinate,{ /* private fields */ }Expand description
DenseMatrix pre-allocates storage for every storage cell.
Trait Implementations§
Source§impl<T, I> Clone for DenseMatrix<T, I>where
T: Clone,
I: Coordinate,
impl<T, I> Clone for DenseMatrix<T, I>where
T: Clone,
I: Coordinate,
Source§impl<T: Debug, I> Debug for DenseMatrix<T, I>where
I: Coordinate + Debug,
impl<T: Debug, I> Debug for DenseMatrix<T, I>where
I: Coordinate + Debug,
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<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<'a, T, I> Matrix<'a, T, I> for DenseMatrix<T, I>where
T: 'static + 'a,
I: Coordinate,
impl<'a, T, I> Matrix<'a, T, I> for DenseMatrix<T, I>where
T: 'static + 'a,
I: Coordinate,
Source§fn row_count(&self) -> I
fn row_count(&self) -> I
row_count returns the number of horizontal rows stored in the Matrix.
Source§fn column_count(&self) -> I
fn column_count(&self) -> I
column_count returns the number of vertical columns stored in the Matrix.
Source§fn addresses(&self) -> MatrixForwardIterator<I> ⓘ
fn addresses(&self) -> MatrixForwardIterator<I> ⓘ
addresses iterates over the addresses in a Matrix in row-major order.
Source§fn iter(&'a self) -> MatrixValueIterator<'a, T, I> ⓘ
fn iter(&'a self) -> MatrixValueIterator<'a, T, I> ⓘ
iter iterates over the values in a matrix in row-major order.
Source§fn indexed_iter(&self) -> MatrixForwardIndexedIterator<'_, T, I> ⓘ
fn indexed_iter(&self) -> MatrixForwardIndexedIterator<'_, T, I> ⓘ
indexed_iter returns addresses and their cell’s contents as an iterator.
Source§fn row(&'a self, row_num: I) -> Option<Row<'a, T, I>>
fn row(&'a self, row_num: I) -> Option<Row<'a, T, I>>
row retrieves a row by index. None is returned for out of bounds row numbers.
Source§fn column(&'a self, column_num: I) -> Option<Column<'a, T, I>>
fn column(&'a self, column_num: I) -> Option<Column<'a, T, I>>
column retrieves a column by index. None is returned for out of bounds column numbers.
Source§fn rows(&'a self) -> MatrixRowsIterator<'a, T, I> ⓘ
fn rows(&'a self) -> MatrixRowsIterator<'a, T, I> ⓘ
rows returns an iterator over the rows of the matrix.
Source§fn columns(&'a self) -> MatrixColumnsIterator<'a, T, I> ⓘ
fn columns(&'a self) -> MatrixColumnsIterator<'a, T, I> ⓘ
columns returns an iterator over the columns of the matrix.
Source§impl<'a, 'b, T, V, I> MatrixMap<'a, 'b, T, V, I> for DenseMatrix<T, I>where
T: 'static,
V: 'static,
I: 'static + Coordinate,
impl<'a, 'b, T, V, I> MatrixMap<'a, 'b, T, V, I> for DenseMatrix<T, I>where
T: 'static,
V: 'static,
I: 'static + Coordinate,
Source§fn map_matrix(&'a self, f: &'a dyn Fn(&T) -> V) -> DenseMatrix<V, I>
fn map_matrix(&'a self, f: &'a dyn Fn(&T) -> V) -> DenseMatrix<V, I>
map creates a Matrix<V, I> from a Matrix<T, I> using a helper function
to transform each element.
Source§fn map_indexed_matrix(
&'a self,
f: &mut dyn FnMut(MatrixAddress<I>, &T) -> V,
) -> DenseMatrix<V, I>
fn map_indexed_matrix( &'a self, f: &mut dyn FnMut(MatrixAddress<I>, &T) -> V, ) -> DenseMatrix<V, I>
map_indexed_matrix creates a Matrix<V, I> from a Matrix<T, I> using a helper
function that takes the address and value of each element.
Source§impl<T, I> PartialEq for DenseMatrix<T, I>where
T: PartialEq,
I: Coordinate,
impl<T, I> PartialEq for DenseMatrix<T, I>where
T: PartialEq,
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<T, I> Eq for DenseMatrix<T, I>where
T: Eq,
I: Coordinate,
Auto Trait Implementations§
impl<T, I> Freeze for DenseMatrix<T, I>where
I: Freeze,
impl<T, I> RefUnwindSafe for DenseMatrix<T, I>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> Send for DenseMatrix<T, I>
impl<T, I> Sync for DenseMatrix<T, I>
impl<T, I> Unpin for DenseMatrix<T, I>
impl<T, I> UnwindSafe for DenseMatrix<T, I>where
I: UnwindSafe,
T: 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