-
Notifications
You must be signed in to change notification settings - Fork 23
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
newpt_wrapper
access to undefined reference
#151
Comments
I think that replacing this line if m.newpoint_user != nothing
ret = m.newpt_callback(m, x, lambda, m.newpoint_user)
else
ret = m.newpt_callback(m, x, lambda)
end should solve the issue, but I don't know if this is the most idiomatic way of doing it. |
Here is a minimal working example. Source using KNITRO
function callbackNewPoint(kc, x, duals, userParams)
println("[INFO] callbackNewPoint")
return 0
end
lm = KNITRO.LMcontext()
kc = KNITRO.KN_new_lm(lm)
KNITRO.KN_add_vars(kc, 1)
KNITRO.KN_set_var_lobnds(kc, Cint(0), 2.0)
KNITRO.KN_set_var_primal_init_values(kc, [0.0])
KNITRO.KN_set_obj_goal(kc, KNITRO.KN_OBJGOAL_MINIMIZE)
KNITRO.KN_add_obj_quadratic_struct(kc, Cint[0], Cint[0], [1.0])
KNITRO.KN_set_newpt_callback(kc, callbackNewPoint)
# KNITRO.KN_set_newpt_callback(kc, callbackNewPoint, []) # this one works
KNITRO.KN_solve(kc)
KNITRO.KN_free(kc)
KNITRO.KN_release_license(lm) Output
|
Closed with #152. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an issue related to #143 after upgrading to
v0.9.0
:This only happens if I set a new point callback:
The text was updated successfully, but these errors were encountered: