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,
impl<P> Ipopt<P>where
P: BasicProblem,
Sourcepub fn new_unconstrained(nlp: P) -> Result<Ipopt<P>, CreateError>
pub fn new_unconstrained(nlp: P) -> Result<Ipopt<P>, CreateError>
Create a new unconstrained non-linear problem.
Sourcepub fn set_option<'a, O>(
&mut self,
name: &str,
option: O,
) -> Option<&mut Ipopt<P>>where
O: Into<IpoptOption<'a>>,
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.
Sourcepub fn set_intermediate_callback(
&mut self,
mb_cb: Option<fn(&mut P, IntermediateCallbackData) -> bool>,
)where
P: BasicProblem,
pub fn set_intermediate_callback(
&mut self,
mb_cb: Option<fn(&mut P, IntermediateCallbackData) -> bool>,
)where
P: BasicProblem,
Set intermediate callback.
Sourcepub fn solve(&mut self) -> SolveResult<'_, P>
pub fn solve(&mut self) -> SolveResult<'_, P>
Solve non-linear problem. Return the solve status and the final value of the objective function.
Sourcepub fn solver_data_mut(&mut self) -> SolverDataMut<'_, P>
pub fn solver_data_mut(&mut self) -> SolverDataMut<'_, P>
Get data for inspection and updating.
Sourcepub fn solver_data(&self) -> SolverData<'_, P>
pub fn solver_data(&self) -> SolverData<'_, P>
Get data for inspection from the internal solver.
Source§impl<P> Ipopt<P>where
P: NewtonProblem,
impl<P> Ipopt<P>where
P: NewtonProblem,
Sourcepub fn new_newton(nlp: P) -> Result<Ipopt<P>, CreateError>
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>where
P: ConstrainedProblem,
impl<P> Ipopt<P>where
P: ConstrainedProblem,
Sourcepub fn new(nlp: P) -> Result<Ipopt<P>, CreateError>
pub fn new(nlp: P) -> Result<Ipopt<P>, CreateError>
Create a new constrained non-linear problem.
Trait Implementations§
Source§impl<P> Drop for Ipopt<P>where
P: BasicProblem,
Free the memory allocated on the C side.
impl<P> Drop for Ipopt<P>where
P: BasicProblem,
Free the memory allocated on the C side.
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> 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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.