pub struct SVD {
pub s: Vec<f64>,
pub u: Matrix,
pub vt: Matrix,
}
Fields§
§s: Vec<f64>
§u: Matrix
§vt: Matrix
Implementations§
source§impl SVD
impl SVD
pub fn u(&self) -> &Matrix
pub fn vt(&self) -> &Matrix
pub fn s_mat(&self) -> Matrix
sourcepub fn truncated(&self) -> Self
pub fn truncated(&self) -> Self
Generated Truncated SVD
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
let x = ml_matrix("1 2 3;4 5 6");
// Full SVD
let svd = x.svd();
svd.u().print(); // m x m matrix
svd.s_mat().print(); // m x n matrix
svd.vt().print(); // n x n matrix
// Truncated SVD
let svd2 = svd.truncated();
svd2.u().print(); // m x p matrix
svd2.s_mat().print(); // p x p matrix
svd2.vt().print(); // p x n matrix
}
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SVD
impl Send for SVD
impl Sync for SVD
impl Unpin for SVD
impl UnwindSafe for SVD
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