pub struct Row<'a, T: 'a> { /* private fields */ }
Expand description
Row of a matrix.
This struct points to a slice making up
a row in a matrix. You can deref this
struct to retrieve a MatrixSlice
of
the row.
Example
use rulinalg::matrix::BaseMatrix;
let mat = matrix![1.0, 2.0;
3.0, 4.0];
let row = mat.row(1);
assert_eq!((*row + 2.0).sum(), 11.0);
Implementations
Trait Implementations
sourceimpl<'a, T> BaseMatrix<T> for Row<'a, T>
impl<'a, T> BaseMatrix<T> for Row<'a, T>
sourcefn row_stride(&self) -> usize
fn row_stride(&self) -> usize
Row stride in the matrix.
sourcefn as_slice(&self) -> MatrixSlice<'_, T>
fn as_slice(&self) -> MatrixSlice<'_, T>
Returns a
MatrixSlice
over the whole matrix. Read moresourceunsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
Get a reference to an element in the matrix without bounds checking.
sourcefn get(&self, index: [usize; 2]) -> Option<&T>
fn get(&self, index: [usize; 2]) -> Option<&T>
Get a reference to an element in the matrix. Read more
sourcefn col(&self, index: usize) -> Column<'_, T>
fn col(&self, index: usize) -> Column<'_, T>
Returns the column of a matrix at the given index.
None
if the index is out of bounds. Read moresourceunsafe fn col_unchecked(&self, index: usize) -> Column<'_, T>
unsafe fn col_unchecked(&self, index: usize) -> Column<'_, T>
Returns the column of a matrix at the given
index without doing a bounds check. Read more
sourcefn row(&self, index: usize) -> Row<'_, T>
fn row(&self, index: usize) -> Row<'_, T>
Returns the row of a matrix at the given index. Read more
sourceunsafe fn row_unchecked(&self, index: usize) -> Row<'_, T>
unsafe fn row_unchecked(&self, index: usize) -> Row<'_, T>
Returns the row of a matrix at the given index without doing unbounds checking Read more
sourcefn iter<'a>(&self) -> SliceIter<'a, T>ⓘNotable traits for SliceIter<'a, T>impl<'a, T> Iterator for SliceIter<'a, T> type Item = &'a T;
where
T: 'a,
fn iter<'a>(&self) -> SliceIter<'a, T>ⓘNotable traits for SliceIter<'a, T>impl<'a, T> Iterator for SliceIter<'a, T> type Item = &'a T;
where
T: 'a,
Returns an iterator over the matrix data. Read more
sourcefn col_iter(&self) -> Cols<'_, T>ⓘNotable traits for Cols<'a, T>impl<'a, T> Iterator for Cols<'a, T> type Item = Column<'a, T>;
fn col_iter(&self) -> Cols<'_, T>ⓘNotable traits for Cols<'a, T>impl<'a, T> Iterator for Cols<'a, T> type Item = Column<'a, T>;
Iterate over the columns of the matrix. Read more
sourcefn row_iter(&self) -> Rows<'_, T>ⓘNotable traits for Rows<'a, T>impl<'a, T> Iterator for Rows<'a, T> type Item = Row<'a, T>;
fn row_iter(&self) -> Rows<'_, T>ⓘNotable traits for Rows<'a, T>impl<'a, T> Iterator for Rows<'a, T> type Item = Row<'a, T>;
Iterate over the rows of the matrix. Read more
sourcefn diag_iter(&self, k: DiagOffset) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
fn diag_iter(&self, k: DiagOffset) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
Iterate over diagonal entries Read more
sourcefn metric<'a, 'b, B, M>(&'a self, mat: &'b B, metric: M) -> Twhere
B: 'b + BaseMatrix<T>,
M: MatrixMetric<'a, 'b, T, Self, B>,
fn metric<'a, 'b, B, M>(&'a self, mat: &'b B, metric: M) -> Twhere
B: 'b + BaseMatrix<T>,
M: MatrixMetric<'a, 'b, T, Self, B>,
Compute the metric distance between two matrices. Read more
sourcefn diag(&self) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
fn diag(&self) -> Diagonal<'_, T, Self>ⓘNotable traits for Diagonal<'a, T, M>impl<'a, T, M: BaseMatrix<T>> Iterator for Diagonal<'a, T, M> type Item = &'a T;
Extract the diagonal of the matrix Read more
sourcefn split_at(
&self,
mid: usize,
axis: Axes
) -> (MatrixSlice<'_, T>, MatrixSlice<'_, T>)
fn split_at(
&self,
mid: usize,
axis: Axes
) -> (MatrixSlice<'_, T>, MatrixSlice<'_, T>)
Split the matrix at the specified axis returning two
MatrixSlice
s. Read moresourcefn sub_slice<'a>(
&self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSlice<'a, T>where
T: 'a,
fn sub_slice<'a>(
&self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSlice<'a, T>where
T: 'a,
Produce a
MatrixSlice
from an existing matrix. Read moresourceimpl<'a, T: 'a> Deref for Row<'a, T>
impl<'a, T: 'a> Deref for Row<'a, T>
type Target = MatrixSlice<'a, T>
type Target = MatrixSlice<'a, T>
The resulting type after dereferencing.
sourcefn deref(&self) -> &MatrixSlice<'a, T>
fn deref(&self) -> &MatrixSlice<'a, T>
Dereferences the value.
impl<'a, T: Copy + 'a> Copy for Row<'a, T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Row<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for Row<'a, T>
impl<'a, T> !Sync for Row<'a, T>
impl<'a, T> Unpin for Row<'a, T>
impl<'a, T> UnwindSafe for Row<'a, T>where
T: RefUnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more