Ipopt

Struct Ipopt 

Source
pub struct Ipopt<P>
where P: BasicProblem,
{ /* private fields */ }
Expand description

Ipopt non-linear optimization problem solver.

This structure is used to store data needed to solve these problems using first and second order methods.

Implementations§

Source§

impl<P> Ipopt<P>
where P: BasicProblem,

Source

pub fn new_unconstrained(nlp: P) -> Result<Ipopt<P>, CreateError>

Create a new unconstrained non-linear problem.

Source

pub fn set_option<'a, O>( &mut self, name: &str, option: O, ) -> Option<&mut Ipopt<P>>
where O: Into<IpoptOption<'a>>,

Set an Ipopt option.

Source

pub fn set_intermediate_callback( &mut self, mb_cb: Option<fn(&mut P, IntermediateCallbackData) -> bool>, )
where P: BasicProblem,

Set intermediate callback.

Source

pub fn solve(&mut self) -> SolveResult<'_, P>

Solve non-linear problem. Return the solve status and the final value of the objective function.

Source

pub fn solver_data_mut(&mut self) -> SolverDataMut<'_, P>

Get data for inspection and updating.

Source

pub fn solver_data(&self) -> SolverData<'_, P>

Get data for inspection from the internal solver.

Source§

impl<P> Ipopt<P>
where P: NewtonProblem,

Source

pub fn new_newton(nlp: P) -> Result<Ipopt<P>, CreateError>

Create a new second order problem, which will be solved using the Newton-Raphson method.

Source§

impl<P> Ipopt<P>

Source

pub fn new(nlp: P) -> Result<Ipopt<P>, CreateError>

Create a new constrained non-linear problem.

Trait Implementations§

Source§

impl<P> Debug for Ipopt<P>
where P: BasicProblem + Debug,

Implement debug for Ipopt.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<P> Drop for Ipopt<P>
where P: BasicProblem,

Free the memory allocated on the C side.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<P> Send for Ipopt<P>
where P: BasicProblem,

The only non-Send type in Ipopt is nlp_internal, which is a mutable raw pointer to an underlying C struct. It is safe to implement Send for Ipopt here because it cannot be copied or cloned.

Auto Trait Implementations§

§

impl<P> Freeze for Ipopt<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for Ipopt<P>
where P: RefUnwindSafe,

§

impl<P> !Sync for Ipopt<P>

§

impl<P> Unpin for Ipopt<P>
where P: Unpin,

§

impl<P> UnwindSafe for Ipopt<P>
where P: UnwindSafe,

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

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.