thanks for spotting this. I ran some tests today, and it seems that the Osi interface uses additivity for the linear constraint coefficients. We also add any nonlinear expressions to the appropriate row, so it is consistent with our philosophy to apply your patch. I will commit later this evening.
Horand I. Gassmann, Professor
Kenneth C. Rowe School of Business, Dalhousie University
6100 University Avenue, PO Box 15000
Halifax, Nova Scotia, Canada, B3H 4R2
ph. (902) 494-1844
fax (902) 494-1107
] on behalf of Tony Kelman [kel...@berkeley.edu
Sent: January 21, 2015 3:09 PM
Subject: [OS] Duplicate linear objective coefficients
I’m in the process of writing an interface between the JuMP (http://jump.readthedocs.org
) modeling language for Julia (http://julialang.org
) and Optimization Services, writing OSiL files to access solvers such as Bonmin and Couenne that are otherwise difficult to access from high-level languages right now because they only have C++ API’s. The end result once I get everything working should be similar to the prototype nonlinear Matlab interface I sent to this list in October 2013, but much higher-performance thanks to Julia’s just-in-time compilation, and fully open-source.
I have a question about linear objective coefficients in OSiL. As far as I can read the OSiL.xsd schema, there don’t appear to be any assumptions or requirements that the indices of objective coefficients be sorted or unique. Depending on the modeling language, it may potentially be simpler to write the interface in such a way that the generated OSiL file directly translates objective coefficients without combining duplicates or sorting indices. I will have to do some testing, but should OSiL files with this irregular set of objective coefficients be valid and work correctly, or be checked and verified against?
Based on the current code, it looks like any solvers that use OSInstance::getDenseObjectiveCoefficients() could interpret an objective with duplicate coefficients incorrectly. The dense coefficients are all initialized to zero, but the = at https://projects.coin-or.org/OS/browser/trunk/OS/src/OSCommonInterfaces/OSInstance.cpp?rev=4915#L2218
means only the last objective coefficient with a given index will be seen by the solver, rather than combining values with the same index. Would it make sense to change that = to a += ?
OS mailing list