jump-dev / CPLEX.jl

A Julia interface to the CPLEX solver
https://www.ibm.com/products/ilog-cplex-optimization-studio
MIT License
134 stars 63 forks source link

Unable to get node id in callback #402

Closed ZacharieALES closed 2 years ago

ZacharieALES commented 2 years ago

I try to get the id of the current node using:

valueP = Ref{Cdouble}()
ret = CPXcallbackgetinfodbl(cb_data, CPXCALLBACKINFO_NODEUID, valueP)
@show valueP[], ret

This displays very low values of "valueP" (ex: 6*10^-10) and the value "ret" is always 1003.

Do I do something wrong?

joaquimg commented 2 years ago

According to https://www.ibm.com/docs/en/icos/12.10.0?topic=manual-cpxcallbackinfo CPXCALLBACKINFO_NODEUID is a long and not a double. You would need something like: CPXcallbackgetinfolong

(haven't tested)

odow commented 2 years ago

Presumably something like:

valueP = Ref{Clong}()
ret = CPXcallbackgetinfolong(cb_data, CPXCALLBACKINFO_NODEUID, valueP)
@show valueP[], ret

I'm going to close this issue because it isn't a bug in CPLEX.jl.

If you have a follow-up question, please post on the community forum: https://discourse.julialang.org/c/domain/opt/13 There are more people who read the questions, and it may help someone else in future with a similar question.