pub struct Matrix2D {
pub rows: usize,
pub cols: usize,
pub data: Vec<Vec<f64>>,
}Expand description
表示具有指定行数和列数的二维矩阵。
Fields§
§rows: usize矩阵的行数。
cols: usize矩阵的列数。
data: Vec<Vec<f64>>以二维向量形式存储在矩阵中的数据。
Implementations§
Source§impl Matrix2D
impl Matrix2D
pub fn print(&self)
pub fn determinant(&self) -> Option<f64>
pub fn inverse(&self) -> Option<Matrix2D>
pub fn eigenvalue_eigenvector(&self) -> Option<(Vec<f64>, Vec<Vec<f64>>)>
pub fn svd(&self) -> (Matrix2D, Matrix2D, Matrix2D)
pub fn multiply_by_vector(&self, vector: &Vec<f64>) -> Matrix2D
pub fn eye(size: usize) -> Matrix2D
pub fn zeros(rows: usize, cols: usize) -> Matrix2D
pub fn eigen(&self) -> (Vec<f64>, Matrix2D)
pub fn argsort(vector: &Vec<f64>) -> Vec<usize>
pub fn column(&self, col_index: usize) -> Vec<f64>
Trait Implementations§
impl StructuralPartialEq for Matrix2D
Auto Trait Implementations§
impl Freeze for Matrix2D
impl RefUnwindSafe for Matrix2D
impl Send for Matrix2D
impl Sync for Matrix2D
impl Unpin for Matrix2D
impl UnwindSafe for Matrix2D
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