Mat

Struct Mat 

Source
#[repr(transparent)]
pub struct Mat<Inner>(pub Inner);
Expand description

generic Mat wrapper

Tuple Fields§

§0: Inner

Implementations§

Source§

impl<'a, T> Mat<Mut<'a, T>>

Source

pub fn from_row_major_array_mut<const ROWS: usize, const COLS: usize>( array: &'a mut [[T; COLS]; ROWS], ) -> Self

equivalent to MatMut::from_row_major_slice_mut(array.as_flattened_mut(), ROWS, COLS)

Source

pub fn from_column_major_array_mut<const ROWS: usize, const COLS: usize>( array: &'a mut [[T; ROWS]; COLS], ) -> Self

equivalent to MatMut::from_column_major_slice_mut(array.as_flattened_mut(), ROWS, COLS)

Source§

impl<'a, T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride> Mat<Mut<'a, T, Rows, Cols, RStride, CStride>>

Source

pub const unsafe fn from_raw_parts_mut( ptr: *mut T, nrows: Rows, ncols: Cols, row_stride: RStride, col_stride: CStride, ) -> Self

creates a MatMut from a pointer to the matrix data, dimensions, and strides

the row (resp. column) stride is the offset from the memory address of a given matrix element at index (row: i, col: j), to the memory address of the matrix element at index (row: i + 1, col: 0) (resp. (row: 0, col: i + 1)). this offset is specified in number of elements, not in bytes

§safety

the behavior is undefined if any of the following conditions are violated:

  • for each matrix unit, the entire memory region addressed by the matrix must be contained within a single allocation, accessible in its entirety by the corresponding pointer in ptr
  • for each matrix unit, the corresponding pointer must be non null and properly aligned, even for a zero-sized matrix.
  • the values accessible by the matrix must be initialized at some point before they are read, or references to them are formed
  • no aliasing (including self aliasing) is allowed. in other words, none of the elements accessible by any matrix unit may be accessed for reads or writes by any other means for the duration of the lifetime 'a. no two elements within a single matrix unit may point to the same address (such a thing can be achieved with a zero stride, for example), and no two matrix units may point to the same address
§example
use faer::{MatMut, mat};

// row major matrix with 2 rows, 3 columns, with a column at the end that we want to skip.
// the row stride is the pointer offset from the address of 1.0 to the address of 4.0,
// which is 4
// the column stride is the pointer offset from the address of 1.0 to the address of 2.0,
// which is 1
let mut data = [[1.0, 2.0, 3.0, f64::NAN], [4.0, 5.0, 6.0, f64::NAN]];
let mut matrix =
	unsafe { MatMut::from_raw_parts_mut(data.as_mut_ptr() as *mut f64, 2, 3, 4, 1) };

let expected = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
assert_eq!(expected.as_ref(), matrix);
Source

pub fn as_ptr(&self) -> *const T

returns a pointer to the matrix data

Source

pub fn nrows(&self) -> Rows

returns the number of rows of the matrix

Source

pub fn ncols(&self) -> Cols

returns the number of columns of the matrix

Source

pub fn shape(&self) -> (Rows, Cols)

returns the number of rows and columns of the matrix

Source

pub fn row_stride(&self) -> RStride

returns the row stride of the matrix, specified in number of elements, not in bytes

Source

pub fn col_stride(&self) -> CStride

returns the column stride of the matrix, specified in number of elements, not in bytes

Source

pub fn ptr_at(&self, row: IdxInc<Rows>, col: IdxInc<Cols>) -> *const T

returns a raw pointer to the element at the given index

Source

pub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>, col: Idx<Cols>) -> *const T

returns a raw pointer to the element at the given index, assuming the provided index is within the matrix bounds

§safety

the behavior is undefined if any of the following conditions are violated:

  • row < self.nrows()
  • col < self.ncols()
Source

pub fn split_at( self, row: IdxInc<Rows>, col: IdxInc<Cols>, ) -> (MatRef<'a, T, usize, usize, RStride, CStride>, MatRef<'a, T, usize, usize, RStride, CStride>, MatRef<'a, T, usize, usize, RStride, CStride>, MatRef<'a, T, usize, usize, RStride, CStride>)

Source

pub fn split_at_row( self, row: IdxInc<Rows>, ) -> (MatRef<'a, T, usize, Cols, RStride, CStride>, MatRef<'a, T, usize, Cols, RStride, CStride>)

Source

pub fn split_at_col( self, col: IdxInc<Cols>, ) -> (MatRef<'a, T, Rows, usize, RStride, CStride>, MatRef<'a, T, Rows, usize, RStride, CStride>)

Source

pub fn transpose(self) -> MatRef<'a, T, Cols, Rows, CStride, RStride>

Source

pub fn conjugate(self) -> MatRef<'a, T::Conj, Rows, Cols, RStride, CStride>
where T: Conjugate,

Source

pub fn canonical(self) -> MatRef<'a, T::Canonical, Rows, Cols, RStride, CStride>
where T: Conjugate,

Source

pub fn adjoint(self) -> MatRef<'a, T::Conj, Cols, Rows, CStride, RStride>
where T: Conjugate,

Source

pub fn reverse_rows(self) -> MatRef<'a, T, Rows, Cols, RStride::Rev, CStride>

Source

pub fn reverse_cols(self) -> MatRef<'a, T, Rows, Cols, RStride, CStride::Rev>

Source

pub fn reverse_rows_and_cols( self, ) -> MatRef<'a, T, Rows, Cols, RStride::Rev, CStride::Rev>

Source

pub fn submatrix<V: Shape, H: Shape>( self, row_start: IdxInc<Rows>, col_start: IdxInc<Cols>, nrows: V, ncols: H, ) -> MatRef<'a, T, V, H, RStride, CStride>

Source

pub fn subrows<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> MatRef<'a, T, V, Cols, RStride, CStride>

Source

pub fn subcols<H: Shape>( self, col_start: IdxInc<Cols>, ncols: H, ) -> MatRef<'a, T, Rows, H, RStride, CStride>

Source

pub fn as_shape<V: Shape, H: Shape>( self, nrows: V, ncols: H, ) -> MatRef<'a, T, V, H, RStride, CStride>

Source

pub fn as_row_shape<V: Shape>( self, nrows: V, ) -> MatRef<'a, T, V, Cols, RStride, CStride>

Source

pub fn as_col_shape<H: Shape>( self, ncols: H, ) -> MatRef<'a, T, Rows, H, RStride, CStride>

Source

pub fn as_dyn_stride(self) -> MatRef<'a, T, Rows, Cols, isize, isize>

Source

pub fn as_dyn(self) -> MatRef<'a, T, usize, usize, RStride, CStride>

Source

pub fn as_dyn_rows(self) -> MatRef<'a, T, usize, Cols, RStride, CStride>

Source

pub fn as_dyn_cols(self) -> MatRef<'a, T, Rows, usize, RStride, CStride>

Source

pub fn row(self, i: Idx<Rows>) -> RowRef<'a, T, Cols, CStride>

Source

pub fn col(self, j: Idx<Cols>) -> ColRef<'a, T, Rows, RStride>

Source

pub fn col_iter( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = ColRef<'a, T, Rows, RStride>>
where Rows: 'a, Cols: 'a,

Source

pub fn row_iter( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = RowRef<'a, T, Cols, CStride>>
where Rows: 'a, Cols: 'a,

Source

pub fn par_col_iter( self, ) -> impl 'a + IndexedParallelIterator<Item = ColRef<'a, T, Rows, RStride>>
where T: Sync, Rows: 'a, Cols: 'a,

Source

pub fn par_row_iter( self, ) -> impl 'a + IndexedParallelIterator<Item = RowRef<'a, T, Cols, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

Source

pub fn par_col_chunks( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, Rows, usize, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

Source

pub fn par_col_partition( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, Rows, usize, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

Source

pub fn par_row_chunks( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, usize, Cols, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

Source

pub fn par_row_partition( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, usize, Cols, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

Source

pub fn try_as_col_major( self, ) -> Option<MatRef<'a, T, Rows, Cols, ContiguousFwd, CStride>>

Source

pub fn try_as_row_major( self, ) -> Option<MatRef<'a, T, Rows, Cols, RStride, ContiguousFwd>>

Source

pub fn bind<'M, 'N>( self, row: Guard<'M>, col: Guard<'N>, ) -> MatMut<'a, T, Dim<'M>, Dim<'N>, RStride, CStride>

see [MatRef::)]] #[doc(hidden)]

Source

pub fn get<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <MatRef<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, ColRange>>::Target
where MatRef<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, ColRange>,

Source

pub unsafe fn get_unchecked<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <MatRef<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, ColRange>>::Target
where MatRef<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, ColRange>,

Source

pub fn get_mut<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <MatMut<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, ColRange>>::Target
where MatMut<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, ColRange>,

Source

pub unsafe fn get_mut_unchecked<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <MatMut<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, ColRange>>::Target
where MatMut<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, ColRange>,

Source§

impl<T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride, Inner: for<'short> ReborrowMut<'short, Target = Mut<'short, T, Rows, Cols, RStride, CStride>>> Mat<Inner>

Source

pub fn as_mut(&mut self) -> MatMut<'_, T, Rows, Cols, RStride, CStride>

returns a view over self

Source

pub fn copy_from_triangular_lower<RhsT: Conjugate<Canonical = T>>( &mut self, other: impl AsMatRef<T = RhsT, Rows = Rows, Cols = Cols>, )
where T: ComplexField,

copies the lower triangular half of other, including the diagonal, into self

Source

pub fn copy_from_triangular_upper<RhsT: Conjugate<Canonical = T>>( &mut self, other: impl AsMatRef<T = RhsT, Rows = Rows, Cols = Cols>, )
where T: ComplexField,

copies the upper triangular half of other, including the diagonal, into self

Source

pub fn copy_from<RhsT: Conjugate<Canonical = T>>( &mut self, other: impl AsMatRef<T = RhsT, Rows = Rows, Cols = Cols>, )
where T: ComplexField,

copies other into self

Source

pub fn copy_from_strict_triangular_lower<RhsT: Conjugate<Canonical = T>>( &mut self, other: impl AsMatRef<T = RhsT, Rows = Rows, Cols = Cols>, )
where T: ComplexField,

copies the lower triangular half of other, excluding the diagonal, into self

Source

pub fn copy_from_strict_triangular_upper<RhsT: Conjugate<Canonical = T>>( &mut self, other: impl AsMatRef<T = RhsT, Rows = Rows, Cols = Cols>, )
where T: ComplexField,

copies the upper triangular half of other, excluding the diagonal, into self

Source

pub fn fill(&mut self, value: T)
where T: Clone,

fills all the elements of self with value

Source§

impl<'a, T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride> Mat<Mut<'a, T, Rows, Cols, RStride, CStride>>

Source

pub fn as_ptr_mut(&self) -> *mut T

Source

pub fn ptr_at_mut(&self, row: IdxInc<Rows>, col: IdxInc<Cols>) -> *mut T

Source

pub unsafe fn ptr_inbounds_at_mut( &self, row: Idx<Rows>, col: Idx<Cols>, ) -> *mut T

Source

pub fn split_at_mut( self, row: IdxInc<Rows>, col: IdxInc<Cols>, ) -> (MatMut<'a, T, usize, usize, RStride, CStride>, MatMut<'a, T, usize, usize, RStride, CStride>, MatMut<'a, T, usize, usize, RStride, CStride>, MatMut<'a, T, usize, usize, RStride, CStride>)

Source

pub fn split_at_row_mut( self, row: IdxInc<Rows>, ) -> (MatMut<'a, T, usize, Cols, RStride, CStride>, MatMut<'a, T, usize, Cols, RStride, CStride>)

Source

pub fn split_at_col_mut( self, col: IdxInc<Cols>, ) -> (MatMut<'a, T, Rows, usize, RStride, CStride>, MatMut<'a, T, Rows, usize, RStride, CStride>)

Source

pub fn transpose_mut(self) -> MatMut<'a, T, Cols, Rows, CStride, RStride>

Source

pub fn conjugate_mut(self) -> MatMut<'a, T::Conj, Rows, Cols, RStride, CStride>
where T: Conjugate,

Source

pub fn canonical_mut( self, ) -> MatMut<'a, T::Canonical, Rows, Cols, RStride, CStride>
where T: Conjugate,

Source

pub fn adjoint_mut(self) -> MatMut<'a, T::Conj, Cols, Rows, CStride, RStride>
where T: Conjugate,

Source

pub fn reverse_rows_mut( self, ) -> MatMut<'a, T, Rows, Cols, RStride::Rev, CStride>

Source

pub fn reverse_cols_mut( self, ) -> MatMut<'a, T, Rows, Cols, RStride, CStride::Rev>

Source

pub fn reverse_rows_and_cols_mut( self, ) -> MatMut<'a, T, Rows, Cols, RStride::Rev, CStride::Rev>

Source

pub fn submatrix_mut<V: Shape, H: Shape>( self, row_start: IdxInc<Rows>, col_start: IdxInc<Cols>, nrows: V, ncols: H, ) -> MatMut<'a, T, V, H, RStride, CStride>

Source

pub fn subrows_mut<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> MatMut<'a, T, V, Cols, RStride, CStride>

Source

pub fn subcols_mut<H: Shape>( self, col_start: IdxInc<Cols>, ncols: H, ) -> MatMut<'a, T, Rows, H, RStride, CStride>

Source

pub fn as_shape_mut<V: Shape, H: Shape>( self, nrows: V, ncols: H, ) -> MatMut<'a, T, V, H, RStride, CStride>

Source

pub fn as_row_shape_mut<V: Shape>( self, nrows: V, ) -> MatMut<'a, T, V, Cols, RStride, CStride>

Source

pub fn as_col_shape_mut<H: Shape>( self, ncols: H, ) -> MatMut<'a, T, Rows, H, RStride, CStride>

Source

pub fn as_dyn_stride_mut(self) -> MatMut<'a, T, Rows, Cols, isize, isize>

Source

pub fn as_dyn_mut(self) -> MatMut<'a, T, usize, usize, RStride, CStride>

Source

pub fn as_dyn_rows_mut(self) -> MatMut<'a, T, usize, Cols, RStride, CStride>

Source

pub fn as_dyn_cols_mut(self) -> MatMut<'a, T, Rows, usize, RStride, CStride>

Source

pub fn row_mut(self, i: Idx<Rows>) -> RowMut<'a, T, Cols, CStride>

Source

pub fn col_mut(self, j: Idx<Cols>) -> ColMut<'a, T, Rows, RStride>

Source

pub fn col_iter_mut( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = ColMut<'a, T, Rows, RStride>>
where Rows: 'a, Cols: 'a,

Source

pub fn row_iter_mut( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = RowMut<'a, T, Cols, CStride>>
where Rows: 'a, Cols: 'a,

Source

pub fn par_col_iter_mut( self, ) -> impl 'a + IndexedParallelIterator<Item = ColMut<'a, T, Rows, RStride>>
where T: Send, Rows: 'a, Cols: 'a,

Source

pub fn par_row_iter_mut( self, ) -> impl 'a + IndexedParallelIterator<Item = RowMut<'a, T, Cols, CStride>>
where T: Send, Rows: 'a, Cols: 'a,

Source

pub fn par_col_chunks_mut( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatMut<'a, T, Rows, usize, RStride, CStride>>
where T: Send, Rows: 'a, Cols: 'a,

Source

pub fn par_col_partition_mut( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatMut<'a, T, Rows, usize, RStride, CStride>>
where T: Send, Rows: 'a, Cols: 'a,

Source

pub fn par_row_chunks_mut( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatMut<'a, T, usize, Cols, RStride, CStride>>
where T: Send, Rows: 'a, Cols: 'a,

Source

pub fn par_row_partition_mut( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatMut<'a, T, usize, Cols, RStride, CStride>>
where T: Send, Rows: 'a, Cols: 'a,

Source

pub fn split_first_row_mut( self, ) -> Option<(RowMut<'a, T, Cols, CStride>, MatMut<'a, T, usize, Cols, RStride, CStride>)>

Source

pub fn split_first_col_mut( self, ) -> Option<(ColMut<'a, T, Rows, RStride>, MatMut<'a, T, Rows, usize, RStride, CStride>)>

Source

pub fn split_last_row_mut( self, ) -> Option<(RowMut<'a, T, Cols, CStride>, MatMut<'a, T, usize, Cols, RStride, CStride>)>

Source

pub fn split_last_col_mut( self, ) -> Option<(ColMut<'a, T, Rows, RStride>, MatMut<'a, T, Rows, usize, RStride, CStride>)>

Source

pub fn split_first_row( self, ) -> Option<(RowRef<'a, T, Cols, CStride>, MatRef<'a, T, usize, Cols, RStride, CStride>)>

Source

pub fn split_first_col( self, ) -> Option<(ColRef<'a, T, Rows, RStride>, MatRef<'a, T, Rows, usize, RStride, CStride>)>

Source

pub fn split_last_row( self, ) -> Option<(RowRef<'a, T, Cols, CStride>, MatRef<'a, T, usize, Cols, RStride, CStride>)>

Source

pub fn split_last_col( self, ) -> Option<(ColRef<'a, T, Rows, RStride>, MatRef<'a, T, Rows, usize, RStride, CStride>)>

Source

pub fn try_as_col_major_mut( self, ) -> Option<MatMut<'a, T, Rows, Cols, ContiguousFwd, CStride>>

Source

pub fn try_as_row_major_mut( self, ) -> Option<MatMut<'a, T, Rows, Cols, RStride, ContiguousFwd>>

Source

pub fn two_cols_mut( self, i0: Idx<Cols>, i1: Idx<Cols>, ) -> (ColMut<'a, T, Rows, RStride>, ColMut<'a, T, Rows, RStride>)

returns two views over the given columns

§panics

panics if i0 == i1

Source

pub fn two_rows_mut( self, i0: Idx<Rows>, i1: Idx<Rows>, ) -> (RowMut<'a, T, Cols, CStride>, RowMut<'a, T, Cols, CStride>)

returns two views over the given rows

§panics

panics if i0 == i1

Source§

impl<'a, T, Rows: Shape, Cols: Shape> Mat<Mut<'a, T, Rows, Cols>>

Source

pub fn from_column_major_slice_mut( slice: &'a mut [T], nrows: Rows, ncols: Cols, ) -> Self
where T: Sized,

creates a MatMut from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a column-major format, so that the first chunk of nrows values from the slices goes in the first column of the matrix, the second chunk of nrows values goes in the second column, and so on

§panics

the function panics if any of the following conditions are violated:

  • nrows * ncols == slice.len()
§example
use faer::{MatMut, mat};

let mut slice = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0_f64];
let view = MatMut::from_column_major_slice_mut(&mut slice, 3, 2);

let expected = mat![[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]];
assert_eq!(expected, view);
Source

pub fn from_column_major_slice_with_stride_mut( slice: &'a mut [T], nrows: Rows, ncols: Cols, col_stride: usize, ) -> Self
where T: Sized,

creates a MatMut from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a column-major format, where the beginnings of two consecutive columns are separated by col_stride elements.

Source

pub fn from_row_major_slice_mut( slice: &'a mut [T], nrows: Rows, ncols: Cols, ) -> Self
where T: Sized,

creates a MatMut from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a row-major format, so that the first chunk of ncols values from the slices goes in the first column of the matrix, the second chunk of ncols values goes in the second column, and so on

§panics

the function panics if any of the following conditions are violated:

  • nrows * ncols == slice.len()
§example
use faer::{MatMut, mat};

let mut slice = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0_f64];
let view = MatMut::from_row_major_slice_mut(&mut slice, 3, 2);

let expected = mat![[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];
assert_eq!(expected, view);
Source

pub fn from_row_major_slice_with_stride_mut( slice: &'a mut [T], nrows: Rows, ncols: Cols, row_stride: usize, ) -> Self
where T: Sized,

creates a MatMut from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a row-major format, where the beginnings of two consecutive rows are separated by row_stride elements.

Source§

impl<'a, T, Dim: Shape, RStride: Stride, CStride: Stride> Mat<Mut<'a, T, Dim, Dim, RStride, CStride>>

Source

pub fn diagonal(self) -> DiagRef<'a, T, Dim, isize>

Source§

impl<'a, T, Dim: Shape, RStride: Stride, CStride: Stride> Mat<Mut<'a, T, Dim, Dim, RStride, CStride>>

Source

pub fn diagonal_mut(self) -> DiagMut<'a, T, Dim, isize>

Source§

impl<'a, T, Rows: Shape, Cols: Shape> Mat<Mut<'a, T, Rows, Cols>>
where T: RealField,

Source

pub fn min(self) -> Option<T>

Source

pub fn max(self) -> Option<T>

Source§

impl<T> Mat<Own<T>>

Source

pub const fn new() -> Self

returns an empty matrix of dimension 0×0.

Source

pub fn with_capacity(row_capacity: usize, col_capacity: usize) -> Self

reserves the minimum capacity for row_capacity rows and col_capacity columns without reallocating. does nothing if the capacity is already sufficient

Source§

impl<T, Rows: Shape, Cols: Shape> Mat<Own<T, Rows, Cols>>

Source

pub fn from_fn( nrows: Rows, ncols: Cols, f: impl FnMut(Idx<Rows>, Idx<Cols>) -> T, ) -> Self

returns a new matrix with dimensions (nrows, ncols), filled with the provided function

Source

pub fn zeros(nrows: Rows, ncols: Cols) -> Self
where T: ComplexField,

returns a new matrix with dimensions (nrows, ncols), filled with zeros

Source

pub fn ones(nrows: Rows, ncols: Cols) -> Self
where T: ComplexField,

returns a new matrix with dimensions (nrows, ncols), filled with ones

Source

pub fn identity(nrows: Rows, ncols: Cols) -> Self
where T: ComplexField,

returns a new identity matrix, with ones on the diagonal and zeros everywhere else

Source

pub fn full(nrows: Rows, ncols: Cols, value: T) -> Self
where T: Clone,

returns a new matrix with dimensions (nrows, ncols), filled with value

Source

pub fn try_reserve( &mut self, new_row_capacity: usize, new_col_capacity: usize, ) -> Result<(), TryReserveError>

reserves the minimum capacity for new_row_capacity rows and new_col_capacity columns without reallocating, or returns an error in case of failure. does nothing if the capacity is already sufficient

Source

pub fn reserve(&mut self, new_row_capacity: usize, new_col_capacity: usize)

reserves the minimum capacity for new_row_capacity rows and new_col_capacity columns without reallocating. does nothing if the capacity is already sufficient

Source

pub fn resize_with( &mut self, new_nrows: Rows, new_ncols: Cols, f: impl FnMut(Idx<Rows>, Idx<Cols>) -> T, )

resizes the matrix in-place so that the new dimensions are (new_nrows, new_ncols). new elements are created with the given function f, so that elements at index (i, j) are created by calling f(i, j).

Source

pub fn truncate(&mut self, new_nrows: Rows, new_ncols: Cols)

truncates the matrix so that its new dimensions are new_nrows and new_ncols.
both of the new dimensions must be smaller than or equal to the current dimensions

§panics

the function panics if any of the following conditions are violated:

  • new_nrows > self.nrows()
  • new_ncols > self.ncols()
Source

pub fn into_shape<V: Shape, H: Shape>(self, nrows: V, ncols: H) -> Mat<T, V, H>

Source

pub unsafe fn set_dims(&mut self, nrows: Rows, ncols: Cols)

set the dimensions of the matrix.

§safety

the behavior is undefined if any of the following conditions are violated:

  • nrows < self.row_capacity()
  • ncols < self.col_capacity()
  • the elements that were previously out of bounds but are now in bounds must be initialized
Source

pub fn col_as_slice(&self, j: Idx<Cols>) -> &[T]

returns a reference to a slice over the column at the given index

Source

pub fn col_as_slice_mut(&mut self, j: Idx<Cols>) -> &mut [T]

returns a reference to a slice over the column at the given index

Source§

impl<T, Rows: Shape, Cols: Shape> Mat<Own<T, Rows, Cols>>

Source

pub fn nrows(&self) -> Rows

returns the number of rows of the matrix

Source

pub fn ncols(&self) -> Cols

returns the number of columns of the matrix

Source§

impl<T, Rows: Shape, Cols: Shape> Mat<Own<T, Rows, Cols>>

Source

pub fn as_ptr(&self) -> *const T

returns a pointer to the matrix data

Source

pub fn shape(&self) -> (Rows, Cols)

returns the number of rows and columns of the matrix

Source

pub fn row_stride(&self) -> isize

returns the row stride of the matrix, specified in number of elements, not in bytes

Source

pub fn col_stride(&self) -> isize

returns the column stride of the matrix, specified in number of elements, not in bytes

Source

pub fn ptr_at(&self, row: IdxInc<Rows>, col: IdxInc<Cols>) -> *const T

returns a raw pointer to the element at the given index

Source

pub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>, col: Idx<Cols>) -> *const T

returns a raw pointer to the element at the given index, assuming the provided index is within the matrix bounds

§safety

the behavior is undefined if any of the following conditions are violated:

  • row < self.nrows()
  • col < self.ncols()
Source

pub fn split_at( &self, row: IdxInc<Rows>, col: IdxInc<Cols>, ) -> (MatRef<'_, T, usize, usize>, MatRef<'_, T, usize, usize>, MatRef<'_, T, usize, usize>, MatRef<'_, T, usize, usize>)

Source

pub fn split_at_row( &self, row: IdxInc<Rows>, ) -> (MatRef<'_, T, usize, Cols>, MatRef<'_, T, usize, Cols>)

Source

pub fn split_at_col( &self, col: IdxInc<Cols>, ) -> (MatRef<'_, T, Rows, usize>, MatRef<'_, T, Rows, usize>)

Source

pub fn transpose(&self) -> MatRef<'_, T, Cols, Rows>

Source

pub fn conjugate(&self) -> MatRef<'_, T::Conj, Rows, Cols>
where T: Conjugate,

Source

pub fn canonical(&self) -> MatRef<'_, T::Canonical, Rows, Cols>
where T: Conjugate,

Source

pub fn adjoint(&self) -> MatRef<'_, T::Conj, Cols, Rows>
where T: Conjugate,

Source

pub fn reverse_rows(&self) -> MatRef<'_, T, Rows, Cols>

Source

pub fn reverse_cols(&self) -> MatRef<'_, T, Rows, Cols>

Source

pub fn reverse_rows_and_cols(&self) -> MatRef<'_, T, Rows, Cols>

Source

pub fn submatrix<V: Shape, H: Shape>( &self, row_start: IdxInc<Rows>, col_start: IdxInc<Cols>, nrows: V, ncols: H, ) -> MatRef<'_, T, V, H>

Source

pub fn subrows<V: Shape>( &self, row_start: IdxInc<Rows>, nrows: V, ) -> MatRef<'_, T, V, Cols>

Source

pub fn subcols<H: Shape>( &self, col_start: IdxInc<Cols>, ncols: H, ) -> MatRef<'_, T, Rows, H>

Source

pub fn as_shape<V: Shape, H: Shape>( &self, nrows: V, ncols: H, ) -> MatRef<'_, T, V, H>

Source

pub fn as_row_shape<V: Shape>(&self, nrows: V) -> MatRef<'_, T, V, Cols>

Source

pub fn as_col_shape<H: Shape>(&self, ncols: H) -> MatRef<'_, T, Rows, H>

Source

pub fn as_dyn_stride(&self) -> MatRef<'_, T, Rows, Cols, isize, isize>

Source

pub fn as_dyn(&self) -> MatRef<'_, T, usize, usize>

Source

pub fn as_dyn_rows(&self) -> MatRef<'_, T, usize, Cols>

Source

pub fn as_dyn_cols(&self) -> MatRef<'_, T, Rows, usize>

Source

pub fn row(&self, i: Idx<Rows>) -> RowRef<'_, T, Cols>

Source

pub fn col(&self, j: Idx<Cols>) -> ColRef<'_, T, Rows>

Source

pub fn col_iter( &self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = ColRef<'_, T, Rows>>

Source

pub fn row_iter( &self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = RowRef<'_, T, Cols>>

Source

pub fn par_col_iter( &self, ) -> impl '_ + IndexedParallelIterator<Item = ColRef<'_, T, Rows>>
where T: Sync,

Source

pub fn par_row_iter( &self, ) -> impl '_ + IndexedParallelIterator<Item = RowRef<'_, T, Cols>>
where T: Sync,

Source

pub fn par_col_chunks( &self, chunk_size: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatRef<'_, T, Rows, usize>>
where T: Sync,

Source

pub fn par_col_partition( &self, count: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatRef<'_, T, Rows, usize>>
where T: Sync,

Source

pub fn par_row_chunks( &self, chunk_size: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatRef<'_, T, usize, Cols>>
where T: Sync,

Source

pub fn par_row_partition( &self, count: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatRef<'_, T, usize, Cols>>
where T: Sync,

Source

pub fn try_as_col_major( &self, ) -> Option<MatRef<'_, T, Rows, Cols, ContiguousFwd>>

Source

pub fn try_as_row_major( &self, ) -> Option<MatRef<'_, T, Rows, Cols, isize, ContiguousFwd>>

Source

pub fn get<RowRange, ColRange>( &self, row: RowRange, col: ColRange, ) -> <MatRef<'_, T, Rows, Cols> as MatIndex<RowRange, ColRange>>::Target
where for<'a> MatRef<'a, T, Rows, Cols>: MatIndex<RowRange, ColRange>,

Source

pub unsafe fn get_unchecked<RowRange, ColRange>( &self, row: RowRange, col: ColRange, ) -> <MatRef<'_, T, Rows, Cols> as MatIndex<RowRange, ColRange>>::Target
where for<'a> MatRef<'a, T, Rows, Cols>: MatIndex<RowRange, ColRange>,

Source

pub fn get_mut<RowRange, ColRange>( &mut self, row: RowRange, col: ColRange, ) -> <MatMut<'_, T, Rows, Cols> as MatIndex<RowRange, ColRange>>::Target
where for<'a> MatMut<'a, T, Rows, Cols>: MatIndex<RowRange, ColRange>,

Source

pub unsafe fn get_mut_unchecked<RowRange, ColRange>( &mut self, row: RowRange, col: ColRange, ) -> <MatMut<'_, T, Rows, Cols> as MatIndex<RowRange, ColRange>>::Target
where for<'a> MatMut<'a, T, Rows, Cols>: MatIndex<RowRange, ColRange>,

Source§

impl<T, Rows: Shape, Cols: Shape> Mat<Own<T, Rows, Cols>>

Source

pub fn as_ptr_mut(&mut self) -> *mut T

returns a pointer to the matrix data

Source

pub fn ptr_at_mut(&mut self, row: IdxInc<Rows>, col: IdxInc<Cols>) -> *mut T

returns a raw pointer to the element at the given index

Source

pub unsafe fn ptr_inbounds_at_mut( &mut self, row: Idx<Rows>, col: Idx<Cols>, ) -> *mut T

returns a raw pointer to the element at the given index, assuming the provided index is within the matrix bounds

§safety

the behavior is undefined if any of the following conditions are violated:

  • row < self.nrows()
  • col < self.ncols()
Source

pub fn split_at_mut( &mut self, row: IdxInc<Rows>, col: IdxInc<Cols>, ) -> (MatMut<'_, T, usize, usize>, MatMut<'_, T, usize, usize>, MatMut<'_, T, usize, usize>, MatMut<'_, T, usize, usize>)

Source

pub fn split_at_row_mut( &mut self, row: IdxInc<Rows>, ) -> (MatMut<'_, T, usize, Cols>, MatMut<'_, T, usize, Cols>)

Source

pub fn split_at_col_mut( &mut self, col: IdxInc<Cols>, ) -> (MatMut<'_, T, Rows, usize>, MatMut<'_, T, Rows, usize>)

Source

pub fn transpose_mut(&mut self) -> MatMut<'_, T, Cols, Rows>

Source

pub fn conjugate_mut(&mut self) -> MatMut<'_, T::Conj, Rows, Cols>
where T: Conjugate,

Source

pub fn canonical_mut(&mut self) -> MatMut<'_, T::Canonical, Rows, Cols>
where T: Conjugate,

Source

pub fn adjoint_mut(&mut self) -> MatMut<'_, T::Conj, Cols, Rows>
where T: Conjugate,

Source

pub fn reverse_rows_mut(&mut self) -> MatMut<'_, T, Rows, Cols>

Source

pub fn reverse_cols_mut(&mut self) -> MatMut<'_, T, Rows, Cols>

Source

pub fn reverse_rows_and_cols_mut(&mut self) -> MatMut<'_, T, Rows, Cols>

Source

pub fn submatrix_mut<V: Shape, H: Shape>( &mut self, row_start: IdxInc<Rows>, col_start: IdxInc<Cols>, nrows: V, ncols: H, ) -> MatMut<'_, T, V, H>

Source

pub fn subrows_mut<V: Shape>( &mut self, row_start: IdxInc<Rows>, nrows: V, ) -> MatMut<'_, T, V, Cols>

Source

pub fn subcols_mut<H: Shape>( &mut self, col_start: IdxInc<Cols>, ncols: H, ) -> MatMut<'_, T, Rows, H>

Source

pub fn as_shape_mut<V: Shape, H: Shape>( &mut self, nrows: V, ncols: H, ) -> MatMut<'_, T, V, H>

Source

pub fn as_row_shape_mut<V: Shape>(&mut self, nrows: V) -> MatMut<'_, T, V, Cols>

Source

pub fn as_col_shape_mut<H: Shape>(&mut self, ncols: H) -> MatMut<'_, T, Rows, H>

Source

pub fn as_dyn_stride_mut(&mut self) -> MatMut<'_, T, Rows, Cols, isize, isize>

Source

pub fn as_dyn_mut(&mut self) -> MatMut<'_, T, usize, usize>

Source

pub fn as_dyn_rows_mut(&mut self) -> MatMut<'_, T, usize, Cols>

Source

pub fn as_dyn_cols_mut(&mut self) -> MatMut<'_, T, Rows, usize>

Source

pub fn row_mut(&mut self, i: Idx<Rows>) -> RowMut<'_, T, Cols>

Source

pub fn col_mut(&mut self, j: Idx<Cols>) -> ColMut<'_, T, Rows>

Source

pub fn col_iter_mut( &mut self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = ColMut<'_, T, Rows>>

Source

pub fn row_iter_mut( &mut self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = RowMut<'_, T, Cols>>

Source

pub fn par_col_iter_mut( &mut self, ) -> impl '_ + IndexedParallelIterator<Item = ColMut<'_, T, Rows>>
where T: Send,

Source

pub fn par_row_iter_mut( &mut self, ) -> impl '_ + IndexedParallelIterator<Item = RowMut<'_, T, Cols>>
where T: Send,

Source

pub fn par_col_chunks_mut( &mut self, chunk_size: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatMut<'_, T, Rows, usize>>
where T: Send,

Source

pub fn par_col_partition_mut( &mut self, count: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatMut<'_, T, Rows, usize>>
where T: Send,

Source

pub fn par_row_chunks_mut( &mut self, chunk_size: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatMut<'_, T, usize, Cols>>
where T: Send,

Source

pub fn par_row_partition_mut( &mut self, count: usize, ) -> impl '_ + IndexedParallelIterator<Item = MatMut<'_, T, usize, Cols>>
where T: Send,

Source

pub fn split_first_row_mut( &mut self, ) -> Option<(RowMut<'_, T, Cols>, MatMut<'_, T, usize, Cols>)>

Source

pub fn try_as_col_major_mut( &mut self, ) -> Option<MatMut<'_, T, Rows, Cols, ContiguousFwd>>

Source

pub fn try_as_row_major_mut( &mut self, ) -> Option<MatMut<'_, T, Rows, Cols, isize, ContiguousFwd>>

Source

pub fn two_cols_mut( &mut self, i0: Idx<Cols>, i1: Idx<Cols>, ) -> (ColMut<'_, T, Rows>, ColMut<'_, T, Rows>)

Source

pub fn two_rows_mut( &mut self, i0: Idx<Rows>, i1: Idx<Rows>, ) -> (RowMut<'_, T, Cols>, RowMut<'_, T, Cols>)

Source§

impl<T, Dim: Shape> Mat<Own<T, Dim, Dim>>

Source

pub fn diagonal(&self) -> DiagRef<'_, T, Dim, isize>

Source

pub fn diagonal_mut(&mut self) -> DiagMut<'_, T, Dim, isize>

Source§

impl<T, Cols: Shape> Mat<Own<T, usize, Cols>>

Source

pub fn push_row(&mut self, row: RowRef<'_, T, Cols>)
where T: Clone,

inserts a row at the end of the matrix

§panics

The function panics if the number of columns in the row does not match the number of columns in the matrix

Source§

impl<T, Rows: Shape> Mat<Own<T, Rows>>

Source

pub fn push_col(&mut self, col: ColRef<'_, T, Rows>)
where T: Clone,

inserts a col at the end of the matrix

§panics

The function panics if the number of rows in the col does not match the number of rows in the matrix

Source§

impl<T, Rows: Shape, Cols: Shape> Mat<Own<T, Rows, Cols>>
where T: RealField,

Source

pub fn min(self) -> Option<T>

Source

pub fn max(self) -> Option<T>

Source§

impl<'a, T> Mat<Ref<'a, T>>

Source

pub fn from_row_major_array<const ROWS: usize, const COLS: usize>( array: &'a [[T; COLS]; ROWS], ) -> Self

equivalent to MatRef::from_row_major_slice(array.as_flattened(), ROWS, COLS)

Source

pub fn from_column_major_array<const ROWS: usize, const COLS: usize>( array: &'a [[T; ROWS]; COLS], ) -> Self

equivalent to MatRef::from_column_major_slice(array.as_flattened(), ROWS, COLS)

Source

pub fn from_ref(value: &'a T) -> Self

creates a 1×1 view over the given element

Source§

impl<'a, T, Rows: Shape, Cols: Shape> Mat<Ref<'a, T, Rows, Cols>>

Source

pub fn from_repeated_ref(value: &'a T, nrows: Rows, ncols: Cols) -> Self

creates a MatRef from a view over a single element, repeated nrows×ncols times

Source

pub fn from_column_major_slice(slice: &'a [T], nrows: Rows, ncols: Cols) -> Self

creates a MatRef from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a column-major format, so that the first chunk of nrows values from the slices goes in the first column of the matrix, the second chunk of nrows values goes in the second column, and so on

§panics

the function panics if any of the following conditions are violated:

  • nrows * ncols == slice.len()
§example
use faer::{MatRef, mat};

let slice = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0_f64];
let view = MatRef::from_column_major_slice(&slice, 3, 2);

let expected = mat![[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]];
assert_eq!(expected, view);
Source

pub fn from_column_major_slice_with_stride( slice: &'a [T], nrows: Rows, ncols: Cols, col_stride: usize, ) -> Self

creates a MatRef from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a column-major format, where the beginnings of two consecutive columns are separated by col_stride elements

Source

pub fn from_row_major_slice(slice: &'a [T], nrows: Rows, ncols: Cols) -> Self

creates a MatRef from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a row-major format, so that the first chunk of ncols values from the slices goes in the first column of the matrix, the second chunk of ncols values goes in the second column, and so on

§panics

the function panics if any of the following conditions are violated:

  • nrows * ncols == slice.len()
§example
use faer::{MatRef, mat};

let slice = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0_f64];
let view = MatRef::from_row_major_slice(&slice, 3, 2);

let expected = mat![[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];
assert_eq!(expected, view);
Source

pub fn from_row_major_slice_with_stride( slice: &'a [T], nrows: Rows, ncols: Cols, row_stride: usize, ) -> Self

creates a MatRef from slice views over the matrix data, and the matrix dimensions. the data is interpreted in a row-major format, where the beginnings of two consecutive rows are separated by row_stride elements

Source§

impl<'a, T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride> Mat<Ref<'a, T, Rows, Cols, RStride, CStride>>

Source

pub const unsafe fn from_raw_parts( ptr: *const T, nrows: Rows, ncols: Cols, row_stride: RStride, col_stride: CStride, ) -> Self

creates a MatRef from a pointer to the matrix data, dimensions, and strides

the row (resp. column) stride is the offset from the memory address of a given matrix element at index (row: i, col: j), to the memory address of the matrix element at index (row: i + 1, col: 0) (resp. (row: 0, col: i + 1)). this offset is specified in number of elements, not in bytes

§safety

the behavior is undefined if any of the following conditions are violated:

  • for each matrix unit, the entire memory region addressed by the matrix must be contained within a single allocation, accessible in its entirety by the corresponding pointer in ptr
  • for each matrix unit, the corresponding pointer must be properly aligned, even for a zero-sized matrix
  • the values accessible by the matrix must be initialized at some point before they are read, or references to them are formed
  • no mutable aliasing is allowed. in other words, none of the elements accessible by any matrix unit may be accessed for writes by any other means for the duration of the lifetime 'a
§example
use faer::{MatRef, mat};

// row major matrix with 2 rows, 3 columns, with a column at the end that we want to skip.
// the row stride is the pointer offset from the address of 1.0 to the address of 4.0,
// which is 4
// the column stride is the pointer offset from the address of 1.0 to the address of 2.0,
// which is 1
let data = [[1.0, 2.0, 3.0, f64::NAN], [4.0, 5.0, 6.0, f64::NAN]];
let matrix = unsafe { MatRef::from_raw_parts(data.as_ptr() as *const f64, 2, 3, 4, 1) };

let expected = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
assert_eq!(expected.as_ref(), matrix);
Source

pub fn as_ptr(&self) -> *const T

returns a pointer to the matrix data

Source

pub fn nrows(&self) -> Rows

returns the number of rows of the matrix

Source

pub fn ncols(&self) -> Cols

returns the number of columns of the matrix

Source

pub fn shape(&self) -> (Rows, Cols)

returns the number of rows and columns of the matrix

Source

pub fn row_stride(&self) -> RStride

returns the row stride of the matrix, specified in number of elements, not in bytes

Source

pub fn col_stride(&self) -> CStride

returns the column stride of the matrix, specified in number of elements, not in bytes

Source

pub fn ptr_at(&self, row: IdxInc<Rows>, col: IdxInc<Cols>) -> *const T

returns a raw pointer to the element at the given index

Source

pub unsafe fn ptr_inbounds_at(&self, row: Idx<Rows>, col: Idx<Cols>) -> *const T

returns a raw pointer to the element at the given index, assuming the provided index is within the matrix bounds

§safety

the behavior is undefined if any of the following conditions are violated:

  • row < self.nrows()
  • col < self.ncols()
Source

pub fn split_at( self, row: IdxInc<Rows>, col: IdxInc<Cols>, ) -> (MatRef<'a, T, usize, usize, RStride, CStride>, MatRef<'a, T, usize, usize, RStride, CStride>, MatRef<'a, T, usize, usize, RStride, CStride>, MatRef<'a, T, usize, usize, RStride, CStride>)

splits the matrix horizontally and vertically at the given index into four corners and returns an array of each submatrix, in the following order:

  • top left
  • top right
  • bottom left
  • bottom right
§safety

the function panics if any of the following conditions are violated:

  • row <= self.nrows()
  • col <= self.ncols()
Source

pub fn split_at_row( self, row: IdxInc<Rows>, ) -> (MatRef<'a, T, usize, Cols, RStride, CStride>, MatRef<'a, T, usize, Cols, RStride, CStride>)

splits the matrix horizontally at the given row into two parts and returns an array of each submatrix, in the following order:

  • top
  • bottom
§panics

the function panics if the following condition is violated:

  • row <= self.nrows()
Source

pub fn split_at_col( self, col: IdxInc<Cols>, ) -> (MatRef<'a, T, Rows, usize, RStride, CStride>, MatRef<'a, T, Rows, usize, RStride, CStride>)

splits the matrix vertically at the given column into two parts and returns an array of each submatrix, in the following order:

  • left
  • right
§panics

the function panics if the following condition is violated:

  • col <= self.ncols()
Source

pub fn transpose(self) -> MatRef<'a, T, Cols, Rows, CStride, RStride>

returns a view over the transpose of self

§example
use faer::mat;

let matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_ref();
let transpose = view.transpose();

let expected = mat![[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]];
assert_eq!(expected.as_ref(), transpose);
Source

pub fn conjugate(self) -> MatRef<'a, T::Conj, Rows, Cols, RStride, CStride>
where T: Conjugate,

returns a view over the conjugate of self

Source

pub fn canonical(self) -> MatRef<'a, T::Canonical, Rows, Cols, RStride, CStride>
where T: Conjugate,

returns an unconjugated view over self

Source

pub fn adjoint(self) -> MatRef<'a, T::Conj, Cols, Rows, CStride, RStride>
where T: Conjugate,

returns a view over the conjugate transpose of self.

Source

pub fn reverse_rows(self) -> MatRef<'a, T, Rows, Cols, RStride::Rev, CStride>

returns a view over the self, with the rows in reversed order

§example
use faer::mat;

let matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_ref();
let reversed_rows = view.reverse_rows();

let expected = mat![[4.0, 5.0, 6.0], [1.0, 2.0, 3.0]];
assert_eq!(expected.as_ref(), reversed_rows);
Source

pub fn reverse_cols(self) -> MatRef<'a, T, Rows, Cols, RStride, CStride::Rev>

returns a view over the self, with the columns in reversed order

§example
use faer::mat;

let matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_ref();
let reversed_cols = view.reverse_cols();

let expected = mat![[3.0, 2.0, 1.0], [6.0, 5.0, 4.0]];
assert_eq!(expected.as_ref(), reversed_cols);
Source

pub fn reverse_rows_and_cols( self, ) -> MatRef<'a, T, Rows, Cols, RStride::Rev, CStride::Rev>

returns a view over the self, with the rows and the columns in reversed order

§example
use faer::mat;

let matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_ref();
let reversed = view.reverse_rows_and_cols();

let expected = mat![[6.0, 5.0, 4.0], [3.0, 2.0, 1.0]];
assert_eq!(expected.as_ref(), reversed);
Source

pub fn submatrix<V: Shape, H: Shape>( self, row_start: IdxInc<Rows>, col_start: IdxInc<Cols>, nrows: V, ncols: H, ) -> MatRef<'a, T, V, H, RStride, CStride>

returns a view over the submatrix starting at index (row_start, col_start), and with dimensions (nrows, ncols)

§panics

the function panics if any of the following conditions are violated:

  • row_start <= self.nrows()
  • col_start <= self.ncols()
  • nrows <= self.nrows() - row_start
  • ncols <= self.ncols() - col_start
§example
use faer::mat;

let matrix = mat![
	[1.0, 5.0, 9.0], //
	[2.0, 6.0, 10.0],
	[3.0, 7.0, 11.0],
	[4.0, 8.0, 12.0f64],
];

let view = matrix.as_ref();
let submatrix = view.submatrix(
	/* row_start: */ 2, /* col_start: */ 1, /* nrows: */ 2, /* ncols: */ 2,
);

let expected = mat![[7.0, 11.0], [8.0, 12.0f64]];
assert_eq!(expected.as_ref(), submatrix);
Source

pub fn subrows<V: Shape>( self, row_start: IdxInc<Rows>, nrows: V, ) -> MatRef<'a, T, V, Cols, RStride, CStride>

returns a view over the submatrix starting at row row_start, and with number of rows nrows

§panics

the function panics if any of the following conditions are violated:

  • row_start <= self.nrows()
  • nrows <= self.nrows() - row_start
§example
use faer::mat;

let matrix = mat![
	[1.0, 5.0, 9.0], //
	[2.0, 6.0, 10.0],
	[3.0, 7.0, 11.0],
	[4.0, 8.0, 12.0f64],
];

let view = matrix.as_ref();
let subrows = view.subrows(/* row_start: */ 1, /* nrows: */ 2);

let expected = mat![[2.0, 6.0, 10.0], [3.0, 7.0, 11.0],];
assert_eq!(expected.as_ref(), subrows);
Source

pub fn subcols<H: Shape>( self, col_start: IdxInc<Cols>, ncols: H, ) -> MatRef<'a, T, Rows, H, RStride, CStride>

returns a view over the submatrix starting at column col_start, and with number of columns ncols

§panics

the function panics if any of the following conditions are violated:

  • col_start <= self.ncols()
  • ncols <= self.ncols() - col_start
§example
use faer::mat;

let matrix = mat![
	[1.0, 5.0, 9.0], //
	[2.0, 6.0, 10.0],
	[3.0, 7.0, 11.0],
	[4.0, 8.0, 12.0f64],
];

let view = matrix.as_ref();
let subcols = view.subcols(/* col_start: */ 2, /* ncols: */ 1);

let expected = mat![[9.0], [10.0], [11.0], [12.0f64]];
assert_eq!(expected.as_ref(), subcols);
Source

pub fn as_shape<V: Shape, H: Shape>( self, nrows: V, ncols: H, ) -> MatRef<'a, T, V, H, RStride, CStride>

returns the input matrix with the given shape after checking that it matches the current shape

Source

pub fn as_row_shape<V: Shape>( self, nrows: V, ) -> MatRef<'a, T, V, Cols, RStride, CStride>

returns the input matrix with the given row shape after checking that it matches the current row shape

Source

pub fn as_col_shape<H: Shape>( self, ncols: H, ) -> MatRef<'a, T, Rows, H, RStride, CStride>

returns the input matrix with the given column shape after checking that it matches the current column shape

Source

pub fn as_dyn_stride(self) -> MatRef<'a, T, Rows, Cols, isize, isize>

returns the input matrix with dynamic stride

Source

pub fn as_dyn(self) -> MatRef<'a, T, usize, usize, RStride, CStride>

returns the input matrix with dynamic shape

Source

pub fn as_dyn_rows(self) -> MatRef<'a, T, usize, Cols, RStride, CStride>

returns the input matrix with dynamic row shape

Source

pub fn as_dyn_cols(self) -> MatRef<'a, T, Rows, usize, RStride, CStride>

returns the input matrix with dynamic column shape

Source

pub fn row(self, i: Idx<Rows>) -> RowRef<'a, T, Cols, CStride>

returns a view over the row at the given index

§panics

the function panics if any of the following conditions are violated:

  • row_idx < self.nrows()
Source

pub fn col(self, j: Idx<Cols>) -> ColRef<'a, T, Rows, RStride>

returns a view over the column at the given index

§panics

the function panics if any of the following conditions are violated:

  • col_idx < self.ncols()
Source

pub fn col_iter( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = ColRef<'a, T, Rows, RStride>>
where Rows: 'a, Cols: 'a,

returns an iterator over the columns of the matrix

Source

pub fn row_iter( self, ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = RowRef<'a, T, Cols, CStride>>
where Rows: 'a, Cols: 'a,

returns an iterator over the rows of the matrix

Source

pub fn par_col_iter( self, ) -> impl 'a + IndexedParallelIterator<Item = ColRef<'a, T, Rows, RStride>>
where T: Sync, Rows: 'a, Cols: 'a,

returns a parallel iterator over the columns of the matrix

Source

pub fn par_row_iter( self, ) -> impl 'a + IndexedParallelIterator<Item = RowRef<'a, T, Cols, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

returns a parallel iterator over the rows of the matrix

Source

pub fn par_col_chunks( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, Rows, usize, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

returns a parallel iterator that provides successive chunks of the columns of this matrix, with each having at most chunk_size columns

if the number of columns is a multiple of chunk_size, then all chunks have chunk_size columns

only available with the rayon feature

Source

pub fn par_col_partition( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, Rows, usize, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

returns a parallel iterator that provides exactly count successive chunks of the columns of this matrix

only available with the rayon feature

Source

pub fn par_row_chunks( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, usize, Cols, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

returns a parallel iterator that provides successive chunks of the rows of this matrix, with each having at most chunk_size rows

if the number of rows is a multiple of chunk_size, then all chunks have chunk_size rows

only available with the rayon feature

Source

pub fn par_row_partition( self, count: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatRef<'a, T, usize, Cols, RStride, CStride>>
where T: Sync, Rows: 'a, Cols: 'a,

returns a parallel iterator that provides exactly count successive chunks of the rows of this matrix

only available with the rayon feature

Source

pub fn split_first_row( self, ) -> Option<(RowRef<'a, T, Cols, CStride>, MatRef<'a, T, usize, Cols, RStride, CStride>)>

returns a reference to the first row and a view over the remaining ones if the matrix has at least one row, otherwise None

Source

pub fn split_first_col( self, ) -> Option<(ColRef<'a, T, Rows, RStride>, MatRef<'a, T, Rows, usize, RStride, CStride>)>

returns a reference to the first column and a view over the remaining ones if the matrix has at least one column, otherwise None

Source

pub fn split_last_row( self, ) -> Option<(RowRef<'a, T, Cols, CStride>, MatRef<'a, T, usize, Cols, RStride, CStride>)>

returns a reference to the last row and a view over the remaining ones if the matrix has at least one row, otherwise None

Source

pub fn split_last_col( self, ) -> Option<(ColRef<'a, T, Rows, RStride>, MatRef<'a, T, Rows, usize, RStride, CStride>)>

returns a reference to the last column and a view over the remaining ones if the matrix has at least one column, otherwise None

Source

pub fn try_as_row_major( self, ) -> Option<MatRef<'a, T, Rows, Cols, RStride, ContiguousFwd>>

returns a view over the matrix with a static column stride equal to +1, or None otherwise

Source

pub fn try_as_col_major( self, ) -> Option<MatRef<'a, T, Rows, Cols, ContiguousFwd, CStride>>

returns a view over the matrix with a static row stride equal to +1, or None otherwise

Source

pub fn get<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <MatRef<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, ColRange>>::Target
where MatRef<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, ColRange>,

returns references to the element at the given index, or submatrices if either row or col is a range, with bound checks

§panics

the function panics if any of the following conditions are violated:

  • row must be contained in [0, self.nrows())
  • col must be contained in [0, self.ncols())
Source

pub fn get_r<RowRange>( self, row: RowRange, ) -> <MatRef<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, RangeFull>>::Target
where MatRef<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, RangeFull>,

equivalent to self.get(row, ..)

Source

pub fn get_c<ColRange>( self, col: ColRange, ) -> <MatRef<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RangeFull, ColRange>>::Target
where MatRef<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RangeFull, ColRange>,

equivalent to self.get(.., col)

Source

pub unsafe fn get_unchecked<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <MatRef<'a, T, Rows, Cols, RStride, CStride> as MatIndex<RowRange, ColRange>>::Target
where MatRef<'a, T, Rows, Cols, RStride, CStride>: MatIndex<RowRange, ColRange>,

returns references to the element at the given index, or submatrices if either row or col is a range, without bound checks

§safety

the behavior is undefined if any of the following conditions are violated:

  • row must be contained in [0, self.nrows())
  • col must be contained in [0, self.ncols())
Source§

impl<T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride, Inner: for<'short> Reborrow<'short, Target = Ref<'short, T, Rows, Cols, RStride, CStride>>> Mat<Inner>

Source

pub fn as_ref(&self) -> MatRef<'_, T, Rows, Cols, RStride, CStride>

returns a view over self

Source

pub fn cloned(&self) -> Mat<T, Rows, Cols>
where T: Clone,

returns a newly allocated matrix holding the cloned values of self

Source

pub fn to_owned(&self) -> Mat<T::Canonical, Rows, Cols>
where T: Conjugate,

returns a newly allocated matrix holding the (possibly conjugated) values of self

Source

pub fn norm_max(&self) -> Real<T>
where T: Conjugate,

returns the maximum norm of self

Source

pub fn norm_l2(&self) -> Real<T>
where T: Conjugate,

returns the l2 norm of self

Source

pub fn squared_norm_l2(&self) -> Real<T>
where T: Conjugate,

returns the squared l2 norm of self

Source

pub fn norm_l1(&self) -> Real<T>
where T: Conjugate,

returns the l1 norm of self

Source

pub fn sum(&self) -> T::Canonical
where T: Conjugate,

returns the sum of the elements of self

Source

pub fn determinant(&self) -> T::Canonical
where T: Conjugate,

returns the determinant of self

Source

pub fn kron( &self, rhs: impl AsMatRef<T: Conjugate<Canonical = T::Canonical>>, ) -> Mat<T::Canonical>
where T: Conjugate,

kronecker product of two matrices

the kronecker product of two matrices $A$ and $B$ is a block matrix $B$ with the following structure:

C = [ a[(0, 0)] * B    , a[(0, 1)] * B    , ... , a[(0, n-1)] * B    ]
    [ a[(1, 0)] * B    , a[(1, 1)] * B    , ... , a[(1, n-1)] * B    ]
    [ ...              , ...              , ... , ...              ]
    [ a[(m-1, 0)] * B  , a[(m-1, 1)] * B  , ... , a[(m-1, n-1)] * B  ]
§panics

panics if dst does not have the correct dimensions. the dimensions of dst must be A.nrows() * B.nrows() by A.ncols() * B.ncols().

§example
use faer::linalg::kron::kron;
use faer::{Mat, mat};

let a = mat![[1.0, 2.0], [3.0, 4.0]];
let b = mat![[0.0, 5.0], [6.0, 7.0]];
let c = mat![
	[0.0, 5.0, 0.0, 10.0],
	[6.0, 7.0, 12.0, 14.0],
	[0.0, 15.0, 0.0, 20.0],
	[18.0, 21.0, 24.0, 28.0],
];
let mut dst = Mat::zeros(4, 4);
kron(dst.as_mut(), a.as_ref(), b.as_ref());
assert_eq!(dst, c);
Source

pub fn is_all_finite(&self) -> bool
where T: Conjugate,

returns true if all of the elements of self are finite. otherwise returns false.

Source

pub fn is_identity(&self) -> bool
where T: Conjugate,

returns true if self is the identity matrix. otherwise returns false.

Source

pub fn has_nan(&self) -> bool
where T: Conjugate,

returns true if any of the elements of self is NaN. otherwise returns false.

Source§

impl<'a, T, Dim: Shape, RStride: Stride, CStride: Stride> Mat<Ref<'a, T, Dim, Dim, RStride, CStride>>

Source

pub fn diagonal(self) -> DiagRef<'a, T, Dim, isize>

returns the diagonal of the matrix

Source§

impl<'a, T, Rows: Shape, Cols: Shape> Mat<Ref<'a, T, Rows, Cols>>
where T: RealField,

Source

pub fn max(self) -> Option<T>

Returns the maximum element in the matrix

§Returns
  • Option<T> - The maximum element in the matrix, or None if the matrix is empty
§Examples
use faer::{Mat, mat};

let m = mat![[1.0, 5.0, 3.0], [4.0, 2.0, 9.0], [7.0, 8.0, 6.0],];

assert_eq!(m.max(), Some(9.0));

let empty: Mat<f64> = Mat::new();
assert_eq!(empty.max(), None);
Source

pub fn min(self) -> Option<T>

Returns the minimum element in the matrix

§Returns
  • Option<T> - The minimum element in the matrix, or None if the matrix is empty
§Examples
use faer::{Mat, mat};

let m = mat![[1.0, 5.0, 3.0], [4.0, 2.0, 9.0], [7.0, 8.0, 6.0],];

assert_eq!(m.min(), Some(1.0));

let empty: Mat<f64> = Mat::new();
assert_eq!(empty.min(), None);
Source§

impl<Inner> Mat<Inner>

Source

pub fn from_inner_ref(inner: &Inner) -> &Self

wrap by reference

Source

pub fn from_inner_mut(inner: &mut Inner) -> &mut Self

wrap by mutable reference

Source§

impl<C: Conjugate, Inner: for<'short> Reborrow<'short, Target = Ref<'short, C>>> Mat<Inner>

Source

pub fn partial_piv_lu(&self) -> PartialPivLu<C::Canonical>

returns the $LU$ decomposition of self with partial (row) pivoting

Source

pub fn full_piv_lu(&self) -> FullPivLu<C::Canonical>

returns the $LU$ decomposition of self with full pivoting

Source

pub fn qr(&self) -> Qr<C::Canonical>

returns the $QR$ decomposition of self

Source

pub fn col_piv_qr(&self) -> ColPivQr<C::Canonical>

returns the $QR$ decomposition of self with column pivoting

Source

pub fn svd(&self) -> Result<Svd<C::Canonical>, SvdError>

returns the svd of self

singular values are nonnegative and sorted in nonincreasing order

Source

pub fn thin_svd(&self) -> Result<Svd<C::Canonical>, SvdError>

returns the thin svd of self

singular values are nonnegative and sorted in nonincreasing order

Source

pub fn llt(&self, side: Side) -> Result<Llt<C::Canonical>, LltError>

returns the $L L^\top$ decomposition of self

Source

pub fn ldlt(&self, side: Side) -> Result<Ldlt<C::Canonical>, LdltError>

returns the $L D L^\top$ decomposition of self

Source

pub fn lblt(&self, side: Side) -> Lblt<C::Canonical>

returns the $LBL^\top$ decomposition of self

Source

pub fn self_adjoint_eigen( &self, side: Side, ) -> Result<SelfAdjointEigen<C::Canonical>, EvdError>

returns the eigendecomposition of self, assuming it is self-adjoint

eigenvalues sorted in nondecreasing order

Source

pub fn self_adjoint_eigenvalues( &self, side: Side, ) -> Result<Vec<Real<C>>, EvdError>

returns the eigenvalues of self, assuming it is self-adjoint

eigenvalues sorted in nondecreasing order

Source

pub fn singular_values(&self) -> Result<Vec<Real<C>>, SvdError>

returns the singular values of self

singular values are nonnegative and sorted in nonincreasing order

Source§

impl<T: Conjugate, Inner: for<'short> Reborrow<'short, Target = Ref<'short, T>>> Mat<Inner>

Source

pub fn generalized_eigen( &self, B: impl AsMatRef<T = T, Rows = usize, Cols = usize>, ) -> Result<GeneralizedEigen<Real<T>>, GevdError>

returns the generalized_eigendecomposition of (self, B)

Source

pub fn eigen(&self) -> Result<Eigen<Real<T>>, EvdError>

returns the eigendecomposition of self

Source

pub fn eigenvalues(&self) -> Result<Vec<Complex<Real<T>>>, EvdError>

returns the eigenvalues of self

Trait Implementations§

Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Add<&Mat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Mat<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Add<&Mat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Mat<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Add<Mat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Mat<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Add<Mat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Mat<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> AddAssign<&Mat<R>> for Mat<L>

Source§

fn add_assign(&mut self, rhs: &Mat<R>)

Performs the += operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> AddAssign<Mat<R>> for Mat<L>

Source§

fn add_assign(&mut self, rhs: Mat<R>)

Performs the += operation. Read more
Source§

impl<Inner: Clone> Clone for Mat<Inner>

Source§

fn clone(&self) -> Mat<Inner>

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<Inner: Debug> Debug for Mat<Inner>

Source§

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

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

impl<Inner> Deref for Mat<Inner>

Source§

type Target = Inner

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<Inner> DerefMut for Mat<Inner>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: ComplexField, D: Distribution<T>> Distribution<Mat<Own<T>>> for UnitaryMat<usize, D>

Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Mat<T>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Map sampled values to type S Read more
Source§

impl<T, Rows: Shape, Cols: Shape, D: Distribution<T>> Distribution<Mat<Own<T, Rows, Cols>>> for CwiseMatDistribution<Rows, Cols, D>

Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Mat<T, Rows, Cols>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Map sampled values to type S Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<&Scale<T>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Scale<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<&Scale<T>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Scale<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<&f64> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f64) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<&f64> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f64) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<Scale<T>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Scale<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<Scale<T>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Scale<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<f64> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Div<f64> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> DivAssign<&Scale<T>> for Mat<L>

Source§

fn div_assign(&mut self, rhs: &Scale<T>)

Performs the /= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> DivAssign<&f64> for Mat<L>

Source§

fn div_assign(&mut self, rhs: &f64)

Performs the /= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> DivAssign<Scale<T>> for Mat<L>

Source§

fn div_assign(&mut self, rhs: Scale<T>)

Performs the /= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> DivAssign<f64> for Mat<L>

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl<T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride, Inner: for<'short> Reborrow<'short, Target = Ref<'short, T, Rows, Cols, RStride, CStride>>> Index<(<Rows as ShapeIdx>::Idx<usize>, <Cols as ShapeIdx>::Idx<usize>)> for Mat<Inner>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, (row, col): (Idx<Rows>, Idx<Cols>)) -> &Self::Output

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

impl<T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride, Inner: for<'short> Reborrow<'short, Target = Ref<'short, T, Rows, Cols, RStride, CStride>> + for<'short> ReborrowMut<'short, Target = Mut<'short, T, Rows, Cols, RStride, CStride>>> IndexMut<(<Rows as ShapeIdx>::Idx<usize>, <Cols as ShapeIdx>::Idx<usize>)> for Mat<Inner>

Source§

fn index_mut(&mut self, (row, col): (Idx<Rows>, Idx<Cols>)) -> &mut Self::Output

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

impl<Inner: IntoConst> IntoConst for Mat<Inner>

Source§

type Target = Mat<<Inner as IntoConst>::Target>

Source§

fn into_const(self) -> Self::Target

Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Cols, RRStride>>> Mul<&Col<R>> for &Mat<L>

Source§

type Output = Col<Own<T, Rows>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Col<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Cols, RRStride>>> Mul<&Col<R>> for Mat<L>

Source§

type Output = Col<Own<T, Rows>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Col<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Rows: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Dim, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, RStride>>> Mul<&Diag<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Dim>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Diag<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Rows: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Dim, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, RStride>>> Mul<&Diag<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Dim>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Diag<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Dim, LStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &Diag<L>

Source§

type Output = Mat<Own<T, Dim, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, Rows>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &Perm<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &Row<L>

Source§

type Output = Row<Own<T, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &Scale<T>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &SparseColMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &SparseRowMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for &f64

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Dim, LStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for Diag<L>

Source§

type Output = Mat<Own<T, Dim, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, Rows>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for Perm<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for Row<L>

Source§

type Output = Row<Own<T, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for Scale<T>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for SparseColMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for SparseRowMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<&Mat<R>> for f64

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, Cols>>> Mul<&Perm<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Perm<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, Cols>>> Mul<&Perm<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Perm<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<&Scale<T>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<&Scale<T>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<&SparseColMat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &SparseColMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<&SparseColMat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &SparseColMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<&SparseRowMat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &SparseRowMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<&SparseRowMat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &SparseRowMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<&f64> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<&f64> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Cols, RRStride>>> Mul<Col<R>> for &Mat<L>

Source§

type Output = Col<Own<T, Rows>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Col<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Cols, RRStride>>> Mul<Col<R>> for Mat<L>

Source§

type Output = Col<Own<T, Rows>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Col<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Rows: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Dim, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, RStride>>> Mul<Diag<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Dim>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Diag<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Rows: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Dim, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, RStride>>> Mul<Diag<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Dim>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Diag<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Dim, LStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &Diag<L>

Source§

type Output = Mat<Own<T, Dim, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, Rows>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &Perm<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &Row<L>

Source§

type Output = Row<Own<T, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &Scale<T>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &SparseColMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &SparseRowMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for &f64

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Dim: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Dim, LStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Dim, Cols, RRStride, RCStride>>> Mul<Mat<R>> for Diag<L>

Source§

type Output = Mat<Own<T, Dim, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<Mat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, Rows>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for Perm<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for Row<L>

Source§

type Output = Row<Own<T, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for Scale<T>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<Mat<R>> for SparseColMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, I, LT, Rows, Depth>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Depth, Cols, RRStride, RCStride>>> Mul<Mat<R>> for SparseRowMat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Mul<Mat<R>> for f64

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, Cols>>> Mul<Perm<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Perm<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, Cols>>> Mul<Perm<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Perm<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<Scale<T>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<Scale<T>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<SparseColMat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SparseColMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<SparseColMat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SparseColMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<SparseRowMat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SparseRowMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I: Index, T: ComplexField, Rows: Shape, Cols: Shape, Depth: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Depth, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, RT, Depth, Cols>>> Mul<SparseRowMat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SparseRowMat<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<f64> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>> Mul<f64> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> MulAssign<&Scale<T>> for Mat<L>

Source§

fn mul_assign(&mut self, rhs: &Scale<T>)

Performs the *= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> MulAssign<&f64> for Mat<L>

Source§

fn mul_assign(&mut self, rhs: &f64)

Performs the *= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> MulAssign<Scale<T>> for Mat<L>

Source§

fn mul_assign(&mut self, rhs: Scale<T>)

Performs the *= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>> MulAssign<f64> for Mat<L>

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl<T: Conjugate, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride, Inner: for<'a> Reborrow<'a, Target = Ref<'a, T, Rows, Cols, RStride, CStride>>> Neg for &Mat<Inner>

Source§

type Output = Mat<Own<<T as Conjugate>::Canonical, Rows, Cols>>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: Conjugate, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride, Inner: for<'a> Reborrow<'a, Target = Ref<'a, T, Rows, Cols, RStride, CStride>>> Neg for Mat<Inner>

Source§

type Output = Mat<Own<<T as Conjugate>::Canonical, Rows, Cols>>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<LT: PartialEq<RT>, LRows: Shape, LCols: Shape, LRStride: Stride, LCStride: Stride, RT, RRows: Shape, RCols: Shape, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, LRows, LCols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, RRows, RCols, RRStride, RCStride>>> PartialEq<Mat<R>> for Mat<L>

Source§

fn eq(&self, other: &Mat<R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'short, Inner: Reborrow<'short>> Reborrow<'short> for Mat<Inner>

Source§

type Target = Mat<<Inner as Reborrow<'short>>::Target>

Source§

fn rb(&'short self) -> Self::Target

Source§

impl<'short, Inner: ReborrowMut<'short>> ReborrowMut<'short> for Mat<Inner>

Source§

type Target = Mat<<Inner as ReborrowMut<'short>>::Target>

Source§

fn rb_mut(&'short mut self) -> Self::Target

Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Sub<&Mat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Mat<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Sub<&Mat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Mat<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Sub<Mat<R>> for &Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Mat<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LT: Conjugate<Canonical = T>, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> Reborrow<'a, Target = Ref<'a, LT, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> Sub<Mat<R>> for Mat<L>

Source§

type Output = Mat<Own<T, Rows, Cols>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Mat<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> SubAssign<&Mat<R>> for Mat<L>

Source§

fn sub_assign(&mut self, rhs: &Mat<R>)

Performs the -= operation. Read more
Source§

impl<T: ComplexField, Rows: Shape, Cols: Shape, LRStride: Stride, LCStride: Stride, RT: Conjugate<Canonical = T>, RRStride: Stride, RCStride: Stride, L: for<'a> ReborrowMut<'a, Target = Mut<'a, T, Rows, Cols, LRStride, LCStride>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RT, Rows, Cols, RRStride, RCStride>>> SubAssign<Mat<R>> for Mat<L>

Source§

fn sub_assign(&mut self, rhs: Mat<R>)

Performs the -= operation. Read more
Source§

impl<Inner: Copy> Copy for Mat<Inner>

Auto Trait Implementations§

§

impl<Inner> Freeze for Mat<Inner>
where Inner: Freeze,

§

impl<Inner> RefUnwindSafe for Mat<Inner>
where Inner: RefUnwindSafe,

§

impl<Inner> Send for Mat<Inner>
where Inner: Send,

§

impl<Inner> Sync for Mat<Inner>
where Inner: Sync,

§

impl<Inner> Unpin for Mat<Inner>
where Inner: Unpin,

§

impl<Inner> UnwindSafe for Mat<Inner>
where Inner: UnwindSafe,

Blanket Implementations§

Source§

impl<Rhs, Lhs, Output> AddByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Add<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn add_by_ref(&self, rhs: &Rhs) -> <Lhs as AddByRef<Rhs>>::Output

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<M> AsColMut for M
where M: AsMatMut<Cols = One>,

Source§

fn as_col_mut( &mut self, ) -> Col<Mut<'_, <M as AsMatRef>::T, <M as AsMatRef>::Rows>>

returns a view over self
Source§

impl<M> AsColRef for M
where M: AsMatRef<Cols = One>,

Source§

fn as_col_ref(&self) -> Col<Ref<'_, <M as AsMatRef>::T, <M as AsMatRef>::Rows>>

returns a view over self
Source§

impl<M> AsRowMut for M
where M: AsMatMut<Rows = One>,

Source§

fn as_row_mut( &mut self, ) -> Row<Mut<'_, <M as AsMatRef>::T, <M as AsMatRef>::Cols>>

returns a view over self
Source§

impl<M> AsRowRef for M
where M: AsMatRef<Rows = One>,

Source§

fn as_row_ref(&self) -> Row<Ref<'_, <M as AsMatRef>::T, <M as AsMatRef>::Cols>>

returns a view over self
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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl ?Sized + Rng)) -> T
where Self: Distribution<T>,

Source§

impl<Rhs, Lhs, Output> DivByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Div<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn div_by_ref(&self, rhs: &Rhs) -> <Lhs as DivByRef<Rhs>>::Output

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Rhs, Lhs, Output> MulByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Mul<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn mul_by_ref(&self, rhs: &Rhs) -> <Lhs as MulByRef<Rhs>>::Output

Source§

impl<T, Output> NegByRef for T
where &'a T: for<'a> Neg<Output = Output>,

Source§

type Output = Output

Source§

fn neg_by_ref(&self) -> <T as NegByRef>::Output

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<R> Rng for R
where R: RngCore + ?Sized,

Source§

fn random<T>(&mut self) -> T

Return a random value via the StandardUniform distribution. Read more
Source§

fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>

Return an iterator over random variates Read more
Source§

fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Source§

fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
Source§

fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being true. Read more
Source§

fn sample<T, D>(&mut self, distr: D) -> T
where D: Distribution<T>,

Sample a new value, using the given distribution. Read more
Source§

fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>
where D: Distribution<T>, Self: Sized,

Create an iterator that generates values using the given distribution. Read more
Source§

fn fill<T>(&mut self, dest: &mut T)
where T: Fill + ?Sized,

Fill any type implementing Fill with random data Read more
Source§

fn gen<T>(&mut self) -> T

👎Deprecated since 0.9.0: Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Alias for Rng::random.
Source§

fn gen_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

👎Deprecated since 0.9.0: Renamed to random_range
Source§

fn gen_bool(&mut self, p: f64) -> bool

👎Deprecated since 0.9.0: Renamed to random_bool
Alias for Rng::random_bool.
Source§

fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool

👎Deprecated since 0.9.0: Renamed to random_ratio
Source§

impl<T> RngCore for T
where T: DerefMut, <T as Deref>::Target: RngCore,

Source§

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
Source§

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
Source§

fn fill_bytes(&mut self, dst: &mut [u8])

Fill dest with random data. Read more
Source§

impl<Rhs, Lhs, Output> SubByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Sub<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn sub_by_ref(&self, rhs: &Rhs) -> <Lhs as SubByRef<Rhs>>::Output

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

impl<R> TryRngCore for R
where R: RngCore + ?Sized,

Source§

type Error = Infallible

The type returned in the event of a RNG error.
Source§

fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>

Return the next random u32.
Source§

fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>

Return the next random u64.
Source§

fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>

Fill dest entirely with random data.
Source§

fn unwrap_err(self) -> UnwrapErr<Self>
where Self: Sized,

Wrap RNG with the UnwrapErr wrapper.
Source§

fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>

Wrap RNG with the UnwrapMut wrapper.
Source§

fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>
where Self: Sized,

Convert an RngCore to a RngReadAdapter.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

Source§

impl<T> CryptoRng for T
where T: DerefMut, <T as Deref>::Target: CryptoRng,

Source§

impl<R> TryCryptoRng for R
where R: CryptoRng + ?Sized,