Struct iterative_methods::conjugate_gradient::ConjugateGradient [−][src]
pub struct ConjugateGradient {}
Expand description
Store the state of a conjugate gradient computation.
This implementation deviates from the pseudocode given in this
module slightly: the prelude to the loop is run in initialization,
and advance implements the loop. Since advance is always called
before get, the currently calculated quantities (suffixed by _k
)
are one step ahead of what we should return. Thus we store and
return the previous calculated quantities (suffixed _km
for “k
minus one”). Also, once denominators are very close to zero we
stop to avoid numerical instabilities.
Fields
a: M
Problem data
b: V
x_k: V
Latest iterate (might numerically deteriorate)
solution: V
x_{k-1}: this is the solution we guard from numerical issues and should be reported.
r_k: V
Residual
p_k: V
alpha_k: S
beta_k: S
r_k2: S
||r_k||^2
r_km2: S
||r_{k-1}||^2 : one measure of residual of the reported solution.
ap_k: V
Ap_k
pap_k: S
||p_k||_A^2 = p_k.TAp_k
pap_km: S
||p_{k-1}||_A^2: another measure of error of the reported solution.
Implementations
impl ConjugateGradient
[src]
impl ConjugateGradient
[src]pub fn for_problem(p: &LinearSystem) -> ConjugateGradient
[src]
pub fn for_problem(p: &LinearSystem) -> ConjugateGradient
[src]Initialize a conjugate gradient iterative solver to solve linear system p
.
Trait Implementations
impl Clone for ConjugateGradient
[src]
impl Clone for ConjugateGradient
[src]fn clone(&self) -> ConjugateGradient
[src]
fn clone(&self) -> ConjugateGradient
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ConjugateGradient
[src]
impl Debug for ConjugateGradient
[src]impl StreamingIterator for ConjugateGradient
[src]
impl StreamingIterator for ConjugateGradient
[src]type Item = Self
type Item = Self
The type of the elements being iterated over.
fn get(&self) -> Option<&Self::Item>
[src]
fn get(&self) -> Option<&Self::Item>
[src]Returns a reference to the current element of the iterator. Read more
fn next(&mut self) -> Option<&Self::Item>
[src]
fn next(&mut self) -> Option<&Self::Item>
[src]Advances the iterator and returns the next value. Read more
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]Returns the bounds on the remaining length of the iterator.
fn all<F>(&mut self, f: F) -> bool where
F: FnMut(&Self::Item) -> bool,
[src]
fn all<F>(&mut self, f: F) -> bool where
F: FnMut(&Self::Item) -> bool,
[src]Determines if all elements of the iterator satisfy a predicate.
fn any<F>(&mut self, f: F) -> bool where
F: FnMut(&Self::Item) -> bool,
[src]
fn any<F>(&mut self, f: F) -> bool where
F: FnMut(&Self::Item) -> bool,
[src]Determines if any elements of the iterator satisfy a predicate.
fn chain<I>(self, other: I) -> Chain<Self, I> where
I: StreamingIterator<Item = Self::Item>,
[src]
fn chain<I>(self, other: I) -> Chain<Self, I> where
I: StreamingIterator<Item = Self::Item>,
[src]Consumes two iterators and returns a new iterator that iterates over both in sequence.
fn cloned(self) -> Cloned<Self> where
Self::Item: Clone,
[src]
fn cloned(self) -> Cloned<Self> where
Self::Item: Clone,
[src]Produces a normal, non-streaming, iterator by cloning the elements of this iterator.
fn count(self) -> usize
[src]
fn count(self) -> usize
[src]Consumes the iterator, counting the number of remaining elements and returning it.
fn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
[src]
fn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
[src]Creates an iterator which uses a closure to determine if an element should be yielded.
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F> where
F: FnMut(&Self::Item) -> Option<B>,
[src]
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F> where
F: FnMut(&Self::Item) -> Option<B>,
[src]Creates an iterator which both filters and maps by applying a closure to elements.
fn flat_map<J, F>(self, f: F) -> FlatMap<Self, J, F> where
F: FnMut(&Self::Item) -> J,
J: StreamingIterator,
[src]
fn flat_map<J, F>(self, f: F) -> FlatMap<Self, J, F> where
F: FnMut(&Self::Item) -> J,
J: StreamingIterator,
[src]Creates an iterator which flattens iterators obtained by applying a closure to elements. Note that the returned iterators must be streaming iterators. Read more
fn filter_map_deref<B, F>(self, f: F) -> FilterMapDeref<Self, F> where
F: FnMut(&Self::Item) -> Option<B>,
[src]
fn filter_map_deref<B, F>(self, f: F) -> FilterMapDeref<Self, F> where
F: FnMut(&Self::Item) -> Option<B>,
[src]Creates a regular, non-streaming iterator which both filters and maps by applying a closure to elements.
fn find<F>(&mut self, f: F) -> Option<&Self::Item> where
F: FnMut(&Self::Item) -> bool,
[src]
fn find<F>(&mut self, f: F) -> Option<&Self::Item> where
F: FnMut(&Self::Item) -> bool,
[src]Returns the first element of the iterator that satisfies the predicate.
fn fuse(self) -> Fuse<Self>
[src]
fn fuse(self) -> Fuse<Self>
[src]Creates an iterator which is “well behaved” at the beginning and end of iteration. Read more
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnMut(&Self::Item),
[src]
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnMut(&Self::Item),
[src]Call a closure on each element, passing the element on.
The closure is called upon calls to advance
or advance_back
, and exactly once per element
regardless of how many times (if any) get
is called. Read more
fn map<B, F>(self, f: F) -> Map<Self, B, F> where
F: FnMut(&Self::Item) -> B,
[src]
fn map<B, F>(self, f: F) -> Map<Self, B, F> where
F: FnMut(&Self::Item) -> B,
[src]Creates an iterator which transforms elements of this iterator by passing them to a closure.
fn map_deref<B, F>(self, f: F) -> MapDeref<Self, F> where
F: FnMut(&Self::Item) -> B,
[src]
fn map_deref<B, F>(self, f: F) -> MapDeref<Self, F> where
F: FnMut(&Self::Item) -> B,
[src]Creates a regular, non-streaming iterator which transforms elements of this iterator by passing them to a closure.
fn map_ref<B, F>(self, f: F) -> MapRef<Self, F> where
F: Fn(&Self::Item) -> &B,
B: ?Sized,
[src]
fn map_ref<B, F>(self, f: F) -> MapRef<Self, F> where
F: Fn(&Self::Item) -> &B,
B: ?Sized,
[src]Creates an iterator which transforms elements of this iterator by passing them to a closure. Read more
fn nth(&mut self, n: usize) -> Option<&Self::Item>
[src]
fn nth(&mut self, n: usize) -> Option<&Self::Item>
[src]Consumes the first n
elements of the iterator, returning the next one.
fn position<F>(&mut self, f: F) -> Option<usize> where
F: FnMut(&Self::Item) -> bool,
[src]
fn position<F>(&mut self, f: F) -> Option<usize> where
F: FnMut(&Self::Item) -> bool,
[src]Returns the index of the first element of the iterator matching a predicate.
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
[src]
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
[src]Creates an iterator that skips initial elements matching a predicate.
fn take(self, n: usize) -> Take<Self>
[src]
fn take(self, n: usize) -> Take<Self>
[src]Creates an iterator which only returns the first n
elements.
fn take_while<F>(self, f: F) -> TakeWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
[src]
fn take_while<F>(self, f: F) -> TakeWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
[src]Creates an iterator which only returns initial elements matching a predicate.
fn rev(self) -> Rev<Self> where
Self: DoubleEndedStreamingIterator,
[src]
fn rev(self) -> Rev<Self> where
Self: DoubleEndedStreamingIterator,
[src]Creates an iterator which returns elemens in the opposite order.
Auto Trait Implementations
impl RefUnwindSafe for ConjugateGradient
impl Send for ConjugateGradient
impl Sync for ConjugateGradient
impl Unpin for ConjugateGradient
impl UnwindSafe for ConjugateGradient
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,