MatrixSlice

Struct MatrixSlice 

Source
pub struct MatrixSlice<'a, T>
where T: 'a,
{ /* private fields */ }
Expand description

A MatrixSlice

This struct provides a slice into a matrix.

The struct contains the upper left point of the slice and the width and height of the slice.

Implementations§

Source§

impl<'a, T> MatrixSlice<'a, T>

Source

pub fn from_matrix( mat: &'a Matrix<T>, start: [usize; 2], rows: usize, cols: usize, ) -> MatrixSlice<'a, T>

Produce a MatrixSlice from a Matrix

§Examples
use rulinalg::matrix::{Matrix, MatrixSlice};

let a = Matrix::new(3,3, (0..9).collect::<Vec<usize>>());
let slice = MatrixSlice::from_matrix(&a, [1,1], 2, 2);
Source

pub unsafe fn from_raw_parts( ptr: *const T, rows: usize, cols: usize, row_stride: usize, ) -> MatrixSlice<'a, T>

Creates a MatrixSlice from raw parts.

§Examples
use rulinalg::matrix::MatrixSlice;

let mut a = vec![4.0; 16];

unsafe {
    // Create a matrix slice with 3 rows, and 3 cols
    // The row stride of 4 specifies the distance between the start of each row in the data.
    let b = MatrixSlice::from_raw_parts(a.as_ptr(), 3, 3, 4);
}
§Safety

The pointer must be followed by a contiguous slice of data larger than row_stride * rows. If not then other operations will produce undefined behaviour.

Additionally cols should be less than the row_stride. It is possible to use this function safely whilst violating this condition. So long as max(cols, row_stride) * rows is less than the data size.

Source

pub fn reslice( self, start: [usize; 2], rows: usize, cols: usize, ) -> MatrixSlice<'a, T>

Produce a MatrixSlice from an existing MatrixSlice.

This function will be deprecated. Prefer using BaseMatrix::sub_slice.

§Examples
use rulinalg::matrix::{Matrix, MatrixSlice};

let a = Matrix::new(3,3, (0..9).collect::<Vec<usize>>());
let slice = MatrixSlice::from_matrix(&a, [1,1], 2, 2);
let new_slice = slice.reslice([0,0], 1, 1);

Trait Implementations§

Source§

impl<'a, 'b, 'c, T> Add<&'c Matrix<T>> for &'b MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, m: &Matrix<T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<&'b Matrix<T>> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, m: &Matrix<T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<&'c MatrixSlice<'a, T>> for &'b Matrix<T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<&'b MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Add<&'d MatrixSlice<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Add<&'d MatrixSlice<'b, T>> for &'c MatrixSliceMut<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<&'c MatrixSlice<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<&'c MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Add<&'d MatrixSliceMut<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<&'c MatrixSliceMut<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: &MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<&'c T> for &'b MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Scalar addition with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, f: &T) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<&'b T> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Scalar addition with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, f: &T) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<Matrix<T>> for &'b MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, m: Matrix<T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, T> Add<Matrix<T>> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, m: Matrix<T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<MatrixSlice<'a, T>> for &'b Matrix<T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, T> Add<MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<MatrixSlice<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<MatrixSlice<'b, T>> for &'c MatrixSliceMut<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<MatrixSlice<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, 'c, T> Add<MatrixSliceMut<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<MatrixSliceMut<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, s: MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Add<T> for &'b MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Scalar addition with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, f: T) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, T> Add<T> for MatrixSlice<'a, T>
where T: Copy + Add<Output = T>,

Scalar addition with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the + operator.
Source§

fn add(self, f: T) -> Matrix<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> AddAssign<&'b MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Add<Output = T>,

Performs elementwise addition assignment between two matrices.

Source§

