Skip to content

Conversation

@spockoyno
Copy link
Contributor

Multivariate user-defined functions in JuMP do not currently allow Hessians. This breaks integer optimisation with Pavito; see https://discourse.julialang.org/t/integer-optimisation-with-users-multivariate-functions-possible-in-julia/17924. The proposed workaround resolves this issue.

src/algorithm.jl Outdated
m.vartypes = fill(:Cont, numvar)

MathProgBase.initialize(d, [:Grad, :Jac, :Hess])
d.disable_2ndorder ? MathProgBase.initialize(d, [:Grad, :Jac]) : MathProgBase.initialize(d, [:Grad, :Jac, :Hess])
Copy link
Member

Choose a reason for hiding this comment

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

Use :Hess in MathProgBase.features_available(d) instead of d.disable_2ndorder. The former is the documented API (https://mathprogbasejl.readthedocs.io/en/latest/nlp.html#features_available) and the latter is an internal implementation detail that works only when d is of a certain type. This should resolve the test failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comments. Hope the second version is better. Alternatively, we could just check if :Hess is contained in MathProgBase.features_available(d) and use either [:Grad, :Jac, :Hess] or [:Grad, :Jac] accordingly. In fact, simply setting to MathProgBase.features_available(d) in lines 96 and 380 worked both in the Pavito-provided and my own examples.

Copy link
Member

@mlubin mlubin left a comment

Choose a reason for hiding this comment

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

The code change is correct and it looks like the AppVeyor failure is a pre-existing condition. It would be nice to have this use case covered by tests so that it doesn't break in the future but I'll leave that up to @ccoffrin and @chriscoey to enforce or not.

@ccoffrin
Copy link
Collaborator

I don't know anything about appveyor or windows really. I'll pass on updating this until someone reports it is not working on Windows.

@chriscoey
Copy link
Contributor

thanks @spockoyno!

@chriscoey chriscoey merged commit fe689d4 into jump-dev:master Nov 29, 2018
@spockoyno spockoyno deleted the patch-1 branch November 30, 2018 18:09
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.

4 participants