[Osi-tickets] [COIN-OR Open Solver Interface] #50: CPLEX Error 1017: Not available for mixed-integer programs.
COIN-OR Open Solver Interface
coin-trac at coin-or.org
Mon Feb 18 11:23:27 EST 2008
#50: CPLEX Error 1017: Not available for mixed-integer programs.
----------------------+-----------------------------------------------------
Reporter: joe | Owner: mjs
Type: defect | Status: new
Priority: critical | Milestone:
Component: OsiCpx | Version: 0.96
Keywords: |
----------------------+-----------------------------------------------------
This trace comes from the discussion
[http://groups.google.com/group/optimizationservices/t/96d24e16583ef6a3]
I tried to solve a pure ILP program with CPLEX and OSSolverService
(from trunk version one hour ago) but it is resulting in a crash. This
problem is computed successfully with cbc and symphony. Please find my
problem computesheet0-problem.osil in google "Files section".
OSSolverService's output :
{{{
Input String = -solver cplex -osil computesheet0-problem.osil -osrl
computesheet0-problem.osrl
Call Text Extra
Call scan string
call ossslex
Found option: -solver cplex
Found option: computesheet0-problem.osil
Found option: computesheet0-problem.osrl
done with call to ossslex
HERE ARE THE OPTION VALUES:
OSiL file = computesheet0-problem.osil
OSrL file = computesheet0-problem.osrl
Inside FileUtil:getFileAsString and calling inFile
Inside FileUtil:getFileAsString, file read put into ostringstream
Inside FileUtil:getFileAsString, convert to a string
Solver Name = cplex
Parsing took (seconds): 0
Start Solve with a Coin Solver
SOLVER NAME = cplex
ILOG CPLEX 10.010, licensed to "Joe", options: e m b q use=10
CREATING A NEW OPTIMIZATION SOLUTION
Tried aggregator 5 times.
MIP Presolve eliminated 170 rows and 70 columns.
MIP Presolve modified 1292 coefficients.
Aggregator did 1552 substitutions.
Reduced MIP has 162 rows, 268 columns, and 739 nonzeros.
Presolve time = 0.03 sec.
Clique table members: 59.
MIP emphasis: balance optimality and feasibility.
Root relaxation solution time = 0.01 sec.
CPLEX Error 1017: Not available for mixed-integer programs.
ERROR: CPXgetpi returned error 1017 (getRowPrice in
OsiCpxSolverInterface)
terminate called after throwing an instance of 'CoinError
}}}
Finally, i've checked in <cplex.h> header file :
{{{
#define CPXERR_NOT_FOR_MIP 1017
}}}
For my purpose, I've made a quick and dirty fix for my OS/Osi sources.
I'm not sure this would be usefull for anyone else. Please find this
ugly patch for the trunk :
{{{
Index: /local/joe/20080218/OS/OS1.1/Osi/src/OsiCpx/
OsiCpxSolverInterface.cpp
===================================================================
--- /local/joe/20080218/OS/OS1.1/Osi/src/OsiCpx/
OsiCpxSolverInterface.cpp (revision 1188)
+++ /local/joe/20080218/OS/OS1.1/Osi/src/OsiCpx/
OsiCpxSolverInterface.cpp (working copy)
@@ -1237,6 +1237,7 @@
return colsol_;
}
//------------------------------------------------------------------
+
const double * OsiCpxSolverInterface::getRowPrice() const
{
debugMessage("OsiCpxSolverInterface::getRowPrice()\n");
@@ -1248,7 +1249,7 @@
{
rowsol_ = new double[nrows];
int err = CPXgetpi( env_, getMutableLpPtr(), rowsol_, 0,
nrows-1 );
- if ( err == CPXERR_NO_SOLN )
+ if ( err == CPXERR_NO_SOLN || err == CPXERR_NOT_FOR_MIP )
CoinFillN( rowsol_, nrows, 0.0 );
else
checkCPXerror( err, "CPXgetpi", "getRowPrice" );
@@ -1268,7 +1269,7 @@
{
redcost_ = new double[ncols];
int err = CPXgetdj( env_, getMutableLpPtr(), redcost_, 0,
ncols-1 );
- if ( err == CPXERR_NO_SOLN )
+ if ( err == CPXERR_NO_SOLN || err == CPXERR_NOT_FOR_MIP )
CoinFillN( redcost_, ncols, 0.0 );
else
checkCPXerror( err, "CPXgetdj", "getReducedCost" );
}}}
--
Ticket URL: <https://projects.coin-or.org/Osi/ticket/50>
COIN-OR Open Solver Interface <http://projects.coin-or.org/Osi>
An API for a variety of LP and MIP solvers (and more).
More information about the Osi-tickets
mailing list