30 #define STRONGBRANCH_RESTOREBASIS 38 #ifndef NO_CONFIG_HEADER 39 #include "scip/config.h" 43 #ifdef SCIP_WITH_LPSCHECK 46 #define CHECK_SPXSOLVE true 47 #define CHECK_SPXSTRONGBRANCH true 49 #define EXIT_AT_WRONG_RESULT false 50 #define EXIT_AT_CPXERROR false 52 #define CPX_CALL(x) do \ 55 if( (_cpxstat_ = (x)) != 0 ) \ 57 SCIPmessagePrintWarning(_messagehdlr, "CPLEX error <%d>; SoPlex result unchecked\n", _cpxstat_); \ 58 if( EXIT_AT_CPXERROR ) \ 72 #define CHECK_SOPLEX_PARAM(x) \ 75 SCIPmessagePrintWarning(_messagehdlr, "SoPlex: unsupported parameter value\n"); \ 89 #pragma GCC diagnostic ignored "-Wclass-memaccess" 96 #pragma GCC diagnostic ignored "-Wdeprecated-copy" 104 #ifndef SOPLEX_SUBVERSION 105 #define SOPLEX_SUBVERSION 0 108 #ifndef SOPLEX_APIVERSION 109 #define SOPLEX_APIVERSION 0 113 #if (SOPLEX_VERSION < 200 || (SOPLEX_VERSION == 200 && SOPLEX_SUBVERSION < 2) || (SOPLEX_VERSION > 200 && SOPLEX_VERSION < 201)) 114 #error "This interface is not compatible with SoPlex versions prior to 2.0.0.2" 117 #if (SOPLEX_APIVERSION <= 5) 118 #include "spxgithash.h" 129 #if defined(_MSC_VER) && _MSC_VER < 1900 131 #define snprintf _snprintf 135 #define SOPLEX_VERBLEVEL 5 156 #define SOPLEX_TRY(messagehdlr, x) do \ 162 catch( const SPxMemoryException& E ) \ 164 std::string s = E.what(); \ 165 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 168 catch( const SPxException& E ) \ 170 std::string s = E.what(); \ 171 SCIPmessagePrintWarning((messagehdlr), "SoPlex threw an exception: %s\n", s.c_str()); \ 172 return SCIP_LPERROR; \ 178 #define SOPLEX_TRY(messagehdlr, x) do \ 184 catch( const SPxMemoryException& E ) \ 186 std::string s = E.what(); \ 187 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 190 catch( const SPxException& ) \ 192 return SCIP_LPERROR; \ 201 #define SOPLEX_TRY_ABORT(x) do \ 207 catch( const SPxException& E ) \ 209 std::string s = E.what(); \ 210 SCIPerrorMessage("SoPlex threw an exception: %s\n", s.c_str()); \ 219 class SPxSCIP :
public SoPlex 224 DataArray<SPxSolver::VarStatus> _colStat;
225 DataArray<SPxSolver::VarStatus> _rowStat;
226 #ifdef SCIP_WITH_LPSCHECK 237 const char* probname =
NULL 244 _messagehdlr(messagehdlr)
246 if ( probname !=
NULL )
249 #if SOPLEX_APIVERSION >= 2 250 (void)setBoolParam(SoPlex::ENSURERAY,
true);
253 #ifdef SCIP_WITH_LPSCHECK 256 _doublecheck =
false;
257 _cpxenv = CPXopenCPLEX(&cpxstat);
258 assert(_cpxenv !=
NULL);
259 _cpxlp = CPXcreateprob(_cpxenv, &cpxstat, probname !=
NULL ? probname :
"spxcheck");
260 (void) CPXsetintparam(_cpxenv, CPX_PARAM_SCRIND, 0);
266 if( _probname !=
NULL )
269 freePreStrongbranchingBasis();
271 #ifdef SCIP_WITH_LPSCHECK 272 (void) CPXfreeprob(_cpxenv, &_cpxlp);
273 (void) CPXcloseCPLEX(&_cpxenv);
295 return realParam(OPTTOL);
307 Real getObjLimit()
const 309 return (intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE)
310 ? realParam(SoPlex::OBJLIMIT_UPPER)
311 : realParam(SoPlex::OBJLIMIT_LOWER);
315 bool getFromScratch()
const 320 void setFromScratch(
bool fs)
326 bool getLpInfo()
const 331 void setLpInfo(
bool lpinfo)
337 void setProbname(
const char* probname)
341 assert(probname !=
NULL);
342 if( _probname !=
NULL )
345 len = strlen(probname);
346 spx_alloc(_probname, len + 1);
347 memcpy(_probname, probname, len + 1);
350 void setRep(SPxSolver::Representation p_rep)
352 if( p_rep == SPxSolver::COLUMN && intParam(REPRESENTATION) == REPRESENTATION_ROW )
357 else if( (p_rep == SPxSolver::ROW && intParam(REPRESENTATION) == REPRESENTATION_COLUMN) )
364 #ifdef SCIP_WITH_LPSCHECK 365 bool getDoubleCheck()
368 return _doublecheck && _checknum + 1 >= CHECK_START;
371 void setDoubleCheck(
bool dc)
380 case SPxSolver::ABORT_TIME:
382 case SPxSolver::ABORT_ITER:
384 case SPxSolver::ABORT_VALUE:
385 return "ABORT_VALUE";
386 case SPxSolver::SINGULAR:
388 case SPxSolver::REGULAR:
392 case SPxSolver::OPTIMAL:
394 #if SOPLEX_APIVERSION >= 3 395 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
396 return "OPTIMAL_UNSCALED_VIOLATIONS";
398 case SPxSolver::UNBOUNDED:
400 case SPxSolver::INFEASIBLE:
407 const char* cpxStatusString(
const int stat)
const 411 case CPX_STAT_ABORT_TIME_LIM:
413 case CPX_STAT_ABORT_IT_LIM:
415 case CPX_STAT_ABORT_OBJ_LIM:
416 return "ABORT_VALUE";
417 case CPX_STAT_OPTIMAL:
419 case CPX_STAT_OPTIMAL_INFEAS:
420 return "CPX_STAT_OPTIMAL_INFEAS: OPT SOL INFEASIBLE AFTER UNSCALING";
421 case CPX_STAT_UNBOUNDED:
423 case CPX_STAT_INFEASIBLE:
425 case CPX_STAT_INForUNBD:
426 return "INFEASIBLE or UNBOUNDED";
427 case CPX_STAT_NUM_BEST:
428 return "CPX_STAT_NUM_BEST: SOL AVAILABLE BUT NOT PROVEN OPTIMAL DUE TO NUM TROUBLE";
436 bool checkConsistentBounds()
const 438 for(
int i = 0; i < numColsReal(); ++i )
440 if( lowerReal(i) > upperReal(i) + realParam(SoPlex::EPSILON_ZERO) )
442 SCIPerrorMessage(
"inconsistent bounds on column %d: lower=%.17g, upper=%.17g\n",
443 i, lowerReal(i), upperReal(i));
451 bool checkConsistentSides()
const 453 for(
int i = 0; i < numRowsReal(); ++i )
455 if( lhsReal(i) > rhsReal(i) + realParam(SoPlex::EPSILON_ZERO) )
458 i, lhsReal(i), rhsReal(i));
467 void trySolve(
bool printwarning =
true)
474 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 480 catch(
const SPxException&
x)
482 std::string s = x.what();
492 assert(status() != SPxSolver::OPTIMAL);
495 assert(intParam(ITERLIMIT) < 0 || numIterations() <= intParam(ITERLIMIT));
498 timespent = solveTime();
502 timelimit = realParam(TIMELIMIT);
503 if( timelimit > timespent )
504 timelimit -= timespent;
508 assert(timelimit >= 0);
515 SPxOut::Verbosity verbosity;
520 verbosity = spxout.getVerbosity();
521 spxout.setVerbosity((SPxOut::Verbosity)(getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
523 assert(checkConsistentBounds());
524 assert(checkConsistentSides());
526 #ifdef SCIP_WITH_LPSCHECK 528 if( getDoubleCheck() )
529 writeStateReal(
"spxcheck",
NULL,
NULL);
532 trySolve(printwarning);
533 spxStatus = status();
538 #ifdef SCIP_WITH_LPSCHECK 539 bool minimize = intParam(OBJSENSE) == OBJSENSE_MINIMIZE;
540 Real objLimitUpper = realParam(OBJLIMIT_UPPER);
541 Real objLimitLower = realParam(OBJLIMIT_LOWER);
544 if( getDoubleCheck() && (spxStatus == SPxSolver::OPTIMAL || spxStatus == SPxSolver::UNBOUNDED || spxStatus == SPxSolver::INFEASIBLE || spxStatus == SPxSolver::ABORT_VALUE) )
550 CPX_CALL( CPXreadcopyprob(_cpxenv, _cpxlp,
"spxcheck.mps",
NULL) );
551 CPX_CALL( CPXreadcopybase(_cpxenv, _cpxlp,
"spxcheck.bas") );
554 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPOPT,
MAX(opttol(), 1e-9)) );
555 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPRHS,
MAX(feastol(), 1e-9)) );
558 CPX_CALL( CPXlpopt(_cpxenv, _cpxlp) );
561 CPX_CALL( CPXsolution(_cpxenv, _cpxlp, &cpxstat, &cpxobj,
NULL,
NULL,
NULL,
NULL) );
566 if( cpxstat == CPX_STAT_OPTIMAL_INFEAS )
568 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s)\n",
569 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat));
570 if( EXIT_AT_CPXERROR )
573 else if( (spxStatus == SPxSolver::OPTIMAL && cpxstat != CPX_STAT_OPTIMAL)
574 || (spxStatus == SPxSolver::UNBOUNDED && cpxstat != CPX_STAT_UNBOUNDED)
575 || (spxStatus == SPxSolver::INFEASIBLE && cpxstat != CPX_STAT_INFEASIBLE) )
577 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
578 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
579 if( EXIT_AT_WRONG_RESULT )
582 else if( spxStatus == SPxSolver::ABORT_VALUE )
586 case CPX_STAT_OPTIMAL:
587 if( (minimize && LTrel(cpxobj, objLimitUpper, 2*opttol()))
588 || (!minimize && GTrel(cpxobj, objLimitLower, 2*opttol())) )
590 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
591 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
592 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
593 if( EXIT_AT_WRONG_RESULT )
596 else if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
598 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
599 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize?
"<" :
">",
600 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
603 case CPX_STAT_OPTIMAL_INFEAS:
604 case CPX_STAT_NUM_BEST:
605 if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
607 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
608 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
609 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
612 case CPX_STAT_INFEASIBLE:
614 case CPX_STAT_UNBOUNDED:
615 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
616 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
617 if( EXIT_AT_WRONG_RESULT )
620 case CPX_STAT_INForUNBD:
622 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
623 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
628 else if( spxStatus == SPxSolver::OPTIMAL )
630 if( (minimize && LTrel(objValueReal(), cpxobj, 2*opttol()))
631 || (!minimize && GTrel(objValueReal(), cpxobj, 2*opttol())) )
636 else if( (minimize && GTrel(objValueReal(), cpxobj, 2*opttol()))
637 || (!minimize && LTrel(objValueReal(), cpxobj, 2*opttol())) )
639 SCIPerrorMessage(
"In %s: LP optimal; SoPlex value=%.10f %s CPLEX value=%.10f suboptimal (checknum=%d)\n", objValueReal(),
640 _probname, minimize ?
">" :
"<", cpxobj, _checknum);
641 if( EXIT_AT_WRONG_RESULT )
651 spxout.setVerbosity(verbosity);
657 void savePreStrongbranchingBasis()
659 _rowStat.reSize(numRowsReal());
660 _colStat.reSize(numColsReal());
664 getBasis(_rowStat.get_ptr(), _colStat.get_ptr());
667 catch(
const SPxException&
x)
669 std::string s = x.what();
676 assert(status() != SPxSolver::OPTIMAL);
679 catch(
const SPxException&)
685 void restorePreStrongbranchingBasis()
687 assert(_rowStat.size() == numRowsReal());
688 assert(_colStat.size() == numColsReal());
692 setBasis(_rowStat.get_ptr(), _colStat.get_ptr());
695 catch(
const SPxException&
x)
697 std::string s = x.what();
700 catch(
const SPxException&)
707 assert(status() != SPxSolver::OPTIMAL);
712 void freePreStrongbranchingBasis()
719 bool preStrongbranchingBasisFreed()
const 721 return ((_rowStat.size() == 0 ) && (_colStat.size() == 0));
725 DataArray<SPxSolver::VarStatus>& rowStat()
731 DataArray<SPxSolver::VarStatus>& colStat()
749 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 751 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 775 COLPACKET* packcstat;
776 ROWPACKET* packrstat;
810 assert(num <= lpi->cstatsize);
832 assert(num <= lpi->rstatsize);
870 assert(lpistate !=
NULL);
886 assert(lpistate !=
NULL);
903 assert(lpistate !=
NULL);
904 assert(blkmem !=
NULL);
925 assert(blkmem !=
NULL);
926 assert(lpistate !=
NULL);
927 assert(*lpistate !=
NULL);
977 #if (SOPLEX_SUBVERSION > 0) 978 (void)snprintf(
spxname, 100,
"SoPlex %d.%d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10,
SOPLEX_SUBVERSION);
980 (void)snprintf(
spxname, 100,
"SoPlex %d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10);
990 (void)snprintf(
spxdesc, 200,
"%s [GitHash: %s]",
"Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de)" 991 #ifdef SCIP_WITH_LPSCHECK
992 " - including CPLEX double check" 1004 return (
void*) lpi->
spx;
1014 #if (SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3)) 1015 assert(ncols == lpi->
spx->numColsReal() || (ncols == 0 && intInfo ==
NULL));
1016 lpi->
spx->setIntegralityInformation(ncols, intInfo);
1019 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1068 assert(lpi !=
NULL);
1069 assert(name !=
NULL);
1076 SOPLEX_TRY( messagehdlr, (*lpi)->spx = new ((*lpi)->spx) SPxSCIP(messagehdlr, name) );
1077 (void) (*lpi)->spx->setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_ONLYREAL);
1078 (void) (*lpi)->spx->setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_REAL);
1079 (void) (*lpi)->spx->setIntParam(SoPlex::REPRESENTATION, SoPlex::REPRESENTATION_AUTO);
1082 #if SOPLEX_APIVERSION >= 10 1083 (void) (*lpi)->spx->setIntParam(SoPlex::STATTIMER, 0);
1086 (*lpi)->cstat =
NULL;
1087 (*lpi)->rstat =
NULL;
1088 (*lpi)->cstatsize = 0;
1089 (*lpi)->rstatsize = 0;
1091 (*lpi)->conditionlimit = -1.0;
1092 (*lpi)->checkcondition =
FALSE;
1093 (*lpi)->messagehdlr = messagehdlr;
1104 SPxOut::Verbosity verbosity = (*lpi)->spx->spxout.getVerbosity();
1105 (*lpi)->spx->spxout.setVerbosity((SPxOut::Verbosity)((*lpi)->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
1106 (*lpi)->spx->printVersion();
1107 (*lpi)->spx->spxout.setVerbosity(verbosity);
1118 assert(lpi !=
NULL);
1119 assert(*lpi !=
NULL);
1120 assert((*lpi)->spx !=
NULL);
1123 (*lpi)->spx->~SPxSCIP();
1168 for( j = 0; j < nnonz; j++ )
1169 assert( val[j] != 0 );
1175 assert(lpi !=
NULL);
1177 assert(lhs !=
NULL);
1178 assert(rhs !=
NULL);
1179 assert(obj !=
NULL);
1182 assert(beg !=
NULL);
1183 assert(ind !=
NULL);
1184 assert(val !=
NULL);
1187 assert(lpi->
spx->preStrongbranchingBasisFreed());
1191 SPxSCIP* spx = lpi->
spx;
1192 LPRowSet rows(nrows);
1193 DSVector emptyVector(0);
1199 (void) spx->setIntParam(SoPlex::OBJSENSE, (objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE));
1202 for( i = 0; i < nrows; ++i )
1203 rows.add(lhs[i], emptyVector, rhs[i]);
1204 spx->addRowsReal(rows);
1210 catch(
const SPxException&
x )
1212 std::string s =
x.what();
1215 catch(
const SPxException& )
1240 assert(lpi !=
NULL);
1242 assert(obj !=
NULL);
1245 assert(nnonz == 0 || beg !=
NULL);
1246 assert(nnonz == 0 || ind !=
NULL);
1247 assert(nnonz == 0 || val !=
NULL);
1253 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1259 int nrows = lpi->
spx->numRowsReal();
1260 for (
int j = 0; j < nnonz; ++j)
1262 assert( 0 <= ind[j] && ind[j] < nrows );
1263 assert( val[j] != 0.0 );
1268 SPxSCIP* spx = lpi->
spx;
1271 LPColSet cols(ncols);
1272 DSVector colVector(ncols);
1278 for( i = 0; i < ncols; ++i )
1284 last = (i == ncols-1 ? nnonz : beg[i+1]);
1285 colVector.add( last-start, &ind[start], &val[start] );
1287 cols.add(obj[i], lb[i], colVector, ub[i]);
1289 spx->addColsReal(cols);
1292 catch(
const SPxException&
x )
1294 std::string s =
x.what();
1297 catch(
const SPxException& )
1315 assert(lpi !=
NULL);
1317 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1321 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1341 assert(lpi !=
NULL);
1343 assert(dstat !=
NULL);
1347 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1349 ncols = lpi->
spx->numColsReal();
1352 for( i = 0; i < ncols; ++i )
1375 assert(lpi !=
NULL);
1377 assert(lhs !=
NULL);
1378 assert(rhs !=
NULL);
1379 assert(nnonz == 0 || beg !=
NULL);
1380 assert(nnonz == 0 || ind !=
NULL);
1381 assert(nnonz == 0 || val !=
NULL);
1385 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1391 int ncols = lpi->
spx->numColsReal();
1392 for (
int j = 0; j < nnonz; ++j)
1394 assert( val[j] != 0.0 );
1395 assert( 0 <= ind[j] && ind[j] < ncols );
1402 SPxSCIP* spx = lpi->
spx;
1403 LPRowSet rows(nrows);
1410 for( i = 0; i < nrows; ++i )
1416 last = (i == nrows-1 ? nnonz : beg[i+1]);
1417 rowVector.add( last-start, &ind[start], &val[start] );
1419 rows.add(lhs[i], rowVector, rhs[i]);
1421 spx->addRowsReal(rows);
1424 catch(
const SPxException&
x )
1426 std::string s =
x.what();
1429 catch(
const SPxException& )
1447 assert(lpi !=
NULL);
1449 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1453 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1473 assert(lpi !=
NULL);
1478 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1480 nrows = lpi->
spx->numRowsReal();
1483 for( i = 0; i < nrows; ++i )
1498 assert(lpi !=
NULL);
1503 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1522 assert(lpi !=
NULL);
1524 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1530 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1534 for( i = 0; i < ncols; ++i )
1536 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1540 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1545 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1549 lpi->
spx->changeBoundsReal(ind[i], lb[i], ub[i]);
1550 assert(lpi->
spx->lowerReal(ind[i]) <= lpi->
spx->upperReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1554 catch(
const SPxException&
x )
1556 std::string s =
x.what();
1559 catch(
const SPxException& )
1581 assert(lpi !=
NULL);
1583 assert(ind !=
NULL);
1584 assert(lhs !=
NULL);
1585 assert(rhs !=
NULL);
1591 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1595 for( i = 0; i < nrows; ++i )
1597 assert(0 <= ind[i] && ind[i] < lpi->
spx->numRowsReal());
1598 lpi->
spx->changeRangeReal(ind[i], lhs[i], rhs[i]);
1599 assert(lpi->
spx->lhsReal(ind[i]) <= lpi->
spx->rhsReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1603 catch(
const SPxException&
x )
1605 std::string s =
x.what();
1608 catch(
const SPxException& )
1627 assert(lpi !=
NULL);
1629 assert(0 <= row && row < lpi->spx->numRowsReal());
1630 assert(0 <= col && col < lpi->spx->numColsReal());
1634 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1649 assert(lpi !=
NULL);
1654 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1673 assert(lpi !=
NULL);
1675 assert(ind !=
NULL);
1676 assert(obj !=
NULL);
1680 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1684 for( i = 0; i < ncols; ++i )
1686 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1687 lpi->
spx->changeObjReal(ind[i], obj[i]);
1691 catch(
const SPxException&
x )
1693 std::string s =
x.what();
1696 catch(
const SPxException& )
1717 assert(lpi !=
NULL);
1719 assert(scaleval != 0.0);
1725 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1728 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1729 SVector rowvec = lpi->
spx->rowVectorRealInternal(row);
1731 SVector rowvec = lpi->
spx->rowVectorReal(row);
1733 lhs = lpi->
spx->lhsReal(row);
1734 rhs = lpi->
spx->rhsReal(row);
1740 if( lhs > -lpi->
spx->realParam(SoPlex::INFTY) )
1742 else if( scaleval < 0.0 )
1743 lhs = lpi->
spx->realParam(SoPlex::INFTY);
1744 if( rhs < lpi->spx->realParam(SoPlex::INFTY) )
1746 else if( scaleval < 0.0 )
1747 rhs = -lpi->
spx->realParam(SoPlex::INFTY);
1748 if( scaleval < 0.0 )
1756 LPRow lprow(lhs, rowvec, rhs);
1759 lpi->
spx->changeRowReal(row, lprow);
1760 assert(lpi->
spx->lhsReal(row) <= lpi->
spx->rhsReal(row));
1763 catch(
const SPxException&
x )
1765 std::string s =
x.what();
1768 catch(
const SPxException& )
1792 assert(lpi !=
NULL);
1794 assert(scaleval != 0.0);
1800 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1803 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1804 SVector colvec = lpi->
spx->colVectorRealInternal(col);
1806 SVector colvec = lpi->
spx->colVectorReal(col);
1808 obj = lpi->
spx->objReal(col);
1809 lb = lpi->
spx->lowerReal(col);
1810 ub = lpi->
spx->upperReal(col);
1819 if( lb > -lpi->
spx->realParam(SoPlex::INFTY) )
1821 else if( scaleval < 0.0 )
1822 lb = lpi->
spx->realParam(SoPlex::INFTY);
1823 if( ub < lpi->spx->realParam(SoPlex::INFTY) )
1825 else if( scaleval < 0.0 )
1826 ub = -lpi->
spx->realParam(SoPlex::INFTY);
1827 if( scaleval < 0.0 )
1835 LPCol lpcol(obj, colvec, ub, lb);
1838 lpi->
spx->changeColReal(col, lpcol);
1839 assert(lpi->
spx->lowerReal(col) <= lpi->
spx->upperReal(col));
1842 catch(
const SPxException&
x )
1844 std::string s =
x.what();
1847 catch(
const SPxException& )
1876 assert(lpi !=
NULL);
1878 assert(nrows !=
NULL);
1880 *nrows = lpi->
spx->numRowsReal();
1893 assert(lpi !=
NULL);
1895 assert(ncols !=
NULL);
1897 *ncols = lpi->
spx->numColsReal();
1912 assert(lpi !=
NULL);
1914 assert(nnonz !=
NULL);
1918 if( lpi->
spx->numRowsReal() < lpi->
spx->numColsReal() )
1920 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
1922 (*nnonz) += lpi->
spx->rowVectorRealInternal(i).size();
1924 (*nnonz) += lpi->
spx->rowVectorReal(i).size();
1929 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
1931 (*nnonz) += lpi->
spx->colVectorRealInternal(i).size();
1933 (*nnonz) += lpi->
spx->colVectorReal(i).size();
1961 assert(lpi !=
NULL);
1963 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1969 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1970 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1972 DVector lbvec(lpi->
spx->numColsReal());
1973 DVector ubvec(lpi->
spx->numColsReal());
1974 lpi->
spx->getLowerReal(lbvec);
1975 lpi->
spx->getUpperReal(ubvec);
1976 for( i = firstcol; i <= lastcol; ++i )
1978 lb[i-firstcol] = lbvec[i];
1979 ub[i-firstcol] = ubvec[i];
1984 const Vector& lbvec = lpi->
spx->lowerRealInternal();
1985 const Vector& ubvec = lpi->
spx->upperRealInternal();
1986 for( i = firstcol; i <= lastcol; ++i )
1988 lb[i-firstcol] = lbvec[i];
1989 ub[i-firstcol] = ubvec[i];
1993 const Vector& lbvec = lpi->
spx->lowerReal();
1994 const Vector& ubvec = lpi->
spx->upperReal();
1996 for( i = firstcol; i <= lastcol; ++i )
1998 lb[i-firstcol] = lbvec[i];
1999 ub[i-firstcol] = ubvec[i];
2007 for( i = firstcol; i <= lastcol; ++i )
2009 beg[i-firstcol] = *nnonz;
2011 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2012 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2015 lpi->
spx->getColVectorReal(i, cvec);
2016 for( j = 0; j < cvec.size(); ++j )
2018 ind[*nnonz] = cvec.index(j);
2019 val[*nnonz] = cvec.value(j);
2025 const SVector& cvec = lpi->
spx->colVectorRealInternal(i);
2026 for( j = 0; j < cvec.size(); ++j )
2028 ind[*nnonz] = cvec.index(j);
2029 val[*nnonz] = cvec.value(j);
2034 const SVector& cvec = lpi->
spx->colVectorReal(i);
2035 for( j = 0; j < cvec.size(); ++j )
2037 ind[*nnonz] = cvec.index(j);
2038 val[*nnonz] = cvec.value(j);
2069 assert(lpi !=
NULL);
2071 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2077 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2078 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2080 DVector lhsvec(lpi->
spx->numRowsReal());
2081 DVector rhsvec(lpi->
spx->numRowsReal());
2082 lpi->
spx->getLhsReal(lhsvec);
2083 lpi->
spx->getRhsReal(rhsvec);
2084 for( i = firstrow; i <= lastrow; ++i )
2086 lhs[i-firstrow] = lhsvec[i];
2087 rhs[i-firstrow] = rhsvec[i];
2092 const Vector& lhsvec = lpi->
spx->lhsRealInternal();
2093 const Vector& rhsvec = lpi->
spx->rhsRealInternal();
2094 for( i = firstrow; i <= lastrow; ++i )
2096 lhs[i-firstrow] = lhsvec[i];
2097 rhs[i-firstrow] = rhsvec[i];
2101 const Vector& lhsvec = lpi->
spx->lhsReal();
2102 const Vector& rhsvec = lpi->
spx->rhsReal();
2103 for( i = firstrow; i <= lastrow; ++i )
2105 lhs[i-firstrow] = lhsvec[i];
2106 rhs[i-firstrow] = rhsvec[i];
2114 for( i = firstrow; i <= lastrow; ++i )
2116 beg[i-firstrow] = *nnonz;
2118 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2119 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2122 lpi->
spx->getRowVectorReal(i, rvec);
2123 for( j = 0; j < rvec.size(); ++j )
2125 ind[*nnonz] = rvec.index(j);
2126 val[*nnonz] = rvec.value(j);
2132 const SVector& rvec = lpi->
spx->rowVectorRealInternal(i);
2133 for( j = 0; j < rvec.size(); ++j )
2135 ind[*nnonz] = rvec.index(j);
2136 val[*nnonz] = rvec.value(j);
2141 const SVector& rvec = lpi->
spx->rowVectorReal(i);
2142 for( j = 0; j < rvec.size(); ++j )
2144 ind[*nnonz] = rvec.index(j);
2145 val[*nnonz] = rvec.value(j);
2162 int namestoragesize,
2166 assert( lpi !=
NULL );
2168 assert( colnames !=
NULL || namestoragesize == 0 );
2169 assert( namestorage !=
NULL || namestoragesize == 0 );
2170 assert( namestoragesize >= 0 );
2171 assert( storageleft !=
NULL );
2172 assert( 0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal() );
2188 int namestoragesize,
2192 assert( lpi !=
NULL );
2194 assert( rownames !=
NULL || namestoragesize == 0 );
2195 assert( namestorage !=
NULL || namestoragesize == 0 );
2196 assert( namestoragesize >= 0 );
2197 assert( storageleft !=
NULL );
2198 assert( 0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal() );
2215 assert(lpi !=
NULL);
2217 assert(objsen !=
NULL);
2236 assert(lpi !=
NULL);
2238 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2239 assert(vals !=
NULL);
2241 for( i = firstcol; i <= lastcol; ++i )
2242 vals[i-firstcol] = lpi->
spx->objReal(i);
2260 assert(lpi !=
NULL);
2262 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2264 for( i = firstcol; i <= lastcol; ++i )
2267 lbs[i-firstcol] = lpi->
spx->lowerReal(i);
2269 ubs[i-firstcol] = lpi->
spx->upperReal(i);
2288 assert(lpi !=
NULL);
2290 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2292 for( i = firstrow; i <= lastrow; ++i )
2295 lhss[i-firstrow] = lpi->
spx->lhsReal(i);
2297 rhss[i-firstrow] = lpi->
spx->rhsReal(i);
2313 assert(lpi !=
NULL);
2315 assert(0 <= col && col < lpi->spx->numColsReal());
2316 assert(0 <= row && row < lpi->spx->numRowsReal());
2317 assert(val !=
NULL);
2319 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2320 *val = lpi->
spx->coefReal(row, col);
2322 *val = lpi->
spx->colVectorReal(col)[row];
2346 assert( lpi !=
NULL );
2349 SPxOut::Verbosity verbosity;
2351 verbosity = lpi->
spx->spxout.getVerbosity();
2354 SCIPdebugMessage(
"calling SoPlex solve(): %d cols, %d rows\n", lpi->
spx->numColsReal(), lpi->
spx->numRowsReal());
2358 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2360 #ifdef SCIP_WITH_LPSCHECK 2361 lpi->
spx->setDoubleCheck(CHECK_SPXSOLVE);
2365 if( lpi->
spx->getFromScratch() )
2369 lpi->
spx->clearBasis();
2372 catch(
const SPxException&
x)
2374 std::string s = x.what();
2377 catch(
const SPxException&)
2380 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
2384 assert(!lpi->
spx->getFromScratch() || lpi->
spx->status() == SPxSolver::NO_PROBLEM);
2387 SCIPdebugMessage(
" -> SoPlex status: %d, basis status: %d\n", lpi->
spx->status(), lpi->
spx->basisStatus());
2391 lpi->
spx->spxout.setVerbosity(verbosity);
2395 case SPxSolver::ABORT_TIME:
2396 case SPxSolver::ABORT_ITER:
2397 case SPxSolver::ABORT_VALUE:
2398 case SPxSolver::SINGULAR:
2399 case SPxSolver::REGULAR:
2401 case SPxSolver::OPTIMAL:
2402 #if SOPLEX_APIVERSION >= 3 2403 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2405 case SPxSolver::UNBOUNDED:
2406 case SPxSolver::INFEASIBLE:
2420 assert(lpi !=
NULL);
2423 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2434 assert(lpi !=
NULL);
2437 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2447 assert(lpi !=
NULL);
2461 assert(lpi !=
NULL);
2464 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2465 lpi->
spx->savePreStrongbranchingBasis();
2475 assert(lpi !=
NULL);
2478 assert( ! lpi->
spx->preStrongbranchingBasisFreed() );
2479 lpi->
spx->restorePreStrongbranchingBasis();
2480 lpi->
spx->freePreStrongbranchingBasis();
2501 assert(lpi !=
NULL);
2510 bool fromparentbasis;
2513 SPxOut::Verbosity verbosity;
2516 verbosity = lpi->
spx->spxout.getVerbosity();
2519 SCIPdebugMessage(
"calling SCIPlpiStrongbranch() on variable %d (%d iterations)\n", col, itlim);
2521 assert(lpi !=
NULL);
2525 assert(downvalid !=
NULL);
2526 assert(upvalid !=
NULL);
2529 #ifndef STRONGBRANCH_RESTOREBASIS 2530 fromparentbasis =
false;
2533 oldItlim = spx->intParam(SoPlex::ITERLIMIT);
2536 oldlb = spx->lowerReal(col);
2537 oldub = spx->upperReal(col);
2546 (void) spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2549 newub =
EPSCEIL(psol-1.0, lpi->
spx->feastol());
2550 if( newub >= oldlb - 0.5 && down !=
NULL )
2552 SCIPdebugMessage(
"strong branching down on x%d (%g) with %d iterations\n", col, psol, itlim);
2554 spx->changeUpperReal(col, newub);
2555 assert(spx->lowerReal(col) <= spx->upperReal(col));
2557 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2560 #ifndef STRONGBRANCH_RESTOREBASIS 2563 #ifdef SCIP_WITH_LPSCHECK 2564 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2566 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2567 status = spx->optimize();
2569 status = spx->solve();
2574 case SPxSolver::OPTIMAL:
2575 *down = spx->objValueReal();
2579 case SPxSolver::ABORT_TIME:
2580 case SPxSolver::ABORT_ITER:
2581 case SPxSolver::ABORT_CYCLING:
2582 #if SOPLEX_APIVERSION >= 3 2583 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2585 *down = spx->objValueReal();
2587 case SPxSolver::ABORT_VALUE:
2588 case SPxSolver::INFEASIBLE:
2589 *down = spx->getObjLimit();
2597 (*iter) += spx->numIterations();
2599 #ifdef STRONGBRANCH_RESTOREBASIS 2601 assert( ! spx->preStrongbranchingBasisFreed() );
2602 spx->restorePreStrongbranchingBasis();
2603 fromparentbasis =
false;
2607 #if SOPLEX_APIVERSION >= 3 2608 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2609 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2611 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2612 && !fromparentbasis && spx->numIterations() < itlim);
2614 if( repeatstrongbranching )
2616 SCIPdebugMessage(
" --> Repeat strong branching down with %d iterations after restoring basis\n",
2617 itlim - spx->numIterations());
2618 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2619 spx->restorePreStrongbranchingBasis();
2620 fromparentbasis =
true;
2625 fromparentbasis =
false;
2628 while( fromparentbasis );
2630 spx->changeUpperReal(col, oldub);
2631 assert(spx->lowerReal(col) <= spx->upperReal(col));
2633 else if( down !=
NULL )
2635 *down = spx->getObjLimit();
2645 if( newlb <= oldub + 0.5 && up !=
NULL )
2647 SCIPdebugMessage(
"strong branching up on x%d (%g) with %d iterations\n", col, psol, itlim);
2649 spx->changeLowerReal(col, newlb);
2650 assert(spx->lowerReal(col) <= spx->upperReal(col));
2652 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2655 #ifndef STRONGBRANCH_RESTOREBASIS 2658 #ifdef SCIP_WITH_LPSCHECK 2659 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2661 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2662 status = spx->optimize();
2664 status = spx->solve();
2669 case SPxSolver::OPTIMAL:
2670 *up = spx->objValueReal();
2674 case SPxSolver::ABORT_TIME:
2675 case SPxSolver::ABORT_ITER:
2676 case SPxSolver::ABORT_CYCLING:
2677 #if SOPLEX_APIVERSION >= 3 2678 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2680 *up = spx->objValueReal();
2682 case SPxSolver::ABORT_VALUE:
2683 case SPxSolver::INFEASIBLE:
2684 *up = spx->getObjLimit();
2692 (*iter) += spx->numIterations();
2694 #ifdef STRONGBRANCH_RESTOREBASIS 2696 assert( ! spx->preStrongbranchingBasisFreed() );
2697 spx->restorePreStrongbranchingBasis();
2698 fromparentbasis =
false;
2702 #if SOPLEX_APIVERSION >= 3 2703 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2704 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2706 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2707 && !fromparentbasis && spx->numIterations() < itlim);
2709 if( repeatstrongbranching )
2711 SCIPdebugMessage(
" --> Repeat strong branching up with %d iterations after restoring basis\n", itlim - spx->numIterations());
2712 spx->restorePreStrongbranchingBasis();
2713 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2715 fromparentbasis =
true;
2719 fromparentbasis =
false;
2722 while( fromparentbasis );
2724 spx->changeLowerReal(col, oldlb);
2725 assert(spx->lowerReal(col) <= spx->upperReal(col));
2727 else if( up !=
NULL )
2729 *up = spx->getObjLimit();
2737 (void) spx->setIntParam(SoPlex::ITERLIMIT, oldItlim);
2740 lpi->
spx->spxout.setVerbosity(verbosity);
2744 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2769 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2799 assert( cols !=
NULL );
2800 assert( psols !=
NULL );
2801 assert( down !=
NULL );
2802 assert( up !=
NULL );
2803 assert( downvalid !=
NULL );
2804 assert( upvalid !=
NULL );
2805 assert( down !=
NULL );
2810 for (
int j = 0; j < ncols; ++j)
2813 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2843 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2873 assert( cols !=
NULL );
2874 assert( psols !=
NULL );
2875 assert( down !=
NULL );
2876 assert( up !=
NULL );
2877 assert( downvalid !=
NULL );
2878 assert( upvalid !=
NULL );
2879 assert( down !=
NULL );
2884 for (
int j = 0; j < ncols; ++j)
2887 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2916 assert(lpi !=
NULL);
2939 assert(lpi !=
NULL);
2940 assert(primalfeasible !=
NULL);
2941 assert(dualfeasible !=
NULL);
2958 assert(lpi !=
NULL);
2961 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
2973 assert(lpi !=
NULL);
2976 return lpi->
spx->hasPrimalRay();
2986 assert(lpi !=
NULL);
2989 assert(lpi->
spx->status() != SPxSolver::UNBOUNDED || lpi->
spx->basisStatus() == SPxBasis::UNBOUNDED);
2994 return lpi->
spx->status() == SPxSolver::UNBOUNDED;
3004 assert(lpi !=
NULL);
3007 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3017 assert(lpi !=
NULL);
3020 return lpi->
spx->basisStatus() == SPxBasis::OPTIMAL || lpi->
spx->basisStatus() == SPxBasis::PRIMAL;
3032 assert(lpi !=
NULL);
3035 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3047 assert(lpi !=
NULL);
3050 return lpi->
spx->hasDualFarkas();
3060 assert(lpi !=
NULL);
3063 return lpi->
spx->status() == SPxSolver::INFEASIBLE && lpi->
spx->basisStatus() == SPxBasis::DUAL;
3073 assert(lpi !=
NULL);
3076 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3086 assert(lpi !=
NULL);
3089 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->
spx->basisStatus() == SPxBasis::DUAL;
3099 assert(lpi !=
NULL);
3101 assert((lpi->
spx->basisStatus() == SPxBasis::OPTIMAL)
3104 return (lpi->
spx->status() == SPxSolver::OPTIMAL);
3120 assert(lpi !=
NULL);
3125 #if SOPLEX_APIVERSION >= 3 3126 if( lpi->
spx->status() == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS )
3157 assert(lpi !=
NULL);
3160 return (lpi->
spx->status() == SPxSolver::ABORT_VALUE);
3170 assert(lpi !=
NULL);
3173 return (lpi->
spx->status() == SPxSolver::ABORT_ITER);
3183 assert(lpi !=
NULL);
3186 return (lpi->
spx->status() == SPxSolver::ABORT_TIME);
3196 assert(lpi !=
NULL);
3199 return static_cast<int>(lpi->
spx->status());
3210 assert(lpi !=
NULL);
3212 assert(success !=
NULL);
3214 #if SOPLEX_APIVERSION >= 4 3215 *success = lpi->
spx->ignoreUnscaledViolations();
3231 assert(lpi !=
NULL);
3233 assert(objval !=
NULL);
3235 *objval = lpi->
spx->objValueReal();
3256 assert(lpi !=
NULL);
3259 if( objval !=
NULL )
3260 *objval = lpi->
spx->objValueReal();
3264 if( primsol !=
NULL )
3266 #if SOPLEX_APIVERSION > 10 3267 (void)lpi->
spx->getPrimalReal(primsol, lpi->
spx->numColsReal());
3269 Vector tmp(lpi->
spx->numColsReal(), primsol);
3270 (void)lpi->
spx->getPrimalReal(tmp);
3273 if( dualsol !=
NULL )
3275 #if SOPLEX_APIVERSION > 10 3276 (void)lpi->
spx->getDualReal(dualsol, lpi->
spx->numRowsReal());
3278 Vector tmp(lpi->
spx->numRowsReal(), dualsol);
3279 (void)lpi->
spx->getDualReal(tmp);
3282 if( activity !=
NULL )
3284 #if SOPLEX_APIVERSION > 10 3285 (void)lpi->
spx->getSlacksReal(activity, lpi->
spx->numRowsReal());
3287 Vector tmp(lpi->
spx->numRowsReal(), activity);
3288 (void)lpi->
spx->getSlacksReal(tmp);
3291 if( redcost !=
NULL )
3293 #if SOPLEX_APIVERSION > 10 3294 (void)lpi->
spx->getRedCostReal(redcost, lpi->
spx->numColsReal());
3296 Vector tmp(lpi->
spx->numColsReal(), redcost);
3297 (void)lpi->
spx->getRedCostReal(tmp);
3302 catch(
const SPxException&
x )
3304 std::string s =
x.what();
3307 catch(
const SPxException& )
3324 assert(lpi !=
NULL);
3326 assert(lpi->
spx->hasPrimalRay());
3327 assert(ray !=
NULL);
3331 #if SOPLEX_APIVERSION > 10 3332 (void)lpi->
spx->getPrimalRayReal(ray, lpi->
spx->numColsReal());
3334 Vector tmp(lpi->
spx->numColsReal(), ray);
3335 (void)lpi->
spx->getPrimalRayReal(tmp);
3339 catch(
const SPxException&
x )
3341 std::string s =
x.what();
3344 catch(
const SPxException& )
3361 assert(lpi !=
NULL);
3363 assert(lpi->
spx->hasDualFarkas());
3364 assert(dualfarkas !=
NULL);
3368 #if SOPLEX_APIVERSION > 10 3369 (void)lpi->
spx->getDualFarkasReal(dualfarkas, lpi->
spx->numRowsReal());
3371 Vector tmp(lpi->
spx->numRowsReal(), dualfarkas);
3372 (void)lpi->
spx->getDualFarkasReal(tmp);
3376 catch(
const SPxException&
x )
3378 std::string s =
x.what();
3381 catch(
const SPxException& )
3398 assert(lpi !=
NULL);
3400 assert(iterations !=
NULL);
3402 *iterations = lpi->
spx->numIterations();
3420 assert(lpi !=
NULL);
3421 assert(quality !=
NULL);
3425 SCIPdebugMessage(
"requesting solution quality from SoPlex: quality %d\n", qualityindicator);
3427 switch( qualityindicator )
3430 success = lpi->
spx->getEstimatedCondition(*quality);
3434 success = lpi->
spx->getExactCondition(*quality);
3475 assert(lpi !=
NULL);
3478 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3482 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
3484 switch( lpi->
spx->basisRowStatus(i) )
3486 case SPxSolver::BASIC:
3489 case SPxSolver::FIXED:
3490 case SPxSolver::ON_LOWER:
3493 case SPxSolver::ON_UPPER:
3496 case SPxSolver::ZERO:
3497 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3499 case SPxSolver::UNDEFINED:
3510 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
3513 switch( lpi->
spx->basisColStatus(i) )
3515 case SPxSolver::BASIC:
3518 case SPxSolver::FIXED:
3532 case SPxSolver::ON_LOWER:
3535 case SPxSolver::ON_UPPER:
3538 case SPxSolver::ZERO:
3541 case SPxSolver::UNDEFINED:
3566 assert(lpi !=
NULL);
3572 assert(cstat !=
NULL || ncols == 0);
3573 assert(rstat !=
NULL || nrows == 0);
3575 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3578 DataArray<SPxSolver::VarStatus>& _colstat = lpi->
spx->colStat();
3579 DataArray<SPxSolver::VarStatus>& _rowstat = lpi->
spx->rowStat();
3581 _colstat.reSize(ncols);
3582 _rowstat.reSize(nrows);
3584 for( i = 0; i < nrows; ++i )
3589 _rowstat[i] = SPxSolver::ON_LOWER;
3592 _rowstat[i] = SPxSolver::BASIC;
3595 _rowstat[i] = SPxSolver::ON_UPPER;
3598 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3607 for( i = 0; i < ncols; ++i )
3612 _colstat[i] = SPxSolver::ON_LOWER;
3615 _colstat[i] = SPxSolver::BASIC;
3618 _colstat[i] = SPxSolver::ON_UPPER;
3621 _colstat[i] = SPxSolver::ZERO;
3631 lpi->
spx->freePreStrongbranchingBasis();
3644 assert(lpi !=
NULL);
3646 assert(bind !=
NULL);
3648 assert(lpi->
spx->preStrongbranchingBasisFreed());
3650 lpi->
spx->getBasisInd(bind);
3673 assert(lpi !=
NULL);
3675 assert(lpi->
spx->preStrongbranchingBasisFreed());
3676 assert(coef !=
NULL);
3679 assert(r < lpi->spx->numRowsReal());
3681 if( ! lpi->
spx->getBasisInverseRowReal(
r, coef, inds, ninds) )
3708 assert( lpi !=
NULL );
3710 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3711 assert(coef !=
NULL);
3713 if( ! lpi->
spx->getBasisInverseColReal(c, coef, inds, ninds) )
3743 assert(lpi !=
NULL);
3745 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3746 assert(coef !=
NULL);
3748 nrows = lpi->
spx->numRowsReal();
3749 ncols = lpi->
spx->numColsReal();
3753 if( binvrow ==
NULL )
3762 assert(binv !=
NULL);
3770 Vector binvvec(nrows, binv);
3772 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3777 for( c = 0; c < ncols; ++c )
3779 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3780 lpi->
spx->getColVectorReal(c, acol);
3781 coef[c] = binvvec * acol;
3783 coef[c] = binvvec * lpi->
spx->colVectorReal(c);
3809 DVector col(lpi->
spx->numRowsReal());
3811 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3818 assert( lpi !=
NULL );
3820 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3821 assert(coef !=
NULL);
3825 assert(c < lpi->spx->numColsReal());
3835 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3836 lpi->
spx->getColVectorReal(c, colsparse);
3840 col = lpi->
spx->colVectorReal(c);
3844 if( ! lpi->
spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3874 assert(blkmem !=
NULL);
3875 assert(lpi !=
NULL);
3877 assert(lpistate !=
NULL);
3879 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3881 ncols = lpi->
spx->numColsReal();
3882 nrows = lpi->
spx->numRowsReal();
3897 (*lpistate)->ncols = ncols;
3898 (*lpistate)->nrows = nrows;
3919 assert(lpi !=
NULL);
3921 assert(lpistate !=
NULL);
3924 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3926 lpncols = lpi->
spx->numColsReal();
3927 lpnrows = lpi->
spx->numRowsReal();
3928 assert(lpistate->
ncols <= lpncols);
3929 assert(lpistate->
nrows <= lpnrows);
3939 for( i = lpistate->
ncols; i < lpncols; ++i )
3945 bnd = lpi->
spx->lowerReal(i);
3957 for( i = lpistate->
nrows; i < lpnrows; ++i )
3973 assert(lpi !=
NULL);
3978 lpi->
spx->clearBasis();
3981 catch(
const SPxException&
x )
3983 std::string s = x.what();
3986 catch(
const SPxException& )
3989 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
4005 assert(lpi !=
NULL);
4006 assert(lpistate !=
NULL);
4007 assert(blkmem !=
NULL);
4009 if ( *lpistate !=
NULL )
4021 assert(lpi !=
NULL);
4032 assert(lpi !=
NULL);
4034 assert(fname !=
NULL);
4036 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4050 assert(lpi !=
NULL);
4052 assert(fname !=
NULL);
4055 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4087 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4091 assert(blkmem !=
NULL);
4092 assert(lpi !=
NULL);
4094 assert(lpinorms !=
NULL);
4096 lpi->
spx->getNdualNorms(nrows, ncols);
4098 if( nrows == 0 && ncols == 0)
4107 (*lpinorms)->nrows = 0;
4108 (*lpinorms)->ncols = 0;
4110 SCIPdebugMessage(
"storing SoPlex LPi pricing norms in %p (%d rows, %d cols)\n", (
void *) *lpinorms, nrows, ncols);
4112 if( !lpi->
spx->getDualNorms((*lpinorms)->nrows, (*lpinorms)->ncols, (*lpinorms)->norms) )
4117 assert(*lpinorms ==
NULL);
4122 assert(nrows == (*lpinorms)->nrows);
4123 assert(ncols == (*lpinorms)->ncols);
4142 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4143 assert(blkmem !=
NULL);
4144 assert(lpi !=
NULL);
4148 if( lpinorms ==
NULL )
4151 assert(lpinorms->
nrows <= lpi->
spx->numRowsReal());
4152 assert(lpinorms->
ncols <= lpi->
spx->numColsReal());
4154 if( lpinorms->
nrows == 0 )
4157 SCIPdebugMessage(
"loading LPi simplex norms %p (%d rows, %d cols) into SoPlex LP with %d rows and %d cols\n",
4158 (
const void *) lpinorms, lpinorms->
nrows, lpinorms->
ncols, lpi->
spx->numRowsReal(), lpi->
spx->numColsReal());
4173 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4174 assert(lpi !=
NULL);
4175 assert(lpinorms !=
NULL);
4181 assert(*lpinorms ==
NULL);
4210 assert(lpi !=
NULL);
4212 assert(ival !=
NULL);
4217 *ival = lpi->
spx->getFromScratch();
4220 *ival = lpi->
spx->getLpInfo();
4223 *ival = lpi->
spx->intParam(SoPlex::ITERLIMIT);
4228 *ival = lpi->
spx->intParam(SoPlex::SIMPLIFIER) == SoPlex::SIMPLIFIER_AUTO;
4234 scaleparam = lpi->
spx->intParam(SoPlex::SCALER);
4236 if( scaleparam == SoPlex::SCALER_OFF )
4238 else if( scaleparam == SoPlex::SCALER_BIEQUI )
4240 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4243 assert(scaleparam == SoPlex::SCALER_LEASTSQ);
4249 assert(scaleparam == SoPlex::SCALER_GEO8);
4254 #if SOPLEX_VERSION >= 201 4256 *ival = (int) (lpi->
spx->intParam(SoPlex::TIMER));
4259 #if SOPLEX_VERSION >= 230 || (SOPLEX_VERSION == 220 && SOPLEX_SUBVERSION >= 3) 4261 *ival = (int) lpi->
spx->randomSeed();
4264 #if SOPLEX_APIVERSION >= 1 4266 *ival = (int) lpi->
spx->intParam(SoPlex::FACTOR_UPDATE_MAX);
4285 assert(lpi !=
NULL);
4292 lpi->
spx->setFromScratch(
bool(ival));
4296 lpi->
spx->setLpInfo(
bool(ival));
4299 assert( ival >= 0 );
4301 if( ival >= INT_MAX )
4303 (void) lpi->
spx->setIntParam(SoPlex::ITERLIMIT, ival);
4307 (void) lpi->
spx->setIntParam(SoPlex::SIMPLIFIER, (ival ? SoPlex::SIMPLIFIER_AUTO : SoPlex::SIMPLIFIER_OFF));
4315 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_AUTO);
4318 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4321 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_PARMULT);
4324 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4327 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_QUICKSTEEP);
4330 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_DEVEX);
4337 assert(ival >= 0 && ival <= 2);
4339 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_OFF);
4340 else if( ival == 1 )
4341 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_BIEQUI);
4343 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4344 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_LEASTSQ);
4346 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_GEO8);
4350 #if SOPLEX_VERSION >= 201 4352 assert(ival >= 0 && ival < 3);
4353 (void) lpi->
spx->setIntParam(SoPlex::TIMER, ival);
4356 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3) 4358 lpi->
spx->setRandomSeed((
unsigned long)(
long)ival);
4361 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION >= 221 && SOPLEX_SUBVERSION >= 3) 4363 assert(ival >= 0 && ival < 3);
4364 (void) lpi->
spx->setIntParam(SoPlex::SOLUTION_POLISHING, ival);
4367 #if SOPLEX_APIVERSION >= 1 4370 (void) lpi->
spx->setIntParam(SoPlex::FACTOR_UPDATE_MAX, ival);
4390 assert(lpi !=
NULL);
4392 assert(dval !=
NULL);
4397 *dval = lpi->
spx->feastol();
4400 *dval = lpi->
spx->opttol();
4403 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4404 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_UPPER);
4406 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_LOWER);
4409 *dval = lpi->
spx->realParam(SoPlex::TIMELIMIT);
4412 *dval = lpi->
spx->realParam(SoPlex::REPRESENTATION_SWITCH);
4420 #if (SOPLEX_APIVERSION >= 9) 4421 *dval = lpi->
spx->realParam(SoPlex::MIN_MARKOWITZ);
4440 assert(lpi !=
NULL);
4447 assert( dval > 0.0 );
4448 lpi->
spx->setFeastol(dval);
4452 assert( dval > 0.0 );
4453 lpi->
spx->setOpttol(dval);
4457 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4458 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_UPPER, dval);
4460 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_LOWER, dval);
4463 assert( dval > 0.0 );
4465 (void) lpi->
spx->setRealParam(SoPlex::TIMELIMIT, dval);
4469 assert( dval >= 0.0 || dval == -1.0 );
4473 (
void) lpi->
spx->setRealParam(SoPlex::REPRESENTATION_SWITCH, dval);
4480 #if (SOPLEX_APIVERSION >= 9) 4484 else if( dval > 0.9999 )
4487 (void) lpi->
spx->setRealParam(SoPlex::MIN_MARKOWITZ, dval);
4514 assert(lpi !=
NULL);
4517 return lpi->
spx->realParam(SoPlex::INFTY);
4526 assert(lpi !=
NULL);
4529 return (val >= lpi->
spx->realParam(SoPlex::INFTY));
4547 const char* filename
4552 f = fopen(filename,
"r");
4569 assert(lpi !=
NULL);
4571 assert(fname !=
NULL);
4573 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4580 assert(lpi->
spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4581 if( !lpi->
spx->readFile(fname) )
4585 catch(
const SPxException&
x )
4587 std::string s =
x.what();
4590 catch(
const SPxException& )
4607 assert(lpi !=
NULL);
4609 assert(fname !=
NULL);
4613 (void) lpi->
spx->writeFileReal(fname);
4616 catch(
const SPxException&
x )
4618 std::string s =
x.what();
4621 catch(
const SPxException& )
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
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)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
const char * SCIPlpiGetSolverName(void)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
enum SCIP_ObjSen SCIP_OBJSEN
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
interface methods for specific LP solvers
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
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)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_Bool SCIPlpiHasPrimalSolve(void)
static int rowpacketNum(int nrows)
static SCIP_RETCODE optimize(SCIP *scip, SCIP_SOL *worksol, SCIP_VAR **vars, int *blockstart, int *blockend, int nblocks, OPTTYPE opttype, SCIP_Real *activities, int nrows, SCIP_Bool *improvement, SCIP_Bool *varboundserr, SCIP_HEURDATA *heurdata)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
static void invalidateSolution(SCIP_LPI *lpi)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
enum SCIP_LPParam SCIP_LPPARAM
#define BMSallocMemoryArray(ptr, num)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
#define BMSfreeMemory(ptr)
enum SCIP_Pricing SCIP_PRICING
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
static void setOpttol(SCIP_NLPIPROBLEM *nlpiproblem, SCIP_Real opttol)
static SCIP_RETCODE ensureRstatMem(SCIP_LPI *lpi, int num)
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
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)
#define SOPLEX_TRY(messagehdlr, x)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
polyscip::Polyscip::PolyscipStatus Status
abbreviation
SCIP_RETCODE SCIPlpiReadState(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)
static SCIP_RETCODE ensureCstatMem(SCIP_LPI *lpi, int num)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
packing single and dual bit values
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
static int colpacketNum(int ncols)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, const int *cstat, const int *rstat)
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
static SCIP_RETCODE pricing(SCIP *scip, SCIP_PRICER *pricer, SCIP_Real *lowerbound, SCIP_Bool farkas)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_Bool SCIPlpiHasDualSolve(void)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
static void setIntParam(SCIP_LPI *lpi, int const param, int const parval)
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
static SCIP_RETCODE lpiStrongbranch(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
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 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 SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
static SCIP_Bool fileExists(const char *filename)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
#define CHECK_SOPLEX_PARAM(x)
#define SOPLEX_SUBVERSION
#define BMSfreeBlockMemory(mem, ptr)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
#define BMSallocBlockMemoryArray(mem, ptr, num)
static void setFeastol(SCIP_NLPIPROBLEM *nlpiproblem, SCIP_Real feastol)
const char * SCIPlpiGetSolverDesc(void)
#define BMSallocMemoryCPP(size)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
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 SCIPlpiGetRows(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs, int *nnonz, int *beg, int *ind, SCIP_Real *val)
static SCIP_RETCODE spxSolve(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *obj)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *, const SCIP_LPISTATE *lpistate)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
public methods for message output
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
SCIP_DUALPACKET COLPACKET
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
#define BMSallocMemory(ptr)
#define BMSreallocMemoryArray(ptr, num)
SCIP_RETCODE SCIPlpiClear(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)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
SCIP_DUALPACKET ROWPACKET
#define SOPLEX_TRY_ABORT(x)
SCIP_MESSAGEHDLR * messagehdlr
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
#define BMSallocBlockMemory(mem, ptr)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiHasBarrierSolve(void)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)