Interior Point Method via Ipopt

Interior Point Methods 1 implementation

Implementations

Gravity

Adapts Gravity models to Ipopt's TNLP (Templated NLP) interface.

IpoptProgram Class:

  • Inherits from Ipopt::TNLP and Program
  • _model: Pointer to Gravity Model

Required TNLP Callbacks:

  • get_nlp_info(): Return problem dimensions (n, m, nnz_jac, nnz_hess)
  • get_bounds_info(): Variable and constraint bounds
  • get_starting_point(): Initial x, z_L, z_U, lambda
  • eval_f(): Objective function value
  • eval_grad_f(): Objective gradient
  • eval_g(): Constraint values
  • eval_jac_g(): Jacobian values and structure
  • eval_h(): Hessian of Lagrangian
  • finalize_solution(): Copy solution back to model

Sparsity Pattern:

  • First call to eval_jac_g/eval_h: return structure (iRow, jCol)
  • Subsequent calls: return values only
  • Gravity tracks via _first_call_jac, _first_call_hess

Solution Recovery:

  • finalize_solution() copies x values to model variables
  • Retrieves dual values (lambda) for constraints
  • Retrieves bound multipliers (z_L, z_U)