pub struct LmHooks<'a> {
pub deadline: Option<Deadline>,
pub on_iterate: Option<&'a mut dyn FnMut(&LmIterate<'_>) -> bool>,
}Expand description
What the LM consults besides the model: a time budget and a per-iterate
observer. LmHooks::default is neither.
Fields§
§deadline: Option<Deadline>Checked once per iterate, after the convergence test and before the next step, so an iterate that already passes is never thrown away for being late — the same order as the IPM’s convergence check.
on_iterate: Option<&'a mut dyn FnMut(&LmIterate<'_>) -> bool>Called at every iterate, the start included, before the
convergence test (the IPM’s order: upstream’s
OptimalityErrorConvergenceCheck fires the intermediate callback
first). Returning false stops the method with
LmStatus::UserRequestedStop.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LmHooks<'a>
impl<'a> !Send for LmHooks<'a>
impl<'a> !Sync for LmHooks<'a>
impl<'a> !UnwindSafe for LmHooks<'a>
impl<'a> Freeze for LmHooks<'a>
impl<'a> Unpin for LmHooks<'a>
impl<'a> UnsafeUnpin for LmHooks<'a>
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
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more