pub struct DenseMatrix {
pub rows: usize,
pub cols: usize,
pub data: Vec<Vec<f64>>,
}Expand description
A Rust-level dense matrix over f64 for computational purposes.
Fields§
§rows: usizeNumber of rows.
cols: usizeNumber of columns.
data: Vec<Vec<f64>>Row-major storage of matrix entries.
Implementations§
Source§impl DenseMatrix
impl DenseMatrix
Sourcepub fn add(&self, other: &DenseMatrix) -> Option<DenseMatrix>
pub fn add(&self, other: &DenseMatrix) -> Option<DenseMatrix>
Matrix addition.
Sourcepub fn mul(&self, other: &DenseMatrix) -> Option<DenseMatrix>
pub fn mul(&self, other: &DenseMatrix) -> Option<DenseMatrix>
Matrix multiplication.
Sourcepub fn scale(&self, s: f64) -> DenseMatrix
pub fn scale(&self, s: f64) -> DenseMatrix
Scalar multiplication.
Sourcepub fn transpose(&self) -> DenseMatrix
pub fn transpose(&self) -> DenseMatrix
Transpose.
Sourcepub fn row_echelon(&self) -> (DenseMatrix, usize)
pub fn row_echelon(&self) -> (DenseMatrix, usize)
Gaussian elimination: returns (row echelon form, rank).
Sourcepub fn is_symmetric(&self) -> bool
pub fn is_symmetric(&self) -> bool
Check if symmetric.
Trait Implementations§
Source§impl Clone for DenseMatrix
impl Clone for DenseMatrix
Source§fn clone(&self) -> DenseMatrix
fn clone(&self) -> DenseMatrix
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DenseMatrix
impl RefUnwindSafe for DenseMatrix
impl Send for DenseMatrix
impl Sync for DenseMatrix
impl Unpin for DenseMatrix
impl UnsafeUnpin for DenseMatrix
impl UnwindSafe for DenseMatrix
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