pub struct Matrix<T> { /* private fields */ }Implementations§
Source§impl<T: Num + Neg<Output = T> + Copy> Matrix<T>
impl<T: Num + Neg<Output = T> + Copy> Matrix<T>
pub fn mneg<'a>(&'a mut self) -> &'a mut Matrix<T>
pub fn mscale<'a>(&'a mut self, factor: T) -> &'a mut Matrix<T>
pub fn madd<'a>(&'a mut self, m: &Matrix<T>) -> &'a mut Matrix<T>
pub fn msub<'a>(&'a mut self, m: &Matrix<T>) -> &'a mut Matrix<T>
pub fn melem_mul<'a>(&'a mut self, m: &Matrix<T>) -> &'a mut Matrix<T>
pub fn melem_div<'a>(&'a mut self, m: &Matrix<T>) -> &'a mut Matrix<T>
pub fn mmul<'a>( &self, m: &Matrix<T>, dst: &'a mut Matrix<T>, ) -> &'a mut Matrix<T>
Source§impl<T: Copy> Matrix<T>
impl<T: Copy> Matrix<T>
pub fn new(no_rows: usize, no_cols: usize, data: Vec<T>) -> Matrix<T>
pub fn dirty(no_rows: usize, no_cols: usize) -> Matrix<T>
pub fn vector(data: Vec<T>) -> Matrix<T>
pub fn row_vector(data: Vec<T>) -> Matrix<T>
pub fn rows(&self) -> usize
pub fn cols(&self) -> usize
pub fn get_data<'a>(&'a self) -> &'a Vec<T>
pub fn get_ref<'lt>(&'lt self, row: usize, col: usize) -> &'lt T
pub fn map<S: Copy>(&self, f: &dyn Fn(&T) -> S) -> Matrix<S>
pub fn reduce<S: Copy>( &self, init: &Vec<S>, f: &dyn Fn(&S, &T) -> S, ) -> Matrix<S>
pub fn is_square(&self) -> bool
pub fn is_not_square(&self) -> bool
Source§impl<T: Num + Copy> Matrix<T>
impl<T: Num + Copy> Matrix<T>
pub fn id(m: usize, n: usize) -> Matrix<T>
pub fn zero(no_rows: usize, no_cols: usize) -> Matrix<T>
pub fn diag(data: Vec<T>) -> Matrix<T>
pub fn block_diag(m: usize, n: usize, data: Vec<T>) -> Matrix<T>
pub fn zero_vector(no_rows: usize) -> Matrix<T>
pub fn one_vector(no_rows: usize) -> Matrix<T>
Source§impl<T: Copy> Matrix<T>
impl<T: Copy> Matrix<T>
pub fn get(&self, row: usize, col: usize) -> T
pub fn cr(&self, m: &Matrix<T>) -> Matrix<T>
pub fn cb(&self, m: &Matrix<T>) -> Matrix<T>
pub fn t(&self) -> Matrix<T>
pub fn minor(&self, row: usize, col: usize) -> Matrix<T>
pub fn sub_matrix<RRI, RCI, RR, RC>(&self, rows: RR, cols: RC) -> Matrix<T>where
RRI: MatrixRangeIterator,
RCI: MatrixRangeIterator,
RR: MatrixRange<RRI>,
RC: MatrixRange<RCI>,
pub fn get_columns<RCI: MatrixRangeIterator, RC: MatrixRange<RCI>>( &self, columns: RC, ) -> Matrix<T>
pub fn get_rows<RCI: MatrixRangeIterator, RC: MatrixRange<RCI>>( &self, row: RC, ) -> Matrix<T>
pub fn permute(&self, rows: &[usize], columns: &[usize]) -> Matrix<T>
pub fn permute_rows(&self, rows: &[usize]) -> Matrix<T>
pub fn permute_columns(&self, columns: &[usize]) -> Matrix<T>
pub fn filter_rows(&self, f: &dyn Fn(&Matrix<T>, usize) -> bool) -> Matrix<T>
pub fn filter_columns(&self, f: &dyn Fn(&Matrix<T>, usize) -> bool) -> Matrix<T>
pub fn select_rows(&self, selector: &[bool]) -> Matrix<T>
pub fn select_columns(&self, selector: &[bool]) -> Matrix<T>
Source§impl<T: Float + ApproxEq<T> + Signed + Copy> Matrix<T>
impl<T: Float + ApproxEq<T> + Signed + Copy> Matrix<T>
pub fn trace(&self) -> T
pub fn det(&self) -> T
pub fn solve(&self, b: &Matrix<T>) -> Option<Matrix<T>>
pub fn inverse(&self) -> Option<Matrix<T>>
pub fn is_singular(&self) -> bool
pub fn is_non_singular(&self) -> bool
pub fn pinverse(&self) -> Matrix<T>
pub fn vector_euclidean_norm(&self) -> T
pub fn length(&self) -> T
pub fn vector_1_norm(&self) -> T
pub fn vector_2_norm(&self) -> T
pub fn vector_p_norm(&self, p: T) -> T
pub fn frobenius_norm(&self) -> T
pub fn vector_inf_norm(&self) -> T
pub fn is_symmetric(&self) -> bool
pub fn is_non_symmetric(&self) -> bool
pub fn approx_eq(&self, m: &Matrix<T>) -> bool
Trait Implementations§
Source§impl<'a, 'b, T: Add<T, Output = T> + Mul<T, Output = T> + Zero + Copy> Mul<&'a Matrix<T>> for &'b Matrix<T>
impl<'a, 'b, T: Add<T, Output = T> + Mul<T, Output = T> + Zero + Copy> Mul<&'a Matrix<T>> for &'b Matrix<T>
Source§impl<'a, T: Add<T, Output = T> + Mul<T, Output = T> + Zero + Copy> Mul<&'a Matrix<T>> for Matrix<T>
impl<'a, T: Add<T, Output = T> + Mul<T, Output = T> + Zero + Copy> Mul<&'a Matrix<T>> for Matrix<T>
Source§impl<'a, T: Add<T, Output = T> + Mul<T, Output = T> + Zero + Copy> Mul<Matrix<T>> for &'a Matrix<T>
impl<'a, T: Add<T, Output = T> + Mul<T, Output = T> + Zero + Copy> Mul<Matrix<T>> for &'a Matrix<T>
impl<T> StructuralPartialEq for Matrix<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix<T>
impl<T> RefUnwindSafe for Matrix<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix<T>where
T: Send,
impl<T> Sync for Matrix<T>where
T: Sync,
impl<T> Unpin for Matrix<T>where
T: Unpin,
impl<T> UnwindSafe for Matrix<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more