pub struct DefaultIterateInitializer {
pub bound_push: Number,
pub bound_frac: Number,
pub slack_bound_push: Number,
pub slack_bound_frac: Number,
pub constr_mult_init_max: Number,
pub bound_mult_init_val: Number,
pub bound_mult_init_method: String,
pub eq_mult_calculator: Option<Box<dyn EqMultCalculator>>,
pub least_square_init_primal: bool,
pub least_square_init_max_trials: Index,
pub least_square_init_accept_ratio: Number,
pub last_least_square_report: Option<LeastSquareInitReport>,
}Fields§
§bound_push: Number§bound_frac: Number§slack_bound_push: Number§slack_bound_frac: Number§constr_mult_init_max: Number§bound_mult_init_val: Number§bound_mult_init_method: Stringbound_mult_init_method. Must be "constant" — upstream’s
"mu-based" is registered for ipopt.opt compatibility but not
implemented, and set_initial_iterates returns false on it
rather than serving a third, undocumented behaviour (gh#604).
eq_mult_calculator: Option<Box<dyn EqMultCalculator>>Equality-multiplier calculator used by the
least_square_mults step at the end of set_initial_iterates,
matching upstream IpDefaultIterateInitializer.cpp:334-341. If
None, the LS step is skipped (y_c, y_d remain at zero).
least_square_init_primal: boolleast_square_init_primal — port of
IpDefaultIterateInitializer.cpp:200-222. When on, the
initializer replaces the user’s starting x with the min-norm
solution of the linearized equality + inequality constraints,
then pushes that to the interior. Used by the Mehrotra cascade
(IpIpoptAlg.cpp:182) to dramatically reduce iter-0 primal
infeasibility on LP-shaped problems.
least_square_init_max_trials: Indexleast_square_init_primal_max_trials — how many backtracking
trials the safeguard in Self::safeguarded_least_square_x may
take before it gives up and keeps the user’s point. Each trial
costs one constraint evaluation (c and d); none of them
costs a Jacobian or a KKT solve, because the step direction is
computed once and only its length changes.
least_square_init_accept_ratio: NumberArmijo-style acceptance ratio for the safeguard: a trial at
step fraction alpha is accepted when the true nonlinear
violation satisfies theta(alpha) <= (1 - eta*alpha) * theta_0,
i.e. when the actual feasibility reduction is at least eta
times the reduction the linearization predicted.
last_least_square_report: Option<LeastSquareInitReport>Diagnostics from the most recent safeguarded least-square
initialization: initial/final violation, accepted step norm,
rejected trial count, termination reason. None when the step
was never attempted.
Implementations§
Source§impl DefaultIterateInitializer
impl DefaultIterateInitializer
pub fn new() -> Self
pub fn with_eq_mult_calculator(eq_mult: Box<dyn EqMultCalculator>) -> Self
Sourcepub fn accepts_trial(
theta_0: Number,
theta: Number,
alpha: Number,
eta: Number,
) -> bool
pub fn accepts_trial( theta_0: Number, theta: Number, alpha: Number, eta: Number, ) -> bool
The safeguard’s accept test, as a pure predicate of the four numbers it actually reads.
A trial at step fraction alpha whose true nonlinear violation
is theta is accepted when
theta <= (1 - eta*alpha) * theta_0 — the linear model predicts
theta -> 0 at alpha = 1, so the predicted reduction at
alpha is alpha * theta_0 and the test is exactly “the actual
reduction is at least eta times the predicted one”. The
trailing theta < theta_0 makes the contract independent of
eta: however small eta is set, a trial that does not strictly
reduce the violation is never accepted.
Split out of the trial loop for gh#616, whose conclusion rests on
what this predicate can express. eta is confined to (0, 1]
— at eta > 1 the alpha = 1 trial would demand a negative
violation and the full step could never be taken — and over that
whole range the reachable rejections are bounded. The tests in
tests/issue_616_ls_init_accept_test.rs pin the consequence: no
eta rejects eigenb2’s accepted trial, so retuning eta is
not a route to its old SolveSucceeded status.
pub fn push_to_interior( bound_push: Number, bound_frac: Number, x: Number, lower: Option<Number>, upper: Option<Number>, ) -> Number
Trait Implementations§
Source§impl Default for DefaultIterateInitializer
impl Default for DefaultIterateInitializer
Source§impl IterateInitializer for DefaultIterateInitializer
impl IterateInitializer for DefaultIterateInitializer
Source§fn least_square_report(&self) -> Option<LeastSquareInitReport>
fn least_square_report(&self) -> Option<LeastSquareInitReport>
least_square_init_primal
step (gh#605): initial/final nonlinear violation, accepted step
norm, rejected-trial count, termination reason. None for
initializers that do not run that step, or when it was not
attempted on this solve.Source§fn set_initial_iterates(
&mut self,
data: &IpoptDataHandle,
cq: &IpoptCqHandle,
nlp: &Rc<RefCell<dyn IpoptNlp>>,
aug_solver: &mut dyn AugSystemSolver,
) -> bool
fn set_initial_iterates( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, aug_solver: &mut dyn AugSystemSolver, ) -> bool
IpoptData::curr with an initial iterate. Mirrors
IterateInitializer::SetInitialIterates. The implementation
can use aug_solver for least-square multiplier estimates;
callers that don’t need that may pass any solver — concrete
initializers consult it only if their option settings require
it.Auto Trait Implementations§
impl !RefUnwindSafe for DefaultIterateInitializer
impl !Send for DefaultIterateInitializer
impl !Sync for DefaultIterateInitializer
impl !UnwindSafe for DefaultIterateInitializer
impl Freeze for DefaultIterateInitializer
impl Unpin for DefaultIterateInitializer
impl UnsafeUnpin for DefaultIterateInitializer
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