alpaqa 1.0.0a9
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Static Private Member Functions | 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 11 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
 
struct  Sparsity
 

Public Types

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_l
 
vec initial_guess_bounds_multipliers_u
 
vec initial_guess_multipliers
 
struct alpaqa::IpoptAdapter::Results results
 

Static Private Member Functions

static void set_sparsity (Index n, Index m, Index nele, Index *iRow, Index *jCol, const Sparsity &sp)
 

Private Attributes

struct alpaqa::IpoptAdapter::Sparsity sparsity_J
 
struct alpaqa::IpoptAdapter::Sparsity sparsity_H
 

Class Documentation

◆ alpaqa::IpoptAdapter::Results

struct alpaqa::IpoptAdapter::Results
+ Collaboration diagram for IpoptAdapter::Results:
Class Members
SolverReturn status = Ipopt::SolverReturn::UNASSIGNED
vec solution_x
vec solution_z_L
vec solution_z_U
vec solution_y
vec solution_g
real_t solution_f = NaN<config_t>
real_t infeasibility = NaN<config_t>
real_t nlp_error = NaN<config_t>
length_t iter_count = 0

◆ alpaqa::IpoptAdapter::Sparsity

struct alpaqa::IpoptAdapter::Sparsity
+ Collaboration diagram for IpoptAdapter::Sparsity:
Class Members
length_t nnz
indexvec inner_idx
indexvec outer_ptr

Member Typedef Documentation

◆ Problem

using Problem = TypeErasedProblem<config_t>

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

◆ Index

using Index = Ipopt::Index

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

◆ Number

using Number = Ipopt::Number

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

Constructor & Destructor Documentation

◆ IpoptAdapter() [1/2]

IpoptAdapter ( const Problem problem)

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

+ Here is the call graph for this function:

◆ 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 27 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 42 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 53 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 82 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 88 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 94 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 100 of file ipopt-adapter.cpp.

+ Here is the call 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 114 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 140 of file ipopt-adapter.cpp.

◆ set_sparsity()

void set_sparsity ( Index  n,
Index  m,
Index  nele,
Index iRow,
Index jCol,
const Sparsity sp 
)
staticprivate

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ problem

const Problem& problem

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

◆ initial_guess

vec initial_guess

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

◆ initial_guess_bounds_multipliers_l

vec initial_guess_bounds_multipliers_l

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

◆ initial_guess_bounds_multipliers_u

vec initial_guess_bounds_multipliers_u

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

◆ initial_guess_multipliers

vec initial_guess_multipliers

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

◆ results

◆ sparsity_J

struct alpaqa::IpoptAdapter::Sparsity sparsity_J
private

◆ sparsity_H

struct alpaqa::IpoptAdapter::Sparsity sparsity_H
private

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