alpaqa pi-pico
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
IpoptAdapter Class Reference

#include <alpaqa/ipopt/ipopt-adapter.hpp>

Detailed Description

Based on https://coin-or.github.io/Ipopt/INTERFACES.html.

Definition at line 13 of file ipopt-adapter.hpp.

+ Inheritance diagram for IpoptAdapter:
+ Collaboration diagram for IpoptAdapter:

Functions required by Ipopt

bool get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style) override
 
bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) override
 
bool get_starting_point (Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda) override
 
bool eval_f (Index n, const Number *x, bool new_x, Number &obj_value) override
 
bool eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f) override
 
bool eval_g (Index n, const Number *x, bool new_x, Index m, Number *g) override
 
bool eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) override
 
bool eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values) override
 
void finalize_solution (Ipopt::SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq) override
 

Classes

struct  Results
 

Public Types

using Sparsity = sparsity::Sparsity< config_t >
 
using Problem = TypeErasedProblem< config_t >
 
using Index = Ipopt::Index
 
using Number = Ipopt::Number
 

Public Member Functions

 IpoptAdapter (const Problem &problem)
 
 IpoptAdapter (Problem &&)=delete
 

Public Attributes

const Problemproblem
 
vec initial_guess
 
vec initial_guess_bounds_multipliers
 
vec initial_guess_multipliers
 
struct alpaqa::IpoptAdapter::Results results
 

Private Types

using SparsityConv = sparsity::SparsityConverter< Sparsity, sparsity::SparseCOO< config_t, Index > >
 

Private Attributes

Sparsity orig_sparsity_jac_g = problem.get_jac_g_sparsity()
 
Sparsity orig_sparsity_hess_L = problem.get_hess_L_sparsity()
 
SparsityConv cvt_sparsity_jac_g = orig_sparsity_jac_g
 
SparsityConv cvt_sparsity_hess_L = orig_sparsity_hess_L
 

Member Typedef Documentation

◆ Sparsity

Definition at line 16 of file ipopt-adapter.hpp.

◆ Problem

Definition at line 17 of file ipopt-adapter.hpp.

◆ Index

using Index = Ipopt::Index

Definition at line 22 of file ipopt-adapter.hpp.

◆ Number

using Number = Ipopt::Number

Definition at line 23 of file ipopt-adapter.hpp.

◆ SparsityConv

Definition at line 80 of file ipopt-adapter.hpp.

Constructor & Destructor Documentation

◆ IpoptAdapter() [1/2]

IpoptAdapter ( const Problem problem)

Definition at line 8 of file ipopt-adapter.cpp.

◆ IpoptAdapter() [2/2]

IpoptAdapter ( Problem &&  )
delete

Member Function Documentation

◆ get_nlp_info()

bool get_nlp_info ( Index n,
Index m,
Index nnz_jac_g,
Index nnz_h_lag,
IndexStyleEnum index_style 
)
override

Definition at line 10 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:

◆ get_bounds_info()

bool get_bounds_info ( Index  n,
Number x_l,
Number x_u,
Index  m,
Number g_l,
Number g_u 
)
override

Definition at line 32 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:

◆ get_starting_point()

bool get_starting_point ( Index  n,
bool  init_x,
Number x,
bool  init_z,
Number z_L,
Number z_U,
Index  m,
bool  init_lambda,
Number lambda 
)
override

Definition at line 43 of file ipopt-adapter.cpp.

◆ eval_f()

bool eval_f ( Index  n,
const Number x,
bool  new_x,
Number obj_value 
)
override

Definition at line 74 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:

◆ eval_grad_f()

bool eval_grad_f ( Index  n,
const Number x,
bool  new_x,
Number grad_f 
)
override

Definition at line 80 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:

◆ eval_g()

bool eval_g ( Index  n,
const Number x,
bool  new_x,
Index  m,
Number g 
)
override

Definition at line 86 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:

◆ eval_jac_g()

bool eval_jac_g ( Index  n,
const Number x,
bool  new_x,
Index  m,
Index  nele_jac,
Index iRow,
Index jCol,
Number values 
)
override

Definition at line 92 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eval_h()

bool eval_h ( Index  n,
const Number x,
bool  new_x,
Number  obj_factor,
Index  m,
const Number lambda,
bool  new_lambda,
Index  nele_hess,
Index iRow,
Index jCol,
Number values 
)
override

Definition at line 108 of file ipopt-adapter.cpp.

+ Here is the call graph for this function:

◆ finalize_solution()

void finalize_solution ( Ipopt::SolverReturn  status,
Index  n,
const Number x,
const Number z_L,
const Number z_U,
Index  m,
const Number g,
const Number lambda,
Number  obj_value,
const Ipopt::IpoptData *  ip_data,
Ipopt::IpoptCalculatedQuantities *  ip_cq 
)
override

Definition at line 126 of file ipopt-adapter.cpp.

Member Data Documentation

◆ problem

const Problem& problem

Definition at line 18 of file ipopt-adapter.hpp.

◆ initial_guess

vec initial_guess

Definition at line 19 of file ipopt-adapter.hpp.

◆ initial_guess_bounds_multipliers

vec initial_guess_bounds_multipliers

Definition at line 20 of file ipopt-adapter.hpp.

◆ initial_guess_multipliers

vec initial_guess_multipliers

Definition at line 21 of file ipopt-adapter.hpp.

◆ results

◆ orig_sparsity_jac_g

Sparsity orig_sparsity_jac_g = problem.get_jac_g_sparsity()
private

Definition at line 83 of file ipopt-adapter.hpp.

◆ orig_sparsity_hess_L

Sparsity orig_sparsity_hess_L = problem.get_hess_L_sparsity()
private

Definition at line 84 of file ipopt-adapter.hpp.

◆ cvt_sparsity_jac_g

SparsityConv cvt_sparsity_jac_g = orig_sparsity_jac_g
private

Definition at line 85 of file ipopt-adapter.hpp.

◆ cvt_sparsity_hess_L

SparsityConv cvt_sparsity_hess_L = orig_sparsity_hess_L
private

Definition at line 86 of file ipopt-adapter.hpp.


The documentation for this class was generated from the following files: