pub struct ADProblem<T, const X: usize, const CACHE: bool> { /* private fields */ }Expand description
Wrapper struct that handles caching and sparsity detection to interface between the blackbox model and IPOPT.
Implementations§
Source§impl<T: SimpleADProblem<X>, const X: usize> ADProblem<T, X, false>
impl<T: SimpleADProblem<X>, const X: usize> ADProblem<T, X, false>
Source§impl<T: CachedADProblem<X>, const X: usize> ADProblem<T, X, true>
impl<T: CachedADProblem<X>, const X: usize> ADProblem<T, X, true>
Sourcepub fn new_cached(problem: T) -> Result<Self, T::Error>
pub fn new_cached(problem: T) -> Result<Self, T::Error>
Initialize an NLP using the CachedADProblem interface.
Trait Implementations§
Source§impl<T: SimpleADProblem<X>, const X: usize> BasicProblem for ADProblem<T, X, false>
impl<T: SimpleADProblem<X>, const X: usize> BasicProblem for ADProblem<T, X, false>
Source§fn num_variables(&self) -> usize
fn num_variables(&self) -> usize
Total number of variables of the non-linear problem.
Source§fn initial_point(&self, x: &mut [f64]) -> bool
fn initial_point(&self, x: &mut [f64]) -> bool
Construct the initial guess of the primal variables for Ipopt to start with. Read more
Source§fn objective(&self, x: &[f64], _: bool, obj: &mut f64) -> bool
fn objective(&self, x: &[f64], _: bool, obj: &mut f64) -> bool
Objective function. This is the function being minimized. Read more
Source§fn objective_grad(&self, x: &[f64], _: bool, grad_f: &mut [f64]) -> bool
fn objective_grad(&self, x: &[f64], _: bool, grad_f: &mut [f64]) -> bool
The gradient of the objective function speficies the search direction to Ipopt. Read more
Source§fn indexing_style(&self) -> IndexingStyle
fn indexing_style(&self) -> IndexingStyle
Specify the indexing style used for arrays in this problem.
(Default is zero-based)
Source§fn initial_bounds_multipliers(&self, z_l: &mut [f64], z_u: &mut [f64]) -> bool
fn initial_bounds_multipliers(&self, z_l: &mut [f64], z_u: &mut [f64]) -> bool
Construct the initial guess of the lower and upper bounds multipliers for Ipopt to start with. Read more
Source§fn variable_scaling(&self, _x_scaling: &mut [f64]) -> bool
fn variable_scaling(&self, _x_scaling: &mut [f64]) -> bool
Provide custom variable scaling. Read more
Source§fn objective_scaling(&self) -> f64
fn objective_scaling(&self) -> f64
Provide custom scaling for the objective function. Read more
Source§impl<T: CachedADProblem<X>, const X: usize> BasicProblem for ADProblem<T, X, true>
impl<T: CachedADProblem<X>, const X: usize> BasicProblem for ADProblem<T, X, true>
Source§fn num_variables(&self) -> usize
fn num_variables(&self) -> usize
Total number of variables of the non-linear problem.
Source§fn initial_point(&self, x: &mut [f64]) -> bool
fn initial_point(&self, x: &mut [f64]) -> bool
Construct the initial guess of the primal variables for Ipopt to start with. Read more
Source§fn objective(&self, x: &[f64], new_x: bool, obj: &mut f64) -> bool
fn objective(&self, x: &[f64], new_x: bool, obj: &mut f64) -> bool
Objective function. This is the function being minimized. Read more
Source§fn objective_grad(&self, x: &[f64], new_x: bool, grad_f: &mut [f64]) -> bool
fn objective_grad(&self, x: &[f64], new_x: bool, grad_f: &mut [f64]) -> bool
The gradient of the objective function speficies the search direction to Ipopt. Read more
Source§fn indexing_style(&self) -> IndexingStyle
fn indexing_style(&self) -> IndexingStyle
Specify the indexing style used for arrays in this problem.
(Default is zero-based)
Source§fn initial_bounds_multipliers(&self, z_l: &mut [f64], z_u: &mut [f64]) -> bool
fn initial_bounds_multipliers(&self, z_l: &mut [f64], z_u: &mut [f64]) -> bool
Construct the initial guess of the lower and upper bounds multipliers for Ipopt to start with. Read more
Source§fn variable_scaling(&self, _x_scaling: &mut [f64]) -> bool
fn variable_scaling(&self, _x_scaling: &mut [f64]) -> bool
Provide custom variable scaling. Read more
Source§fn objective_scaling(&self) -> f64
fn objective_scaling(&self) -> f64
Provide custom scaling for the objective function. Read more
Source§impl<T: SimpleADProblem<X>, const X: usize> ConstrainedProblem for ADProblem<T, X, false>
impl<T: SimpleADProblem<X>, const X: usize> ConstrainedProblem for ADProblem<T, X, false>
Source§fn num_constraints(&self) -> usize
fn num_constraints(&self) -> usize
Number of equality and inequality constraints.
Source§fn num_constraint_jacobian_non_zeros(&self) -> usize
fn num_constraint_jacobian_non_zeros(&self) -> usize
Number of non-zeros in the constraint Jacobian.
Source§fn constraint(&self, x: &[f64], _: bool, g: &mut [f64]) -> bool
fn constraint(&self, x: &[f64], _: bool, g: &mut [f64]) -> bool
Constraint function. Read more
Source§fn constraint_jacobian_indices(
&self,
rows: &mut [i32],
cols: &mut [i32],
) -> bool
fn constraint_jacobian_indices( &self, rows: &mut [i32], cols: &mut [i32], ) -> bool
Constraint Jacobian indices. Read more
Source§fn constraint_jacobian_values(
&self,
x: &[f64],
_: bool,
vals: &mut [f64],
) -> bool
fn constraint_jacobian_values( &self, x: &[f64], _: bool, vals: &mut [f64], ) -> bool
Constraint Jacobian values. Read more
Source§fn num_hessian_non_zeros(&self) -> usize
fn num_hessian_non_zeros(&self) -> usize
Number of non-zeros in the Hessian matrix. Read more
Source§fn hessian_indices(&self, rows: &mut [i32], cols: &mut [i32]) -> bool
fn hessian_indices(&self, rows: &mut [i32], cols: &mut [i32]) -> bool
Hessian indices. Read more
Source§fn hessian_values(
&self,
x: &[f64],
_new_x: bool,
obj_factor: f64,
lambda: &[f64],
vals: &mut [f64],
) -> bool
fn hessian_values( &self, x: &[f64], _new_x: bool, obj_factor: f64, lambda: &[f64], vals: &mut [f64], ) -> bool
Hessian values. Read more
Source§impl<T: CachedADProblem<X>, const X: usize> ConstrainedProblem for ADProblem<T, X, true>
impl<T: CachedADProblem<X>, const X: usize> ConstrainedProblem for ADProblem<T, X, true>
Source§fn num_constraints(&self) -> usize
fn num_constraints(&self) -> usize
Number of equality and inequality constraints.
Source§fn num_constraint_jacobian_non_zeros(&self) -> usize
fn num_constraint_jacobian_non_zeros(&self) -> usize
Number of non-zeros in the constraint Jacobian.
Source§fn constraint(&self, x: &[f64], new_x: bool, g: &mut [f64]) -> bool
fn constraint(&self, x: &[f64], new_x: bool, g: &mut [f64]) -> bool
Constraint function. Read more
Source§fn constraint_jacobian_indices(
&self,
rows: &mut [i32],
cols: &mut [i32],
) -> bool
fn constraint_jacobian_indices( &self, rows: &mut [i32], cols: &mut [i32], ) -> bool
Constraint Jacobian indices. Read more
Source§fn constraint_jacobian_values(
&self,
x: &[f64],
new_x: bool,
vals: &mut [f64],
) -> bool
fn constraint_jacobian_values( &self, x: &[f64], new_x: bool, vals: &mut [f64], ) -> bool
Constraint Jacobian values. Read more
Source§fn num_hessian_non_zeros(&self) -> usize
fn num_hessian_non_zeros(&self) -> usize
Number of non-zeros in the Hessian matrix. Read more
Source§fn hessian_indices(&self, rows: &mut [i32], cols: &mut [i32]) -> bool
fn hessian_indices(&self, rows: &mut [i32], cols: &mut [i32]) -> bool
Hessian indices. Read more
Source§fn hessian_values(
&self,
x: &[f64],
_new_x: bool,
obj_factor: f64,
lambda: &[f64],
vals: &mut [f64],
) -> bool
fn hessian_values( &self, x: &[f64], _new_x: bool, obj_factor: f64, lambda: &[f64], vals: &mut [f64], ) -> bool
Hessian values. Read more
Auto Trait Implementations§
impl<T, const X: usize, const CACHE: bool> !Freeze for ADProblem<T, X, CACHE>
impl<T, const X: usize, const CACHE: bool> !RefUnwindSafe for ADProblem<T, X, CACHE>
impl<T, const X: usize, const CACHE: bool> Send for ADProblem<T, X, CACHE>where
T: Send,
impl<T, const X: usize, const CACHE: bool> !Sync for ADProblem<T, X, CACHE>
impl<T, const X: usize, const CACHE: bool> Unpin for ADProblem<T, X, CACHE>where
T: Unpin,
impl<T, const X: usize, const CACHE: bool> UnwindSafe for ADProblem<T, X, CACHE>where
T: 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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.