Struct argmin::solver::conjugategradient::cg::ConjugateGradient
source · [−]pub struct ConjugateGradient<P, S> { /* private fields */ }
Expand description
The conjugate gradient method is a solver for systems of linear equations with a symmetric and positive-definite matrix.
References:
[0] Jorge Nocedal and Stephen J. Wright (2006). Numerical Optimization. Springer. ISBN 0-387-30303-0.
Implementations
sourceimpl<P, S> ConjugateGradient<P, S> where
P: Clone + Default,
S: Default,
impl<P, S> ConjugateGradient<P, S> where
P: Clone + Default,
S: Default,
sourcepub fn new(b: P) -> Result<Self, Error>
pub fn new(b: P) -> Result<Self, Error>
Constructor
Parameters:
b
: right hand side of A * x = b
sourcepub fn p(&self) -> P
pub fn p(&self) -> P
Return the current search direction (This is needed by NewtonCG for instance)
Trait Implementations
sourceimpl<P: Clone, S: Clone> Clone for ConjugateGradient<P, S>
impl<P: Clone, S: Clone> Clone for ConjugateGradient<P, S>
sourcefn clone(&self) -> ConjugateGradient<P, S>
fn clone(&self) -> ConjugateGradient<P, S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'de, P, S> Deserialize<'de> for ConjugateGradient<P, S> where
P: Deserialize<'de>,
S: Default,
impl<'de, P, S> Deserialize<'de> for ConjugateGradient<P, S> where
P: Deserialize<'de>,
S: Default,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<P, S> Serialize for ConjugateGradient<P, S> where
P: Serialize,
impl<P, S> Serialize for ConjugateGradient<P, S> where
P: Serialize,
sourceimpl<P, O, S, F> Solver<O> for ConjugateGradient<P, S> where
O: ArgminOp<Param = P, Output = P, Float = F>,
P: Clone + Serialize + DeserializeOwned + ArgminDot<O::Param, S> + ArgminSub<O::Param, O::Param> + ArgminScaledAdd<O::Param, S, O::Param> + ArgminAdd<O::Param, O::Param> + ArgminConj + ArgminMul<O::Float, O::Param>,
S: Debug + ArgminDiv<S, S> + ArgminNorm<O::Float> + ArgminConj,
F: ArgminFloat,
impl<P, O, S, F> Solver<O> for ConjugateGradient<P, S> where
O: ArgminOp<Param = P, Output = P, Float = F>,
P: Clone + Serialize + DeserializeOwned + ArgminDot<O::Param, S> + ArgminSub<O::Param, O::Param> + ArgminScaledAdd<O::Param, S, O::Param> + ArgminAdd<O::Param, O::Param> + ArgminConj + ArgminMul<O::Float, O::Param>,
S: Debug + ArgminDiv<S, S> + ArgminNorm<O::Float> + ArgminConj,
F: ArgminFloat,
sourcefn next_iter(
&mut self,
op: &mut OpWrapper<O>,
state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
fn next_iter(
&mut self,
op: &mut OpWrapper<O>,
state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
Perform one iteration of CG algorithm
sourcefn init(
&mut self,
op: &mut OpWrapper<O>,
state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>
fn init(
&mut self,
op: &mut OpWrapper<O>,
state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>
Initializes the algorithm Read more
sourcefn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason
fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason
Checks whether basic termination reasons apply. Read more
sourcefn terminate(&mut self, _state: &IterState<O>) -> TerminationReason
fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason
Checks whether the algorithm must be terminated
Auto Trait Implementations
impl<P, S> RefUnwindSafe for ConjugateGradient<P, S> where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for ConjugateGradient<P, S> where
P: Send,
S: Send,
impl<P, S> Sync for ConjugateGradient<P, S> where
P: Sync,
S: Sync,
impl<P, S> Unpin for ConjugateGradient<P, S> where
P: Unpin,
S: Unpin,
impl<P, S> UnwindSafe for ConjugateGradient<P, S> where
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more