Trait ndarray_linalg::krylov::Orthogonalizer [−][src]
Trait for creating orthogonal basis from iterator of arrays
Panic
- if the size of the input array mismatches to the dimension
Example
let mut mgs = MGS::new(3, 1e-9); let coef = mgs.append(array![0.0, 1.0, 0.0]).into_coeff(); close_l2(&coef, &array![1.0], 1e-9); let coef = mgs.append(array![1.0, 1.0, 0.0]).into_coeff(); 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]).is_dependent()); // You can get coefficients of dependent vector if let AppendResult::Dependent(coef) = mgs.append(array![1.0, 2.0, 0.0]) { close_l2(&coef, &array![2.0, 1.0, 0.0], 1e-9); }
Associated Types
Loading content...Required methods
fn dim(&self) -> usize
[src]
Dimension of input array
fn len(&self) -> usize
[src]
Number of cached basis
fn tolerance(&self) -> <Self::Elem as Scalar>::Real
[src]
fn decompose<S>(&self, a: &mut ArrayBase<S, Ix1>) -> Coefficients<Self::Elem> where
S: DataMut<Elem = Self::Elem>,
[src]
S: DataMut<Elem = Self::Elem>,
Decompose given vector into the span of current basis and its tangent space
a
becomes the tangent vector- The Coefficients to the current basis is returned.
fn coeff<S>(&self, a: ArrayBase<S, Ix1>) -> Coefficients<Self::Elem> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Calculate the coefficient to the current basis basis
- This will be faster than
decompose
because the construction of the residual vector may requires more Calculation
fn append<S>(&mut self, a: ArrayBase<S, Ix1>) -> AppendResult<Self::Elem> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Add new vector if the residual is larger than relative tolerance
fn div_append<S>(
&mut self,
a: &mut ArrayBase<S, Ix1>
) -> AppendResult<Self::Elem> where
S: DataMut<Elem = Self::Elem>,
[src]
&mut self,
a: &mut ArrayBase<S, Ix1>
) -> AppendResult<Self::Elem> where
S: DataMut<Elem = Self::Elem>,
Add new vector if the residual is larger than relative tolerance, and return the residual vector
fn get_q(&self) -> Q<Self::Elem>
[src]
Get Q-matrix of generated basis
Provided methods
Loading content...Implementors
impl<A: Scalar + Lapack> Orthogonalizer for Householder<A>
[src]
type Elem = A
fn dim(&self) -> usize
[src]
fn len(&self) -> usize
[src]
fn tolerance(&self) -> A::Real
[src]
fn decompose<S>(&self, a: &mut ArrayBase<S, Ix1>) -> Array1<A> where
S: DataMut<Elem = A>,
[src]
S: DataMut<Elem = A>,
fn coeff<S>(&self, a: ArrayBase<S, Ix1>) -> Array1<A> where
S: Data<Elem = A>,
[src]
S: Data<Elem = A>,
fn div_append<S>(&mut self, a: &mut ArrayBase<S, Ix1>) -> AppendResult<A> where
S: DataMut<Elem = A>,
[src]
S: DataMut<Elem = A>,
fn append<S>(&mut self, a: ArrayBase<S, Ix1>) -> AppendResult<A> where
S: Data<Elem = A>,
[src]
S: Data<Elem = A>,
fn get_q(&self) -> Q<A>
[src]
impl<A: Scalar + Lapack> Orthogonalizer for MGS<A>
[src]
type Elem = A
fn dim(&self) -> usize
[src]
fn len(&self) -> usize
[src]
fn tolerance(&self) -> A::Real
[src]
fn decompose<S>(&self, a: &mut ArrayBase<S, Ix1>) -> Array1<A> where
S: DataMut<Elem = A>,
[src]
S: DataMut<Elem = A>,
fn coeff<S>(&self, a: ArrayBase<S, Ix1>) -> Array1<A> where
A: Lapack,
S: Data<Elem = A>,
[src]
A: Lapack,
S: Data<Elem = A>,
fn append<S>(&mut self, a: ArrayBase<S, Ix1>) -> AppendResult<A> where
A: Lapack,
S: Data<Elem = A>,
[src]
A: Lapack,
S: Data<Elem = A>,
fn div_append<S>(&mut self, a: &mut ArrayBase<S, Ix1>) -> AppendResult<A> where
A: Lapack,
S: DataMut<Elem = A>,
[src]
A: Lapack,
S: DataMut<Elem = A>,