From a previous post (Computing common components in KNITRO callbacks), I am working on a creating an algorithm that uses the KNITRO.jl solver. I am in the process of trying to report data as I run experiments on several datasets.
As seen in the screenshot below, when calling KNITRO, I see this below:
I am wondering if it is possible to get the ||step|| from a call to KNITRO. Something like KNITRO.KN_get_step_norm(kc). Looking around the documentation, I was not able to find an immediate way to do this. Any pointers would be appreciated. Thanks!
In particular, I have a function:
function callbackNewPoint(kc, x, lambda_, userParams)
# Get the number of variables in the model
n = KNITRO.KN_get_number_vars(kc)
# Query information about the current problem.
dFeasError = KNITRO.KN_get_abs_feas_error(kc)
if verbose
println(">> New point computed by Knitro:(", x, ")")
println("Number FC evals= ", KNITRO.KN_get_number_FC_evals(kc))
println("Current feasError= ", dFeasError)
# println("step norm: ," KNITRO.KN_...)
end
return 0
end
If I can print it out in this funciton, then I could store in my data table.
From the Julia example nlp2.jl, there an example callback
function callbackNewPoint(kc, x, lambda_, userParams)
# Get the number of variables in the model
n = KNITRO.KN_get_number_vars(kc)
# Query information about the current problem.
dFeasError = KNITRO.KN_get_abs_feas_error(kc)
if verbose
println(">> New point computed by Knitro:(", x, ")")
println("Number FC evals= ", KNITRO.KN_get_number_FC_evals(kc))
println("Current feasError= ", dFeasError)
end
# Demonstrate user-defined termination
#(Uncomment to activate)
if KNITRO.KN_get_obj_value(kc) > 0.2 && dFeasError <= 1.0e-4
return KNITRO.KN_RC_USER_TERMINATION
end
return 0
end
Does x refer to x_{k+1} and lambda_ refer to \lambda_{k+1}, and KN_get_solution refer to (x_k, \lambda_k)?
Thanks!