27 void casadi_bound_consistency(casadi_int n, T1* x, T1* lam,
28 const T1* lbx,
const T1* ubx) {
35 lb = lbx ? lbx[i] : 0.;
36 ub = ubx ? ubx[i] : 0.;
38 x[i] = fmin(fmax(x[i], lb), ub);
40 if (std::isinf(lb) && std::isinf(ub)) {
43 }
else if (std::isinf(lb) || x[i] - lb > ub - x[i]) {
45 lam[i] = fmax(0., lam[i]);
46 }
else if (std::isinf(ub) || x[i] - lb < ub - x[i]) {
48 lam[i] = fmin(0., lam[i]);