-
When using the C++ interface, we assume that most optimization information can be obtained from the function finalize_solution(). However, I have noticed that when the optimization terminates due to exceeding the maximum time (max_wall_time or max_cpu_time), the returned multiplier and constraint values are wrong or incomplete in finalize_solution(). For example, solve the hs071 problem and set max_wall_time=0.001. the output is:
It stops at iteration 2 with incomplete multiplier and constraint values. Conversely, if we set the termination condition as max_iter=2, the output becomes:
It reproduces the same decision variable values and optimization process, but now we get the full multiplier and constraint values. Any ideas on how to fix this, or is it deliberately designed this way? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thank you for the detailed report. I think when the termination due to the CPU timelimit was added, it was forgotten to add that the full solution should be passed on to It turns out that this is easy to fix: c967728. |
Beta Was this translation helpful? Give feedback.
Thank you for the detailed report.
I think when the termination due to the CPU timelimit was added, it was forgotten to add that the full solution should be passed on to
finalize_solution()
. And when the termination due to the wallclock timelimit was added by mostly copy-pasting the other timelimit, this was forgotten, too.It turns out that this is easy to fix: c967728.