Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call jac_structure if problem has no constraints #66

Closed
wants to merge 1 commit into from

Conversation

abelsiqueira
Copy link

CC @mlubin

Untested because I don't have KNITRO. Follows jump-dev/Ipopt.jl#71, fixing for JuliaOpt/MathProgBase.jl#133.

@yeesian
Copy link
Collaborator

yeesian commented Apr 29, 2017

@mlubin I don't know what to check for (it seems like the unit test is supposed to be added at the MPB level), but this seems acceptable to me. Okay to merge?

@mlubin
Copy link
Member

mlubin commented Apr 29, 2017

If it passes rosenbrocktest then you can merge.

Copy link
Contributor

@gragusa gragusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and won't work (even fixing row 85). Although the nonlinear model is loaded correctly, KNITRO still calls eval_jac_g callback --- it seems the numConstr=0 and empty indexes are not the right wy to communicate to KNITRO that the problem is unconstrained. Should probably pass pointer to null somewhere?

initialize(d, init_feat)

Ihess, Jhess = has_hessian ? hesslag_structure(d) : (Int[], Int[])
Ijac, Jjac = numConstr > 0 && jac_structure(d) : (Int[], Int[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& should be ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

@sylvainmouret
Copy link
Contributor

sylvainmouret commented Jul 6, 2017

The remaining issue mentioned by gragusa is due to the fact that Knitro asks for objective gradient and jacobian evaluations through a single callback.
Then, the interface calls the two separate callbacks internally.
To fix this, you need to modify the line 254
kp.eval_jac_g(x,unsafe_wrap(Array,J_,nnzJ))
by
if m > 0
kp.eval_jac_g(x,unsafe_wrap(Array,J_,nnzJ))
end

@huckl3b3rry87
Copy link
Contributor

@sylvainmouret line 254 of what script?

@sylvainmouret
Copy link
Contributor

Sorry, I forgot to mention it. It's in KNITRO.jl.

@sylvainmouret
Copy link
Contributor

This has been implement in #73 so I will close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants