70 const casadi_real**
arg;
77 enum ApplicationReturnStatus
status;
99 void casadi_ipopt_work(
const casadi_ipopt_prob<T1>* p, casadi_int* sz_arg, casadi_int* sz_res, casadi_int* sz_iw, casadi_int* sz_w) {
100 casadi_nlpsol_work(p->
nlp, sz_arg, sz_res, sz_iw, sz_w);
107 template<
typename T1>
108 void casadi_ipopt_init(
casadi_ipopt_data<T1>* d,
const T1*** arg, T1*** res, casadi_int** iw, T1** w) {
113 d->
z_L = *w; *w += p_nlp->
nx;
114 d->
z_U = *w; *w += p_nlp->
nx;
123 template<
typename T1>
130 d->
ipopt = CreateIpoptProblem(
131 p_nlp->
nx, (
double *) d_nlp->
lbz, (
double *) d_nlp->
ubz,
132 p_nlp->
ng, (
double *) d_nlp->
lbz+p_nlp->
nx,
133 (
double *) d_nlp->
ubz+p_nlp->
nx,
141 template<
typename T1>
151 for (casadi_int i=0; i<p_nlp->
nx; ++i) {
152 d->
z_L[i] = casadi_fmax(0., -d_nlp->
lam[i]);
153 d->
z_U[i] = casadi_fmax(0., d_nlp->
lam[i]);
158 for (casadi_int i=0; i<p_nlp->
nx; ++i) {
162 FreeIpoptProblem(d->
ipopt);
164 if (d->
status==Solve_Succeeded ||
165 d->
status==Solved_To_Acceptable_Level ||
166 d->
status==Feasible_Point_Found) {
168 }
else if (d->
status==Maximum_Iterations_Exceeded) {
172 #if (IPOPT_VERSION_MAJOR > 3) || (IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR >= 14)
180 template<
typename T1>
181 void casadi_ipopt_sparsity(
const casadi_int* sp, ipindex *iRow, ipindex *jCol) {
182 casadi_int ncol = sp[1];
183 const casadi_int* colind = sp+2;
184 const casadi_int* row = colind+ncol+1;
186 for (casadi_int cc=0; cc<ncol; ++cc) {
187 for (casadi_int el=colind[cc]; el<colind[cc+1]; ++el) {
195 template<
typename T1>
196 bool casadi_ipopt_hess_l_empty(ipindex n, ipnumber *x,
bool new_x, ipnumber obj_factor, ipindex m, ipnumber *lambda,
bool new_lambda, ipindex nele_hess, ipindex *iRow, ipindex *jCol, ipnumber *values, UserDataPtr user_data) {
const casadi_ipopt_prob< T1 > * prob
casadi_nlpsol_data< T1 > * nlp
enum ApplicationReturnStatus status
int unified_return_status
const casadi_nlpsol_prob< T1 > * nlp
Eval_Grad_F_CB eval_grad_f