Skip to main content

BacktrackingLineSearch

Struct BacktrackingLineSearch 

Source
pub struct BacktrackingLineSearch {
Show 13 fields 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, pub accept_every_trial_step: bool, pub alpha_for_y: AlphaForY, /* private fields */
}

Fields§

§acceptor: Box<dyn BacktrackingLsAcceptor>§alpha_red_factor: Number§max_soc: i32§kappa_soc: Number

Threshold for the SOC outer-loop convergence test theta_trial <= kappa_soc * theta_soc_old. Mirrors upstream’s kappa_soc (default 0.99).

§soc_method: i32

SOC RHS variant. 0 = upstream default (“old”), 1 = scaled gradient-block variant. Both correspond to upstream’s soc_method option.

§watchdog_shortened_iter_trigger: i32

Number 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: i32

Maximum 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: Number

Lower bound on α; below this we declare a tiny step (mirrors alpha_min_frac flow, IpBacktrackingLineSearch.cpp:CalculateAlphaMin).

§max_trials: i32

Maximum trial-iteration cap before declaring failure.

§soft_resto_pderror_reduction_factor: Number

Required 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: i32

Cap on consecutive soft-resto iterations before full restoration is forced. Mirrors upstream max_soft_resto_iters (default 10).

§accept_every_trial_step: bool

accept_every_trial_step — when true, the alpha loop and filter are bypassed: the FTB-truncated alpha_init/alpha_dual step is set as the trial and accepted unconditionally. Mirrors upstream’s IpBacktrackingLineSearch.cpp:accept_every_trial_step_ short-circuit at the top of FindAcceptableTrialPoint.

§alpha_for_y: AlphaForY

alpha_for_y policy applied to the equality multipliers y_c, y_d when constructing the trial iterate. See AlphaForY.

Implementations§

Source§

impl BacktrackingLineSearch

Source

pub fn new(acceptor: Box<dyn BacktrackingLsAcceptor>) -> Self

Source

pub fn acceptor(&self) -> &dyn BacktrackingLsAcceptor

Source

pub fn acceptor_mut(&mut self) -> &mut dyn BacktrackingLsAcceptor

Source

pub fn reset(&mut self)

Reset the acceptor state at the start of a new outer iteration.

Source

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 in data.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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more