pub struct Matrix {
pub val: Vec<f64>,
pub ncols: usize,
pub nrows: usize,
}Expand description
Data structure for matrix
Fields§
§val: Vec<f64>Vec holding the values of the matrix. Note that val.len() must be equal to the product of ncols and nrows.
ncols: usizeNumber of columns of the matrix
nrows: usizeNumber of rows of the matrix
Implementations§
Source§impl Matrix
impl Matrix
pub fn insert_column(&self, column: usize, elem: Vec<f64>) -> Matrix
pub fn gauss_elimination(&self, row: usize, by: usize, col: usize) -> Matrix
pub fn row_addition( &self, dst_row: usize, src_row: usize, multiplier: Option<f64>, ) -> Matrix
pub fn get_columns(&self, ind: &Vec<usize>) -> Matrix
pub fn update_column(&self, ind: usize, v: &Vec<f64>) -> Matrix
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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