pub struct ConjugateGradient<T: RealScalar = f64, B: LinearAlgebra<T> = NalgebraProvider, L = StrongWolfeLineSearch<T, B>> { /* private fields */ }Expand description
Scalar- and linear-algebra-generic nonlinear conjugate-gradient optimizer.
Trait Implementations§
Source§impl<T, B, L, P, U, E> Algorithm<P, GradientStatus<T, B>, U, E> for ConjugateGradient<T, B, L>where
T: RealScalar,
B: LinearAlgebra<T> + PseudoInverse<T>,
P: Gradient<T, B, U, E>,
L: for<'a> LineSearch<T, B, TransformedProblem<'a, P, T, B>, U, E> + Clone + Default + Send + Sync,
impl<T, B, L, P, U, E> Algorithm<P, GradientStatus<T, B>, U, E> for ConjugateGradient<T, B, L>where
T: RealScalar,
B: LinearAlgebra<T> + PseudoInverse<T>,
P: Gradient<T, B, U, E>,
L: for<'a> LineSearch<T, B, TransformedProblem<'a, P, T, B>, U, E> + Clone + Default + Send + Sync,
Source§type Summary = MinimizationSummary<T, B>
type Summary = MinimizationSummary<T, B>
A type which holds a summary of the algorithm’s ending state.
Source§type Config = ConjugateGradientConfig<T, B, L>
type Config = ConjugateGradientConfig<T, B, L>
The configuration struct for the algorithm.
Source§fn initialize(
&mut self,
problem: &P,
status: &mut GradientStatus<T, B>,
args: &U,
init: &Self::Init,
config: &Self::Config,
) -> Result<(), E>
fn initialize( &mut self, problem: &P, status: &mut GradientStatus<T, B>, args: &U, init: &Self::Init, config: &Self::Config, ) -> Result<(), E>
Any setup work done before the main steps of the algorithm should be done here. Read more
Source§fn step(
&mut self,
_current_step: usize,
problem: &P,
status: &mut GradientStatus<T, B>,
args: &U,
config: &Self::Config,
) -> Result<(), E>
fn step( &mut self, _current_step: usize, problem: &P, status: &mut GradientStatus<T, B>, args: &U, config: &Self::Config, ) -> Result<(), E>
The main “step” of an algorithm, which is repeated until termination conditions are met or
the max number of steps have been taken. Read more
Source§fn postprocessing(
&mut self,
problem: &P,
status: &mut GradientStatus<T, B>,
args: &U,
config: &Self::Config,
) -> Result<(), E>
fn postprocessing( &mut self, problem: &P, status: &mut GradientStatus<T, B>, args: &U, config: &Self::Config, ) -> Result<(), E>
Source§fn summarize(
&self,
_current_step: usize,
_problem: &P,
status: &GradientStatus<T, B>,
_args: &U,
init: &Self::Init,
config: &Self::Config,
) -> Result<Self::Summary, E>
fn summarize( &self, _current_step: usize, _problem: &P, status: &GradientStatus<T, B>, _args: &U, init: &Self::Init, config: &Self::Config, ) -> Result<Self::Summary, E>
Generates a new
Algorithm::Summary from the current state of the Algorithm, which can be displayed or used elsewhere. Read moreSource§fn default_callbacks() -> Callbacks<Self, P, GradientStatus<T, B>, U, E, Self::Config>
fn default_callbacks() -> Callbacks<Self, P, GradientStatus<T, B>, U, E, Self::Config>
Provides a set of reasonable default callbacks specific to this
Algorithm.Source§fn process<I, C>(
&mut self,
problem: &P,
args: &U,
init: I,
config: Self::Config,
callbacks: C,
) -> Result<Self::Summary, E>
fn process<I, C>( &mut self, problem: &P, args: &U, init: I, config: Self::Config, callbacks: C, ) -> Result<Self::Summary, E>
Source§impl<T: Clone + RealScalar, B: Clone + LinearAlgebra<T>, L: Clone> Clone for ConjugateGradient<T, B, L>
impl<T: Clone + RealScalar, B: Clone + LinearAlgebra<T>, L: Clone> Clone for ConjugateGradient<T, B, L>
Source§fn clone(&self) -> ConjugateGradient<T, B, L>
fn clone(&self) -> ConjugateGradient<T, B, L>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + RealScalar, B: Debug + LinearAlgebra<T>, L: Debug> Debug for ConjugateGradient<T, B, L>
impl<T: Debug + RealScalar, B: Debug + LinearAlgebra<T>, L: Debug> Debug for ConjugateGradient<T, B, L>
Source§impl<T, B, L> Default for ConjugateGradient<T, B, L>
impl<T, B, L> Default for ConjugateGradient<T, B, L>
Source§impl<T, B, L, P, U, E> Terminator<ConjugateGradient<T, B, L>, P, GradientStatus<T, B>, U, E, ConjugateGradientConfig<T, B, L>> for ConjugateGradientGTerminator<T>where
T: RealScalar,
B: LinearAlgebra<T> + PseudoInverse<T>,
P: Gradient<T, B, U, E>,
L: for<'a> LineSearch<T, B, TransformedProblem<'a, P, T, B>, U, E> + Clone + Default + Send + Sync,
impl<T, B, L, P, U, E> Terminator<ConjugateGradient<T, B, L>, P, GradientStatus<T, B>, U, E, ConjugateGradientConfig<T, B, L>> for ConjugateGradientGTerminator<T>where
T: RealScalar,
B: LinearAlgebra<T> + PseudoInverse<T>,
P: Gradient<T, B, U, E>,
L: for<'a> LineSearch<T, B, TransformedProblem<'a, P, T, B>, U, E> + Clone + Default + Send + Sync,
Source§fn check_for_termination(
&mut self,
_current_step: usize,
algorithm: &mut ConjugateGradient<T, B, L>,
_problem: &P,
status: &mut GradientStatus<T, B>,
_args: &U,
_config: &ConjugateGradientConfig<T, B, L>,
) -> ControlFlow<()>
fn check_for_termination( &mut self, _current_step: usize, algorithm: &mut ConjugateGradient<T, B, L>, _problem: &P, status: &mut GradientStatus<T, B>, _args: &U, _config: &ConjugateGradientConfig<T, B, L>, ) -> ControlFlow<()>
A termination check which is called on each step of an
Algorithm.Auto Trait Implementations§
impl<T, B, L> Freeze for ConjugateGradient<T, B, L>
impl<T, B, L> RefUnwindSafe for ConjugateGradient<T, B, L>where
T: RefUnwindSafe,
L: RefUnwindSafe,
<B as LinearAlgebra<T>>::VectorStorage: RefUnwindSafe,
B: RefUnwindSafe,
impl<T, B, L> Send for ConjugateGradient<T, B, L>where
L: Send,
impl<T, B, L> Sync for ConjugateGradient<T, B, L>where
L: Sync,
impl<T, B, L> Unpin for ConjugateGradient<T, B, L>
impl<T, B, L> UnsafeUnpin for ConjugateGradient<T, B, L>
impl<T, B, L> UnwindSafe for ConjugateGradient<T, B, L>where
T: UnwindSafe,
L: UnwindSafe,
<B as LinearAlgebra<T>>::VectorStorage: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.