pub struct Matrix {
pub data: Vec<Vec<f64>>,
pub rows: usize,
pub cols: usize,
}Fields§
§data: Vec<Vec<f64>>§rows: usize§cols: usizeImplementations§
Source§impl Matrix
impl Matrix
pub fn new(data: Vec<Vec<f64>>) -> Result<Self, &'static str>
pub fn zeros(rows: usize, cols: usize) -> Self
pub fn identity(size: usize) -> Self
pub fn transpose(&self) -> Self
pub fn determinant(&self) -> Result<f64, &'static str>
pub fn inverse(&self) -> Result<Matrix, &'static str>
pub fn svd( &self, max_iter: usize, tolerance: f64, ) -> Result<(Matrix, Vector, Matrix), &'static str>
pub fn eigendecomposition( &self, max_iter: usize, tolerance: f64, ) -> Result<(Matrix, Vec<f64>), &'static str>
pub fn cholesky(&self) -> Result<Matrix, &'static str>
pub fn is_symmetric(&self) -> bool
pub fn is_positive_definite(&self) -> bool
pub fn trace(&self) -> Result<f64, &'static str>
pub fn frobenius_norm(&self) -> f64
Source§impl Matrix
impl Matrix
pub fn lu_decomposition(&self) -> Result<(Matrix, Matrix), &'static str>
pub fn qr_decomposition(&self) -> Result<(Matrix, Matrix), &'static str>
pub fn rank(&self) -> Result<usize, &'static str>
pub fn power_iteration( &self, max_iter: usize, tolerance: f64, ) -> Result<(f64, Vector), &'static str>
pub fn multiply_vector(&self, v: &Vector) -> Result<Vector, &'static str>
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