Open fschwaiger opened 3 years ago
I haven't had a chance to look at this, but just wanted to point out that there is a free Matlab toolbox for interfacing to many of the COIN-OR solvers, including Clp: https://www.inverseproblem.co.nz/OPTI/.
Thanks. We are aware of this toolbox and cannot use it, because it is missing this warm start feature.
The documentation for using warm start follows the example in
defaults.cpp
and goes like this:I am writing a MEX interface to use CLP in MATLAB and have the following (should-be) equivalent code, that links dynamically agains the official pre-built
Clp.dll
v1.17.6:This code is running fine and as expected on Linux and MacOS. On Windows, this code causes Access Violation in the lines with
delete[] status
. Or, better, it does not crash if I allow the memory leak and comment out thedelete[] status
lines:Now, I remember from a different project that we got Access Violations when writing to global parameters in a different DLL. I understand that according to this MSVC doc article, any access to data from a DLL is forbidden. In my understanding that should include
delete[]
ing pointers allocated by said DLL.I think calling
delete[]
on the return array fromstatusCopy
is wrong as a concept. Maybe one of the following should help?1) return a
std::vector
fromClpSimple::statusCopy
2) provide a function inClpSimplex
were the user can return the pointer