pub struct Matrix {
pub rows: usize,
pub cols: usize,
pub data: Vec<f64>,
}Fields§
§rows: usize§cols: usize§data: Vec<f64>Implementations§
Source§impl Matrix
impl Matrix
pub fn new(rows: usize, cols: usize) -> Self
pub fn from_vec( rows: usize, cols: usize, data: Vec<f64>, ) -> Result<Self, String>
pub fn at(&self, row: usize, col: usize) -> f64
pub fn set(&mut self, row: usize, col: usize, value: f64)
pub fn valid(&self) -> bool
pub fn multiply(&self, rhs: &Matrix) -> Result<Matrix, String>
Trait Implementations§
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnsafeUnpin for Matrix
impl UnwindSafe for Matrix
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