pub struct BacktrackingLineSearch {
pub acceptor: Box<dyn BacktrackingLsAcceptor>,
pub alpha_red_factor: Number,
pub max_soc: i32,
pub kappa_soc: Number,
pub soc_method: i32,
pub watchdog_shortened_iter_trigger: i32,
pub watchdog_trial_iter_max: i32,
pub alpha_min: Number,
pub max_trials: i32,
pub soft_resto_pderror_reduction_factor: Number,
pub max_soft_resto_iters: i32,
/* private fields */
}Fields§
§acceptor: Box<dyn BacktrackingLsAcceptor>§alpha_red_factor: Number§max_soc: i32§kappa_soc: NumberThreshold for the SOC outer-loop convergence test
theta_trial <= kappa_soc * theta_soc_old. Mirrors upstream’s
kappa_soc (default 0.99).
soc_method: i32SOC RHS variant. 0 = upstream default (“old”), 1 = scaled
gradient-block variant. Both correspond to upstream’s
soc_method option.
watchdog_shortened_iter_trigger: i32Number of consecutive shortened iterations before the watchdog
procedure activates. Disabled when <= 0. Mirrors upstream’s
watchdog_shortened_iter_trigger (default 10).
watchdog_trial_iter_max: i32Maximum number of outer iterations the watchdog will accept
non-decreasing trial points before reverting to the snapshot.
Mirrors upstream’s watchdog_trial_iter_max (default 3).
alpha_min: NumberLower bound on α; below this we declare a tiny step (mirrors
alpha_min_frac flow, IpBacktrackingLineSearch.cpp:CalculateAlphaMin).
max_trials: i32Maximum trial-iteration cap before declaring failure.
soft_resto_pderror_reduction_factor: NumberRequired relative reduction in the primal-dual system error for
a soft-resto step to be accepted. 0 disables soft restoration.
Mirrors upstream soft_resto_pderror_reduction_factor
(default 1 - 1e-4).
max_soft_resto_iters: i32Cap on consecutive soft-resto iterations before full
restoration is forced. Mirrors upstream max_soft_resto_iters
(default 10).
Implementations§
Source§impl BacktrackingLineSearch
impl BacktrackingLineSearch
pub fn new(acceptor: Box<dyn BacktrackingLsAcceptor>) -> Self
pub fn acceptor(&self) -> &dyn BacktrackingLsAcceptor
pub fn acceptor_mut(&mut self) -> &mut dyn BacktrackingLsAcceptor
Sourcepub fn find_acceptable_trial_point(
&mut self,
data: &IpoptDataHandle,
cq: &IpoptCqHandle,
delta: &IteratesVector,
alpha_init: Number,
alpha_dual: Number,
nlp: Option<&Rc<RefCell<dyn IpoptNlp>>>,
search_dir: Option<&mut PdSearchDirCalc>,
) -> Outcome
pub fn find_acceptable_trial_point( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, delta: &IteratesVector, alpha_init: Number, alpha_dual: Number, nlp: Option<&Rc<RefCell<dyn IpoptNlp>>>, search_dir: Option<&mut PdSearchDirCalc>, ) -> Outcome
Public line-search entry point. Wraps the regular filter line
search (Self::run_filter_line_search) with the soft
restoration phase — port of the in_soft_resto_phase_ state
machine in IpBacktrackingLineSearch::FindAcceptableTrialPoint
(IpBacktrackingLineSearch.cpp:439-465 for the in-phase
continuation, :528-556 for entering the phase).
Outcomes:
Accepted: a trial point is indata.trial— either a regular filter/watchdog step or a soft-resto step (info char ‘s’ = stay in soft resto, ‘S’ = step also satisfies the original filter so soft resto is left).TinyStep/Failed: neither the regular line search nor a soft-resto step could make progress; the caller hands off to the full restoration phase.
Auto Trait Implementations§
impl Freeze for BacktrackingLineSearch
impl !RefUnwindSafe for BacktrackingLineSearch
impl !Send for BacktrackingLineSearch
impl !Sync for BacktrackingLineSearch
impl Unpin for BacktrackingLineSearch
impl UnsafeUnpin for BacktrackingLineSearch
impl !UnwindSafe for BacktrackingLineSearch
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
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>
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>
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 more