27 #ifndef IFOPT_INCLUDE_OPT_IPOPT_ADAPTER_H_ 28 #define IFOPT_INCLUDE_OPT_IPOPT_ADAPTER_H_ 31 #include <IpIpoptApplication.hpp> 32 #include <IpSolveStatistics.hpp> 74 virtual bool get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
75 Index& nnz_h_lag, IndexStyleEnum& index_style);
79 Index m,
double* g_l,
double* g_u);
83 bool init_z,
double* z_L,
double* z_U,
84 Index m,
bool init_lambda,
88 virtual bool eval_f(Index n,
const double* x,
bool new_x,
double& obj_value);
91 virtual bool eval_grad_f(Index n,
const double* x,
bool new_x,
double* grad_f);
94 virtual bool eval_g(Index n,
const double* x,
bool new_x, Index m,
double* g);
100 virtual bool eval_jac_g(Index n,
const double* x,
bool new_x,
101 Index m, Index nele_jac, Index* iRow, Index *jCol,
107 Index iter,
double obj_value,
108 double inf_pr,
double inf_du,
109 double mu,
double d_norm,
110 double regularization_size,
111 double alpha_du,
double alpha_pr,
113 const IpoptData* ip_data,
114 IpoptCalculatedQuantities* ip_cq);
119 Index n,
const double* x,
const double* z_L,
const double* z_U,
120 Index m,
const double* g,
const double* lambda,
122 const IpoptData* ip_data,
123 IpoptCalculatedQuantities* ip_cq);
A generic optimization problem with variables, costs and constraints.
Solves the optimization problem using the IPOPT solver.
Component::Jacobian Jacobian
virtual bool eval_grad_f(Index n, const double *x, bool new_x, double *grad_f)
IpoptAdapter(Problem &nlp, bool finite_diff=false)
Creates an IpoptAdapter wrapping the nlp.
virtual bool get_bounds_info(Index n, double *x_l, double *x_u, Index m, double *g_l, double *g_u)
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
Component::VectorXd VectorXd
namespace defined by the Ipopt solver.
virtual bool eval_f(Index n, const double *x, bool new_x, double &obj_value)
virtual void finalize_solution(SolverReturn status, Index n, const double *x, const double *z_L, const double *z_U, Index m, const double *g, const double *lambda, double obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
virtual ~IpoptAdapter()=default
Problem * nlp_
The solver independent problem definition.
virtual bool eval_jac_g(Index n, const double *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, double *values)
Problem::VectorXd VectorXd
virtual bool get_starting_point(Index n, bool init_x, double *x, bool init_z, double *z_L, double *z_U, Index m, bool init_lambda, double *lambda)
Problem::Jacobian Jacobian
virtual bool eval_g(Index n, const double *x, bool new_x, Index m, double *g)
virtual bool intermediate_callback(AlgorithmMode mode, Index iter, double obj_value, double inf_pr, double inf_du, double mu, double d_norm, double regularization_size, double alpha_du, double alpha_pr, Index ls_trials, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
bool finite_diff_
Flag that indicates the "finite-difference-values" option is set.