fn add_assign(&mut self, _rhs: &MatrixSlice<'_, T>)

Performs the += operation. Read more
Source§

impl<'a, 'b, 'c, T> AddAssign<&'c MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition assignment between two matrices.

Source§

fn add_assign(&mut self, _rhs: &MatrixSlice<'_, T>)

Performs the += operation. Read more
Source§

impl<'a, T> AddAssign<MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Add<Output = T>,

Performs elementwise addition assignment between two matrices.

Source§

fn add_assign(&mut self, _rhs: MatrixSlice<'_, T>)

Performs the += operation. Read more
Source§

impl<'a, 'b, T> AddAssign<MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Add<Output = T>,

Performs elementwise addition assignment between two matrices.

Source§

fn add_assign(&mut self, _rhs: MatrixSlice<'_, T>)

Performs the += operation. Read more
Source§

impl<'a, T> BaseMatrix<T> for MatrixSlice<'a, T>

Source§

fn rows(&self) -> usize

Rows in the matrix.
Source§

fn cols(&self) -> usize

Columns in the matrix.
Source§

fn row_stride(&self) -> usize

Row stride in the matrix.
Source§

fn as_ptr(&self) -> *const T

Top left index of the matrix.
Source§

fn is_empty(&self) -> bool

Returns true if the matrix contais no elements
Source§

fn as_slice(&self) -> MatrixSlice<'_, T>

Returns a MatrixSlice over the whole matrix. Read more
Source§

unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T

Get a reference to a point in the matrix without bounds checking.
Source§

fn get_row(&self, index: usize) -> Option<&[T]>

Returns the row of a matrix at the given index. None if the index is out of bounds. Read more
Source§

unsafe fn get_row_unchecked(&self, index: usize) -> &[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,

Returns an iterator over the matrix data. Read more
Source§

fn iter_rows(&self) -> Rows<'_, T>

Iterate over the rows of the matrix. Read more
Source§

fn iter_diag(&self, k: DiagOffset) -> Diagonal<'_, T, Self>

Iterate over diagonal entries Read more
Source§

fn sum_rows(&self) -> Vector<T>
where T: Copy + Zero<Output = T> + Add,

The sum of the rows of the matrix. Read more
Source§

fn sum_cols(&self) -> Vector<T>
where T: Copy + Zero<Output = T> + Add,

The sum of the columns of the matrix. Read more
Source§

fn sum(&self) -> T
where T: Copy + Zero<Output = T> + Add,

The sum of all elements in the matrix Read more
Source§

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>
where T: Copy, I: IntoIterator<Item = &'a usize>, <I as IntoIterator>::IntoIter: ExactSizeIterator + Clone,

Select rows from matrix Read more
Source§

fn select_cols<'a, I>(&self, cols: I) -> Matrix<T>
where T: Copy, I: IntoIterator<Item = &'a usize>, <I as IntoIterator>::IntoIter: ExactSizeIterator + Clone,

Select columns from matrix Read more
Source§

fn elemul(&self, m: &Self) -> Matrix<T>
where T: Copy + Mul<Output = T>,

The elementwise product of two matrices. Read more
Source§

fn elediv(&self, m: &Self) -> Matrix<T>
where T: Copy + Div<Output = T>,

The elementwise division of two matrices. Read more
Source§

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

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

Vertically concatenates two matrices. With self on top. Read more
Source§

fn diag(&self) -> Vector<T>
where T: Copy,

Extract the diagonal of the matrix Read more
Source§

fn transpose(&self) -> Matrix<T>
where T: Copy,

Tranposes the given matrix Read more
Source§

fn is_diag(&self) -> bool
where T: Zero + PartialEq,

Checks if matrix is diagonal. Read more
Source§

fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error>
where T: Any + Float,

Solves an upper triangular linear system. Read more
Source§

fn solve_l_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error>
where T: Any + Float,

Solves a lower triangular linear system. Read more
Source§

fn split_at( &self, mid: usize, axis: Axes, ) -> (MatrixSlice<'_, T>, MatrixSlice<'_, T>)

Split the matrix at the specified axis returning two MatrixSlices. Read more
Source§

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 more
Source§

impl<'a, T> Clone for MatrixSlice<'a, T>
where T: Clone + 'a,

Source§

fn clone(&self) -> MatrixSlice<'a, T>

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<'a, T> Debug for MatrixSlice<'a, T>
where T: Debug + 'a,

Source§

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

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

impl<'a, 'b, 'c, T> Div<&'c T> for &'b MatrixSlice<'a, T>
where T: Copy + Div<Output = T>,

Scalar division with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the / operator.
Source§

fn div(self, f: &T) -> Matrix<T>

Performs the / operation. Read more
Source§

impl<'a, 'b, T> Div<&'b T> for MatrixSlice<'a, T>
where T: Copy + Div<Output = T>,

Scalar division with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the / operator.
Source§

fn div(self, f: &T) -> Matrix<T>

Performs the / operation. Read more
Source§

impl<'a, 'b, T> Div<T> for &'b MatrixSlice<'a, T>
where T: Copy + Div<Output = T>,

Scalar division with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the / operator.
Source§

fn div(self, f: T) -> Matrix<T>

Performs the / operation. Read more
Source§

impl<'a, T> Div<T> for MatrixSlice<'a, T>
where T: Copy + Div<Output = T>,

Scalar division with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the / operator.
Source§

fn div(self, f: T) -> Matrix<T>

Performs the / operation. Read more
Source§

impl<'a, T> From<MatrixSlice<'a, T>> for Matrix<T>
where T: Copy,

Source§

fn from(slice: MatrixSlice<'a, T>) -> Matrix<T>

Converts to this type from the input type.
Source§

impl<'a, T> Index<[usize; 2]> for MatrixSlice<'a, T>

Indexes matrix slice. Takes row index first then column.

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: [usize; 2]) -> &T

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

impl<'a, T> IntoIterator for &'a MatrixSlice<'a, T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = SliceIter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a MatrixSlice<'a, T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for &'a mut MatrixSlice<'a, T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = SliceIter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a mut MatrixSlice<'a, T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for MatrixSlice<'a, T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = SliceIter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <MatrixSlice<'a, T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T> Metric<T> for MatrixSlice<'a, T>
where T: Float,

Source§

fn norm(&self) -> T

Compute euclidean norm for matrix.

§Examples
use rulinalg::matrix::{Matrix, MatrixSlice};
use rulinalg::Metric;

let a = Matrix::new(2,1, vec![3.0,4.0]);
let b = MatrixSlice::from_matrix(&a, [0,0], 2, 1);
let c = b.norm();

assert_eq!(c, 5.0);
Source§

impl<'a, 'b, 'c, T> Mul<&'c Matrix<T>> for &'b MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &Matrix<T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<&'b Matrix<T>> for MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &Matrix<T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<&'c MatrixSlice<'a, T>> for &'b Matrix<T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<&'b MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Mul<&'d MatrixSlice<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Mul<&'d MatrixSlice<'b, T>> for &'c MatrixSliceMut<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<&'c MatrixSlice<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<&'c MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Mul<&'d MatrixSliceMut<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<&'c MatrixSliceMut<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: &MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<&'c T> for &'b MatrixSlice<'a, T>
where T: Copy + Mul<Output = T>,

Scalar multiplication with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, f: &T) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<&'b T> for MatrixSlice<'a, T>
where T: Copy + Mul<Output = T>,

Scalar multiplication with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, f: &T) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<Matrix<T>> for &'b MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: Matrix<T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, T> Mul<Matrix<T>> for MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: Matrix<T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<MatrixSlice<'a, T>> for &'b Matrix<T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, T> Mul<MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<MatrixSlice<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<MatrixSlice<'b, T>> for &'c MatrixSliceMut<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<MatrixSlice<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSlice<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, 'c, T> Mul<MatrixSliceMut<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<MatrixSliceMut<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Zero<Output = T> + Add + Mul<Output = T> + Any,

Multiplies two matrices together.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, m: MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Mul<T> for &'b MatrixSlice<'a, T>
where T: Copy + Mul<Output = T>,

Scalar multiplication with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, f: T) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, T> Mul<T> for MatrixSlice<'a, T>
where T: Copy + Mul<Output = T>,

Scalar multiplication with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the * operator.
Source§

fn mul(self, f: T) -> Matrix<T>

Performs the * operation. Read more
Source§

impl<'a, 'b, T> Neg for &'b MatrixSlice<'a, T>
where T: Neg<Output = T> + Copy,

Gets negative of matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Matrix<T>

Performs the unary - operation. Read more
Source§

impl<'a, T> Neg for MatrixSlice<'a, T>
where T: Neg<Output = T> + Copy,

Gets negative of matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Matrix<T>

Performs the unary - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<&'c Matrix<T>> for &'b MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, m: &Matrix<T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<&'b Matrix<T>> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, m: &Matrix<T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<&'c MatrixSlice<'a, T>> for &'b Matrix<T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<&'b MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Sub<&'d MatrixSlice<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Sub<&'d MatrixSlice<'b, T>> for &'c MatrixSliceMut<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<&'c MatrixSlice<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<&'c MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, 'd, T> Sub<&'d MatrixSliceMut<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<&'c MatrixSliceMut<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: &MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<&'c T> for &'b MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Scalar subtraction with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, f: &T) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<&'b T> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Scalar subtraction with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, f: &T) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<Matrix<T>> for &'b MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, m: Matrix<T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, T> Sub<Matrix<T>> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, m: Matrix<T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<MatrixSlice<'a, T>> for &'b Matrix<T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, T> Sub<MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between Matrix and MatrixSlice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<MatrixSlice<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<MatrixSlice<'b, T>> for &'c MatrixSliceMut<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<MatrixSlice<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSlice<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, 'c, T> Sub<MatrixSliceMut<'b, T>> for &'c MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<MatrixSliceMut<'b, T>> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction between the slices.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, s: MatrixSliceMut<'_, T>) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> Sub<T> for &'b MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Scalar subtraction with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, f: T) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, T> Sub<T> for MatrixSlice<'a, T>
where T: Copy + Sub<Output = T>,

