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§
Source§impl<'a, T> BaseMatrix<T> for Row<'a, T>
impl<'a, T> BaseMatrix<T> for Row<'a, T>
Source§fn row_stride(&self) -> usize
fn row_stride(&self) -> usize
Row stride in the matrix.
Source§fn as_slice(&self) -> MatrixSlice<'_, T>
fn as_slice(&self) -> MatrixSlice<'_, T>
Returns a
MatrixSlice over the whole matrix. Read moreSource§unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
Get a reference to a point in the matrix without bounds checking.
Source§fn 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 moreSource§unsafe 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
Source§fn 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
Source§unsafe 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
Source§fn iter<'a>(&self) -> SliceIter<'a, T> ⓘwhere
T: 'a,
fn iter<'a>(&self) -> SliceIter<'a, T> ⓘwhere
T: 'a,
Returns an iterator over the matrix data. Read more
Source§fn diag_iter(&self, k: DiagOffset) -> Diagonal<'_, T, Self> ⓘ
fn diag_iter(&self, k: DiagOffset) -> Diagonal<'_, T, Self> ⓘ
Iterate over diagonal entries Read more
Source§fn norm<N: MatrixNorm<T, Self>>(&self, norm: N) -> Twhere
T: Float,
fn norm<N: MatrixNorm<T, Self>>(&self, norm: N) -> Twhere
T: Float,
Compute given matrix norm for matrix. Read more
Source§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>,
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
Source§fn min(&self, axis: Axes) -> Vector<T>where
T: Copy + PartialOrd,
fn min(&self, axis: Axes) -> Vector<T>where
T: Copy + PartialOrd,
The min of the specified axis of the matrix. Read more
Source§fn max(&self, axis: Axes) -> Vector<T>where
T: Copy + PartialOrd,
fn max(&self, axis: Axes) -> Vector<T>where
T: Copy + PartialOrd,
The max of the specified axis of the matrix. Read more
Source§fn into_matrix(self) -> Matrix<T>where
T: Copy,
fn into_matrix(self) -> Matrix<T>where
T: Copy,
Convert the matrix struct into a owned Matrix.
Source§fn select_rows<'a, I>(&self, rows: I) -> Matrix<T>
fn select_rows<'a, I>(&self, rows: I) -> Matrix<T>
Select rows from matrix Read more
Source§fn select_cols<'a, I>(&self, cols: I) -> Matrix<T>
fn select_cols<'a, I>(&self, cols: I) -> Matrix<T>
Select columns from matrix Read more
Source§fn select(&self, rows: &[usize], cols: &[usize]) -> Matrix<T>where
T: Copy,
fn select(&self, rows: &[usize], cols: &[usize]) -> Matrix<T>where
T: Copy,
Select block matrix from matrix Read more
Source§fn hcat<S>(&self, m: &S) -> Matrix<T>where
T: Copy,
S: BaseMatrix<T>,
fn hcat<S>(&self, m: &S) -> Matrix<T>where
T: Copy,
S: BaseMatrix<T>,
Horizontally concatenates two matrices. With self on the left. Read more
Source§fn vcat<S>(&self, m: &S) -> Matrix<T>where
T: Copy,
S: BaseMatrix<T>,
fn vcat<S>(&self, m: &S) -> Matrix<T>where
T: Copy,
S: BaseMatrix<T>,
Vertically concatenates two matrices. With self on top. Read more
Source§fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error>
fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error>
Solves an upper triangular linear system. Read more
Source§fn solve_l_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error>
fn solve_l_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error>
Solves a lower triangular linear system. Read more
Source§fn 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
MatrixSlices. Read moreSource§impl<'a, T: 'a> Deref for Row<'a, T>
impl<'a, T: 'a> Deref for Row<'a, T>
Source§type Target = MatrixSlice<'a, T>
type Target = MatrixSlice<'a, T>
The resulting type after dereferencing.
Source§fn 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> Freeze for Row<'a, T>
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§
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