30 #define STRONGBRANCH_RESTOREBASIS 39 #define CHECK_SPXSOLVE true 40 #define CHECK_SPXSTRONGBRANCH true 42 #define EXIT_AT_WRONG_RESULT false 43 #define EXIT_AT_CPXERROR false 45 #define CPX_CALL(x) do \ 48 if( (_cpxstat_ = (x)) != 0 ) \ 50 SCIPmessagePrintWarning(_messagehdlr, "CPLEX error <%d>; SoPlex result unchecked\n", _cpxstat_); \ 51 if( EXIT_AT_CPXERROR ) \ 65 #define CHECK_SOPLEX_PARAM(x) \ 68 SCIPmessagePrintWarning(_messagehdlr, "SoPlex: unsupported parameter value\n"); \ 81 #ifndef SOPLEX_SUBVERSION 82 #define SOPLEX_SUBVERSION 0 86 #if (SOPLEX_VERSION < 200 || (SOPLEX_VERSION == 200 && SOPLEX_SUBVERSION < 2) || (SOPLEX_VERSION > 200 && SOPLEX_VERSION < 201)) 87 #error "This interface is not compatible with SoPlex versions prior to 2.0.0.2" 90 #include "spxgithash.h" 99 #define SOPLEX_VERBLEVEL 5 120 #define SOPLEX_TRY(messagehdlr, x) do \ 126 catch(const SPxException& E) \ 128 std::string s = E.what(); \ 129 SCIPmessagePrintWarning((messagehdlr), "SoPlex threw an exception: %s\n", s.c_str()); \ 130 return SCIP_LPERROR; \ 136 #define SOPLEX_TRY(messagehdlr, x) do \ 142 catch(const SPxException& E) \ 144 return SCIP_LPERROR; \ 153 #define SOPLEX_TRY_ABORT(x) do \ 159 catch(const SPxException& E) \ 161 std::string s = E.what(); \ 162 SCIPerrorMessage("SoPlex threw an exception: %s\n", s.c_str()); \ 171 class SPxSCIP :
public SoPlex
176 SPxSolver::VarStatus* _colStat;
177 SPxSolver::VarStatus* _rowStat;
189 const char* probname =
NULL 196 _messagehdlr(messagehdlr)
198 if ( probname !=
NULL )
204 _doublecheck =
false;
205 _cpxenv = CPXopenCPLEX(&cpxstat);
206 assert(_cpxenv !=
NULL);
207 _cpxlp = CPXcreateprob(_cpxenv, &cpxstat, probname !=
NULL ? probname :
"spxcheck");
208 (void) CPXsetintparam(_cpxenv, CPX_PARAM_SCRIND, 0);
214 if( _probname !=
NULL )
217 if( _colStat !=
NULL )
220 if( _rowStat !=
NULL )
223 freePreStrongbranchingBasis();
226 (void) CPXfreeprob(_cpxenv, &_cpxlp);
227 (void) CPXcloseCPLEX(&_cpxenv);
235 return realParam(FEASTOL);
249 return realParam(OPTTOL);
261 Real getObjLimit()
const 263 return (intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE)
264 ? realParam(SoPlex::OBJLIMIT_UPPER)
265 : realParam(SoPlex::OBJLIMIT_LOWER);
269 bool getFromScratch()
const 274 void setFromScratch(
bool fs)
280 bool getLpInfo()
const 285 void setLpInfo(
bool lpinfo)
291 void setProbname(
const char* probname)
295 assert(probname !=
NULL);
296 if( _probname !=
NULL )
298 len = (int)strlen(probname);
299 spx_alloc(_probname, len + 1);
300 strncpy(_probname, probname, len);
301 _probname[len] =
'\0';
304 void setRep(SPxSolver::Representation p_rep)
306 if( p_rep == SPxSolver::COLUMN && intParam(REPRESENTATION) == REPRESENTATION_ROW )
311 else if( (p_rep == SPxSolver::ROW && intParam(REPRESENTATION) == REPRESENTATION_COLUMN) )
319 bool getDoubleCheck()
322 return _doublecheck && _checknum + 1 >= CHECK_START;
325 void setDoubleCheck(
bool dc)
330 const char* spxStatusString(
const SPxSolver::Status stat)
const 334 case SPxSolver::ABORT_TIME:
336 case SPxSolver::ABORT_ITER:
338 case SPxSolver::ABORT_VALUE:
339 return "ABORT_VALUE";
340 case SPxSolver::SINGULAR:
342 case SPxSolver::REGULAR:
344 case SPxSolver::UNKNOWN:
346 case SPxSolver::OPTIMAL:
348 case SPxSolver::UNBOUNDED:
350 case SPxSolver::INFEASIBLE:
357 const char* cpxStatusString(
const int stat)
const 361 case CPX_STAT_ABORT_TIME_LIM:
363 case CPX_STAT_ABORT_IT_LIM:
365 case CPX_STAT_ABORT_OBJ_LIM:
366 return "ABORT_VALUE";
367 case CPX_STAT_OPTIMAL:
369 case CPX_STAT_OPTIMAL_INFEAS:
370 return "CPX_STAT_OPTIMAL_INFEAS: OPT SOL INFEASIBLE AFTER UNSCALING";
371 case CPX_STAT_UNBOUNDED:
373 case CPX_STAT_INFEASIBLE:
375 case CPX_STAT_INForUNBD:
376 return "INFEASIBLE or UNBOUNDED";
377 case CPX_STAT_NUM_BEST:
378 return "CPX_STAT_NUM_BEST: SOL AVAILABLE BUT NOT PROVEN OPTIMAL DUE TO NUM TROUBLE";
386 bool checkConsistentBounds()
const 388 for(
int i = 0; i < numColsReal(); ++i )
390 if( lowerReal(i) > upperReal(i) + realParam(SoPlex::EPSILON_ZERO) )
392 SCIPerrorMessage(
"inconsistent bounds on column %d: lower=%.17g, upper=%.17g\n",
393 i, lowerReal(i), upperReal(i));
401 bool checkConsistentSides()
const 403 for(
int i = 0; i < numRowsReal(); ++i )
405 if( lhsReal(i) > rhsReal(i) + realParam(SoPlex::EPSILON_ZERO) )
408 i, lhsReal(i), rhsReal(i));
417 void trySolve(
bool printwarning =
true)
426 catch(
const SPxException& x)
428 std::string s = x.what();
438 assert(status() != SPxSolver::OPTIMAL);
441 assert(intParam(ITERLIMIT) < 0 || numIterations() <= intParam(ITERLIMIT));
444 timespent = solveTime();
448 timelimit = realParam(TIMELIMIT);
449 if( timelimit > timespent )
450 timelimit -= timespent;
454 assert(timelimit >= 0);
459 SPxSolver::Status doSolve(
bool printwarning =
true)
461 SPxOut::Verbosity verbosity;
463 SPxSolver::Status spxStatus;
466 verbosity = spxout.getVerbosity();
467 spxout.setVerbosity((SPxOut::Verbosity)(getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
469 assert(checkConsistentBounds());
470 assert(checkConsistentSides());
474 if( getDoubleCheck() )
475 writeStateReal(
"spxcheck",
NULL,
NULL);
478 trySolve(printwarning);
479 spxStatus = status();
485 bool minimize = intParam(OBJSENSE) == OBJSENSE_MINIMIZE;
486 Real objLimitUpper = realParam(OBJLIMIT_UPPER);
487 Real objLimitLower = realParam(OBJLIMIT_LOWER);
490 if( getDoubleCheck() && (spxStatus == SPxSolver::OPTIMAL || spxStatus == SPxSolver::UNBOUNDED || spxStatus == SPxSolver::INFEASIBLE || spxStatus == SPxSolver::ABORT_VALUE) )
496 CPX_CALL( CPXreadcopyprob(_cpxenv, _cpxlp,
"spxcheck.mps",
NULL) );
497 CPX_CALL( CPXreadcopybase(_cpxenv, _cpxlp,
"spxcheck.bas") );
500 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPOPT,
MAX(opttol(), 1e-9)) );
501 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPRHS,
MAX(feastol(), 1e-9)) );
504 CPX_CALL( CPXlpopt(_cpxenv, _cpxlp) );
507 CPX_CALL( CPXsolution(_cpxenv, _cpxlp, &cpxstat, &cpxobj,
NULL,
NULL,
NULL,
NULL) );
512 if( cpxstat == CPX_STAT_OPTIMAL_INFEAS )
514 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s)\n",
515 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat));
516 if( EXIT_AT_CPXERROR )
519 else if( (spxStatus == SPxSolver::OPTIMAL && cpxstat != CPX_STAT_OPTIMAL)
520 || (spxStatus == SPxSolver::UNBOUNDED && cpxstat != CPX_STAT_UNBOUNDED)
521 || (spxStatus == SPxSolver::INFEASIBLE && cpxstat != CPX_STAT_INFEASIBLE) )
523 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
524 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
525 if( EXIT_AT_WRONG_RESULT )
528 else if( spxStatus == SPxSolver::ABORT_VALUE )
532 case CPX_STAT_OPTIMAL:
533 if( (minimize && LTrel(cpxobj, objLimitUpper, 2*opttol()))
534 || (!minimize && GTrel(cpxobj, objLimitLower, 2*opttol())) )
536 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
537 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
538 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
539 if( EXIT_AT_WRONG_RESULT )
542 else if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
544 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
545 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize?
"<" :
">",
546 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
549 case CPX_STAT_OPTIMAL_INFEAS:
550 case CPX_STAT_NUM_BEST:
551 if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
553 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
554 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
555 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
558 case CPX_STAT_INFEASIBLE:
560 case CPX_STAT_UNBOUNDED:
561 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
562 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
563 if( EXIT_AT_WRONG_RESULT )
566 case CPX_STAT_INForUNBD:
568 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
569 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
574 else if( spxStatus == SPxSolver::OPTIMAL )
576 if( (minimize && LTrel(objValueReal(), cpxobj, 2*opttol()))
577 || (!minimize && GTrel(objValueReal(), cpxobj, 2*opttol())) )
582 else if( (minimize && GTrel(objValueReal(), cpxobj, 2*opttol()))
583 || (!minimize && LTrel(objValueReal(), cpxobj, 2*opttol())) )
585 SCIPerrorMessage(
"In %s: LP optimal; SoPlex value=%.10f %s CPLEX value=%.10f suboptimal (checknum=%d)\n", objValueReal(),
586 _probname, minimize ?
">" :
"<", cpxobj, _checknum);
587 if( EXIT_AT_WRONG_RESULT )
597 spxout.setVerbosity(verbosity);
603 void savePreStrongbranchingBasis()
605 assert(_rowStat ==
NULL);
606 assert(_colStat ==
NULL);
608 spx_alloc(_rowStat, numRowsReal());
609 spx_alloc(_colStat, numColsReal());
613 getBasis(_rowStat, _colStat);
615 catch(
const SPxException& x)
618 std::string s = x.what();
625 assert(status() != SPxSolver::OPTIMAL);
631 void restorePreStrongbranchingBasis()
633 assert(_rowStat !=
NULL);
634 assert(_colStat !=
NULL);
638 setBasis(_rowStat, _colStat);
640 catch(
const SPxException& x)
643 std::string s = x.what();
650 assert(status() != SPxSolver::OPTIMAL);
655 void freePreStrongbranchingBasis()
657 if( _rowStat !=
NULL )
659 if( _colStat !=
NULL )
664 bool preStrongbranchingBasisFreed()
const 666 return ((_rowStat ==
NULL ) && (_colStat ==
NULL));
679 #include "scip/bitencode.h" 682 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 684 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 735 if( num > lpi->cstatsize )
739 newsize =
MAX(2*lpi->cstatsize, num);
740 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->cstat, newsize) );
741 lpi->cstatsize = newsize;
743 assert(num <= lpi->cstatsize);
757 if( num > lpi->rstatsize )
761 newsize =
MAX(2*lpi->rstatsize, num);
762 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->rstat, newsize) );
763 lpi->rstatsize = newsize;
765 assert(num <= lpi->rstatsize);
803 assert(lpistate !=
NULL);
804 assert(lpistate->packcstat !=
NULL);
805 assert(lpistate->packrstat !=
NULL);
807 SCIPencodeDualBit(cstat, lpistate->packcstat, lpistate->ncols);
808 SCIPencodeDualBit(rstat, lpistate->packrstat, lpistate->nrows);
819 assert(lpistate !=
NULL);
820 assert(lpistate->packcstat !=
NULL);
821 assert(lpistate->packrstat !=
NULL);
823 SCIPdecodeDualBit(lpistate->packcstat, cstat, lpistate->ncols);
824 SCIPdecodeDualBit(lpistate->packrstat, rstat, lpistate->nrows);
836 assert(lpistate !=
NULL);
837 assert(blkmem !=
NULL);
841 int nColPackets = colpacketNum(ncols);
842 int nRowPackets = rowpacketNum(nrows);
844 SCIP_ALLOC( BMSallocBlockMemory(blkmem, lpistate) );
845 SCIP_ALLOC( BMSallocBlockMemoryArray(blkmem, &(*lpistate)->packcstat, nColPackets) );
846 SCIP_ALLOC( BMSallocBlockMemoryArray(blkmem, &(*lpistate)->packrstat, nRowPackets) );
858 assert(blkmem !=
NULL);
859 assert(lpistate !=
NULL);
860 assert(*lpistate !=
NULL);
862 int nColPackets = colpacketNum((*lpistate)->ncols);
863 int nRowPackets = rowpacketNum((*lpistate)->nrows);
865 BMSfreeBlockMemoryArray(blkmem, &(*lpistate)->packcstat, nColPackets);
866 BMSfreeBlockMemoryArray(blkmem, &(*lpistate)->packrstat, nRowPackets);
867 BMSfreeBlockMemory(blkmem, lpistate);
880 void invalidateSolution(
SCIP_LPI* lpi)
897 static char spxname[100];
898 static char spxdesc[200];
910 #if (SOPLEX_SUBVERSION > 0) 911 sprintf(spxname,
"SoPlex2 %d.%d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10,
SOPLEX_SUBVERSION);
913 sprintf(spxname,
"SoPlex2 %d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10);
923 sprintf(spxdesc,
"%s",
"Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de)");
924 sprintf(spxdesc,
"%s [GitHash: %s]", spxdesc, getGitHash());
926 sprintf(spxdesc,
"%s %s", spxdesc,
"- including CPLEX double check");
936 return (
void*) lpi->spx;
964 (*lpi)->spx =
static_cast<SPxSCIP*
>(BMSallocMemoryCPP(
sizeof(SPxSCIP)));
965 SOPLEX_TRY( messagehdlr, (*lpi)->spx = new ((*lpi)->spx) SPxSCIP(messagehdlr, name) );
966 (void) (*lpi)->spx->setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_ONLYREAL);
967 (void) (*lpi)->spx->setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_REAL);
968 (void) (*lpi)->spx->setIntParam(SoPlex::REPRESENTATION, SoPlex::REPRESENTATION_AUTO);
970 (*lpi)->cstat =
NULL;
971 (*lpi)->rstat =
NULL;
972 (*lpi)->cstatsize = 0;
973 (*lpi)->rstatsize = 0;
975 (*lpi)->conditionlimit = -1.0;
976 (*lpi)->checkcondition =
FALSE;
977 (*lpi)->messagehdlr = messagehdlr;
979 invalidateSolution(*lpi);
988 SPxOut::Verbosity verbosity = (*lpi)->spx->spxout.getVerbosity();
989 (*lpi)->spx->spxout.setVerbosity((SPxOut::Verbosity)((*lpi)->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
990 (*lpi)->spx->printVersion();
991 (*lpi)->spx->spxout.setVerbosity(verbosity);
1002 assert(lpi !=
NULL);
1003 assert(*lpi !=
NULL);
1004 assert((*lpi)->spx !=
NULL);
1007 (*lpi)->spx->~SPxSCIP();
1008 BMSfreeMemory(&((*lpi)->spx));
1011 BMSfreeMemoryArrayNull(&(*lpi)->cstat);
1012 BMSfreeMemoryArrayNull(&(*lpi)->rstat);
1051 assert(lpi !=
NULL);
1052 assert(lpi->spx !=
NULL);
1053 assert(lhs !=
NULL);
1054 assert(rhs !=
NULL);
1056 invalidateSolution(lpi);
1057 assert(lpi->spx->preStrongbranchingBasisFreed());
1061 SPxSCIP* spx = lpi->spx;
1062 LPRowSet rows(nrows);
1063 DSVector emptyVector(0);
1069 (void) spx->setIntParam(SoPlex::OBJSENSE, (objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE));
1072 for( i = 0; i < nrows; ++i )
1073 rows.add(lhs[i], emptyVector, rhs[i]);
1074 spx->addRowsReal(rows);
1079 catch(
const SPxException& x)
1082 std::string s = x.what();
1107 assert(lpi !=
NULL);
1108 assert(lpi->spx !=
NULL);
1109 assert(obj !=
NULL);
1112 assert(nnonz == 0 || beg !=
NULL);
1113 assert(nnonz == 0 || ind !=
NULL);
1114 assert(nnonz == 0 || val !=
NULL);
1116 invalidateSolution(lpi);
1118 assert( lpi->spx->preStrongbranchingBasisFreed() );
1120 SPxSCIP* spx = lpi->spx;
1123 LPColSet cols(ncols);
1124 DSVector colVector(ncols);
1130 for( i = 0; i < ncols; ++i )
1136 last = (i == ncols-1 ? nnonz : beg[i+1]);
1137 colVector.add( last-start, &ind[start], &val[start] );
1139 cols.add(obj[i], lb[i], colVector, ub[i]);
1141 spx->addColsReal(cols);
1143 catch(
const SPxException& x)
1146 std::string s = x.what();
1164 assert(lpi !=
NULL);
1165 assert(lpi->spx !=
NULL);
1166 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1168 invalidateSolution(lpi);
1170 assert( lpi->spx->preStrongbranchingBasisFreed() );
1172 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->removeColRangeReal(firstcol, lastcol) );
1190 assert(lpi !=
NULL);
1191 assert(lpi->spx !=
NULL);
1193 invalidateSolution(lpi);
1195 assert( lpi->spx->preStrongbranchingBasisFreed() );
1197 ncols = lpi->spx->numColsReal();
1200 for( i = 0; i < ncols; ++i )
1203 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->removeColsReal(dstat) );
1223 assert(lpi !=
NULL);
1224 assert(lpi->spx !=
NULL);
1225 assert(lhs !=
NULL);
1226 assert(rhs !=
NULL);
1227 assert(nnonz == 0 || beg !=
NULL);
1228 assert(nnonz == 0 || ind !=
NULL);
1229 assert(nnonz == 0 || val !=
NULL);
1231 invalidateSolution(lpi);
1233 assert( lpi->spx->preStrongbranchingBasisFreed() );
1237 SPxSCIP* spx = lpi->spx;
1238 LPRowSet rows(nrows);
1245 for( i = 0; i < nrows; ++i )
1251 last = (i == nrows-1 ? nnonz : beg[i+1]);
1252 rowVector.add( last-start, &ind[start], &val[start] );
1254 rows.add(lhs[i], rowVector, rhs[i]);
1256 spx->addRowsReal(rows);
1258 catch(
const SPxException& x)
1261 std::string s = x.what();
1279 assert(lpi !=
NULL);
1280 assert(lpi->spx !=
NULL);
1281 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1283 invalidateSolution(lpi);
1285 assert( lpi->spx->preStrongbranchingBasisFreed() );
1287 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->removeRowRangeReal(firstrow, lastrow) );
1305 assert(lpi !=
NULL);
1306 assert(lpi->spx !=
NULL);
1308 invalidateSolution(lpi);
1310 assert( lpi->spx->preStrongbranchingBasisFreed() );
1312 nrows = lpi->spx->numRowsReal();
1315 for( i = 0; i < nrows; ++i )
1318 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->removeRowsReal(dstat) );
1330 assert(lpi !=
NULL);
1331 assert(lpi->spx !=
NULL);
1333 invalidateSolution(lpi);
1335 assert( lpi->spx->preStrongbranchingBasisFreed() );
1336 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->clearLPReal() );
1354 assert(lpi !=
NULL);
1355 assert(lpi->spx !=
NULL);
1356 assert(ind !=
NULL);
1360 invalidateSolution(lpi);
1362 assert( lpi->spx->preStrongbranchingBasisFreed() );
1366 for( i = 0; i < ncols; ++i )
1368 assert(0 <= ind[i] && ind[i] < lpi->spx->numColsReal());
1369 lpi->spx->changeBoundsReal(ind[i], lb[i], ub[i]);
1370 assert(lpi->spx->lowerReal(ind[i]) <= lpi->spx->upperReal(ind[i]) + lpi->spx->realParam(SoPlex::EPSILON_ZERO));
1373 catch(
const SPxException& x)
1376 std::string s = x.what();
1398 assert(lpi !=
NULL);
1399 assert(lpi->spx !=
NULL);
1400 assert(ind !=
NULL);
1401 assert(lhs !=
NULL);
1402 assert(rhs !=
NULL);
1404 invalidateSolution(lpi);
1406 assert( lpi->spx->preStrongbranchingBasisFreed() );
1410 for( i = 0; i < nrows; ++i )
1412 assert(0 <= ind[i] && ind[i] < lpi->spx->numRowsReal());
1413 lpi->spx->changeRangeReal(ind[i], lhs[i], rhs[i]);
1414 assert(lpi->spx->lhsReal(ind[i]) <= lpi->spx->rhsReal(ind[i]) + lpi->spx->realParam(SoPlex::EPSILON_ZERO));
1417 catch(
const SPxException& x)
1420 std::string s = x.what();
1439 assert(lpi !=
NULL);
1440 assert(lpi->spx !=
NULL);
1441 assert(0 <= row && row < lpi->spx->numRowsReal());
1442 assert(0 <= col && col < lpi->spx->numColsReal());
1444 invalidateSolution(lpi);
1446 assert( lpi->spx->preStrongbranchingBasisFreed() );
1448 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->changeElementReal(row, col, newval) );
1461 assert(lpi !=
NULL);
1462 assert(lpi->spx !=
NULL);
1464 invalidateSolution(lpi);
1466 assert( lpi->spx->preStrongbranchingBasisFreed() );
1468 SOPLEX_TRY( lpi->messagehdlr, (
void) lpi->spx->setIntParam(SoPlex::OBJSENSE, objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE ) );
1485 assert(lpi !=
NULL);
1486 assert(lpi->spx !=
NULL);
1487 assert(ind !=
NULL);
1488 assert(obj !=
NULL);
1490 invalidateSolution(lpi);
1492 assert( lpi->spx->preStrongbranchingBasisFreed() );
1496 for( i = 0; i < ncols; ++i )
1498 assert(0 <= ind[i] && ind[i] < lpi->spx->numColsReal());
1499 lpi->spx->changeObjReal(ind[i], obj[i]);
1502 catch(
const SPxException& x)
1505 std::string s = x.what();
1526 assert(lpi !=
NULL);
1527 assert(lpi->spx !=
NULL);
1528 assert(scaleval != 0.0);
1532 invalidateSolution(lpi);
1534 assert( lpi->spx->preStrongbranchingBasisFreed() );
1537 SVector rowvec = lpi->spx->rowVectorReal(row);
1538 lhs = lpi->spx->lhsReal(row);
1539 rhs = lpi->spx->rhsReal(row);
1545 if( lhs > -lpi->spx->realParam(SoPlex::INFTY) )
1547 else if( scaleval < 0.0 )
1548 lhs = lpi->spx->realParam(SoPlex::INFTY);
1549 if( rhs < lpi->spx->realParam(SoPlex::INFTY) )
1551 else if( scaleval < 0.0 )
1552 rhs = -lpi->spx->realParam(SoPlex::INFTY);
1553 if( scaleval < 0.0 )
1561 LPRow lprow(lhs, rowvec, rhs);
1564 lpi->spx->changeRowReal(row, lprow);
1565 assert(lpi->spx->lhsReal(row) <= lpi->spx->rhsReal(row));
1567 catch(
const SPxException& x)
1570 std::string s = x.what();
1594 assert(lpi !=
NULL);
1595 assert(lpi->spx !=
NULL);
1596 assert(scaleval != 0.0);
1600 invalidateSolution(lpi);
1602 assert( lpi->spx->preStrongbranchingBasisFreed() );
1605 SVector colvec = lpi->spx->colVectorReal(col);
1606 obj = lpi->spx->objReal(col);
1607 lb = lpi->spx->lowerReal(col);
1608 ub = lpi->spx->upperReal(col);
1617 if( lb > -lpi->spx->realParam(SoPlex::INFTY) )
1619 else if( scaleval < 0.0 )
1620 lb = lpi->spx->realParam(SoPlex::INFTY);
1621 if( ub < lpi->spx->realParam(SoPlex::INFTY) )
1623 else if( scaleval < 0.0 )
1624 ub = -lpi->spx->realParam(SoPlex::INFTY);
1625 if( scaleval < 0.0 )
1633 LPCol lpcol(obj, colvec, ub, lb);
1636 lpi->spx->changeColReal(col, lpcol);
1637 assert(lpi->spx->lowerReal(col) <= lpi->spx->upperReal(col));
1639 catch(
const SPxException& x)
1642 std::string s = x.what();
1671 assert(lpi !=
NULL);
1672 assert(lpi->spx !=
NULL);
1673 assert(nrows !=
NULL);
1675 *nrows = lpi->spx->numRowsReal();
1688 assert(lpi !=
NULL);
1689 assert(lpi->spx !=
NULL);
1690 assert(ncols !=
NULL);
1692 *ncols = lpi->spx->numColsReal();
1707 assert(lpi !=
NULL);
1708 assert(lpi->spx !=
NULL);
1709 assert(nnonz !=
NULL);
1713 if( lpi->spx->numRowsReal() < lpi->spx->numColsReal() )
1715 for( i = 0; i < lpi->spx->numRowsReal(); ++i )
1716 (*nnonz) += lpi->spx->rowVectorReal(i).size();
1720 for( i = 0; i < lpi->spx->numColsReal(); ++i )
1721 (*nnonz) += lpi->spx->colVectorReal(i).size();
1748 assert(lpi !=
NULL);
1749 assert(lpi->spx !=
NULL);
1750 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1756 const Vector& lbvec = lpi->spx->lowerReal();
1757 const Vector& ubvec = lpi->spx->upperReal();
1758 for( i = firstcol; i <= lastcol; ++i )
1760 lb[i-firstcol] = lbvec[i];
1761 ub[i-firstcol] = ubvec[i];
1770 for( i = firstcol; i <= lastcol; ++i )
1772 beg[i-firstcol] = *nnonz;
1773 const SVector& cvec = lpi->spx->colVectorReal(i);
1774 for( j = 0; j < cvec.size(); ++j )
1776 ind[*nnonz] = cvec.index(j);
1777 val[*nnonz] = cvec.value(j);
1784 assert(beg ==
NULL);
1785 assert(ind ==
NULL);
1786 assert(val ==
NULL);
1813 assert(lpi !=
NULL);
1814 assert(lpi->spx !=
NULL);
1815 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1819 assert(rhs !=
NULL);
1821 const Vector& lhsvec = lpi->spx->lhsReal();
1822 const Vector& rhsvec = lpi->spx->rhsReal();
1823 for( i = firstrow; i <= lastrow; ++i )
1825 lhs[i-firstrow] = lhsvec[i];
1826 rhs[i-firstrow] = rhsvec[i];
1830 assert(rhs ==
NULL);
1835 for( i = firstrow; i <= lastrow; ++i )
1837 beg[i-firstrow] = *nnonz;
1838 const SVector& rvec = lpi->spx->rowVectorReal(i);
1839 for( j = 0; j < rvec.size(); ++j )
1841 ind[*nnonz] = rvec.index(j);
1842 val[*nnonz] = rvec.value(j);
1849 assert(beg ==
NULL);
1850 assert(ind ==
NULL);
1851 assert(val ==
NULL);
1864 int namestoragesize,
1868 assert( lpi !=
NULL );
1869 assert( lpi->spx !=
NULL );
1870 assert( colnames !=
NULL || namestoragesize == 0 );
1871 assert( namestorage !=
NULL || namestoragesize == 0 );
1872 assert( namestoragesize >= 0 );
1873 assert( storageleft !=
NULL );
1874 assert( 0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal() );
1890 int namestoragesize,
1894 assert( lpi !=
NULL );
1895 assert( lpi->spx !=
NULL );
1896 assert( rownames !=
NULL || namestoragesize == 0 );
1897 assert( namestorage !=
NULL || namestoragesize == 0 );
1898 assert( namestoragesize >= 0 );
1899 assert( storageleft !=
NULL );
1900 assert( 0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal() );
1917 assert(lpi !=
NULL);
1918 assert(lpi->spx !=
NULL);
1919 assert(objsen !=
NULL);
1938 assert(lpi !=
NULL);
1939 assert(lpi->spx !=
NULL);
1940 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1941 assert(vals !=
NULL);
1943 for( i = firstcol; i <= lastcol; ++i )
1944 vals[i-firstcol] = lpi->spx->objReal(i);
1962 assert(lpi !=
NULL);
1963 assert(lpi->spx !=
NULL);
1964 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1966 for( i = firstcol; i <= lastcol; ++i )
1969 lbs[i-firstcol] = lpi->spx->lowerReal(i);
1971 ubs[i-firstcol] = lpi->spx->upperReal(i);
1990 assert(lpi !=
NULL);
1991 assert(lpi->spx !=
NULL);
1992 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1994 for( i = firstrow; i <= lastrow; ++i )
1997 lhss[i-firstrow] = lpi->spx->lhsReal(i);
1999 rhss[i-firstrow] = lpi->spx->rhsReal(i);
2015 assert(lpi !=
NULL);
2016 assert(lpi->spx !=
NULL);
2017 assert(0 <= col && col < lpi->spx->numColsReal());
2018 assert(0 <= row && row < lpi->spx->numRowsReal());
2019 assert(val !=
NULL);
2021 *val = lpi->spx->colVectorReal(col)[row];
2044 assert( lpi !=
NULL );
2045 assert( lpi->spx !=
NULL );
2047 SPxOut::Verbosity verbosity;
2049 verbosity = lpi->spx->spxout.getVerbosity();
2050 lpi->spx->spxout.setVerbosity((SPxOut::Verbosity)(lpi->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
2052 SCIPdebugMessage(
"calling SoPlex solve(): %d cols, %d rows\n", lpi->spx->numColsReal(), lpi->spx->numRowsReal());
2054 invalidateSolution(lpi);
2056 assert( lpi->spx->preStrongbranchingBasisFreed() );
2058 #ifdef WITH_LPSCHECK 2059 lpi->spx->setDoubleCheck(CHECK_SPXSOLVE);
2063 if( lpi->spx->getFromScratch() )
2067 lpi->spx->clearBasis();
2069 catch(
const SPxException& x)
2072 std::string s = x.what();
2075 assert( lpi->spx->status() != SPxSolver::OPTIMAL );
2079 assert(!lpi->spx->getFromScratch() || lpi->spx->status() == SPxSolver::NO_PROBLEM);
2081 SPxSolver::Status status = lpi->spx->doSolve();
2082 SCIPdebugMessage(
" -> SoPlex status: %d, basis status: %d\n", lpi->spx->status(), lpi->spx->basisStatus());
2086 lpi->spx->spxout.setVerbosity(verbosity);
2090 case SPxSolver::ABORT_TIME:
2091 case SPxSolver::ABORT_ITER:
2092 case SPxSolver::ABORT_VALUE:
2093 case SPxSolver::SINGULAR:
2094 case SPxSolver::REGULAR:
2095 case SPxSolver::UNKNOWN:
2096 case SPxSolver::OPTIMAL:
2097 case SPxSolver::UNBOUNDED:
2098 case SPxSolver::INFEASIBLE:
2112 assert(lpi !=
NULL);
2113 assert(lpi->spx !=
NULL);
2115 (void) lpi->spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2116 return spxSolve(lpi);
2126 assert(lpi !=
NULL);
2127 assert(lpi->spx !=
NULL);
2129 (void) lpi->spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2130 return spxSolve(lpi);
2150 assert( lpi->spx->preStrongbranchingBasisFreed() );
2151 lpi->spx->savePreStrongbranchingBasis();
2161 assert( ! lpi->spx->preStrongbranchingBasisFreed() );
2162 lpi->spx->restorePreStrongbranchingBasis();
2163 lpi->spx->freePreStrongbranchingBasis();
2185 SPxSolver::Status status;
2190 bool fromparentbasis;
2193 SPxOut::Verbosity verbosity;
2196 verbosity = lpi->spx->spxout.getVerbosity();
2197 lpi->spx->spxout.setVerbosity((SPxOut::Verbosity)(lpi->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
2199 SCIPdebugMessage(
"calling SCIPlpiStrongbranch() on variable %d (%d iterations)\n", col, itlim);
2201 assert(lpi !=
NULL);
2202 assert(lpi->spx !=
NULL);
2205 assert(downvalid !=
NULL);
2206 assert(upvalid !=
NULL);
2209 status = SPxSolver::UNKNOWN;
2210 fromparentbasis =
false;
2212 oldItlim = spx->intParam(SoPlex::ITERLIMIT);
2215 oldlb = spx->lowerReal(col);
2216 oldub = spx->upperReal(col);
2226 (void) spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2230 newub =
EPSCEIL(psol-1.0, lpi->spx->feastol());
2231 if( newub >= oldlb - 0.5 && down !=
NULL )
2233 SCIPdebugMessage(
"strong branching down on x%d (%g) with %d iterations\n", col, psol, itlim);
2235 spx->changeUpperReal(col, newub);
2236 assert(spx->lowerReal(col) <= spx->upperReal(col));
2238 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2241 #ifdef WITH_LPSCHECK 2242 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2244 status = spx->solve();
2248 case SPxSolver::OPTIMAL:
2249 *down = spx->objValueReal();
2253 case SPxSolver::ABORT_TIME:
2254 case SPxSolver::ABORT_ITER:
2255 case SPxSolver::ABORT_CYCLING:
2256 *down = spx->objValueReal();
2258 case SPxSolver::ABORT_VALUE:
2259 case SPxSolver::INFEASIBLE:
2260 *down = spx->getObjLimit();
2268 (*iter) += spx->numIterations();
2270 #ifdef STRONGBRANCH_RESTOREBASIS 2272 assert( ! spx->preStrongbranchingBasisFreed() );
2273 spx->restorePreStrongbranchingBasis();
2274 fromparentbasis =
false;
2278 if( (status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim )
2280 SCIPdebugMessage(
" --> Repeat strong branching down with %d iterations after restoring basis\n",
2281 itlim - spx->numIterations());
2282 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2283 assert( ! spx->hasPreStrongbranchingBasis() );
2284 spx->restorePreStrongbranchingBasis();
2285 fromparentbasis =
true;
2290 fromparentbasis =
false;
2293 while( fromparentbasis );
2295 spx->changeUpperReal(col, oldub);
2296 assert(spx->lowerReal(col) <= spx->upperReal(col));
2298 else if( down !=
NULL )
2300 *down = spx->getObjLimit();
2309 newlb =
EPSFLOOR(psol+1.0, lpi->spx->feastol());
2310 if( newlb <= oldub + 0.5 && up !=
NULL )
2312 SCIPdebugMessage(
"strong branching up on x%d (%g) with %d iterations\n", col, psol, itlim);
2314 spx->changeLowerReal(col, newlb);
2315 assert(spx->lowerReal(col) <= spx->upperReal(col));
2317 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2320 #ifdef WITH_LPSCHECK 2321 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2323 status = spx->solve();
2327 case SPxSolver::OPTIMAL:
2328 *up = spx->objValueReal();
2332 case SPxSolver::ABORT_TIME:
2333 case SPxSolver::ABORT_ITER:
2334 case SPxSolver::ABORT_CYCLING:
2335 *up = spx->objValueReal();
2337 case SPxSolver::ABORT_VALUE:
2338 case SPxSolver::INFEASIBLE:
2339 *up = spx->getObjLimit();
2347 (*iter) += spx->numIterations();
2349 #ifdef STRONGBRANCH_RESTOREBASIS 2351 assert( ! spx->preStrongbranchingBasisFreed() );
2352 spx->restorePreStrongbranchingBasis();
2353 fromparentbasis =
false;
2357 else if( (status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim )
2359 SCIPdebugMessage(
" --> Repeat strong branching up with %d iterations after restoring basis\n", itlim - spx->numIterations());
2360 assert( ! spx->hasPreStrongbranchingBasis() );
2361 spx->restorePreStrongbranchingBasis();
2362 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2364 fromparentbasis =
true;
2368 fromparentbasis =
false;
2371 while( fromparentbasis );
2373 spx->changeLowerReal(col, oldlb);
2374 assert(spx->lowerReal(col) <= spx->upperReal(col));
2376 else if( up !=
NULL )
2378 *up = spx->getObjLimit();
2386 (void) spx->setIntParam(SoPlex::ITERLIMIT, oldItlim);
2389 lpi->spx->spxout.setVerbosity(verbosity);
2393 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2418 retcode = lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2448 assert( cols !=
NULL );
2449 assert( psols !=
NULL );
2450 assert( down !=
NULL );
2451 assert( up !=
NULL );
2452 assert( downvalid !=
NULL );
2453 assert( upvalid !=
NULL );
2454 assert( down !=
NULL );
2459 for (
int j = 0; j < ncols; ++j)
2462 retcode = lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2492 retcode = lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2522 assert( cols !=
NULL );
2523 assert( psols !=
NULL );
2524 assert( down !=
NULL );
2525 assert( up !=
NULL );
2526 assert( downvalid !=
NULL );
2527 assert( upvalid !=
NULL );
2528 assert( down !=
NULL );
2533 for (
int j = 0; j < ncols; ++j)
2536 retcode = lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2565 assert(lpi !=
NULL);
2579 assert(lpi !=
NULL);
2580 assert(primalfeasible !=
NULL);
2581 assert(dualfeasible !=
NULL);
2598 assert(lpi !=
NULL);
2599 assert(lpi->spx !=
NULL);
2601 return (lpi->spx->status() == SPxSolver::UNBOUNDED);
2613 assert(lpi !=
NULL);
2614 assert(lpi->spx !=
NULL);
2616 return (lpi->spx->status() == SPxSolver::UNBOUNDED);
2626 assert(lpi !=
NULL);
2627 assert(lpi->spx !=
NULL);
2629 assert(lpi->spx->status() != SPxSolver::UNBOUNDED || lpi->spx->basisStatus() == SPxBasis::UNBOUNDED);
2634 return lpi->spx->status() == SPxSolver::UNBOUNDED;
2644 assert(lpi !=
NULL);
2645 assert(lpi->spx !=
NULL);
2647 return (lpi->spx->status() == SPxSolver::INFEASIBLE);
2655 SPxBasis::SPxStatus basestatus;
2659 assert(lpi !=
NULL);
2660 assert(lpi->spx !=
NULL);
2662 basestatus = lpi->spx->basisStatus();
2667 assert(basestatus == SPxBasis::OPTIMAL || lpi->spx->status() != SPxSolver::OPTIMAL);
2669 return basestatus == SPxBasis::OPTIMAL || basestatus == SPxBasis::PRIMAL;
2681 assert(lpi !=
NULL);
2682 assert(lpi->spx !=
NULL);
2684 return (lpi->spx->status() == SPxSolver::INFEASIBLE);
2696 assert(lpi !=
NULL);
2697 assert(lpi->spx !=
NULL);
2699 return (lpi->spx->status() == SPxSolver::INFEASIBLE);
2709 assert(lpi !=
NULL);
2710 assert(lpi->spx !=
NULL);
2712 return lpi->spx->status() == SPxSolver::INFEASIBLE && lpi->spx->basisStatus() == SPxBasis::DUAL;
2722 assert(lpi !=
NULL);
2723 assert(lpi->spx !=
NULL);
2725 return (lpi->spx->status() == SPxSolver::UNBOUNDED);
2735 assert(lpi !=
NULL);
2736 assert(lpi->spx !=
NULL);
2741 assert(lpi->spx->basisStatus() == SPxBasis::OPTIMAL || lpi->spx->status() != SPxSolver::OPTIMAL);
2743 return (lpi->spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->spx->basisStatus() == SPxBasis::DUAL;
2753 assert(lpi !=
NULL);
2754 assert((lpi->spx->basisStatus() == SPxBasis::OPTIMAL)
2760 return (lpi->spx->basisStatus() == SPxBasis::OPTIMAL);
2770 assert(lpi !=
NULL);
2771 assert(lpi->spx !=
NULL);
2773 if( lpi->spx->status() == SPxSolver::ERROR || lpi->spx->status() == SPxSolver::SINGULAR )
2791 if( kappa > lpi->conditionlimit )
2805 assert(lpi !=
NULL);
2806 assert(lpi->spx !=
NULL);
2808 return (lpi->spx->status() == SPxSolver::ABORT_VALUE);
2818 assert(lpi !=
NULL);
2819 assert(lpi->spx !=
NULL);
2821 return (lpi->spx->status() == SPxSolver::ABORT_ITER);
2831 assert(lpi !=
NULL);
2832 assert(lpi->spx !=
NULL);
2834 return (lpi->spx->status() == SPxSolver::ABORT_TIME);
2844 assert(lpi !=
NULL);
2845 assert(lpi->spx !=
NULL);
2847 return static_cast<int>(lpi->spx->status());
2858 assert(lpi !=
NULL);
2859 assert(lpi->spx !=
NULL);
2875 assert(lpi !=
NULL);
2876 assert(lpi->spx !=
NULL);
2877 assert(objval !=
NULL);
2879 *objval = lpi->spx->objValueReal();
2896 assert(lpi !=
NULL);
2897 assert(lpi->spx !=
NULL);
2899 if( objval !=
NULL )
2900 *objval = lpi->spx->objValueReal();
2904 if( primsol !=
NULL )
2906 Vector tmp(lpi->spx->numColsReal(), primsol);
2907 (void)lpi->spx->getPrimalReal(tmp);
2909 if( dualsol !=
NULL )
2911 Vector tmp(lpi->spx->numRowsReal(), dualsol);
2912 (void)lpi->spx->getDualReal(tmp);
2914 if( activity !=
NULL )
2916 Vector tmp(lpi->spx->numRowsReal(), activity);
2917 (void)lpi->spx->getSlacksReal(tmp);
2919 if( redcost !=
NULL )
2921 Vector tmp(lpi->spx->numColsReal(), redcost);
2922 (void)lpi->spx->getRedCostReal(tmp);
2925 catch(
const SPxException& x)
2928 std::string s = x.what();
2945 assert(lpi !=
NULL);
2946 assert(lpi->spx !=
NULL);
2950 Vector tmp(lpi->spx->numColsReal(), ray);
2951 (void)lpi->spx->getPrimalRayReal(tmp);
2953 catch(
const SPxException& x)
2956 std::string s = x.what();
2973 assert(lpi !=
NULL);
2974 assert(lpi->spx !=
NULL);
2978 Vector tmp(lpi->spx->numRowsReal(), dualfarkas);
2979 (void)lpi->spx->getDualFarkasReal(tmp);
2981 catch(
const SPxException& x)
2984 std::string s = x.what();
3001 assert(lpi !=
NULL);
3002 assert(lpi->spx !=
NULL);
3004 *iterations = lpi->spx->numIterations();
3022 assert(lpi !=
NULL);
3023 assert(quality !=
NULL);
3027 assert(lpi !=
NULL);
3028 assert(quality !=
NULL);
3030 SCIPdebugMessage(
"requesting solution quality from SoPlex: quality %d\n", qualityindicator);
3032 switch( qualityindicator )
3035 success = lpi->spx->getEstimatedCondition(*quality);
3039 success = lpi->spx->getExactCondition(*quality);
3080 assert(lpi !=
NULL);
3081 assert(lpi->spx !=
NULL);
3083 assert( lpi->spx->preStrongbranchingBasisFreed() );
3085 if( rstat !=
NULL && cstat !=
NULL )
3087 for( i = 0; i < lpi->spx->numRowsReal(); ++i )
3089 switch( lpi->spx->basisRowStatus(i) )
3091 case SPxSolver::BASIC:
3094 case SPxSolver::FIXED:
3095 case SPxSolver::ON_LOWER:
3098 case SPxSolver::ON_UPPER:
3101 case SPxSolver::ZERO:
3102 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3104 case SPxSolver::UNDEFINED:
3115 for( i = 0; i < lpi->spx->numColsReal(); ++i )
3118 switch( lpi->spx->basisColStatus(i) )
3120 case SPxSolver::BASIC:
3123 case SPxSolver::FIXED:
3137 case SPxSolver::ON_LOWER:
3140 case SPxSolver::ON_UPPER:
3143 case SPxSolver::ZERO:
3146 case SPxSolver::UNDEFINED:
3166 int nCols = lpi->spx->numColsReal();
3167 int nRows = lpi->spx->numRowsReal();
3171 assert(lpi !=
NULL);
3172 assert(lpi->spx !=
NULL);
3173 assert(cstat !=
NULL || nCols == 0);
3174 assert(rstat !=
NULL || nRows == 0);
3176 assert( lpi->spx->preStrongbranchingBasisFreed() );
3177 invalidateSolution(lpi);
3179 SPxSolver::VarStatus* spxcstat =
NULL;
3180 SPxSolver::VarStatus* spxrstat =
NULL;
3181 SCIP_ALLOC( BMSallocMemoryArray(&spxcstat, nCols) );
3182 SCIP_ALLOC( BMSallocMemoryArray(&spxrstat, nRows) );
3184 for( i = 0; i < nRows; ++i )
3189 spxrstat[i] = SPxSolver::ON_LOWER;
3192 spxrstat[i] = SPxSolver::BASIC;
3195 spxrstat[i] = SPxSolver::ON_UPPER;
3198 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3199 BMSfreeMemoryArrayNull(&spxcstat);
3200 BMSfreeMemoryArrayNull(&spxrstat);
3204 BMSfreeMemoryArrayNull(&spxcstat);
3205 BMSfreeMemoryArrayNull(&spxrstat);
3211 for( i = 0; i < nCols; ++i )
3216 spxcstat[i] = SPxSolver::ON_LOWER;
3219 spxcstat[i] = SPxSolver::BASIC;
3222 spxcstat[i] = SPxSolver::ON_UPPER;
3225 spxcstat[i] = SPxSolver::ZERO;
3229 BMSfreeMemoryArrayNull(&spxcstat);
3230 BMSfreeMemoryArrayNull(&spxrstat);
3236 SOPLEX_TRY( lpi->messagehdlr, lpi->spx->setBasis(spxrstat, spxcstat) );
3238 BMSfreeMemoryArrayNull(&spxcstat);
3239 BMSfreeMemoryArrayNull(&spxrstat);
3252 assert(lpi !=
NULL);
3253 assert(lpi->spx !=
NULL);
3255 assert(lpi->spx->preStrongbranchingBasisFreed());
3257 lpi->spx->getBasisInd(bind);
3280 assert( lpi !=
NULL);
3281 assert(lpi->spx !=
NULL);
3282 assert(lpi->spx->preStrongbranchingBasisFreed());
3285 assert(r < lpi->spx->numRowsReal());
3287 if( ! lpi->spx->getBasisInverseRowReal(r, coef, inds, ninds) )
3314 assert( lpi !=
NULL );
3315 assert( lpi->spx !=
NULL );
3316 assert( lpi->spx->preStrongbranchingBasisFreed() );
3318 if( ! lpi->spx->getBasisInverseColReal(c, coef, inds, ninds) )
3348 assert(lpi !=
NULL);
3349 assert(lpi->spx !=
NULL);
3350 assert( lpi->spx->preStrongbranchingBasisFreed() );
3352 nrows = lpi->spx->numRowsReal();
3353 ncols = lpi->spx->numColsReal();
3357 if( binvrow ==
NULL )
3359 SCIP_ALLOC( BMSallocMemoryArray(&buf, nrows) );
3366 assert(binv !=
NULL);
3374 Vector binvvec(nrows, binv);
3375 for( c = 0; c < ncols; ++c )
3376 coef[c] = binvvec * lpi->spx->colVectorReal(c);
3379 BMSfreeMemoryArrayNull(&buf);
3400 DVector col(lpi->spx->numRowsReal());
3404 assert( lpi !=
NULL );
3405 assert( lpi->spx !=
NULL );
3406 assert( lpi->spx->preStrongbranchingBasisFreed() );
3410 assert(c < lpi->spx->numColsReal());
3419 col = lpi->spx->colVectorReal(c);
3422 if( ! lpi->spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3452 assert(blkmem !=
NULL);
3453 assert(lpi !=
NULL);
3454 assert(lpi->spx !=
NULL);
3455 assert(lpistate !=
NULL);
3457 assert( lpi->spx->preStrongbranchingBasisFreed() );
3459 ncols = lpi->spx->numColsReal();
3460 nrows = lpi->spx->numRowsReal();
3465 SCIP_CALL( lpistateCreate(lpistate, blkmem, ncols, nrows) );
3468 SCIP_CALL( ensureCstatMem(lpi, ncols) );
3469 SCIP_CALL( ensureRstatMem(lpi, nrows) );
3475 (*lpistate)->ncols = ncols;
3476 (*lpistate)->nrows = nrows;
3477 lpistatePack(*lpistate, lpi->cstat, lpi->rstat);
3497 assert(lpi !=
NULL);
3498 assert(lpi->spx !=
NULL);
3499 assert(lpistate !=
NULL);
3501 assert( lpi->spx->preStrongbranchingBasisFreed() );
3503 lpncols = lpi->spx->numColsReal();
3504 lpnrows = lpi->spx->numRowsReal();
3505 assert(lpistate->ncols <= lpncols);
3506 assert(lpistate->nrows <= lpnrows);
3509 SCIP_CALL( ensureCstatMem(lpi, lpncols) );
3510 SCIP_CALL( ensureRstatMem(lpi, lpnrows) );
3513 lpistateUnpack(lpistate, lpi->cstat, lpi->rstat);
3516 for( i = lpistate->ncols; i < lpncols; ++i )
3522 bnd = lpi->spx->lowerReal(i);
3534 for( i = lpistate->nrows; i < lpnrows; ++i )
3550 assert(lpi !=
NULL);
3551 assert(lpi->spx !=
NULL);
3555 lpi->spx->clearBasis();
3557 catch(
const SPxException& x)
3560 std::string s = x.what();
3563 assert( lpi->spx->status() != SPxSolver::OPTIMAL );
3579 assert(lpi !=
NULL);
3580 assert(lpistate !=
NULL);
3582 if ( *lpistate !=
NULL )
3583 lpistateFree(lpistate, blkmem);
3605 assert( lpi->spx->preStrongbranchingBasisFreed() );
3608 SOPLEX_TRY( lpi->messagehdlr, success = lpi->spx->readBasisFile(fname, 0, 0) );
3621 assert( lpi->spx->preStrongbranchingBasisFreed() );
3624 SOPLEX_TRY( lpi->messagehdlr, res = lpi->spx->writeBasisFile(fname, 0, 0) );
3653 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 3657 assert(blkmem !=
NULL);
3658 assert(lpi !=
NULL);
3659 assert(lpi->spx !=
NULL);
3660 assert(lpinorms !=
NULL);
3662 lpi->spx->getNdualNorms(nrows, ncols);
3664 if( nrows == 0 && ncols == 0)
3671 SCIP_ALLOC( BMSallocBlockMemory(blkmem, lpinorms) );
3672 SCIP_ALLOC( BMSallocBlockMemoryArray(blkmem, &(*lpinorms)->norms, nrows + ncols) );
3673 (*lpinorms)->nrows = 0;
3674 (*lpinorms)->ncols = 0;
3676 SCIPdebugMessage(
"storing SoPlex LPi pricing norms in %p (%d rows, %d cols)\n", (
void *) *lpinorms, nrows, ncols);
3678 if( !lpi->spx->getDualNorms((*lpinorms)->nrows, (*lpinorms)->ncols, (*lpinorms)->norms) )
3681 BMSfreeBlockMemoryArray(blkmem, &(*lpinorms)->norms, nrows + ncols);
3682 BMSfreeBlockMemory(blkmem, lpinorms);
3683 assert(*lpinorms ==
NULL);
3688 assert(nrows == (*lpinorms)->nrows);
3689 assert(ncols == (*lpinorms)->ncols);
3708 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 3709 assert(blkmem !=
NULL);
3710 assert(lpi !=
NULL);
3711 assert(lpi->spx !=
NULL);
3714 if( lpinorms ==
NULL )
3717 assert(lpinorms->
nrows <= lpi->spx->numRowsReal());
3718 assert(lpinorms->
ncols <= lpi->spx->numColsReal());
3720 if( lpinorms->
nrows == 0 )
3723 SCIPdebugMessage(
"loading LPi simplex norms %p (%d rows, %d cols) into SoPlex LP with %d rows and %d cols\n",
3724 (
void *) lpinorms, lpinorms->
nrows, lpinorms->
ncols, lpi->spx->numRowsReal(), lpi->spx->numColsReal());
3726 (void) lpi->spx->setDualNorms(lpinorms->
nrows, lpinorms->
ncols, lpinorms->
norms);
3739 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 3740 assert(lpi !=
NULL);
3741 assert(lpinorms !=
NULL);
3745 BMSfreeBlockMemoryArray(blkmem, &(*lpinorms)->norms, (*lpinorms)->nrows + (*lpinorms)->ncols);
3746 BMSfreeBlockMemory(blkmem, lpinorms);
3747 assert(*lpinorms ==
NULL);
3774 assert(lpi !=
NULL);
3775 assert(lpi->spx !=
NULL);
3776 assert(ival !=
NULL);
3781 *ival = lpi->spx->getFromScratch();
3784 *ival = lpi->spx->getLpInfo();
3787 *ival = lpi->spx->intParam(SoPlex::ITERLIMIT);
3790 *ival = lpi->spx->intParam(SoPlex::SIMPLIFIER) == SoPlex::SIMPLIFIER_AUTO;
3793 *ival = (int) lpi->pricing;
3796 *ival = (
int) (lpi->spx->intParam(SoPlex::SCALER) != SoPlex::SCALER_OFF);
3798 #if SOPLEX_VERSION >= 201 3800 *ival = (int) (lpi->spx->intParam(SoPlex::TIMER));
3819 assert(lpi !=
NULL);
3820 assert(lpi->spx !=
NULL);
3826 lpi->spx->setFromScratch(
bool(ival));
3830 lpi->spx->setLpInfo(
bool(ival));
3834 (void) lpi->spx->setIntParam(SoPlex::ITERLIMIT, ival);
3838 (void) lpi->spx->setIntParam(SoPlex::SIMPLIFIER, (ival ? SoPlex::SIMPLIFIER_AUTO : SoPlex::SIMPLIFIER_OFF));
3842 switch( lpi->pricing )
3846 (void) lpi->spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_AUTO);
3849 (void) lpi->spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
3852 (void) lpi->spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_PARMULT);
3855 (void) lpi->spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
3858 (void) lpi->spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_QUICKSTEEP);
3861 (void) lpi->spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_DEVEX);
3869 (void) lpi->spx->setIntParam(SoPlex::SCALER, ( ival ? SoPlex::SCALER_BIEQUI : SoPlex::SCALER_OFF));
3871 #if SOPLEX_VERSION >= 201 3873 assert(ival >= 0 && ival < 3);
3874 (void) lpi->spx->setIntParam(SoPlex::TIMER, ival);
3893 assert(lpi !=
NULL);
3894 assert(lpi->spx !=
NULL);
3895 assert(dval !=
NULL);
3900 *dval = lpi->spx->feastol();
3903 *dval = lpi->spx->opttol();
3906 *dval = lpi->spx->realParam(SoPlex::OBJLIMIT_LOWER);
3909 *dval = lpi->spx->realParam(SoPlex::OBJLIMIT_UPPER);
3912 *dval = lpi->spx->realParam(SoPlex::TIMELIMIT);
3915 *dval = lpi->spx->realParam(SoPlex::REPRESENTATION_SWITCH);
3920 *dval = lpi->conditionlimit;
3938 assert(lpi !=
NULL);
3939 assert(lpi->spx !=
NULL);
3944 lpi->spx->setFeastol(dval);
3947 lpi->spx->setOpttol(dval);
3950 (void) lpi->spx->setRealParam(SoPlex::OBJLIMIT_LOWER, dval);
3953 (void) lpi->spx->setRealParam(SoPlex::OBJLIMIT_UPPER, dval);
3956 (void) lpi->spx->setRealParam(SoPlex::TIMELIMIT, dval);
3959 assert(dval >= -1.5);
3961 (void) lpi->spx->setRealParam(SoPlex::REPRESENTATION_SWITCH,
SCIPlpiInfinity(lpi));
3963 (
void) lpi->spx->setRealParam(SoPlex::REPRESENTATION_SWITCH, dval);
3966 lpi->conditionlimit = dval;
3967 lpi->checkcondition = (dval >= 0);
3995 return lpi->spx->realParam(SoPlex::INFTY);
4006 return (val >= lpi->spx->realParam(SoPlex::INFTY));
4024 const char* filename
4029 f = fopen(filename,
"r");
4046 assert(lpi !=
NULL);
4047 assert(lpi->spx !=
NULL);
4049 assert( lpi->spx->preStrongbranchingBasisFreed() );
4051 if( !fileExists(fname) )
4056 assert(lpi->spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4057 if( !lpi->spx->readFile(fname) )
4060 catch(
const SPxException& x)
4063 std::string s = x.what();
4080 assert(lpi !=
NULL);
4081 assert(lpi->spx !=
NULL);
4085 (void) lpi->spx->writeFileReal(fname);
4087 catch(
const SPxException& x)
4090 std::string s = x.what();
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiStrongbranchFrac(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
enum SCIP_ObjSen SCIP_OBJSEN
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
interface methods for specific LP solvers
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
struct SCIP_Messagehdlr SCIP_MESSAGEHDLR
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiAddCols(SCIP_LPI *lpi, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
enum SCIP_LPParam SCIP_LPPARAM
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
enum SCIP_Pricing SCIP_PRICING
#define CHECK_SOPLEX_PARAM(x)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_DUALPACKET COLPACKET
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
#define SOPLEX_TRY(messagehdlr, x)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_RETCODE SCIPlpiLoadColLP(SCIP_LPI *lpi, SCIP_OBJSEN objsen, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS *lpinorms)
SCIP_DUALPACKET ROWPACKET
struct SCIP_LPiState SCIP_LPISTATE
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiStrongbranchInt(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
const char * SCIPlpiGetSolverDesc(void)
#define SOPLEX_SUBVERSION
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
SCIP_RETCODE SCIPlpiStrongbranchesFrac(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_RETCODE SCIPlpiStrongbranchesInt(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetCols(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lb, SCIP_Real *ub, int *nnonz, int *beg, int *ind, SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
public methods for message output
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, int *ind, SCIP_Real *obj)
SCIP_DUALPACKET COLPACKET
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
SCIP_DUALPACKET ROWPACKET
#define SOPLEX_TRY_ABORT(x)
SCIP_RETCODE SCIPlpiGetRows(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs, int *nnonz, int *beg, int *ind, SCIP_Real *val)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)