Originally posted by: SystemAdmin
[annam said:]
Hi,
I am quite new to Cplex but I am familiar with the OsiSolverInterfaces.
I want to iteratively solve MIPs with Cplex.
I write the instances with the OsiCpxSolverInterface and then, in order to access the CPLEX environment,
I get the pointer to the CPLEX problem and environment in this way:
lp = OsiS->getLpPtr();
env = OsiS->getEnvironmentPtr();
solve the problem with:
status = CPXlpopt (env, lp);
and free the Cplex environment with:
status = CPXcloseCPLEX (&env);
If I do this only once everything is fine, I get an optimal solution.
The problem arises when I put this optimization block inside a bigger program for which I have to run different instances of the optimization problem iteratively.
The first run of the optimization block works fine but then, when the second optimization run starts,
I get the following error message:
ERROR: CPXcreateprob returned error 1002 (getMutableLpPtr in OsiCpxSolverInterface)
terminate called after throwing an instance of 'CoinError'
Abort
It seems that there is problem with the interaction of Cplex with the Coin Osi libraries.
I don't know how to manage it.
I've looked for a solution to this problem throughout the web and Cplex Help but couldn't manage to do it.
Does anyone have any suggestion?
Thanks in advance
anna
#CPLEXOptimizers#DecisionOptimization