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 Freeze for SVD
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
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