pub struct Submatrix<'a, V, T>where
V: 'a + AsPointerToSlice<T>,{ /* private fields */ }Expand description
Immutable view on a matrix that stores elements of type T.
This view is designed to work with various underlying representations
of the matrix, as described by AsPointerToSlice.
Implementations§
Source§impl<'a, V, T> Submatrix<'a, V, T>where
V: 'a + AsPointerToSlice<T>,
impl<'a, V, T> Submatrix<'a, V, T>where
V: 'a + AsPointerToSlice<T>,
pub fn submatrix(self, rows: Range<usize>, cols: Range<usize>) -> Self
pub fn restrict_rows(self, rows: Range<usize>) -> Self
pub fn into_at(self, i: usize, j: usize) -> &'a T
pub fn at<'b>(&'b self, i: usize, j: usize) -> &'b T
pub fn restrict_cols(self, cols: Range<usize>) -> Self
pub fn row_iter(self) -> impl 'a + Clone + ExactSizeIterator<Item = &'a [T]>
pub fn col_iter( self, ) -> impl 'a + Clone + ExactSizeIterator<Item = Column<'a, V, T>>
pub fn into_row_at(self, i: usize) -> &'a [T]
pub fn row_at<'b>(&'b self, i: usize) -> &'b [T]
pub fn into_col_at(self, j: usize) -> Column<'a, V, T>
pub fn col_at<'b>(&'b self, j: usize) -> Column<'b, V, T>
pub fn col_count(&self) -> usize
pub fn row_count(&self) -> usize
Source§impl<'a, T> Submatrix<'a, AsFirstElement<T>, T>
impl<'a, T> Submatrix<'a, AsFirstElement<T>, T>
Sourcepub fn from_1d(data: &'a [T], row_count: usize, col_count: usize) -> Self
pub fn from_1d(data: &'a [T], row_count: usize, col_count: usize) -> Self
Creates a view on the given data slice, interpreting it as a matrix of given shape.
Assumes row-major order, i.e. contigous subslices of data will be the rows of the
resulting matrix.
pub fn from_ndarray<S>(data: &'a ArrayBase<S, Ix2>) -> Selfwhere
S: DataMut<Elem = T>,
Available on crate feature
ndarray only.Trait Implementations§
Source§impl<'a, V, T> Clone for Submatrix<'a, V, T>where
V: 'a + AsPointerToSlice<T>,
impl<'a, V, T> Clone for Submatrix<'a, V, T>where
V: 'a + AsPointerToSlice<T>,
Source§impl<'a, V: AsPointerToSlice<T>, T> From<Submatrix<'a, V, T>> for TransposableSubmatrix<'a, V, T, false>
impl<'a, V: AsPointerToSlice<T>, T> From<Submatrix<'a, V, T>> for TransposableSubmatrix<'a, V, T, false>
Source§impl<'a, V: AsPointerToSlice<T>, T> MatrixCompare<T> for Submatrix<'a, V, T>
impl<'a, V: AsPointerToSlice<T>, T> MatrixCompare<T> for Submatrix<'a, V, T>
impl<'a, V, T> Copy for Submatrix<'a, V, T>where
V: 'a + AsPointerToSlice<T>,
Auto Trait Implementations§
impl<'a, V, T> Freeze for Submatrix<'a, V, T>
impl<'a, V, T> RefUnwindSafe for Submatrix<'a, V, T>where
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, V, T> Send for Submatrix<'a, V, T>
impl<'a, V, T> Sync for Submatrix<'a, V, T>
impl<'a, V, T> Unpin for Submatrix<'a, V, T>
impl<'a, V, T> UnwindSafe for Submatrix<'a, V, T>where
T: RefUnwindSafe,
V: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more