[][src]Struct ndarray_linalg::krylov::MGS

pub struct MGS<A> { /* fields omitted */ }

Iterative orthogonalizer using modified Gram-Schmit procedure

let mut mgs = MGS::new(3);
let coef = mgs.append(array![0.0, 1.0, 0.0], 1e-9).unwrap();
close_l2(&coef, &array![1.0], 1e-9);

let coef = mgs.append(array![1.0, 1.0, 0.0], 1e-9).unwrap();
close_l2(&coef, &array![1.0, 1.0], 1e-9);

// Fail if the vector is linearly dependent
assert!(mgs.append(array![1.0, 2.0, 0.0], 1e-9).is_err());

// You can get coefficients of dependent vector
if let Err(coef) = mgs.append(array![1.0, 2.0, 0.0], 1e-9) {
    close_l2(&coef, &array![2.0, 1.0, 0.0], 1e-9);
}

Methods

impl<A: Scalar> MGS<A>[src]

pub fn new(dimension: usize) -> Self[src]

Create an empty orthogonalizer

Trait Implementations

impl<A: Scalar + Lapack> Orthogonalizer for MGS<A>[src]

type Elem = A

fn is_full(&self) -> bool[src]

check if the basis spans entire space

fn is_empty(&self) -> bool[src]

impl<A: Clone> Clone for MGS<A>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<A: Debug> Debug for MGS<A>[src]

Auto Trait Implementations

impl<A> Send for MGS<A> where
    A: Send

impl<A> Sync for MGS<A> where
    A: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]