pub struct Matrix<A> { /* private fields */ }
Implementations§
Source§impl<A: Clone> Matrix<A>
impl<A: Clone> Matrix<A>
pub fn new(rows: usize, cols: usize, val: A) -> Matrix<A>
pub fn new_with_val( rows: usize, cols: usize, val: Vec<A>, ) -> Result<Matrix<A>, &'static str>
pub fn index(&self, row: usize, col: usize) -> Result<A, &'static str>
pub fn insert( &mut self, row: usize, col: usize, value: A, ) -> Result<(), &'static str>
pub fn dimensions(&self) -> (usize, usize)
pub fn map<F, B>(&self, f: F) -> Matrix<B>where
F: Fn(A) -> B,
pub fn map2<F, B: Clone, C>(
&self,
m: &Matrix<B>,
f: F,
) -> Result<Matrix<C>, &'static str>where
F: Fn(A, B) -> C,
pub fn transpose(&self) -> Matrix<A>
Trait Implementations§
impl<A> StructuralPartialEq for Matrix<A>
Auto Trait Implementations§
impl<A> Freeze for Matrix<A>
impl<A> RefUnwindSafe for Matrix<A>where
A: RefUnwindSafe,
impl<A> Send for Matrix<A>where
A: Send,
impl<A> Sync for Matrix<A>where
A: Sync,
impl<A> Unpin for Matrix<A>where
A: Unpin,
impl<A> UnwindSafe for Matrix<A>where
A: 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