Skip to main content

IpoptAlgorithm

Struct IpoptAlgorithm 

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

kappa_sigma for the post-AcceptTrialPoint multiplier reset (IpIpoptAlg.cpp:correct_bound_multiplier, line 1055-1134).

§max_iter: Index§alpha_init: Number

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

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

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

Companion 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: bool

Set 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: Index

Number of invoke_restoration entries.

§resto_inner_iters: Index

Sum of inner-IPM iter counts across every restoration call.

§resto_outer_iters: Index

Number of outer iters that ran in restoration mode (R-line equivalents in print_level=5 output).

§resto_wall_secs: Number

Cumulative wall-clock seconds spent inside perform_restoration.

§print_iter_output: bool

When 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

Source

pub fn new( data: IpoptDataHandle, cq: IpoptCqHandle, bundle: AlgorithmBundle, ) -> Self

Source

pub fn with_nlp(self, nlp: Rc<RefCell<dyn IpoptNlp>>) -> Self

Source

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().

Source

pub fn with_search_dir(self, sd: PdSearchDirCalc) -> Self

Source

pub fn with_restoration(self, resto: Box<dyn RestorationPhase>) -> Self

Source

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.

Source

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§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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