27 #ifndef IFOPT_INCLUDE_OPT_IPOPT_ADAPTER_H_ 28 #define IFOPT_INCLUDE_OPT_IPOPT_ADAPTER_H_ 31 #include <IpIpoptApplication.hpp> 32 #include <IpSolveStatistics.hpp> 77 static void SetOptions(Ipopt::SmartPtr<Ipopt::IpoptApplication> app);
93 Index& nnz_h_lag, IndexStyleEnum& index_style);
97 Index m,
double* g_l,
double* g_u);
101 bool init_z,
double* z_L,
double* z_U,
102 Index m,
bool init_lambda,
106 virtual bool eval_f(
Index n,
const double* x,
bool new_x,
double& obj_value);
109 virtual bool eval_grad_f(
Index n,
const double* x,
bool new_x,
double* grad_f);
112 virtual bool eval_g(
Index n,
const double* x,
bool new_x,
Index m,
double* g);
125 Index iter,
double obj_value,
126 double inf_pr,
double inf_du,
127 double mu,
double d_norm,
128 double regularization_size,
129 double alpha_du,
double alpha_pr,
131 const Ipopt::IpoptData* ip_data,
132 Ipopt::IpoptCalculatedQuantities* ip_cq);
137 Index n,
const double* x,
const double* z_L,
const double* z_U,
138 Index m,
const double* g,
const double* lambda,
140 const Ipopt::IpoptData* ip_data,
141 Ipopt::IpoptCalculatedQuantities* ip_cq);
virtual ~IpoptAdapter()=default
static void SetOptions(Ipopt::SmartPtr< Ipopt::IpoptApplication > app)
Defines settings for the Ipopt solver app.
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)
virtual bool get_bounds_info(Index n, double *x_l, double *x_u, Index m, double *g_l, double *g_u)
Problem::VectorXd VectorXd
virtual bool eval_jac_g(Index n, const double *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, double *values)
Component::Jacobian Jacobian
virtual bool eval_g(Index n, const double *x, bool new_x, Index m, double *g)
Problem::Jacobian Jacobian
virtual bool eval_f(Index n, const double *x, bool new_x, double &obj_value)
Component::VectorXd VectorXd
virtual bool eval_grad_f(Index n, const double *x, bool new_x, double *grad_f)
IpoptAdapter(Problem &nlp)
Creates an IpoptAdapter wrapping the nlp.
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
virtual bool intermediate_callback(Ipopt::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 Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
Problem * nlp_
The solver independent problem definition.
Solves the optimization problem using the IPOPT solver.
virtual void finalize_solution(Ipopt::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 Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
static void Solve(Problem &nlp)
Creates an IpoptAdapter and solves the NLP.