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>>,
}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: String“constant” / “mu-based” / “least-square”.
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).
Implementations§
Source§impl DefaultIterateInitializer
impl DefaultIterateInitializer
pub fn new() -> Self
pub fn with_eq_mult_calculator(eq_mult: Box<dyn EqMultCalculator>) -> Self
Sourcepub fn push_to_interior(
bound_push: Number,
bound_frac: Number,
x: Number,
lower: Option<Number>,
upper: Option<Number>,
) -> Number
pub fn push_to_interior( bound_push: Number, bound_frac: Number, x: Number, lower: Option<Number>, upper: Option<Number>, ) -> Number
Per-element bound-push formula from upstream
IpDefaultIterateInitializer.cpp:473-666. Given a primal value
x and optional bounds (lower, upper), return a value
shifted to the interior:
- Two-sided bounds: clamp into
[lo + p_l, hi - p_u]wherep_l = min(bound_push * max(|lo|, 1), bound_frac * (hi-lo)),p_u = min(bound_push * max(|hi|, 1), bound_frac * (hi-lo)). - Lower-only: return
max(x, lo + bound_push * max(|lo|, 1)). - Upper-only: return
min(x, hi - bound_push * max(|hi|, 1)). - Free: return
x.
The Px_L/Px_U selection-matrix dance in upstream collapses
to exactly this per-coordinate formula once the bounds are
expanded to the full primal space.
Trait Implementations§
Source§impl Default for DefaultIterateInitializer
impl Default for DefaultIterateInitializer
Source§impl IterateInitializer for DefaultIterateInitializer
impl IterateInitializer for DefaultIterateInitializer
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
Populate
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 Freeze for DefaultIterateInitializer
impl !RefUnwindSafe for DefaultIterateInitializer
impl !Send for DefaultIterateInitializer
impl !Sync for DefaultIterateInitializer
impl Unpin for DefaultIterateInitializer
impl UnsafeUnpin for DefaultIterateInitializer
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more
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