pub struct IpoptAlgorithm {Show 19 fields
pub data: IpoptDataHandle,
pub cq: IpoptCqHandle,
pub bundle: AlgorithmBundle,
pub nlp: Option<Rc<RefCell<dyn IpoptNlp>>>,
pub tnlp: Option<Rc<RefCell<dyn TNLP>>>,
pub search_dir: Option<PdSearchDirCalc>,
pub restoration: Option<Box<dyn RestorationPhase>>,
pub kappa_sigma: Number,
pub max_iter: Index,
pub alpha_init: Number,
pub tiny_step_tol: Number,
pub diverging_iterates_tol: Number,
pub tiny_step_y_tol: Number,
pub tiny_step_last_iteration: bool,
pub resto_calls: Index,
pub resto_inner_iters: Index,
pub resto_outer_iters: Index,
pub resto_wall_secs: Number,
pub print_iter_output: bool,
/* private fields */
}Fields§
§data: IpoptDataHandle§cq: IpoptCqHandle§bundle: AlgorithmBundle§nlp: Option<Rc<RefCell<dyn IpoptNlp>>>Optional NLP handle. Required for any step that evaluates problem functions or pulls bound expansion matrices (init, search direction, line-search trial-point evaluation). Absent in the structural unit tests of Phases 5-6.
tnlp: Option<Rc<RefCell<dyn TNLP>>>Optional TNLP handle — the user-facing problem. When present,
iterate() fires TNLP::intermediate_callback once per outer
iteration so callers can monitor progress or request early
termination (returning false from the callback surfaces as
SolverReturn::UserRequestedStop). Kept separate from nlp
because the algorithm-side NLP is the compressed OrigIpoptNlp
view (fixed-variable elimination, c/d split) while the callback
payload needs to expose the original-coordinate iterate.
search_dir: Option<PdSearchDirCalc>Search-direction calculator (PdSearchDirCalc). Lands once a
concrete SymLinearSolver backend (MUMPS / FERAL) is wired
through AlgBuilder in Phase 7’s tail.
restoration: Option<Box<dyn RestorationPhase>>Restoration-phase strategy. Invoked when the line search
returns Outcome::Failed (port of upstream
IpBacktrackingLineSearch::ActivateLineSearch’s resto
fallback). Optional: in its absence, line-search failure maps
directly to SolverReturn::RestorationFailure so the main
loop’s exit-code semantics match upstream’s “no resto built”
case.
kappa_sigma: Numberkappa_sigma for the post-AcceptTrialPoint multiplier reset
(IpIpoptAlg.cpp:correct_bound_multiplier, line 1055-1134).
max_iter: Index§alpha_init: NumberInitial primal step length offered to the line search at the
top of each iteration. Mirrors IpBacktrackingLineSearch’s
fraction-to-the-boundary primal step (with τ = data.curr_tau).
In v1.0 the structural value here is 1.0 and the FTB cap is
applied per-component when the line-search driver computes
trial slacks; the simplification holds for non-degenerate runs.
tiny_step_tol: NumberTiny-step relative tolerance — port of upstream
IpBacktrackingLineSearch::tiny_step_tol_ (default 10·EPSILON).
Step is “tiny” when max_i |δx_i|/(1+|x_i|) ≤ tiny_step_tol
(and same for s, and c_viol ≤ 1e-4).
diverging_iterates_tol: NumberPort of upstream IpIpoptAlg.cpp divergence guard: when
max_i |x_i| exceeds this threshold the optimization aborts with
SolverReturn::DivergingIterates. Default 1e20 matches the
registered diverging_iterates_tol option. Catches MESH and
similar cases where the normal-mode IPM heads off to infinity
(orig f to ±1e33 by iter 90) before line-search failure forces
a degenerate restoration entry.
tiny_step_y_tol: NumberCompanion threshold on the dual step — when both primal and dual
steps are tiny in two consecutive iterations the algorithm
declares convergence at the best attainable accuracy. Default
1e-2 matches upstream.
tiny_step_last_iteration: boolSet true when the previous iterate was tagged tiny; on the
second consecutive tiny step the loop sets data.tiny_step_flag
so the mu update can attempt to terminate. Mirrors
IpBacktrackingLineSearch::tiny_step_last_iteration_.
resto_calls: IndexNumber of invoke_restoration entries.
resto_inner_iters: IndexSum of inner-IPM iter counts across every restoration call.
resto_outer_iters: IndexNumber of outer iters that ran in restoration mode (R-line
equivalents in print_level=5 output).
resto_wall_secs: NumberCumulative wall-clock seconds spent inside perform_restoration.
print_iter_output: boolWhen false, the per-iteration table that iterate() writes
straight to stdout is suppressed. Wired from
IpoptApplication’s print_level option: level 0 turns this
off (matches upstream’s “no console output” contract). Default
true so CLI / direct-driver users keep the familiar trace.
Implementations§
Source§impl IpoptAlgorithm
impl IpoptAlgorithm
pub fn new( data: IpoptDataHandle, cq: IpoptCqHandle, bundle: AlgorithmBundle, ) -> Self
pub fn with_nlp(self, nlp: Rc<RefCell<dyn IpoptNlp>>) -> Self
Sourcepub fn with_tnlp(self, tnlp: Rc<RefCell<dyn TNLP>>) -> Self
pub fn with_tnlp(self, tnlp: Rc<RefCell<dyn TNLP>>) -> Self
Install a user-facing TNLP handle. Enables per-iteration
TNLP::intermediate_callback invocation from optimize().
pub fn with_search_dir(self, sd: PdSearchDirCalc) -> Self
pub fn with_restoration(self, resto: Box<dyn RestorationPhase>) -> Self
Sourcepub fn with_diagnostics(self, diag: Rc<DiagnosticsState>) -> Self
pub fn with_diagnostics(self, diag: Rc<DiagnosticsState>) -> Self
Install the shared diagnostics state. The state is propagated
to the augmented-system solver at the top of Self::optimize
so dump sites can consult per-iter gating.
Sourcepub fn with_debug_hook(self, hook: Rc<RefCell<dyn DebugHook>>) -> Self
pub fn with_debug_hook(self, hook: Rc<RefCell<dyn DebugHook>>) -> Self
Install an interactive debugger hook. Fired at each checkpoint
in Self::optimize; returning crate::debug::DebugAction::Stop
ends the solve with SolverReturn::UserRequestedStop.
Sourcepub fn debug_hook(&self) -> Option<Rc<RefCell<dyn DebugHook>>>
pub fn debug_hook(&self) -> Option<Rc<RefCell<dyn DebugHook>>>
Shared handle to the installed debugger, if any — used to forward it into the restoration inner IPM.
Sourcepub fn optimize(&mut self) -> SolverReturn
pub fn optimize(&mut self) -> SolverReturn
Outer entry point — port of IpoptAlgorithm::Optimize(). Calls
the iterate-initializer once, then loops iterate() until a
terminal status. The exception → SolverReturn mapping
(TINY_STEP_DETECTED → STEP_BECOMES_TINY,
RESTORATION_FAILED → RESTORATION_FAILURE, etc.) lands in
Phase 9 alongside the restoration phase.
Auto Trait Implementations§
impl !RefUnwindSafe for IpoptAlgorithm
impl !Send for IpoptAlgorithm
impl !Sync for IpoptAlgorithm
impl !UnwindSafe for IpoptAlgorithm
impl Freeze for IpoptAlgorithm
impl Unpin for IpoptAlgorithm
impl UnsafeUnpin for IpoptAlgorithm
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
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>
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