Scalar subtraction with matrix slice.

Source§

type Output = Matrix<T>

The resulting type after applying the - operator.
Source§

fn sub(self, f: T) -> Matrix<T>

Performs the - operation. Read more
Source§

impl<'a, 'b, T> SubAssign<&'b MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction assignment between two matrices.

Source§

fn sub_assign(&mut self, _rhs: &MatrixSlice<'_, T>)

Performs the -= operation. Read more
Source§

impl<'a, 'b, 'c, T> SubAssign<&'c MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction assignment between two matrices.

Source§

fn sub_assign(&mut self, _rhs: &MatrixSlice<'_, T>)

Performs the -= operation. Read more
Source§

impl<'a, T> SubAssign<MatrixSlice<'a, T>> for Matrix<T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction assignment between two matrices.

Source§

fn sub_assign(&mut self, _rhs: MatrixSlice<'_, T>)

Performs the -= operation. Read more
Source§

impl<'a, 'b, T> SubAssign<MatrixSlice<'b, T>> for MatrixSliceMut<'a, T>
where T: Copy + Sub<Output = T>,

Performs elementwise subtraction assignment between two matrices.

Source§

fn sub_assign(&mut self, _rhs: MatrixSlice<'_, T>)

Performs the -= operation. Read more
Source§

impl<'a, T> Copy for MatrixSlice<'a, T>
where T: Copy + 'a,

Auto Trait Implementations§

§

impl<'a, T> Freeze for MatrixSlice<'a, T>

§

impl<'a, T> RefUnwindSafe for MatrixSlice<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> !Send for MatrixSlice<'a, T>

§

impl<'a, T> !Sync for MatrixSlice<'a, T>

§

impl<'a, T> Unpin for MatrixSlice<'a, T>

§

impl<'a, T> UnwindSafe for MatrixSlice<'a, T>
where T: RefUnwindSafe,

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.