DenseMatrix

Struct DenseMatrix 

Source
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,

Source§

fn clone(&self) -> Self

Returns a duplicate 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<T: Debug, I> Debug for DenseMatrix<T, I>
where I: Coordinate + Debug,

Source§

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

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

impl<'a, T, I> Index<MatrixAddress<I>> for DenseMatrix<T, I>
where I: Coordinate,

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: MatrixAddress<I>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T, I> IndexMut<MatrixAddress<I>> for DenseMatrix<T, I>
where I: Coordinate,

Source§

fn index_mut(&mut self, index: MatrixAddress<I>) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, T, I> Matrix<'a, T, I> for DenseMatrix<T, I>
where T: 'static + 'a, I: Coordinate,

Source§

fn row_count(&self) -> I

row_count returns the number of horizontal rows stored in the Matrix.
Source§

fn column_count(&self) -> I

column_count returns the number of vertical columns stored in the Matrix.
Source§

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>

iter iterates over the values in a matrix in row-major order.
Source§

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>>

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>>

column retrieves a column by index. None is returned for out of bounds column numbers.
Source§

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>

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,

Source§

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>

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,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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>>

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>

An out-of-range-safe version of the Index trait.
Source§

fn get_mut(&mut self, address: MatrixAddress<I>) -> Option<&mut T>

An out-of-range-safe version of the IndexMut trait.
Source§

fn contains(&self, address: A) -> bool

contains is true if the given address is within the Tensor’s bounds for all dimensions.
Source§

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>

§

impl<T, I> Send for DenseMatrix<T, I>
where I: Send, T: Send,

§

impl<T, I> Sync for DenseMatrix<T, I>
where I: Sync, T: Sync,

§

impl<T, I> Unpin for DenseMatrix<T, I>
where I: Unpin, T: Unpin,

§

impl<T, I> UnwindSafe for DenseMatrix<T, I>
where I: UnwindSafe, T: UnwindSafe,

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.