pub struct BacktrackingLineSearch<V: Vector> {
pub tau: V::T,
pub c: V::T,
pub steptol: V::T,
pub max_iter: usize,
pub n_iters: usize,
/* private fields */
}Expand description
Backtracking line search implementation, derived from backtracking line search algorithm in Sundials IDA solver (https://github.com/LLNL/sundials/blob/main/src/ida/ida_ic.c#L480)
Parameters:
- tau: step size reduction factor (0 < tau < 1), default 0.5
- c: Armijo condition constant (0 < c < 1), default 1e-4
- steptol: minimum step size, default eps^(2/3)
- max_iter: maximum number of line search iterations, default 100
- n_iters: number of line search iterations performed during last call
Fields§
§tau: V::T§c: V::T§steptol: V::T§max_iter: usize§n_iters: usizeTrait Implementations§
Source§impl<V: Vector> Default for BacktrackingLineSearch<V>
impl<V: Vector> Default for BacktrackingLineSearch<V>
Source§impl<V: Vector> LineSearch<V> for BacktrackingLineSearch<V>
impl<V: Vector> LineSearch<V> for BacktrackingLineSearch<V>
Source§fn take_optimal_step(
&mut self,
x: &mut V,
delta: &mut V,
error_y: &V,
fun: &impl Fn(&V, &mut V),
linear_solver: &impl Fn(&mut V) -> Result<(), DiffsolError>,
convergence: &mut Convergence<'_, V>,
) -> Result<ConvergenceStatus, DiffsolError>
fn take_optimal_step( &mut self, x: &mut V, delta: &mut V, error_y: &V, fun: &impl Fn(&V, &mut V), linear_solver: &impl Fn(&mut V) -> Result<(), DiffsolError>, convergence: &mut Convergence<'_, V>, ) -> Result<ConvergenceStatus, DiffsolError>
Take the optimal step for the current iteration Read more
Auto Trait Implementations§
impl<V> Freeze for BacktrackingLineSearch<V>
impl<V> RefUnwindSafe for BacktrackingLineSearch<V>
impl<V> Send for BacktrackingLineSearch<V>
impl<V> Sync for BacktrackingLineSearch<V>where
V: Sync,
impl<V> Unpin for BacktrackingLineSearch<V>
impl<V> UnsafeUnpin for BacktrackingLineSearch<V>
impl<V> UnwindSafe for BacktrackingLineSearch<V>
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.