Skip to main content

IpoptNlpAdapter

Struct IpoptNlpAdapter 

Source
pub struct IpoptNlpAdapter { /* private fields */ }

Implementations§

Source§

impl IpoptNlpAdapter

Source

pub fn new(nlp: Rc<RefCell<dyn IpoptNlp>>) -> Self

Build the adapter from an IpoptNlp handle. Dimensions are queried directly from Nlp::n(), Nlp::m_eq(), Nlp::m_ineq().

Source

pub fn new_with_declared_bounds(nlp: Rc<RefCell<dyn IpoptNlp>>) -> Self

The same adapter, but reporting the bounds the user declared rather than the live ones the interior method widened by bound_relax_factor.

For the interior iteration the widening is the point — it is what keeps a strictly-interior iterate from being pinned against a bound it must approach. For anything asking where the solution sits relative to the model, it inverts the answer: a point exactly on a declared bound is a full 1e-8 inside the relaxed one, so an activity test against the live bounds calls the binding constraint inactive, and a pivot against them stops short of it. That is the difference between crossover identifying the active set and crossover identifying nothing.

Falls back to the live bounds for any block the NLP does not track (the trait accessors default to None).

Trait Implementations§

Source§

impl SqpProblemSpec for IpoptNlpAdapter

Source§

fn n(&self) -> usize

Source§

fn m(&self) -> usize

Source§

fn x_init(&self) -> Vec<Number>

Source§

fn variable_bounds(&self) -> (Vec<Number>, Vec<Number>)

Source§

fn constraint_bounds(&self) -> (Vec<Number>, Vec<Number>)

Source§

fn eval_f(&mut self, x: &[Number]) -> Number

Source§

fn eval_grad_f(&mut self, x: &[Number]) -> Vec<Number>

Source§

fn eval_c(&mut self, x: &[Number]) -> Vec<Number>

c(x) — combined constraint values (length m). The constraint bounds from constraint_bounds apply directly: row i is a strict equality if bl[i] == bu[i], an inequality otherwise.
Source§

fn eval_jac_c(&mut self, x: &[Number]) -> Triplet

∇c(x) as a sparse m × n triplet (1-based indices).
Source§

fn eval_hess_lag(&mut self, x: &[Number], lambda_g: &[Number]) -> Triplet

∇²L(x, λ_g) = ∇²f(x) + Σ λ_g_i · ∇²c_i(x) as a sparse symmetric n × n triplet.

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

Source§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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