Skip to main content

PdSearchDirCalc

Struct PdSearchDirCalc 

Source
pub struct PdSearchDirCalc {
    pub fast_step_computation: bool,
    pub mehrotra_algorithm: bool,
    /* private fields */
}

Fields§

§fast_step_computation: bool

Skip the residual check on the search direction. Mirrors fast_step_computation (default false).

§mehrotra_algorithm: bool

Mehrotra-style predictor-corrector step. Mirrors mehrotra_algorithm (default false in v1.0; flipped on by the adaptive-mu wiring in Phase 10).

Implementations§

Source§

impl PdSearchDirCalc

Source

pub fn new(pd_solver: PdFullSpaceSolver) -> Self

Source

pub fn pd_solver_rc(&self) -> Rc<RefCell<PdFullSpaceSolver>>

Clone the shared handle to the PD solver. Used by the post-converged sensitivity callback to retain a factor handle past the IPM call.

Source

pub fn pd_solver_mut(&self) -> RefMut<'_, PdFullSpaceSolver>

Borrow the PD solver mutably. Caller is responsible for not holding two mutable borrows at once (single-thread, single- borrow access pattern — matches every existing call site).

Source

pub fn compute_search_direction( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, ) -> bool

Compute the search direction and write it back into data.delta. Returns false if the underlying linear solve fails. Mirrors PDSearchDirCalculator::ComputeSearchDirection.

Source

pub fn compute_affine_step( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, ) -> bool

Affine (predictor) step — port of upstream’s IpAdaptiveMuUpdate::ComputeMuMehrotra predictor solve. Builds the same RHS as Self::compute_search_direction except the z-blocks use the unrelaxed complementarity s · z (μ-target = 0) so the resulting step targets the affine-scaling system. The solution is stored in data.delta_aff for consumption by the Probing / Quality-Function oracles.

Returns false if the linear solve fails.

Source

pub fn compute_centering_step( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, ) -> bool

Pure centering step — port of upstream IpQualityFunctionMuOracle.cpp::CalculateMu lines 218-247. RHS is (0, 0, 0, 0, μ̄·1, μ̄·1, μ̄·1, μ̄·1) with μ̄ = curr_avrg_compl. Solution stored on data.delta_cen for the quality-function oracle’s σ-bracket search.

Returns false if the linear solve fails.

Source

pub fn compute_soc_step( &mut self, data: &IpoptDataHandle, cq: &IpoptCqHandle, nlp: &Rc<RefCell<dyn IpoptNlp>>, c_soc: &dyn Vector, dms_soc: &dyn Vector, alpha_primal_soc: Number, soc_method: i32, ) -> Option<IteratesVector>

Solve the second-order-correction (SOC) linear system used by the filter line search to recover full-step acceptability when the Newton step grows the constraint violation. Mirrors the RHS assembly + pd_solver_->Solve(-1.0, 0.0, ...) block in upstream IpFilterLSAcceptor.cpp:577-608.

The caller supplies the SOC right-hand sides for the equality and inequality blocks (c_soc, dms_soc); this method assembles the remaining six blocks using the current iterate’s KKT residuals and returns the resulting delta_soc. soc_method = 0 matches upstream’s default (gradient blocks unscaled); soc_method = 1 scales the gradient blocks by alpha_primal_soc to reuse a previously-tried correction.

Trait Implementations§

Source§

impl SearchDirCalculator for PdSearchDirCalc

Source§

fn computed_normal_step(&self) -> bool

Compute the next search direction. Phase 7 wires the full signature once IpoptData carries delta/delta_aff.

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, 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.