pub struct CountingTnlp {
pub n_obj: Cell<i32>,
pub n_grad_f: Cell<i32>,
pub n_g: Cell<i32>,
pub n_jac_g: Cell<i32>,
pub n_h: Cell<i32>,
/* private fields */
}Fields§
§n_obj: Cell<i32>§n_grad_f: Cell<i32>§n_g: Cell<i32>§n_jac_g: Cell<i32>§n_h: Cell<i32>Implementations§
Source§impl CountingTnlp
impl CountingTnlp
pub fn new(inner: Rc<RefCell<dyn TNLP>>) -> Self
Sourcepub fn captured_solution(&self) -> Option<(Vec<Number>, Vec<Number>)>
pub fn captured_solution(&self) -> Option<(Vec<Number>, Vec<Number>)>
The (x, lambda) captured at the last finalize_solution, if any.
Sourcepub fn captured_bound_mults(&self) -> Option<(Vec<Number>, Vec<Number>)>
pub fn captured_bound_mults(&self) -> Option<(Vec<Number>, Vec<Number>)>
The (z_l, z_u) captured at that same finalize_solution.
None, and empty vectors, are distinct: a non-OrigIpoptNlp model
hands back empty bound-multiplier blocks and no suffixes are
written, which callers must not confuse with “not captured”.
Trait Implementations§
Source§impl TNLP for CountingTnlp
impl TNLP for CountingTnlp
Source§fn derivative_proofs(&mut self) -> DerivativeProofs
fn derivative_proofs(&mut self) -> DerivativeProofs
Transparent decorator: forward the constant-derivative proofs, or
OrigIpoptNlp asks this wrapper — which knows no algebra — and
gets the declining default, so gh #588 Q6’s reuse never engages on
any model the CLI solves. Neither wrapper changes a row, a
variable or a derivative’s value, so both directions of the proof
carry through unchanged.
Source§fn presolve_infeasibility_proof(&self) -> Option<InfeasibilityProof>
fn presolve_infeasibility_proof(&self) -> Option<InfeasibilityProof>
Transparent decorator: forward the presolve infeasibility proof, or the application never sees it. The CLI stacks this counter above the presolve wrapper, so without this the proof is swallowed here and the solve runs anyway.
Source§fn get_nlp_info(&mut self) -> Option<NlpInfo>
fn get_nlp_info(&mut self) -> Option<NlpInfo>
Source§fn get_bounds_info(&mut self, b: BoundsInfo<'_>) -> bool
fn get_bounds_info(&mut self, b: BoundsInfo<'_>) -> bool
Source§fn get_starting_point(&mut self, sp: StartingPoint<'_>) -> bool
fn get_starting_point(&mut self, sp: StartingPoint<'_>) -> bool
Source§fn eval_f(&mut self, x: &[Number], new_x: bool) -> Option<Number>
fn eval_f(&mut self, x: &[Number], new_x: bool) -> Option<Number>
x.Source§fn eval_grad_f(
&mut self,
x: &[Number],
new_x: bool,
grad_f: &mut [Number],
) -> bool
fn eval_grad_f( &mut self, x: &[Number], new_x: bool, grad_f: &mut [Number], ) -> bool
x into grad_f.Source§fn eval_g(&mut self, x: &[Number], new_x: bool, g: &mut [Number]) -> bool
fn eval_g(&mut self, x: &[Number], new_x: bool, g: &mut [Number]) -> bool
g(x).Source§fn eval_jac_g(
&mut self,
x: Option<&[Number]>,
new_x: bool,
mode: SparsityRequest<'_>,
) -> bool
fn eval_jac_g( &mut self, x: Option<&[Number]>, new_x: bool, mode: SparsityRequest<'_>, ) -> bool
g. Sparsity vs. values selected by
mode. x and new_x are unused on the structure call.Source§fn eval_h(
&mut self,
x: Option<&[Number]>,
new_x: bool,
obj_factor: Number,
lambda: Option<&[Number]>,
new_lambda: bool,
mode: SparsityRequest<'_>,
) -> bool
fn eval_h( &mut self, x: Option<&[Number]>, new_x: bool, obj_factor: Number, lambda: Option<&[Number]>, new_lambda: bool, mode: SparsityRequest<'_>, ) -> bool
Source§fn finalize_solution(
&mut self,
sol: Solution<'_>,
ip_data: &IpoptData,
ip_cq: &IpoptCq,
)
fn finalize_solution( &mut self, sol: Solution<'_>, ip_data: &IpoptData, ip_cq: &IpoptCq, )
Source§fn get_var_con_metadata(
&mut self,
var: &mut MetaData,
con: &mut MetaData,
) -> bool
fn get_var_con_metadata( &mut self, var: &mut MetaData, con: &mut MetaData, ) -> bool
idx_names).
Default: no metadata.Source§fn get_scaling_parameters(&mut self, req: ScalingRequest<'_>) -> bool
fn get_scaling_parameters(&mut self, req: ScalingRequest<'_>) -> bool
nlp_scaling_method=user-scaling. Default: declines.Source§fn get_variables_linearity(&mut self, types: &mut [Linearity]) -> bool
fn get_variables_linearity(&mut self, types: &mut [Linearity]) -> bool
Source§fn get_objective_variables_linearity(&mut self, types: &mut [Linearity]) -> bool
fn get_objective_variables_linearity(&mut self, types: &mut [Linearity]) -> bool
NonLinear iff the objective’s nonlinear part depends on the
variable; a variable that enters the objective only linearly (or
not at all) is Linear even when it is nonlinear in a
constraint. Consumed by presolve’s Phase-0 objective-coupling
guard, which must not mistake constraint-only nonlinearity for
objective coupling. Default: declines (slice untouched).Source§fn get_constraints_linearity(&mut self, types: &mut [Linearity]) -> bool
fn get_constraints_linearity(&mut self, types: &mut [Linearity]) -> bool
nlp_scaling_method=equilibration-based.Source§fn get_number_of_nonlinear_variables(&mut self) -> Index
fn get_number_of_nonlinear_variables(&mut self) -> Index
Source§fn get_list_of_nonlinear_variables(&mut self, pos: &mut [Index]) -> bool
fn get_list_of_nonlinear_variables(&mut self, pos: &mut [Index]) -> bool
Self::get_nlp_info.Source§fn intermediate_callback(
&mut self,
stats: IterStats,
ip_data: &IpoptData,
ip_cq: &IpoptCq,
) -> bool
fn intermediate_callback( &mut self, stats: IterStats, ip_data: &IpoptData, ip_cq: &IpoptCq, ) -> bool
User_Requested_Stop.Source§fn finalize_metadata(&mut self, var: &MetaData, con: &MetaData)
fn finalize_metadata(&mut self, var: &MetaData, con: &MetaData)
Self::finalize_solution. Default does nothing.Source§fn is_presolve_wrapper(&self) -> bool
fn is_presolve_wrapper(&self) -> bool
Source§fn scaling_factors(&self) -> Option<Vec<f64>>
fn scaling_factors(&self) -> Option<Vec<f64>>
finalize_solution payload
see scaled coordinates and need these to undo the substitution.
A transparent decorator should forward the inner answer.Auto Trait Implementations§
impl !Freeze for CountingTnlp
impl !RefUnwindSafe for CountingTnlp
impl !Send for CountingTnlp
impl !Sync for CountingTnlp
impl !UnwindSafe for CountingTnlp
impl Unpin for CountingTnlp
impl UnsafeUnpin for CountingTnlp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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