Struct rulinalg::matrix::Column
[−]
[src]
pub struct Column<'a, T: 'a> { /* fields omitted */ }
Column of a matrix.
This struct points to a MatrixSlice
making up a column in a matrix.
You can deref this struct to retrieve
the raw column MatrixSlice
.
Example
use rulinalg::matrix::BaseMatrix; let mat = matrix![1.0, 2.0; 3.0, 4.0]; let col = mat.col(1); assert_eq!((*col + 2.0).sum(), 10.0);
Methods from Deref<Target=MatrixSlice<'a, T>>
Trait Implementations
impl<'a, T> BaseMatrix<T> for Column<'a, T>
[src]
fn rows(&self) -> usize
Rows in the matrix.
fn cols(&self) -> usize
Columns in the matrix.
fn row_stride(&self) -> usize
Row stride in the matrix.
fn as_ptr(&self) -> *const T
Top left index of the matrix.
fn is_empty(&self) -> bool
Returns true if the matrix contais no elements
fn as_slice(&self) -> MatrixSlice<T>
Returns a MatrixSlice
over the whole matrix. Read more
unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T
Get a reference to a point in the matrix without bounds checking.
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 more
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
fn row(&self, index: usize) -> Row<T>
Returns the row of a matrix at the given index. Read more
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
fn iter<'a>(&self) -> SliceIter<'a, T> where T: 'a
Returns an iterator over the matrix data. Read more
fn col_iter(&self) -> Cols<T>
Iterate over the columns of the matrix. Read more
fn row_iter(&self) -> Rows<T>
Iterate over the rows of the matrix. Read more
fn diag_iter(&self, k: DiagOffset) -> Diagonal<T, Self>
Iterate over diagonal entries Read more
fn sum_rows(&self) -> Vector<T> where T: Copy + Zero + Add<T, Output=T>
The sum of the rows of the matrix. Read more
fn sum_cols(&self) -> Vector<T> where T: Copy + Zero + Add<T, Output=T>
The sum of the columns of the matrix. Read more
fn norm<N: MatrixNorm<T, Self>>(&self, norm: N) -> T where T: Float
Compute given matrix norm for matrix. Read more
fn metric<'a, 'b, B, M>(&'a self, mat: &'b B, metric: M) -> T where B: 'b + BaseMatrix<T>, M: MatrixMetric<'a, 'b, T, Self, B>
Compute the metric distance between two matrices. Read more
fn sum(&self) -> T where T: Copy + Zero + Add<T, Output=T>
The sum of all elements in the matrix Read more
fn min(&self, axis: Axes) -> Vector<T> where T: Copy + PartialOrd
The min of the specified axis of the matrix. Read more
fn max(&self, axis: Axes) -> Vector<T> where T: Copy + PartialOrd
The max of the specified axis of the matrix. Read more
fn into_matrix(self) -> Matrix<T> where T: Copy
Convert the matrix struct into a owned Matrix.
fn select_rows<'a, I>(&self, rows: I) -> Matrix<T> where T: Copy,
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
Select rows from matrix Read more
fn select_cols<'a, I>(&self, cols: I) -> Matrix<T> where T: Copy,
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
I: IntoIterator<Item=&'a usize>,
I::IntoIter: ExactSizeIterator + Clone
Select columns from matrix Read more
fn elemul(&self, m: &Self) -> Matrix<T> where T: Copy + Mul<T, Output=T>
The elementwise product of two matrices. Read more
fn elediv(&self, m: &Self) -> Matrix<T> where T: Copy + Div<T, Output=T>
The elementwise division of two matrices. Read more
fn select(&self, rows: &[usize], cols: &[usize]) -> Matrix<T> where T: Copy
Select block matrix from matrix Read more
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
fn vcat<S>(&self, m: &S) -> Matrix<T> where T: Copy, S: BaseMatrix<T>
Vertically concatenates two matrices. With self on top. Read more
fn diag(&self) -> Diagonal<T, Self>
Extract the diagonal of the matrix Read more
fn transpose(&self) -> Matrix<T> where T: Copy
Tranposes the given matrix Read more
fn is_diag(&self) -> bool where T: Zero + PartialEq
Checks if matrix is diagonal. Read more
fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> where T: Any + Float
Solves an upper triangular linear system. Read more
fn solve_l_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> where T: Any + Float
Solves a lower triangular linear system. Read more
fn split_at(&self, mid: usize, axis: Axes) -> (MatrixSlice<T>, MatrixSlice<T>)
Split the matrix at the specified axis returning two MatrixSlice
s. Read more
fn sub_slice<'a>(&self,
start: [usize; 2],
rows: usize,
cols: usize)
-> MatrixSlice<'a, T> where T: 'a
start: [usize; 2],
rows: usize,
cols: usize)
-> MatrixSlice<'a, T> where T: 'a
Produce a MatrixSlice
from an existing matrix. Read more
impl<'a, T: 'a> Deref for Column<'a, T>
[src]
type Target = MatrixSlice<'a, T>
The resulting type after dereferencing
fn deref(&self) -> &MatrixSlice<'a, T>
The method called to dereference a value
impl<'a, T> Index<usize> for Column<'a, T>
[src]
type Output = T
The returned type after indexing
fn index(&self, idx: usize) -> &T
The method for the indexing (container[index]
) operation
impl<'a, T: Debug + 'a> Debug for Column<'a, T>
[src]
impl<'a, T: Clone + 'a> Clone for Column<'a, T>
[src]
fn clone(&self) -> Column<'a, T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more