Reconsider holding the objective constant outside of the solver
Currently, LQOI essentially keeps the constant part of the objective for itself, storing it in a field of the optimizer rather than actually passing it to the solver. However, there are situations (like https://github.com/JuliaOpt/Gurobi.jl/issues/111 ) where it's useful to actually have that constant exposed to the solver.
Exposing the objective constant to the solver would require that all the wrapped solvers support that:
- [x] Gurobi: supported: http://www.gurobi.com/documentation/7.0/refman/objcon.html
- [x] GLPK: supported: http://www.chiark.greenend.org.uk/doc/glpk-doc/glpk.pdf (call
glp_set_obj_coefwithj=0to set the constant term) - [x] Xpress: supported: https://www.artelys.com/uploads/pdfs/Xpress/Xpress_Optimizer_2447PS.pdf (see page 499, column -1 refers to the constant in the objective)
- [x] Cplex: supported: https://www.ibm.com/support/knowledgecenter/ko/SSSA5P_12.6.2/ilog.odms.studio.help/CPLEX/ReleaseNotes/topics/releasenotes1262/PLUGINS_ROOT/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgobjoffset.html
I think this could also be done in a compatible way by doing the following:
- Create new functions in the LQOI solver interface
set_constant_objectiveandget_constant_objective, with default definitions that just access the.objective_constantfield. - In each solver, implement those interface functions using the internal APIs
- Once all the solvers are updated, delete the
objective_constantfield from LQOI
I agree it easier, it will make a lot easier sending informartion like b&b cut off to speed up prunning. Lets do it!
we can close?
No. Once this LQOI is tagged, we should remove lines like
https://github.com/JuliaOpt/LinQuadOptInterface.jl/blob/b553df3dde540981c702943b420e26716145715d/src/solver_interface.jl#L393
and remove the objective_constant field.