Skip to content

Commit

Permalink
remove try catch in objective function (#9)
Browse files Browse the repository at this point in the history
This was a bad idea, should be done by user if needed.
  • Loading branch information
mohamed82008 authored Feb 24, 2024
1 parent 9e2a081 commit 926f46a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/NonconvexIpopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,9 @@ function get_ipopt_problem(obj, ineq_constr, eq_constr, x0, xlb, xub, first_orde
end
end
end
_obj = function (x)
try
return obj(x)
catch
return Inf
end
end
prob = Ipopt.CreateIpoptProblem(
nvars, xlb, xub, ineq_nconstr + eq_nconstr, clb, cub,
nvalues(ineqJ0) + nvalues(eqJ0), Hnvalues, _obj,
nvalues(ineqJ0) + nvalues(eqJ0), Hnvalues, obj,
eval_g, eval_grad_f, eval_jac_g, eval_h,
)
prob.x = x0
Expand Down

0 comments on commit 926f46a

Please sign in to comment.