NewtonProblem

Trait NewtonProblem 

Source
pub trait NewtonProblem: BasicProblem {
    // Required methods
    fn num_hessian_non_zeros(&self) -> usize;
    fn hessian_indices(&self, rows: &mut [i32], cols: &mut [i32]) -> bool;
    fn hessian_values(&self, x: &[f64], vals: &mut [f64]) -> bool;
}
Expand description

An extension to the BasicProblem trait that enables full Newton iterations in Ipopt.

If this trait is NOT implemented by your problem, Ipopt will be set to perform Quasi-Newton Approximation for second derivatives. This interface asks for the Hessian matrix in sparse triplet form.

Required Methods§

Source

fn num_hessian_non_zeros(&self) -> usize

Number of non-zeros in the Hessian matrix.

Source

fn hessian_indices(&self, rows: &mut [i32], cols: &mut [i32]) -> bool

Hessian indices.

These are the row and column indices of the non-zeros in the sparse representation of the matrix. This is a symmetric matrix, fill the lower left triangular half only. If your problem is constrained (i.e. you are ultimately implementing ConstrainedProblem), ensure that you provide coordinates for non-zeros of the constraint hessian as well. This function is internally called by Ipopt callback eval_h.

Source

fn hessian_values(&self, x: &[f64], vals: &mut [f64]) -> bool

Objective Hessian values.

Each value must correspond to the row and column as specified in hessian_indices. This function is internally called by Ipopt callback eval_h and each value is premultiplied by Ipopt’s obj_factor as necessary.

Implementors§