pub trait NlpProblem {
fn num_variables(&self) -> usize;
fn num_constraints(&self) -> usize;
fn bounds(&self, x_l: &mut [f64], x_u: &mut [f64]);
fn constraint_bounds(&self, g_l: &mut [f64], g_u: &mut [f64]);
fn initial_point(&self, x0: &mut [f64]);
fn initial_multipliers(
&self,
_lam_g: &mut [f64],
_z_l: &mut [f64],
_z_u: &mut [f64],
) -> bool {
false
}
fn objective(&self, x: &[f64], new_x: bool, obj: &mut f64) -> bool;
fn gradient(&self, x: &[f64], new_x: bool, grad: &mut [f64]) -> bool;
fn constraints(&self, x: &[f64], new_x: bool, g: &mut [f64]) -> bool;
fn jacobian_structure(&self) -> (Vec<usize>, Vec<usize>);
fn jacobian_values(&self, x: &[f64], new_x: bool, vals: &mut [f64]) -> bool;
fn hessian_structure(&self) -> (Vec<usize>, Vec<usize>);
fn hessian_values(&self, x: &[f64], _new_x: bool, obj_factor: f64, lambda: &[f64], vals: &mut [f64]) -> bool;
}