34 void casadi_fatrop_mproject(T1 factor,
const T1* x,
const casadi_int* sp_x,
35 T1* y,
const casadi_int* sp_y, T1* w) {
37 const casadi_int* colind_y;
40 casadi_project(x, sp_x, y, sp_y, w);
41 casadi_scal(colind_y[ncol_y], factor, y);
46 void casadi_fatrop_dense_transfer(
double factor,
const T1* x,
47 const casadi_int* sp_x, T1* y,
48 const casadi_int* sp_y, T1* w) {
49 casadi_sparsify(x, w, sp_x, 0);
50 casadi_int nrow_y = sp_y[0];
51 casadi_int ncol_y = sp_y[1];
52 const casadi_int *colind_y = sp_y+2, *row_y = sp_y + 2 + ncol_y+1;
55 for (i=0; i<ncol_y; ++i) {
56 for (el=colind_y[i]; el<colind_y[i+1]; ++el) y[nrow_y*i + row_y[el]] += factor*(*w++);
62 void casadi_fatrop_read_primal_data(
const double* primal_data, T1* x,
const struct FatropOcpCDims *s) {
64 for (k=0;k<s->K;++k) {
65 casadi_copy(primal_data+s->ux_offs[k], s->nu[k], x+s->nx[k]+s->ux_offs[k]);
66 casadi_copy(primal_data+s->ux_offs[k]+s->nu[k], s->nx[k], x+s->ux_offs[k]);
72 void casadi_fatrop_write_primal_data(
const double* x, T1* primal_data,
const struct FatropOcpCDims *s) {
74 for (k=0;k<s->K;++k) {
75 casadi_copy(x+s->nx[k]+s->ux_offs[k], s->nu[k], primal_data+s->ux_offs[k]);
76 casadi_copy(x+s->ux_offs[k], s->nx[k], primal_data+s->ux_offs[k]+s->nu[k]);
119 template<
typename T1>
130 for (k=0;k<p->
N+1;++k) {
135 for (k=0;k<p->
N;++k) {
144 template<
typename T1>
167 struct blasfeo_dvec v,
r;
168 struct blasfeo_dmat
R;
172 struct FatropOcpCStats
stats;
179 template<
typename T1>
185 template<
typename T1>
196 template<
typename T1>
197 fatrop_int casadi_fatrop_full_eval_constr_jac(
const double* primal_data,
const double* stageparams_p,
const double* globalparams_p,
198 struct blasfeo_dmat* BAbt_p,
struct blasfeo_dmat* Ggt_p,
struct blasfeo_dmat* Ggt_ineq_p,
const struct FatropOcpCDims* s,
void* user_data) {
205 casadi_fatrop_read_primal_data(primal_data, d->
x, s);
206 d_oracle->
arg[0] = d->
x;
207 d_oracle->
arg[1] = d_nlp->
p;
208 d_oracle->
res[0] = d->
g;
209 d_oracle->
res[1] = d->
a;
210 calc_function(&d->
prob->nlp_jac_g, d_oracle);
212 casadi_fatrop_mproject(-1.0, d->
a, p->sp_a, d->
AB, p->ABsp, d->
pv);
213 casadi_project(d->
a, p->sp_a, d->
CD, p->CDsp, d->
pv);
214 casadi_project(d->
a, p->sp_a, d->
I, p->Isp, d->
pv);
216 for (i=0;i<p->Isp[2+p->Isp[1]];++i) {
218 casadi_error(
"Structure mismatch: gap-closing constraints must be like this: x_{k+1}-F(xk,uk).");
225 template<
typename T1>
226 fatrop_int casadi_fatrop_full_eval_contr_viol(
const double* primal_data,
const double* stageparams_p,
const double* globalparams_p,
227 double* res,
const struct FatropOcpCDims* s,
void* user_data) {
228 casadi_int i,k,column;
234 casadi_fatrop_read_primal_data(primal_data, d->
x, s);
235 d_oracle->
arg[0] = d->
x;
236 d_oracle->
arg[1] = d_nlp->
p;
237 d_oracle->
res[0] = d->
g;
238 calc_function(&d->
prob->nlp_g, d_oracle);
240 for (k=0;k<s->K;++k) {
242 for (i=d->
a_ineq_idx[k];i<d->a_ineq_idx[k+1];++i) {
243 res[s->g_ineq_offs[k]+column] = d->
g[d->
a_ineq[i]];
246 for (i=d->
x_ineq_idx[k];i<d->x_ineq_idx[k+1];++i) {
247 res[s->g_ineq_offs[k]+column] = d->
x[d->
x_ineq[i]];
251 for (i=d->
a_eq_idx[k];i<d->a_eq_idx[k+1];++i) {
252 res[s->g_offs[k]+column] = d->
g[d->
a_eq[i]]-d->
nlp->lbz[p->
nlp->nx+d->
a_eq[i]];
255 for (i=d->
x_eq_idx[k];i<d->x_eq_idx[k+1];++i) {
256 res[s->g_offs[k]+column] = d->
x[d->
x_eq[i]]-d->
nlp->lbz[d->
x_eq[i]];
260 for (k=0;k<s->K-1;++k) {
261 casadi_scaled_copy(-1.0, d->
g+p->
AB[k].offset_r, p->nx[k+1], res+s->dyn_eq_offs[k]);
267 template<
typename T1>
268 fatrop_int casadi_fatrop_full_eval_obj_grad(
269 double objective_scale,
270 const double *primal_data,
271 const double *stage_params_k,
272 const double *global_params,
273 double *res,
const struct FatropOcpCDims* s,
void* user_data) {
279 casadi_fatrop_read_primal_data(primal_data, d->
x, s);
280 d_oracle->
arg[0] = d->
x;
281 d_oracle->
arg[1] = d_nlp->
p;
282 d_oracle->
res[0] = d->
g;
283 calc_function(&d->
prob->nlp_grad_f, d_oracle);
285 casadi_fatrop_write_primal_data(d->
g, res, s);
286 casadi_scal(p->
nlp->nx, objective_scale, res);
291 template<
typename T1>
292 fatrop_int casadi_fatrop_full_eval_obj(
293 double objective_scale,
294 const double *primal_data,
295 const double *stage_params_k,
296 const double *global_params,
297 double *res,
const struct FatropOcpCDims* s,
void* user_data) {
302 casadi_fatrop_read_primal_data(primal_data, d->
x, s);
303 d_oracle->
arg[0] = d->
x;
304 d_oracle->
arg[1] = d_nlp->p;
305 d_oracle->
res[0] = res;
306 calc_function(&d->
prob->nlp_f, d_oracle);
308 *res *= objective_scale;
313 template<
typename T1>
314 fatrop_int casadi_fatrop_full_eval_lag_hess(
315 double objective_scale,
316 const double *primal_data,
317 const double *lam_data,
318 const double *stage_params_k,
319 const double *global_params,
320 struct blasfeo_dmat *res,
const struct FatropOcpCDims* s,
void* user_data) {
321 casadi_int k, column, i;
327 casadi_fatrop_read_primal_data(primal_data, d->
x, s);
328 for (k=0;k<s->K;++k) {
330 for (i=d->
a_ineq_idx[k];i<d->a_ineq_idx[k+1];++i) {
331 d->
lam[d->
a_ineq[i]] = lam_data[s->g_ineq_offs[k]+column];
335 for (i=d->
a_eq_idx[k];i<d->a_eq_idx[k+1];++i) {
336 d->
lam[d->
a_eq[i]] = lam_data[s->g_offs[k]+column];
340 for (k=0;k<s->K-1;++k) {
341 casadi_scaled_copy(-1.0, lam_data+s->dyn_eq_offs[k], p->nx[k+1], d->
lam+p->
AB[k].offset_r);
344 d_oracle->
arg[0] = d->
x;
345 d_oracle->
arg[1] = d_nlp->
p;
346 d_oracle->
arg[2] = &objective_scale;
347 d_oracle->
arg[3] = d->
lam;
348 d_oracle->
res[0] = d->
g;
349 d_oracle->
res[1] = d->
h;
350 calc_function(&d->
prob->nlp_hess_l, d_oracle);
352 casadi_project(d->
h, p->sp_h, d->
RSQ, p->RSQsp, d->
pv);
355 for (k=0;k<s->K-1;++k) {
356 casadi_axpy(p->nx[k+1], 1.0, lam_data+s->dyn_eq_offs[k], d->
g+p->
CD[k+1].offset_c);
359 for (k=0;k<s->K;++k) {
361 for (i=d->
x_ineq_idx[k];i<d->x_ineq_idx[k+1];++i) {
362 d->
g[d->
x_ineq[i]] += lam_data[s->g_ineq_offs[k]+column];
366 for (i=d->
x_eq_idx[k];i<d->x_eq_idx[k+1];++i) {
367 d->
g[d->
x_eq[i]] += lam_data[s->g_offs[k]+column];
378 template<
typename T1>
379 fatrop_int casadi_fatrop_eval_BAbt(
const double *states_kp1,
const double *inputs_k,
380 const double *states_k,
const double *stage_params_k,
381 const double *global_params,
struct blasfeo_dmat *res,
const fatrop_int k,
void* user_data) {
385 blasfeo_pack_tran_dmat(p->nx[k+1], p->nx[k], d->
AB+p->AB_offsets[k], p->nx[k+1], res, p->nu[k], 0);
386 blasfeo_pack_tran_dmat(p->nx[k+1], p->nu[k], d->
AB+p->AB_offsets[k]+p->nx[k]*p->nx[k+1], p->nx[k+1], res, 0, 0);
387 blasfeo_pack_dmat(1, p->nx[k+1],
const_cast<T1*
>(d_nlp->
lbz+p->
nlp->nx+p->
AB[k].offset_r), 1, res, p->nx[k]+p->nu[k], 0);
389 casadi_scal(p->nx[k+1], -1.0, d->
g+p->
AB[k].offset_r);
391 blasfeo_pack_dmat(1, p->nx[k+1], d->
g+p->
AB[k].offset_r, 1, res, p->nx[k]+p->nu[k], 0);
398 template<
typename T1>
399 fatrop_int casadi_fatrop_eval_RSQrqt(
400 const double *objective_scale,
401 const double *inputs_k,
402 const double *states_k,
403 const double *lam_dyn_k,
404 const double *lam_eq_k,
405 const double *lam_eq_ineq_k,
406 const double *stage_params_k,
407 const double *global_params,
408 struct blasfeo_dmat *res,
409 const fatrop_int k,
void* user_data) {
413 int n = p->nx[k]+p->nu[k];
414 blasfeo_pack_dmat(p->nx[k], p->nx[k],
415 d->
RSQ+p->RSQ_offsets[k], n, res, p->nu[k], p->nu[k]);
416 blasfeo_pack_dmat(p->nu[k], p->nu[k],
417 d->
RSQ+p->RSQ_offsets[k]+p->nx[k]*n+p->nx[k], n, res, 0, 0);
418 blasfeo_pack_dmat(p->nu[k], p->nx[k],
419 d->
RSQ+p->RSQ_offsets[k]+p->nx[k], n, res, 0, p->nu[k]);
420 blasfeo_pack_dmat(p->nx[k], p->nu[k],
421 d->
RSQ+p->RSQ_offsets[k]+p->nx[k]*n, n, res, p->nu[k], 0);
424 blasfeo_pack_dmat(1, p->nx[k], d->
g+p->
CD[k].offset_c, 1, res, p->nx[k]+p->nu[k], p->nu[k]);
425 blasfeo_pack_dmat(1, p->nu[k], d->
g+p->
CD[k].offset_c+p->nx[k], 1, res, p->nx[k]+p->nu[k], 0);
432 template<
typename T1>
433 fatrop_int casadi_fatrop_eval_Ggt(
434 const double *inputs_k,
435 const double *states_k,
436 const double *stage_params_k,
437 const double *global_params,
438 struct blasfeo_dmat *res,
439 const fatrop_int k,
void* user_data) {
442 casadi_int i, column;
446 int ng_eq = n_a_eq+n_x_eq;
448 blasfeo_dgese(p->nx[k]+p->nu[k]+1, ng_eq, 0.0, res, 0, 0);
451 for (i=d->
a_eq_idx[k];i<d->a_eq_idx[k+1];++i) {
452 blasfeo_pack_tran_dmat(1, p->nx[k],
453 d->
CD+p->CD_offsets[k]+(d->
a_eq[i]-p->
CD[k].offset_r),
454 p->
CD[k].rows, res, p->nu[k], column);
455 blasfeo_pack_tran_dmat(1, p->nu[k],
456 d->
CD+p->CD_offsets[k]+(d->
a_eq[i]-p->
CD[k].offset_r)+p->nx[k]*p->
CD[k].rows,
457 p->
CD[k].rows, res, 0, column);
458 BLASFEO_DMATEL(res, p->nx[k]+p->nu[k], column) = d->
g[d->
a_eq[i]]-d->
nlp->lbz[p->
nlp->nx+d->
a_eq[i]];
461 for (i=d->
x_eq_idx[k];i<d->x_eq_idx[k+1];++i) {
462 int j = d->
x_eq[i]-p->
CD[k].offset_c;
468 BLASFEO_DMATEL(res, j, column) = 1;
469 BLASFEO_DMATEL(res, p->nx[k]+p->nu[k], column) = d->
x[d->
x_eq[i]]-d->
nlp->lbz[d->
x_eq[i]];
477 template<
typename T1>
478 fatrop_int casadi_fatrop_eval_Ggt_ineq(
479 const double *inputs_k,
480 const double *states_k,
481 const double *stage_params_k,
482 const double *global_params,
483 struct blasfeo_dmat *res,
484 const fatrop_int k,
void* user_data) {
487 casadi_int i, column;
491 int ng_ineq = n_a_ineq+n_x_ineq;
498 blasfeo_dgese(p->nx[k]+p->nu[k]+1, ng_ineq, 0.0, res, 0, 0);
501 for (i=d->
a_ineq_idx[k];i<d->a_ineq_idx[k+1];++i) {
502 blasfeo_pack_tran_dmat(1, p->nx[k],
503 d->
CD+p->CD_offsets[k]+(d->
a_ineq[i]-p->
CD[k].offset_r),
504 p->
CD[k].rows, res, p->nu[k], column);
505 blasfeo_pack_tran_dmat(1, p->nu[k],
506 d->
CD+p->CD_offsets[k]+(d->
a_ineq[i]-p->
CD[k].offset_r)+p->nx[k]*p->
CD[k].rows,
507 p->
CD[k].rows, res, 0, column);
508 BLASFEO_DMATEL(res, p->nx[k]+p->nu[k], column) = d->
g[d->
a_ineq[i]];
511 for (i=d->
x_ineq_idx[k];i<d->x_ineq_idx[k+1];++i) {
512 int j = d->
x_ineq[i]-p->
CD[k].offset_c;
518 BLASFEO_DMATEL(res, j, column) = 1;
519 BLASFEO_DMATEL(res, p->nx[k]+p->nu[k], column) = d->
x[d->
x_ineq[i]];
527 template<
typename T1>
528 fatrop_int casadi_fatrop_get_nx(
const fatrop_int k,
void* user_data) {
534 if (k==p->N+1)
return p->nx[k-1];
539 template<
typename T1>
540 fatrop_int casadi_fatrop_get_nu(
const fatrop_int k,
void* user_data) {
547 template<
typename T1>
548 fatrop_int casadi_fatrop_get_ng(
const fatrop_int k,
void* user_data) {
568 template<
typename T1>
569 fatrop_int casadi_fatrop_get_horizon_length(
void* user_data) {
577 template<
typename T1>
578 fatrop_int casadi_fatrop_get_ng_ineq(
const fatrop_int k,
void* user_data) {
583 return n_a_ineq+n_x_ineq;
587 template<
typename T1>
588 fatrop_int casadi_fatrop_get_bounds(
double *lower,
double *upper,
const fatrop_int k,
void* user_data) {
593 casadi_int nx = p->
nlp->nx;
597 for (i=d->
a_ineq_idx[k];i<d->a_ineq_idx[k+1];++i) {
598 lower[column] = d_nlp->
lbz[nx+d->
a_ineq[i]];
599 upper[column] = d_nlp->
ubz[nx+d->
a_ineq[i]];
603 for (i=d->
x_ineq_idx[k];i<d->x_ineq_idx[k+1];++i) {
604 lower[column] = d_nlp->
lbz[d->
x_ineq[i]];
605 upper[column] = d_nlp->
ubz[d->
x_ineq[i]];
613 template<
typename T1>
614 fatrop_int casadi_fatrop_get_initial_xk(
double *xk,
const fatrop_int k,
void* user_data) {
619 casadi_copy(d_nlp->
z+p->
CD[k].offset_c, p->nx[k], xk);
625 template<
typename T1>
626 fatrop_int casadi_fatrop_get_initial_uk(
double *uk,
const fatrop_int k,
void* user_data) {
630 casadi_copy(d_nlp->
z+p->
CD[k].offset_c+p->nx[k], p->nu[k], uk);
636 template<
typename T1>
637 void casadi_fatrop_work(
const casadi_fatrop_prob<T1>* p, casadi_int* sz_arg, casadi_int* sz_res, casadi_int* sz_iw, casadi_int* sz_w) {
638 casadi_nlpsol_work(p->
nlp, sz_arg, sz_res, sz_iw, sz_w);
641 *sz_w = casadi_max(*sz_w, 2*(p->
nlp->nx+p->
nlp->ng));
644 *sz_w += casadi_sp_nnz(p->
ABsp);
645 *sz_w += casadi_sp_nnz(p->
CDsp);
646 *sz_w += casadi_sp_nnz(p->
RSQsp);
647 *sz_w += casadi_sp_nnz(p->
Isp);
649 *sz_w += p->
nlp->nx+p->
nlp->ng;
650 *sz_w += casadi_sp_nnz(p->
sp_a);
651 *sz_w += casadi_sp_nnz(p->
sp_h);
652 *sz_w += casadi_max(p->
nlp->nx,p->
nlp->ng);
653 *sz_w += blasfeo_memsize_dvec(p->
nxu_max+1)+64;
654 *sz_w += blasfeo_memsize_dvec(p->
nx_max+p->
nlp->ng)+64;
661 *sz_iw += p->
nlp->ng;
662 *sz_iw += p->
nlp->ng;
663 *sz_iw += p->
nlp->nx;
664 *sz_iw += p->
nlp->nx;
669 template<
typename T1>
679 d->
AB = *w; *w += casadi_sp_nnz(p->
ABsp);
680 d->
CD = *w; *w += casadi_sp_nnz(p->
CDsp);
681 d->
RSQ = *w; *w += casadi_sp_nnz(p->
RSQsp);
682 d->
I = *w; *w += casadi_sp_nnz(p->
Isp);
683 d->
x = *w; *w += p->
nlp->nx;
684 d->
lam = *w; *w += p->
nlp->nx+p->
nlp->ng;
685 d->
a = *w; *w += casadi_sp_nnz(p->
sp_a);
686 d->
h = *w; *w += casadi_sp_nnz(p->
sp_h);
687 d->
g = *w; *w += casadi_max(p->
nlp->nx,p->
nlp->ng);
688 blasfeo_create_dvec(p->
nxu_max+1, &d->v, (
void*) (((
unsigned long long) (*w)+63)/64*64));
689 *w += blasfeo_memsize_dvec(p->
nxu_max+1)+64;
690 blasfeo_create_dvec(p->
nx_max+p->
nlp->ng, &d->
r, (
void*) (((
unsigned long long) (*w)+63)/64*64));
691 *w += blasfeo_memsize_dvec(p->
nx_max+p->
nlp->ng)+64;
692 blasfeo_create_dmat(p->
nxu_max, p->
nxu_max, &d->
R, (
void*) (((
unsigned long long) (*w)+63)/64*64));
700 d->
a_eq = *iw; *iw += p->
nlp->ng;
702 d->
x_eq = *iw; *iw += p->
nlp->nx;
735 template<
typename T1>
737 casadi_int k, i, start, stop, nx;
742 struct FatropOcpCInterface* ocp_interface = &d->
ocp_interface;
744 ocp_interface->get_nx = casadi_fatrop_get_nx<T1>;
745 ocp_interface->get_nu = casadi_fatrop_get_nu<T1>;
746 ocp_interface->get_ng = casadi_fatrop_get_ng<T1>;
747 ocp_interface->get_n_stage_params = 0;
748 ocp_interface->get_n_global_params = 0;
749 ocp_interface->get_default_stage_params = 0;
750 ocp_interface->get_default_global_params = 0;
751 ocp_interface->get_ng_ineq = casadi_fatrop_get_ng_ineq<T1>;
752 ocp_interface->get_horizon_length = casadi_fatrop_get_horizon_length<T1>;
754 ocp_interface->get_bounds = casadi_fatrop_get_bounds<T1>;
755 ocp_interface->get_initial_xk = casadi_fatrop_get_initial_xk<T1>;
756 ocp_interface->get_initial_uk = casadi_fatrop_get_initial_uk<T1>;
758 ocp_interface->full_eval_constr_jac = casadi_fatrop_full_eval_constr_jac<T1>;
759 ocp_interface->full_eval_obj_grad = casadi_fatrop_full_eval_obj_grad<T1>;
760 ocp_interface->full_eval_obj = casadi_fatrop_full_eval_obj<T1>;
761 ocp_interface->full_eval_contr_viol = casadi_fatrop_full_eval_contr_viol<T1>;
762 ocp_interface->full_eval_lag_hess = casadi_fatrop_full_eval_lag_hess<T1>;
764 ocp_interface->eval_BAbt = casadi_fatrop_eval_BAbt<T1>;
765 ocp_interface->eval_RSQrqt = casadi_fatrop_eval_RSQrqt<T1>;
766 ocp_interface->eval_Ggt = casadi_fatrop_eval_Ggt<T1>;
767 ocp_interface->eval_Ggt_ineq = casadi_fatrop_eval_Ggt_ineq<T1>;
768 ocp_interface->eval_rq = 0;
769 ocp_interface->eval_L = 0;
779 for (k=0;k<p->
N+1;++k) {
784 for (i=start;i<stop;++i) {
785 if (d_nlp->
lbz[nx+i]==d_nlp->
ubz[nx+i]) {
788 if (d_nlp->
lbz[nx+i]==-std::numeric_limits<T1>::infinity() && d_nlp->
ubz[nx+i]==std::numeric_limits<T1>::infinity())
continue;
797 for (i=start;i<stop;++i) {
798 if (d_nlp->
lbz[i]==d_nlp->
ubz[i]) {
801 if (d_nlp->
lbz[i]==-std::numeric_limits<T1>::infinity() && d_nlp->
ubz[i]==std::numeric_limits<T1>::infinity())
continue;
813 template<
typename T1>
816 casadi_int k, i, column;
824 fatrop_int ret = fatrop_ocp_c_solve(d->
solver);
836 const struct blasfeo_dvec* primal = fatrop_ocp_c_get_primal(d->
solver);
837 const struct blasfeo_dvec* dual = fatrop_ocp_c_get_dual(d->
solver);
838 const struct FatropOcpCDims* str = fatrop_ocp_c_get_dims(d->
solver);
839 const struct FatropOcpCStats* stats = fatrop_ocp_c_get_stats(d->
solver);
841 d->
stats.compute_sd_time = stats->compute_sd_time;
842 d->
stats.duinf_time = stats->duinf_time;
843 d->
stats.eval_hess_time = stats->eval_hess_time;
844 d->
stats.eval_jac_time = stats->eval_jac_time;
845 d->
stats.eval_cv_time = stats->eval_cv_time;
846 d->
stats.eval_grad_time = stats->eval_grad_time;
847 d->
stats.eval_obj_time = stats->eval_obj_time;
848 d->
stats.initialization_time = stats->initialization_time;
849 d->
stats.time_total = stats->time_total;
850 d->
stats.eval_hess_count = stats->eval_hess_count;
851 d->
stats.eval_jac_count = stats->eval_jac_count;
852 d->
stats.eval_cv_count = stats->eval_cv_count;
853 d->
stats.eval_grad_count = stats->eval_grad_count;
854 d->
stats.eval_obj_count = stats->eval_obj_count;
855 d->
stats.iterations_count = stats->iterations_count;
856 d->
stats.return_flag = stats->return_flag;
858 const double* primal_data = primal->pa;
859 const double* dual_data = dual->pa;
861 casadi_fatrop_read_primal_data(primal_data, d_nlp->
z, str);
864 for (k=0;k<str->K;++k) {
866 for (i=d->
a_ineq_idx[k];i<d->a_ineq_idx[k+1];++i) {
867 d_nlp->
lam[p_nlp->
nx+d->
a_ineq[i]] = dual_data[str->g_ineq_offs[k]+column];
870 for (i=d->
x_ineq_idx[k];i<d->x_ineq_idx[k+1];++i) {
871 d_nlp->
lam[d->
x_ineq[i]] = dual_data[str->g_ineq_offs[k]+column];
876 for (k=0;k<str->K;++k) {
878 for (i=d->
a_eq_idx[k];i<d->a_eq_idx[k+1];++i) {
879 d_nlp->
lam[p_nlp->
nx+d->
a_eq[i]] = dual_data[str->g_offs[k]+column];
882 for (i=d->
x_eq_idx[k];i<d->x_eq_idx[k+1];++i) {
883 d_nlp->
lam[d->
x_eq[i]] = dual_data[str->g_offs[k]+column];
888 for (k=0;k<str->K-1;++k) {
889 casadi_scaled_copy(-1.0, dual_data+str->dyn_eq_offs[k], p->
nx[k+1], d_nlp->
lam+p_nlp->
nx+p->
AB[k].
offset_r);
892 fatrop_ocp_c_destroy(d->
solver);
const casadi_fatrop_prob< T1 > * prob
int unified_return_status
struct FatropOcpCStats stats
struct FatropOcpCInterface ocp_interface
casadi_nlpsol_data< T1 > * nlp
struct FatropOcpCSolver * solver
OracleCallback nlp_grad_f
const casadi_int * I_offsets
OracleCallback nlp_hess_l
const casadi_int * RSQ_offsets
const casadi_int * CD_offsets
const casadi_nlpsol_prob< T1 > * nlp
const casadi_int * AB_offsets
casadi_oracle_data< T1 > * oracle