[−][src]Struct ndarray_linalg::krylov::MGS  
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]
Trait Implementations
impl<A: Scalar + Lapack> Orthogonalizer for MGS<A>[src]
type Elem = A
fn dim(&self) -> usize[src]
fn len(&self) -> usize[src]
fn orthogonalize<S>(&self, a: &mut ArrayBase<S, Ix1>) -> Array1<A> where
    A: Lapack,
    S: DataMut<Elem = A>, [src]
A: Lapack,
S: DataMut<Elem = A>,
fn append<S>(
    &mut self, 
    a: ArrayBase<S, Ix1>, 
    rtol: A::Real
) -> Result<Array1<A>, Array1<A>> where
    A: Lapack,
    S: Data<Elem = A>, [src]
&mut self,
a: ArrayBase<S, Ix1>,
rtol: A::Real
) -> Result<Array1<A>, Array1<A>> where
A: Lapack,
S: Data<Elem = A>,
fn get_q(&self) -> Q<A>[src]
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(&self) -> 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
Blanket Implementations
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
    T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> Into<U> for T where
    U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
    U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
    T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
    T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
    T: 'static + ?Sized, [src]
T: 'static + ?Sized,