Repository navigation
Update all objective coefficients in one time - #98
Conversation
|
@flomnes Is this ready for review? If yes, can we have a brief call? because I'm not sure I understand how the SlowUpdates mechanism works |
|
This can be improved, IMO. by (note
The code is rather inefficient if the objective is not dense. How about changing the code to something like this to create sparse arrays for calling XPRSchgobj(): |
This is actually our own function, though I admit the naming is a bit confusing and should be changed or-tools/ortools/linear_solver/xpress_interface.cc Lines 88 to 94 in 8564311 |
Thank you Daniel, how about opening a new PR to take into account your proposal. |
Fine with me. The code is not wrong by itself, so no need to hold back the merge for this. |
Short description
This PR is about changing the behavior of
XpressInterface::SetObjectiveCoefficient, the function which is used to set the objective coefficient for a single variable. This approach proves to be much faster than individual updates.Before
XpressInterface::SetObjectiveCoefficientimmediately changes the coefficients by callingAfter
The model is invalidated by calling
InvalidateModelSynchronization. When callingMPSolver::Solve, all coefficients are extracted in one time