[−][src]Struct rulinalg::matrix::Matrix
The Matrix struct.
Can be instantiated with any type.
Methods
impl<T> Matrix<T> where
T: Any + Float, [src]
T: Any + Float,
impl<T> Matrix<T> where
T: Any + Float, [src]
T: Any + Float,
impl<T> Matrix<T> where
T: Any + Float, [src]
T: Any + Float,
pub fn bidiagonal_decomp(
self
) -> Result<(Matrix<T>, Matrix<T>, Matrix<T>), Error>[src]
self
) -> Result<(Matrix<T>, Matrix<T>, Matrix<T>), Error>
Converts matrix to bidiagonal form
Returns (B, U, V), where B is bidiagonal and self = U B V_T.
Note that if self has self.rows() > self.cols() the matrix will
be transposed and then reduced - this will lead to a sub-diagonal instead
of super-diagonal.
Failures
- The matrix cannot be reduced to bidiagonal form.
impl<T: Any + Float + Signed> Matrix<T>[src]
pub fn svd(self) -> Result<(Matrix<T>, Matrix<T>, Matrix<T>), Error>[src]
Singular Value Decomposition
Computes the SVD using the Golub-Reinsch algorithm.
Returns Σ, U, V, such that self = U Σ VT. Σ is a diagonal matrix whose elements
correspond to the non-negative singular values of the matrix. The singular values are ordered in
non-increasing order. U and V have orthonormal columns, and each column represents the
left and right singular vectors for the corresponding singular value in Σ, respectively.
If self has M rows and N columns, the dimensions of the returned matrices
are as follows.
If M >= N:
Σ: N x NU: M x NV: N x N
If M < N:
Σ: M x MU: M x MV: N x M
Note: This version of the SVD is sometimes referred to as the 'economy SVD'.
Failures
This function may fail in some cases. The current decomposition whilst being efficient is fairly basic. Hopefully the algorithm can be made not to fail in the near future.
impl<T: Any + Float> Matrix<T>[src]
pub fn upper_hessenberg(self) -> Result<Matrix<T>, Error>[src]
Returns H, where H is the upper hessenberg form.
If the transformation matrix is also required, you should
use upper_hess_decomp.
Examples
use rulinalg::matrix::Matrix; let a = matrix![2., 0., 1., 1.; 2., 0., 1., 2.; 1., 2., 0., 0.; 2., 0., 1., 1.]; let h = a.upper_hessenberg(); println!("{:}", h.expect("Could not get upper Hessenberg form."));
Panics
- The matrix is not square.
Failures
- The matrix cannot be reduced to upper hessenberg form.
pub fn upper_hess_decomp(self) -> Result<(Matrix<T>, Matrix<T>), Error>[src]
Returns (U,H), where H is the upper hessenberg form and U is the unitary transform matrix.
Note: The current transform matrix seems broken...
Examples
use rulinalg::matrix::BaseMatrix; let a = matrix![1., 2., 3.; 4., 5., 6.; 7., 8., 9.]; // u is the transform, h is the upper hessenberg form. let (u, h) = a.clone().upper_hess_decomp().expect("This matrix should decompose!"); assert_matrix_eq!(h, u.transpose() * a * u, comp = abs, tol = 1e-12);
Panics
- The matrix is not square.
Failures
- The matrix cannot be reduced to upper hessenberg form.
impl<T> Matrix<T> where
T: Any + Float, [src]
T: Any + Float,
pub fn lup_decomp(self) -> Result<(Matrix<T>, Matrix<T>, Matrix<T>), Error>[src]
Computes L, U, and P for LUP decomposition.
Returns L,U, and P respectively.
This function is deprecated. Please see PartialPivLu for a replacement.
Examples
use rulinalg::matrix::Matrix; let a = matrix![1.0, 2.0, 0.0; 0.0, 3.0, 4.0; 5.0, 1.0, 2.0]; let (l, u, p) = a.lup_decomp().expect("This matrix should decompose!");
Panics
- Matrix is not square.
Failures
- Matrix cannot be LUP decomposed.
impl<T: Any + Float + Signed> Matrix<T>[src]
pub fn eigenvalues(self) -> Result<Vec<T>, Error>[src]
Eigenvalues of a square matrix.
Returns a Vec of eigenvalues.
Examples
use rulinalg::matrix::Matrix; let a = Matrix::new(4,4, (1..17).map(|v| v as f64).collect::<Vec<f64>>()); let e = a.eigenvalues().expect("We should be able to compute these eigenvalues!"); println!("{:?}", e);
Panics
- The matrix is not square.
Failures
- Eigenvalues cannot be computed.
pub fn eigendecomp(self) -> Result<(Vec<T>, Matrix<T>), Error>[src]
Eigendecomposition of a square matrix.
Returns a Vec of eigenvalues, and a matrix with eigenvectors as the columns.
The eigenvectors are only gauranteed to be correct if the matrix is real-symmetric.
Examples
use rulinalg::matrix::Matrix; let a = matrix![3., 2., 4.; 2., 0., 2.; 4., 2., 3.]; let (e, m) = a.eigendecomp().expect("We should be able to compute this eigendecomp!"); println!("{:?}", e); println!("{:?}", m.data());
Panics
- The matrix is not square.
Failures
- The eigen decomposition can not be computed.
impl<T> Matrix<T>[src]
pub fn new<U: Into<Vec<T>>>(rows: usize, cols: usize, data: U) -> Matrix<T>[src]
Constructor for Matrix struct.
Requires both the row and column dimensions.
Examples
use rulinalg::matrix::{Matrix, BaseMatrix}; let mat = Matrix::new(2,2, vec![1.0, 2.0, 3.0, 4.0]); assert_eq!(mat.rows(), 2); assert_eq!(mat.cols(), 2);
Panics
- The input data does not match the given dimensions.
pub fn from_fn<F>(rows: usize, cols: usize, f: F) -> Matrix<T> where
F: FnMut(usize, usize) -> T, [src]
F: FnMut(usize, usize) -> T,
Constructor for Matrix struct that takes a function f
and constructs a new matrix such that A_ij = f(i, j),
where i is the row index and j the column index.
Requires both the row and column dimensions as well as a generating function.
Examples
use rulinalg::matrix::{Matrix, BaseMatrix}; // Let's assume you have an array of "things" for // which you want to generate a distance matrix: let things: [i32; 3] = [1, 2, 3]; let distances: Matrix<f64> = Matrix::from_fn(things.len(), things.len(), |col, row| { (things[col] - things[row]).abs().into() }); assert_eq!(distances.rows(), 3); assert_eq!(distances.cols(), 3); assert_eq!(distances.data(), &vec![ 0.0, 1.0, 2.0, 1.0, 0.0, 1.0, 2.0, 1.0, 0.0, ]);
pub fn data(&self) -> &Vec<T>[src]
Returns a non-mutable reference to the underlying data.
pub fn mut_data(&mut self) -> &mut [T][src]
Returns a mutable slice of the underlying data.
pub fn into_vec(self) -> Vec<T>[src]
Consumes the Matrix and returns the Vec of data.
impl<T: Clone + Zero> Matrix<T>[src]
pub fn zeros(rows: usize, cols: usize) -> Matrix<T>[src]
Constructs matrix of all zeros.
Requires both the row and the column dimensions.
Examples
use rulinalg::matrix::Matrix; let mat = Matrix::<f64>::zeros(2,3);
pub fn from_diag(diag: &[T]) -> Matrix<T>[src]
Constructs matrix with given diagonal.
Requires slice of diagonal elements.
Examples
use rulinalg::matrix::Matrix; let mat = Matrix::from_diag(&vec![1.0,2.0,3.0,4.0]);
impl<T: Clone + One> Matrix<T>[src]
pub fn ones(rows: usize, cols: usize) -> Matrix<T>[src]
Constructs matrix of all ones.
Requires both the row and the column dimensions.
Examples
use rulinalg::matrix::Matrix; let mat = Matrix::<f64>::ones(2,3);
impl<T: Clone + Zero + One> Matrix<T>[src]
pub fn identity(size: usize) -> Matrix<T>[src]
Constructs the identity matrix.
Requires the size of the matrix.
Examples
use rulinalg::matrix::Matrix; let I = Matrix::<f64>::identity(4);
impl<T: Float + FromPrimitive> Matrix<T>[src]
pub fn mean(&self, axis: Axes) -> Vector<T>[src]
The mean of the matrix along the specified axis.
- Axis Row - Arithmetic mean of rows.
- Axis Col - Arithmetic mean of columns.
Calling mean() on an empty matrix will return an empty matrix.
Examples
use rulinalg::matrix::{Matrix, Axes}; let a = matrix![1.0, 2.0; 3.0, 4.0]; let c = a.mean(Axes::Row); assert_eq!(c, vector![2.0, 3.0]); let d = a.mean(Axes::Col); assert_eq!(d, vector![1.5, 3.5]);
pub fn variance(&self, axis: Axes) -> Result<Vector<T>, Error>[src]
The variance of the matrix along the specified axis.
- Axis Row - Sample variance of rows.
- Axis Col - Sample variance of columns.
Examples
use rulinalg::matrix::{Matrix, Axes}; let a = matrix![1.0, 2.0; 3.0, 4.0]; let c = a.variance(Axes::Row).unwrap(); assert_eq!(c, vector![2.0, 2.0]); let d = a.variance(Axes::Col).unwrap(); assert_eq!(d, vector![0.5, 0.5]);
Failures
- There are one or fewer row/columns in the working axis.
impl<T: Any + Float> Matrix<T>[src]
pub fn solve(self, y: Vector<T>) -> Result<Vector<T>, Error>[src]
Solves the equation Ax = y.
Requires a Vector y as input.
The method performs an LU decomposition internally, consuming the matrix in the process. If solving the same system for multiple right-hand sides is desired, see PartialPivLu.
Examples
use rulinalg::matrix::Matrix; use rulinalg::vector::Vector; let a = matrix![2.0, 3.0; 1.0, 2.0]; let y = vector![13.0, 8.0]; let x = a.solve(y).unwrap(); assert_eq!(x, vector![2.0, 3.0]);
Panics
- The matrix column count and vector size are different.
- The matrix is not square.
Failures
- The matrix cannot be decomposed into an LUP form to solve.
- There is no valid solution as the matrix is singular.
pub fn inverse(self) -> Result<Matrix<T>, Error>[src]
Computes the inverse of the matrix.
Internally performs an LU decomposition.
Examples
use rulinalg::matrix::Matrix; let a = matrix![2., 3.; 1., 2.]; let inv = a.clone().inverse().expect("This matrix should have an inverse!"); let I = a * inv; assert_matrix_eq!(I, matrix![1.0, 0.0; 0.0, 1.0]);
Panics
- The matrix is not square.
Failures
- The matrix could not be LUP decomposed.
- The matrix has zero determinant.
pub fn det(self) -> T[src]
impl<T: ToPrimitive> Matrix<T>[src]
pub fn try_into<U: NumCast>(self) -> Result<Matrix<U>, Error>[src]
Attempts to convert the matrix into a new matrix of different scalar type.
Failures
- One or more of the elements in the matrix cannot be converted into the new type.
Trait Implementations
impl<T> BaseMatrix<T> for Matrix<T>[src]
fn rows(&self) -> usize[src]
fn cols(&self) -> usize[src]
fn row_stride(&self) -> usize[src]
fn is_empty(&self) -> bool[src]
fn as_ptr(&self) -> *const T[src]
fn into_matrix(self) -> Matrix<T> where
T: Copy, [src]
T: Copy,
fn sum(&self) -> T where
T: Copy + Zero + Add<T, Output = T>, [src]
T: Copy + Zero + Add<T, Output = T>,
fn elemul(&self, m: &Self) -> Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
fn elediv(&self, m: &Self) -> Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
fn vcat<S>(&self, m: &S) -> Matrix<T> where
T: Copy,
S: BaseMatrix<T>, [src]
T: Copy,
S: BaseMatrix<T>,
fn as_slice(&self) -> MatrixSlice<T>[src]
unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T[src]
fn col(&self, index: usize) -> Column<T>[src]
unsafe fn col_unchecked(&self, index: usize) -> Column<T>[src]
fn row(&self, index: usize) -> Row<T>[src]
unsafe fn row_unchecked(&self, index: usize) -> Row<T>[src]
ⓘImportant traits for SliceIter<'a, T>fn iter<'a>(&self) -> SliceIter<'a, T> where
T: 'a, [src]
T: 'a,
ⓘImportant traits for Cols<'a, T>fn col_iter(&self) -> Cols<T>[src]
ⓘImportant traits for Rows<'a, T>fn row_iter(&self) -> Rows<T>[src]
ⓘImportant traits for Diagonal<'a, T, M>fn diag_iter(&self, k: DiagOffset) -> Diagonal<T, Self>[src]
fn sum_rows(&self) -> Vector<T> where
T: Copy + Zero + Add<T, Output = T>, [src]
T: Copy + Zero + Add<T, Output = T>,
fn sum_cols(&self) -> Vector<T> where
T: Copy + Zero + Add<T, Output = T>, [src]
T: Copy + Zero + Add<T, Output = T>,
fn norm<N: MatrixNorm<T, Self>>(&self, norm: N) -> T where
T: Float, [src]
T: Float,
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>, [src]
B: 'b + BaseMatrix<T>,
M: MatrixMetric<'a, 'b, T, Self, B>,
fn min(&self, axis: Axes) -> Vector<T> where
T: Copy + PartialOrd, [src]
T: Copy + PartialOrd,
fn max(&self, axis: Axes) -> Vector<T> where
T: Copy + PartialOrd, [src]
T: Copy + PartialOrd,
fn select_rows<'a, I>(&self, rows: I) -> Matrix<T> where
T: Copy,
I: IntoIterator<Item = &'a usize>,
I::IntoIter: ExactSizeIterator + Clone, [src]
T: Copy,
I: IntoIterator<Item = &'a usize>,
I::IntoIter: ExactSizeIterator + Clone,
fn select_cols<'a, I>(&self, cols: I) -> Matrix<T> where
T: Copy,
I: IntoIterator<Item = &'a usize>,
I::IntoIter: ExactSizeIterator + Clone, [src]
T: Copy,
I: IntoIterator<Item = &'a usize>,
I::IntoIter: ExactSizeIterator + Clone,
fn select(&self, rows: &[usize], cols: &[usize]) -> Matrix<T> where
T: Copy, [src]
T: Copy,
fn hcat<S>(&self, m: &S) -> Matrix<T> where
T: Copy,
S: BaseMatrix<T>, [src]
T: Copy,
S: BaseMatrix<T>,
ⓘImportant traits for Diagonal<'a, T, M>fn diag(&self) -> Diagonal<T, Self>[src]
fn transpose(&self) -> Matrix<T> where
T: Copy, [src]
T: Copy,
fn is_diag(&self) -> bool where
T: Zero + PartialEq, [src]
T: Zero + PartialEq,
fn solve_u_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> where
T: Any + Float, [src]
T: Any + Float,
fn solve_l_triangular(&self, y: Vector<T>) -> Result<Vector<T>, Error> where
T: Any + Float, [src]
T: Any + Float,
fn split_at(&self, mid: usize, axis: Axes) -> (MatrixSlice<T>, MatrixSlice<T>)[src]
fn sub_slice<'a>(
&self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSlice<'a, T> where
T: 'a, [src]
&self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSlice<'a, T> where
T: 'a,
impl<T> BaseMatrixMut<T> for Matrix<T>[src]
fn as_mut_ptr(&mut self) -> *mut T[src]
Top left index of the slice.
fn as_mut_slice(&mut self) -> MatrixSliceMut<T>[src]
unsafe fn get_unchecked_mut(&mut self, index: [usize; 2]) -> &mut T[src]
ⓘImportant traits for SliceIterMut<'a, T>fn iter_mut<'a>(&mut self) -> SliceIterMut<'a, T> where
T: 'a, [src]
T: 'a,
fn col_mut(&mut self, index: usize) -> ColumnMut<T>[src]
unsafe fn col_unchecked_mut(&mut self, index: usize) -> ColumnMut<T>[src]
fn row_mut(&mut self, index: usize) -> RowMut<T>[src]
unsafe fn row_unchecked_mut(&mut self, index: usize) -> RowMut<T>[src]
fn swap_rows(&mut self, a: usize, b: usize)[src]
fn swap_cols(&mut self, a: usize, b: usize)[src]
ⓘImportant traits for ColsMut<'a, T>fn col_iter_mut(&mut self) -> ColsMut<T>[src]
ⓘImportant traits for RowsMut<'a, T>fn row_iter_mut(&mut self) -> RowsMut<T>[src]
ⓘImportant traits for DiagonalMut<'a, T, M>fn diag_iter_mut(&mut self, k: DiagOffset) -> DiagonalMut<T, Self>[src]
fn set_to<M: BaseMatrix<T>>(self, target: M) where
T: Copy, [src]
T: Copy,
fn apply(self, f: &dyn Fn(T) -> T) -> Self where
T: Copy, [src]
T: Copy,
fn split_at_mut(
&mut self,
mid: usize,
axis: Axes
) -> (MatrixSliceMut<T>, MatrixSliceMut<T>)[src]
&mut self,
mid: usize,
axis: Axes
) -> (MatrixSliceMut<T>, MatrixSliceMut<T>)
fn sub_slice_mut<'a>(
&mut self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSliceMut<'a, T> where
T: 'a, [src]
&mut self,
start: [usize; 2],
rows: usize,
cols: usize
) -> MatrixSliceMut<'a, T> where
T: 'a,
impl<T: Eq> Eq for Matrix<T>[src]
impl<T: Clone> Clone for Matrix<T>[src]
impl<T: PartialEq> PartialEq<Matrix<T>> for Matrix<T>[src]
impl<T> From<Vector<T>> for Matrix<T>[src]
impl<'a, T: Copy> From<MatrixSlice<'a, T>> for Matrix<T>[src]
fn from(slice: MatrixSlice<'a, T>) -> Self[src]
impl<'a, T: Copy> From<MatrixSliceMut<'a, T>> for Matrix<T>[src]
fn from(slice: MatrixSliceMut<'a, T>) -> Self[src]
impl<T: Hash> Hash for Matrix<T>[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<T> Add<T> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Scalar addition with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, f: T) -> Matrix<T>[src]
impl<'a, T> Add<&'a T> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Scalar addition with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, f: &T) -> Matrix<T>[src]
impl<'a, T> Add<T> for &'a Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Scalar addition with matrix.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, f: T) -> Matrix<T>[src]
impl<'a, 'b, T> Add<&'b T> for &'a Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Scalar addition with matrix.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, f: &T) -> Matrix<T>[src]
impl<'a, T> Add<Matrix<T>> for MatrixSlice<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<Matrix<T>> for &'b MatrixSlice<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<&'b Matrix<T>> for MatrixSlice<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Add<&'c Matrix<T>> for &'b MatrixSlice<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Add<MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<MatrixSlice<'a, T>> for &'b Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<&'b MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: &MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Add<&'c MatrixSlice<'a, T>> for &'b Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: &MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, T> Add<Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<Matrix<T>> for &'b MatrixSliceMut<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<&'b Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Add<&'c Matrix<T>> for &'b MatrixSliceMut<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Add<MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<MatrixSliceMut<'a, T>> for &'b Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<&'b MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: &MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Add<&'c MatrixSliceMut<'a, T>> for &'b Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise
addition
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, s: &MatrixSliceMut<T>) -> Matrix<T>[src]
impl<T> Add<Matrix<T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition between two matrices.
This will reuse allocated memory from self.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Add<Matrix<T>> for &'a Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition between two matrices.
This will reuse allocated memory from m.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Add<&'a Matrix<T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition between two matrices.
This will reuse allocated memory from self.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Add<&'b Matrix<T>> for &'a Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition between two matrices.
type Output = Matrix<T>
The resulting type after applying the + operator.
fn add(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<T> Sub<T> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Scalar subtraction with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, f: T) -> Matrix<T>[src]
impl<'a, T> Sub<&'a T> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Scalar subtraction with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, f: &T) -> Matrix<T>[src]
impl<'a, T> Sub<T> for &'a Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Scalar subtraction with matrix.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, f: T) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<&'b T> for &'a Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Scalar subtraction with matrix.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, f: &T) -> Matrix<T>[src]
impl<'a, T> Sub<Matrix<T>> for MatrixSlice<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<Matrix<T>> for &'b MatrixSlice<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<&'b Matrix<T>> for MatrixSlice<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Sub<&'c Matrix<T>> for &'b MatrixSlice<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Sub<MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<MatrixSlice<'a, T>> for &'b Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<&'b MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: &MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Sub<&'c MatrixSlice<'a, T>> for &'b Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: &MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, T> Sub<Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<Matrix<T>> for &'b MatrixSliceMut<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<&'b Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Sub<&'c Matrix<T>> for &'b MatrixSliceMut<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Sub<MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<MatrixSliceMut<'a, T>> for &'b Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<&'b MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: &MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Sub<&'c MatrixSliceMut<'a, T>> for &'b Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise
subtraction
between Matrix and MatrixSlice.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, s: &MatrixSliceMut<T>) -> Matrix<T>[src]
impl<T> Sub<Matrix<T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction between two matrices.
This will reuse allocated memory from self.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Sub<Matrix<T>> for &'a Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction between two matrices.
This will reuse allocated memory from m.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Sub<&'a Matrix<T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction between two matrices.
This will reuse allocated memory from self.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Sub<&'b Matrix<T>> for &'a Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction between two matrices.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn sub(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<T> Mul<T> for Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
Scalar multiplication with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, f: T) -> Matrix<T>[src]
impl<'a, T> Mul<&'a T> for Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
Scalar multiplication with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, f: &T) -> Matrix<T>[src]
impl<'a, T> Mul<T> for &'a Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
Scalar multiplication with matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, f: T) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'b T> for &'a Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
Scalar multiplication with matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, f: &T) -> Matrix<T>[src]
impl<T> Mul<Vector<T>> for Matrix<T> where
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>, [src]
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>,
Multiplies matrix by vector.
type Output = Vector<T>
The resulting type after applying the * operator.
fn mul(self, m: Vector<T>) -> Vector<T>[src]
impl<'a, T> Mul<Vector<T>> for &'a Matrix<T> where
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>, [src]
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>,
Multiplies matrix by vector.
type Output = Vector<T>
The resulting type after applying the * operator.
fn mul(self, m: Vector<T>) -> Vector<T>[src]
impl<'a, T> Mul<&'a Vector<T>> for Matrix<T> where
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>, [src]
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>,
Multiplies matrix by vector.
type Output = Vector<T>
The resulting type after applying the * operator.
fn mul(self, m: &Vector<T>) -> Vector<T>[src]
impl<'a, 'b, T> Mul<&'b Vector<T>> for &'a Matrix<T> where
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>, [src]
T: Copy + Zero + Mul<T, Output = T> + Add<T, Output = T>,
Multiplies matrix by vector.
type Output = Vector<T>
The resulting type after applying the * operator.
fn mul(self, v: &Vector<T>) -> Vector<T>[src]
impl<'a, T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>> Mul<Matrix<T>> for Matrix<T>[src]
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'a Matrix<T>> for Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Mul<Matrix<T>> for &'a Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'b Matrix<T>> for &'a Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Mul<MatrixSlice<'a, T>> for Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'b MatrixSlice<'a, T>> for Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<MatrixSlice<'a, T>> for &'b Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Mul<&'c MatrixSlice<'a, T>> for &'b Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &MatrixSlice<T>) -> Matrix<T>[src]
impl<'a, T> Mul<Matrix<T>> for MatrixSlice<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'b Matrix<T>> for MatrixSlice<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<Matrix<T>> for &'b MatrixSlice<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Mul<&'c Matrix<T>> for &'b MatrixSlice<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, T> Mul<MatrixSliceMut<'a, T>> for Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'b MatrixSliceMut<'a, T>> for Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<MatrixSliceMut<'a, T>> for &'b Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Mul<&'c MatrixSliceMut<'a, T>> for &'b Matrix<T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &MatrixSliceMut<T>) -> Matrix<T>[src]
impl<'a, T> Mul<Matrix<T>> for MatrixSliceMut<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<&'b Matrix<T>> for MatrixSliceMut<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, T> Mul<Matrix<T>> for &'b MatrixSliceMut<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'c, T> Mul<&'c Matrix<T>> for &'b MatrixSliceMut<'a, T> where
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>, [src]
T: Any + Copy + Zero + Add<T, Output = T> + Mul<T, Output = T>,
Multiplies two matrices together.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, m: &Matrix<T>) -> Matrix<T>[src]
impl<T> Mul<Matrix<T>> for PermutationMatrix<T>[src]
Left-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Matrix<T>) -> Matrix<T>[src]
impl<'b, T> Mul<Matrix<T>> for &'b PermutationMatrix<T> where
T: Clone, [src]
T: Clone,
Left-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Matrix<T>) -> Matrix<T>[src]
impl<'a, 'm, T> Mul<&'a Matrix<T>> for PermutationMatrix<T> where
T: Zero + Clone, [src]
T: Zero + Clone,
Left-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &'a Matrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'm, T> Mul<&'a Matrix<T>> for &'b PermutationMatrix<T> where
T: Zero + Clone, [src]
T: Zero + Clone,
Left-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &'a Matrix<T>) -> Matrix<T>[src]
impl<T> Mul<PermutationMatrix<T>> for Matrix<T>[src]
Right-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: PermutationMatrix<T>) -> Matrix<T>[src]
impl<'a, T> Mul<&'a PermutationMatrix<T>> for Matrix<T> where
T: Clone, [src]
T: Clone,
Right-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &'a PermutationMatrix<T>) -> Matrix<T>[src]
impl<'a, 'm, T> Mul<PermutationMatrix<T>> for &'a Matrix<T> where
T: Zero + Clone, [src]
T: Zero + Clone,
Right-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: PermutationMatrix<T>) -> Matrix<T>[src]
impl<'a, 'b, 'm, T> Mul<&'b PermutationMatrix<T>> for &'a Matrix<T> where
T: Zero + Clone, [src]
T: Zero + Clone,
Right-multiply a matrix by a permutation matrix.
type Output = Matrix<T>
The resulting type after applying the * operator.
fn mul(self, rhs: &'b PermutationMatrix<T>) -> Matrix<T>[src]
impl<T> Div<T> for Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
Scalar division with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the / operator.
fn div(self, f: T) -> Matrix<T>[src]
impl<'a, T> Div<&'a T> for Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
Scalar division with matrix.
Will reuse the memory allocated for the existing matrix.
type Output = Matrix<T>
The resulting type after applying the / operator.
fn div(self, f: &T) -> Matrix<T>[src]
impl<'a, T> Div<T> for &'a Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
Scalar division with matrix.
type Output = Matrix<T>
The resulting type after applying the / operator.
fn div(self, f: T) -> Matrix<T>[src]
impl<'a, 'b, T> Div<&'b T> for &'a Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
Scalar division with matrix.
type Output = Matrix<T>
The resulting type after applying the / operator.
fn div(self, f: &T) -> Matrix<T>[src]
impl<T> Neg for Matrix<T> where
T: Neg<Output = T> + Copy, [src]
T: Neg<Output = T> + Copy,
Gets negative of matrix.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn neg(self) -> Matrix<T>[src]
impl<'a, T> Neg for &'a Matrix<T> where
T: Neg<Output = T> + Copy, [src]
T: Neg<Output = T> + Copy,
Gets negative of matrix.
type Output = Matrix<T>
The resulting type after applying the - operator.
fn neg(self) -> Matrix<T>[src]
impl<T> AddAssign<T> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs addition assignment between a matrix and a scalar.
fn add_assign(&mut self, _rhs: T)[src]
impl<'a, T> AddAssign<&'a T> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs addition assignment between a matrix and a scalar.
fn add_assign(&mut self, _rhs: &T)[src]
impl<T> AddAssign<Matrix<T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: Matrix<T>)[src]
impl<'a, T> AddAssign<&'a Matrix<T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: &Matrix<T>)[src]
impl<'a, T> AddAssign<Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: Matrix<T>)[src]
impl<'a, 'b, T> AddAssign<&'b Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: &Matrix<T>)[src]
impl<'a, T> AddAssign<MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: MatrixSlice<T>)[src]
impl<'a, 'b, T> AddAssign<&'b MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: &MatrixSlice<T>)[src]
impl<'a, T> AddAssign<MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: MatrixSliceMut<T>)[src]
impl<'a, 'b, T> AddAssign<&'b MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Add<T, Output = T>, [src]
T: Copy + Add<T, Output = T>,
Performs elementwise addition assignment between two matrices.
fn add_assign(&mut self, _rhs: &MatrixSliceMut<T>)[src]
impl<T> SubAssign<T> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs subtraction assignment between a matrix and a scalar.
fn sub_assign(&mut self, _rhs: T)[src]
impl<'a, T> SubAssign<&'a T> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs subtraction assignment between a matrix and a scalar.
fn sub_assign(&mut self, _rhs: &T)[src]
impl<T> SubAssign<Matrix<T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: Matrix<T>)[src]
impl<'a, T> SubAssign<&'a Matrix<T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: &Matrix<T>)[src]
impl<'a, T> SubAssign<Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: Matrix<T>)[src]
impl<'a, 'b, T> SubAssign<&'b Matrix<T>> for MatrixSliceMut<'a, T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: &Matrix<T>)[src]
impl<'a, T> SubAssign<MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: MatrixSlice<T>)[src]
impl<'a, 'b, T> SubAssign<&'b MatrixSlice<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: &MatrixSlice<T>)[src]
impl<'a, T> SubAssign<MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: MatrixSliceMut<T>)[src]
impl<'a, 'b, T> SubAssign<&'b MatrixSliceMut<'a, T>> for Matrix<T> where
T: Copy + Sub<T, Output = T>, [src]
T: Copy + Sub<T, Output = T>,
Performs elementwise subtraction assignment between two matrices.
fn sub_assign(&mut self, _rhs: &MatrixSliceMut<T>)[src]
impl<T> MulAssign<T> for Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
Performs multiplication assignment between a matrix and a scalar.
fn mul_assign(&mut self, _rhs: T)[src]
impl<'a, T> MulAssign<&'a T> for Matrix<T> where
T: Copy + Mul<T, Output = T>, [src]
T: Copy + Mul<T, Output = T>,
Performs multiplication assignment between a matrix and a scalar.
fn mul_assign(&mut self, _rhs: &T)[src]
impl<T> DivAssign<T> for Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
Performs division assignment between a matrix and a scalar.
fn div_assign(&mut self, _rhs: T)[src]
impl<'a, T> DivAssign<&'a T> for Matrix<T> where
T: Copy + Div<T, Output = T>, [src]
T: Copy + Div<T, Output = T>,
Performs division assignment between a matrix and a scalar.
fn div_assign(&mut self, _rhs: &T)[src]
impl<T> Index<[usize; 2]> for Matrix<T>[src]
Indexes matrix.
Takes row index first then column.
impl<T> IndexMut<[usize; 2]> for Matrix<T>[src]
Indexes mutable matrix.
Takes row index first then column.
impl<T: Display> Display for Matrix<T>[src]
impl<T: Debug> Debug for Matrix<T>[src]
impl<'a, T: 'a + Copy> FromIterator<&'a [T]> for Matrix<T>[src]
Creates a Matrix from an iterator over slices.
Each of the slices produced by the iterator will become a row in the matrix.
Panics
Will panic if the iterators items do not have constant length.
Examples
We can create a new matrix from some data.
use rulinalg::matrix::{Matrix, BaseMatrix}; let a : Matrix<f64> = vec![4f64; 16].chunks(4).collect(); assert_eq!(a.rows(), 4); assert_eq!(a.cols(), 4);
We can also do more interesting things.
use rulinalg::matrix::{Matrix, BaseMatrix}; let a = Matrix::new(4,2, (0..8).collect::<Vec<usize>>()); // Here we skip the first row and take only those // where the first entry is less than 6. let b = a.row_iter() .skip(1) .filter(|x| x[0] < 6) .collect::<Matrix<usize>>(); // We take the middle rows assert_eq!(b.into_vec(), vec![2,3,4,5]);
fn from_iter<I: IntoIterator<Item = &'a [T]>>(iterable: I) -> Self[src]
impl<'a, T: 'a + Copy> FromIterator<Row<'a, T>> for Matrix<T>[src]
fn from_iter<I: IntoIterator<Item = Row<'a, T>>>(iterable: I) -> Self[src]
impl<'a, T: 'a + Copy> FromIterator<RowMut<'a, T>> for Matrix<T>[src]
fn from_iter<I: IntoIterator<Item = RowMut<'a, T>>>(iterable: I) -> Self[src]
Auto Trait Implementations
impl<T> Sync for Matrix<T> where
T: Sync,
T: Sync,
impl<T> Send for Matrix<T> where
T: Send,
T: Send,
impl<T> Unpin for Matrix<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Matrix<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Matrix<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,