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"); \ 85 #pragma GCC visibility push(default) 91 #ifndef SOPLEX_SUBVERSION 92 #define SOPLEX_SUBVERSION 0 95 #ifndef SOPLEX_APIVERSION 96 #define SOPLEX_APIVERSION 0 100 #if (SOPLEX_VERSION < 200 || (SOPLEX_VERSION == 200 && SOPLEX_SUBVERSION < 2) || (SOPLEX_VERSION > 200 && SOPLEX_VERSION < 201)) 101 #error "This interface is not compatible with SoPlex versions prior to 2.0.0.2" 104 #if (SOPLEX_APIVERSION <= 5) 105 #include "spxgithash.h" 116 #if defined(_MSC_VER) && _MSC_VER < 1900 118 #define snprintf _snprintf 122 #define SOPLEX_VERBLEVEL 5 143 #define SOPLEX_TRY(messagehdlr, x) do \ 149 catch( const SPxMemoryException& E ) \ 151 std::string s = E.what(); \ 152 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 155 catch( const SPxException& E ) \ 157 std::string s = E.what(); \ 158 SCIPmessagePrintWarning((messagehdlr), "SoPlex threw an exception: %s\n", s.c_str()); \ 159 return SCIP_LPERROR; \ 165 #define SOPLEX_TRY(messagehdlr, x) do \ 171 catch( const SPxMemoryException& E ) \ 173 std::string s = E.what(); \ 174 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 177 catch( const SPxException& ) \ 179 return SCIP_LPERROR; \ 188 #define SOPLEX_TRY_ABORT(x) do \ 194 catch( const SPxException& E ) \ 196 std::string s = E.what(); \ 197 SCIPerrorMessage("SoPlex threw an exception: %s\n", s.c_str()); \ 206 class SPxSCIP :
public SoPlex 212 DataArray<SPxSolver::VarStatus> _colStat;
213 DataArray<SPxSolver::VarStatus> _rowStat;
214 #ifdef SCIP_WITH_LPSCHECK 225 const char* probname =
NULL 232 _messagehdlr(messagehdlr)
234 if ( probname !=
NULL )
237 #if SOPLEX_APIVERSION >= 2 238 (void)setBoolParam(SoPlex::ENSURERAY,
true);
241 #ifdef SCIP_WITH_LPSCHECK 244 _doublecheck =
false;
245 _cpxenv = CPXopenCPLEX(&cpxstat);
246 assert(_cpxenv !=
NULL);
247 _cpxlp = CPXcreateprob(_cpxenv, &cpxstat, probname !=
NULL ? probname :
"spxcheck");
248 (void) CPXsetintparam(_cpxenv, CPX_PARAM_SCRIND, 0);
254 if( _probname !=
NULL )
257 freePreStrongbranchingBasis();
259 #ifdef SCIP_WITH_LPSCHECK 260 (void) CPXfreeprob(_cpxenv, &_cpxlp);
261 (void) CPXcloseCPLEX(&_cpxenv);
283 return realParam(OPTTOL);
295 Real getObjLimit()
const 297 return (intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE)
298 ? realParam(SoPlex::OBJLIMIT_UPPER)
299 : realParam(SoPlex::OBJLIMIT_LOWER);
303 bool getFromScratch()
const 308 void setFromScratch(
bool fs)
313 void setInterrupt(
bool interrupt)
315 _interrupt = interrupt;
324 bool getLpInfo()
const 329 void setLpInfo(
bool lpinfo)
335 void setProbname(
const char* probname)
339 assert(probname !=
NULL);
340 if( _probname !=
NULL )
343 len = strlen(probname);
344 spx_alloc(_probname, len + 1);
345 memcpy(_probname, probname, len + 1);
348 void setRep(SPxSolver::Representation p_rep)
350 if( p_rep == SPxSolver::COLUMN && intParam(REPRESENTATION) == REPRESENTATION_ROW )
355 else if( (p_rep == SPxSolver::ROW && intParam(REPRESENTATION) == REPRESENTATION_COLUMN) )
362 #ifdef SCIP_WITH_LPSCHECK 363 bool getDoubleCheck()
366 return _doublecheck && _checknum + 1 >= CHECK_START;
369 void setDoubleCheck(
bool dc)
378 case SPxSolver::ABORT_TIME:
380 case SPxSolver::ABORT_ITER:
382 case SPxSolver::ABORT_VALUE:
383 return "ABORT_VALUE";
384 case SPxSolver::SINGULAR:
386 case SPxSolver::REGULAR:
390 case SPxSolver::OPTIMAL:
392 #if SOPLEX_APIVERSION >= 3 393 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
394 return "OPTIMAL_UNSCALED_VIOLATIONS";
396 case SPxSolver::UNBOUNDED:
398 case SPxSolver::INFEASIBLE:
405 const char* cpxStatusString(
const int stat)
const 409 case CPX_STAT_ABORT_TIME_LIM:
411 case CPX_STAT_ABORT_IT_LIM:
413 case CPX_STAT_ABORT_OBJ_LIM:
414 return "ABORT_VALUE";
415 case CPX_STAT_OPTIMAL:
417 case CPX_STAT_OPTIMAL_INFEAS:
418 return "CPX_STAT_OPTIMAL_INFEAS: OPT SOL INFEASIBLE AFTER UNSCALING";
419 case CPX_STAT_UNBOUNDED:
421 case CPX_STAT_INFEASIBLE:
423 case CPX_STAT_INForUNBD:
424 return "INFEASIBLE or UNBOUNDED";
425 case CPX_STAT_NUM_BEST:
426 return "CPX_STAT_NUM_BEST: SOL AVAILABLE BUT NOT PROVEN OPTIMAL DUE TO NUM TROUBLE";
434 bool checkConsistentBounds()
const 436 for(
int i = 0; i < numColsReal(); ++i )
438 if( lowerReal(i) > upperReal(i) + realParam(SoPlex::EPSILON_ZERO) )
440 SCIPerrorMessage(
"inconsistent bounds on column %d: lower=%.17g, upper=%.17g\n",
441 i, lowerReal(i), upperReal(i));
449 bool checkConsistentSides()
const 451 for(
int i = 0; i < numRowsReal(); ++i )
453 if( lhsReal(i) > rhsReal(i) + realParam(SoPlex::EPSILON_ZERO) )
456 i, lhsReal(i), rhsReal(i));
465 void trySolve(
bool printwarning =
true)
472 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 473 #if SOPLEX_APIVERSION > 11 482 catch(
const SPxException&
x)
484 std::string s = x.what();
494 assert(status() != SPxSolver::OPTIMAL);
497 assert(intParam(ITERLIMIT) < 0 || numIterations() <= intParam(ITERLIMIT));
500 timespent = solveTime();
504 timelimit = realParam(TIMELIMIT);
505 if( timelimit > timespent )
506 timelimit -= timespent;
510 assert(timelimit >= 0);
517 SPxOut::Verbosity verbosity;
522 verbosity = spxout.getVerbosity();
523 spxout.setVerbosity((SPxOut::Verbosity)(getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
525 assert(checkConsistentBounds());
526 assert(checkConsistentSides());
528 #ifdef SCIP_WITH_LPSCHECK 530 if( getDoubleCheck() )
531 writeStateReal(
"spxcheck",
NULL,
NULL);
534 trySolve(printwarning);
535 spxStatus = status();
540 #ifdef SCIP_WITH_LPSCHECK 541 bool minimize = intParam(OBJSENSE) == OBJSENSE_MINIMIZE;
542 Real objLimitUpper = realParam(OBJLIMIT_UPPER);
543 Real objLimitLower = realParam(OBJLIMIT_LOWER);
546 if( getDoubleCheck() && (spxStatus == SPxSolver::OPTIMAL || spxStatus == SPxSolver::UNBOUNDED || spxStatus == SPxSolver::INFEASIBLE || spxStatus == SPxSolver::ABORT_VALUE) )
552 CPX_CALL( CPXreadcopyprob(_cpxenv, _cpxlp,
"spxcheck.mps",
NULL) );
553 CPX_CALL( CPXreadcopybase(_cpxenv, _cpxlp,
"spxcheck.bas") );
556 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPOPT,
MAX(opttol(), 1e-9)) );
557 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPRHS,
MAX(feastol(), 1e-9)) );
560 CPX_CALL( CPXlpopt(_cpxenv, _cpxlp) );
563 CPX_CALL( CPXsolution(_cpxenv, _cpxlp, &cpxstat, &cpxobj,
NULL,
NULL,
NULL,
NULL) );
568 if( cpxstat == CPX_STAT_OPTIMAL_INFEAS )
570 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s)\n",
571 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat));
572 if( EXIT_AT_CPXERROR )
575 else if( (spxStatus == SPxSolver::OPTIMAL && cpxstat != CPX_STAT_OPTIMAL)
576 || (spxStatus == SPxSolver::UNBOUNDED && cpxstat != CPX_STAT_UNBOUNDED)
577 || (spxStatus == SPxSolver::INFEASIBLE && cpxstat != CPX_STAT_INFEASIBLE) )
579 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
580 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
581 if( EXIT_AT_WRONG_RESULT )
584 else if( spxStatus == SPxSolver::ABORT_VALUE )
588 case CPX_STAT_OPTIMAL:
589 if( (minimize && LTrel(cpxobj, objLimitUpper, 2*opttol()))
590 || (!minimize && GTrel(cpxobj, objLimitLower, 2*opttol())) )
592 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
593 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
594 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
595 if( EXIT_AT_WRONG_RESULT )
598 else if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
600 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
601 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize?
"<" :
">",
602 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
605 case CPX_STAT_OPTIMAL_INFEAS:
606 case CPX_STAT_NUM_BEST:
607 if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
609 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
610 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
611 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
614 case CPX_STAT_INFEASIBLE:
616 case CPX_STAT_UNBOUNDED:
617 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
618 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
619 if( EXIT_AT_WRONG_RESULT )
622 case CPX_STAT_INForUNBD:
624 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
625 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
630 else if( spxStatus == SPxSolver::OPTIMAL )
632 if( (minimize && LTrel(objValueReal(), cpxobj, 2*opttol()))
633 || (!minimize && GTrel(objValueReal(), cpxobj, 2*opttol())) )
638 else if( (minimize && GTrel(objValueReal(), cpxobj, 2*opttol()))
639 || (!minimize && LTrel(objValueReal(), cpxobj, 2*opttol())) )
641 SCIPerrorMessage(
"In %s: LP optimal; SoPlex value=%.10f %s CPLEX value=%.10f suboptimal (checknum=%d)\n", _probname, objValueReal(),
642 minimize ?
">" :
"<", cpxobj, _checknum);
643 if( EXIT_AT_WRONG_RESULT )
653 spxout.setVerbosity(verbosity);
659 void savePreStrongbranchingBasis()
661 _rowStat.reSize(numRowsReal());
662 _colStat.reSize(numColsReal());
666 getBasis(_rowStat.get_ptr(), _colStat.get_ptr());
669 catch(
const SPxException&
x)
671 std::string s = x.what();
678 assert(status() != SPxSolver::OPTIMAL);
681 catch(
const SPxException&)
687 void restorePreStrongbranchingBasis()
689 assert(_rowStat.size() == numRowsReal());
690 assert(_colStat.size() == numColsReal());
694 setBasis(_rowStat.get_ptr(), _colStat.get_ptr());
697 catch(
const SPxException&
x)
699 std::string s = x.what();
702 catch(
const SPxException&)
709 assert(status() != SPxSolver::OPTIMAL);
714 void freePreStrongbranchingBasis()
721 bool preStrongbranchingBasisFreed()
const 723 return ((_rowStat.size() == 0 ) && (_colStat.size() == 0));
727 DataArray<SPxSolver::VarStatus>& rowStat()
733 DataArray<SPxSolver::VarStatus>& colStat()
751 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 753 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 777 COLPACKET* packcstat;
778 ROWPACKET* packrstat;
812 assert(num <= lpi->cstatsize);
834 assert(num <= lpi->rstatsize);
872 assert(lpistate !=
NULL);
888 assert(lpistate !=
NULL);
905 assert(lpistate !=
NULL);
906 assert(blkmem !=
NULL);
927 assert(blkmem !=
NULL);
928 assert(lpistate !=
NULL);
929 assert(*lpistate !=
NULL);
968 #if (SOPLEX_SUBVERSION > 0) 969 const static char spxname[20] = {
'S',
'o',
'p',
'l',
'e',
'x',
' ', SOPLEX_VERSION/100 +
'0',
'.', (SOPLEX_VERSION % 100)/10 +
'0',
'.', SOPLEX_VERSION % 10 +
'0',
'.',
SOPLEX_SUBVERSION +
'0'};
971 const static char spxname[20] = {
'S',
'o',
'p',
'l',
'e',
'x',
' ', SOPLEX_VERSION/100 +
'0',
'.', (SOPLEX_VERSION % 100)/10 +
'0',
'.', SOPLEX_VERSION % 10 +
'0'};
978 (void)snprintf(
spxdesc, 200,
"%s [GitHash: %s]",
"Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de)" 979 #ifdef SCIP_WITH_LPSCHECK
980 " - including CPLEX double check" 1011 return (
void*) lpi->
spx;
1021 assert( lpi !=
NULL );
1022 assert( ncols >= 0 );
1023 assert( ncols == 0 || intInfo !=
NULL );
1025 #if (SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3)) 1026 assert(ncols == lpi->
spx->numColsReal() || (ncols == 0 && intInfo ==
NULL));
1027 lpi->
spx->setIntegralityInformation(ncols, intInfo);
1030 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1079 assert(lpi !=
NULL);
1080 assert(name !=
NULL);
1087 SOPLEX_TRY( messagehdlr, (*lpi)->spx = new ((*lpi)->spx) SPxSCIP(messagehdlr, name) );
1088 (void) (*lpi)->spx->setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_ONLYREAL);
1089 (void) (*lpi)->spx->setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_REAL);
1090 (void) (*lpi)->spx->setIntParam(SoPlex::REPRESENTATION, SoPlex::REPRESENTATION_AUTO);
1093 #if SOPLEX_APIVERSION >= 10 1094 (void) (*lpi)->spx->setIntParam(SoPlex::STATTIMER, 0);
1097 (*lpi)->cstat =
NULL;
1098 (*lpi)->rstat =
NULL;
1099 (*lpi)->cstatsize = 0;
1100 (*lpi)->rstatsize = 0;
1102 (*lpi)->conditionlimit = -1.0;
1103 (*lpi)->checkcondition =
FALSE;
1104 (*lpi)->messagehdlr = messagehdlr;
1115 (*lpi)->spx->setInterrupt(
FALSE);
1116 SPxOut::Verbosity verbosity = (*lpi)->spx->spxout.getVerbosity();
1117 (*lpi)->spx->spxout.setVerbosity((SPxOut::Verbosity)((*lpi)->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
1118 (*lpi)->spx->printVersion();
1119 (*lpi)->spx->spxout.setVerbosity(verbosity);
1130 assert(lpi !=
NULL);
1131 assert(*lpi !=
NULL);
1132 assert((*lpi)->spx !=
NULL);
1135 (*lpi)->spx->~SPxSCIP();
1180 for( j = 0; j < nnonz; j++ )
1181 assert( val[j] != 0 );
1187 assert(lpi !=
NULL);
1189 assert(lhs !=
NULL);
1190 assert(rhs !=
NULL);
1191 assert(obj !=
NULL);
1194 assert(beg !=
NULL);
1195 assert(ind !=
NULL);
1196 assert(val !=
NULL);
1199 assert(lpi->
spx->preStrongbranchingBasisFreed());
1203 SPxSCIP* spx = lpi->
spx;
1204 LPRowSet rows(nrows);
1205 DSVector emptyVector(0);
1211 (void) spx->setIntParam(SoPlex::OBJSENSE, (objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE));
1214 for( i = 0; i < nrows; ++i )
1215 rows.add(lhs[i], emptyVector, rhs[i]);
1216 spx->addRowsReal(rows);
1222 catch(
const SPxException&
x )
1224 std::string s =
x.what();
1227 catch(
const SPxException& )
1252 assert(lpi !=
NULL);
1254 assert(obj !=
NULL);
1257 assert(nnonz == 0 || beg !=
NULL);
1258 assert(nnonz == 0 || ind !=
NULL);
1259 assert(nnonz == 0 || val !=
NULL);
1265 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1271 int nrows = lpi->
spx->numRowsReal();
1272 for (
int j = 0; j < nnonz; ++j)
1274 assert( 0 <= ind[j] && ind[j] < nrows );
1275 assert( val[j] != 0.0 );
1280 SPxSCIP* spx = lpi->
spx;
1283 LPColSet cols(ncols);
1284 DSVector colVector(ncols);
1290 for( i = 0; i < ncols; ++i )
1296 last = (i == ncols-1 ? nnonz : beg[i+1]);
1297 colVector.add( last-start, &ind[start], &val[start] );
1299 cols.add(obj[i], lb[i], colVector, ub[i]);
1301 spx->addColsReal(cols);
1304 catch(
const SPxException&
x )
1306 std::string s =
x.what();
1309 catch(
const SPxException& )
1327 assert(lpi !=
NULL);
1329 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1333 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1353 assert(lpi !=
NULL);
1355 assert(dstat !=
NULL);
1359 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1361 ncols = lpi->
spx->numColsReal();
1364 for( i = 0; i < ncols; ++i )
1387 assert(lpi !=
NULL);
1389 assert(lhs !=
NULL);
1390 assert(rhs !=
NULL);
1391 assert(nnonz == 0 || beg !=
NULL);
1392 assert(nnonz == 0 || ind !=
NULL);
1393 assert(nnonz == 0 || val !=
NULL);
1397 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1403 int ncols = lpi->
spx->numColsReal();
1404 for (
int j = 0; j < nnonz; ++j)
1406 assert( val[j] != 0.0 );
1407 assert( 0 <= ind[j] && ind[j] < ncols );
1414 SPxSCIP* spx = lpi->
spx;
1415 LPRowSet rows(nrows);
1422 for( i = 0; i < nrows; ++i )
1428 last = (i == nrows-1 ? nnonz : beg[i+1]);
1429 rowVector.add( last-start, &ind[start], &val[start] );
1431 rows.add(lhs[i], rowVector, rhs[i]);
1433 spx->addRowsReal(rows);
1436 catch(
const SPxException&
x )
1438 std::string s =
x.what();
1441 catch(
const SPxException& )
1459 assert(lpi !=
NULL);
1461 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1465 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1485 assert(lpi !=
NULL);
1490 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1492 nrows = lpi->
spx->numRowsReal();
1495 for( i = 0; i < nrows; ++i )
1510 assert(lpi !=
NULL);
1515 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1534 assert(lpi !=
NULL);
1536 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1542 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1546 for( i = 0; i < ncols; ++i )
1548 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1552 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1557 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1561 lpi->
spx->changeBoundsReal(ind[i], lb[i], ub[i]);
1562 assert(lpi->
spx->lowerReal(ind[i]) <= lpi->
spx->upperReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1566 catch(
const SPxException&
x )
1568 std::string s =
x.what();
1571 catch(
const SPxException& )
1593 assert(lpi !=
NULL);
1595 assert(ind !=
NULL);
1596 assert(lhs !=
NULL);
1597 assert(rhs !=
NULL);
1603 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1607 for( i = 0; i < nrows; ++i )
1609 assert(0 <= ind[i] && ind[i] < lpi->
spx->numRowsReal());
1610 lpi->
spx->changeRangeReal(ind[i], lhs[i], rhs[i]);
1611 assert(lpi->
spx->lhsReal(ind[i]) <= lpi->
spx->rhsReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1615 catch(
const SPxException&
x )
1617 std::string s =
x.what();
1620 catch(
const SPxException& )
1639 assert(lpi !=
NULL);
1641 assert(0 <= row && row < lpi->spx->numRowsReal());
1642 assert(0 <= col && col < lpi->spx->numColsReal());
1646 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1661 assert(lpi !=
NULL);
1666 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1685 assert(lpi !=
NULL);
1687 assert(ind !=
NULL);
1688 assert(obj !=
NULL);
1692 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1696 for( i = 0; i < ncols; ++i )
1698 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1699 lpi->
spx->changeObjReal(ind[i], obj[i]);
1703 catch(
const SPxException&
x )
1705 std::string s =
x.what();
1708 catch(
const SPxException& )
1729 assert(lpi !=
NULL);
1731 assert(scaleval != 0.0);
1737 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1740 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1741 SVector rowvec = lpi->
spx->rowVectorRealInternal(row);
1743 SVector rowvec = lpi->
spx->rowVectorReal(row);
1745 lhs = lpi->
spx->lhsReal(row);
1746 rhs = lpi->
spx->rhsReal(row);
1752 if( lhs > -lpi->
spx->realParam(SoPlex::INFTY) )
1754 else if( scaleval < 0.0 )
1755 lhs = lpi->
spx->realParam(SoPlex::INFTY);
1756 if( rhs < lpi->spx->realParam(SoPlex::INFTY) )
1758 else if( scaleval < 0.0 )
1759 rhs = -lpi->
spx->realParam(SoPlex::INFTY);
1760 if( scaleval < 0.0 )
1768 LPRow lprow(lhs, rowvec, rhs);
1771 lpi->
spx->changeRowReal(row, lprow);
1772 assert(lpi->
spx->lhsReal(row) <= lpi->
spx->rhsReal(row));
1775 catch(
const SPxException&
x )
1777 std::string s =
x.what();
1780 catch(
const SPxException& )
1804 assert(lpi !=
NULL);
1806 assert(scaleval != 0.0);
1812 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1815 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1816 SVector colvec = lpi->
spx->colVectorRealInternal(col);
1818 SVector colvec = lpi->
spx->colVectorReal(col);
1820 obj = lpi->
spx->objReal(col);
1821 lb = lpi->
spx->lowerReal(col);
1822 ub = lpi->
spx->upperReal(col);
1831 if( lb > -lpi->
spx->realParam(SoPlex::INFTY) )
1833 else if( scaleval < 0.0 )
1834 lb = lpi->
spx->realParam(SoPlex::INFTY);
1835 if( ub < lpi->spx->realParam(SoPlex::INFTY) )
1837 else if( scaleval < 0.0 )
1838 ub = -lpi->
spx->realParam(SoPlex::INFTY);
1839 if( scaleval < 0.0 )
1847 LPCol lpcol(obj, colvec, ub, lb);
1850 lpi->
spx->changeColReal(col, lpcol);
1851 assert(lpi->
spx->lowerReal(col) <= lpi->
spx->upperReal(col));
1854 catch(
const SPxException&
x )
1856 std::string s =
x.what();
1859 catch(
const SPxException& )
1888 assert(lpi !=
NULL);
1890 assert(nrows !=
NULL);
1892 *nrows = lpi->
spx->numRowsReal();
1905 assert(lpi !=
NULL);
1907 assert(ncols !=
NULL);
1909 *ncols = lpi->
spx->numColsReal();
1924 assert(lpi !=
NULL);
1926 assert(nnonz !=
NULL);
1930 if( lpi->
spx->numRowsReal() < lpi->
spx->numColsReal() )
1932 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
1934 (*nnonz) += lpi->
spx->rowVectorRealInternal(i).size();
1936 (*nnonz) += lpi->
spx->rowVectorReal(i).size();
1941 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
1943 (*nnonz) += lpi->
spx->colVectorRealInternal(i).size();
1945 (*nnonz) += lpi->
spx->colVectorReal(i).size();
1973 assert(lpi !=
NULL);
1975 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1981 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1982 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1984 DVector lbvec(lpi->
spx->numColsReal());
1985 DVector ubvec(lpi->
spx->numColsReal());
1986 lpi->
spx->getLowerReal(lbvec);
1987 lpi->
spx->getUpperReal(ubvec);
1988 for( i = firstcol; i <= lastcol; ++i )
1990 lb[i-firstcol] = lbvec[i];
1991 ub[i-firstcol] = ubvec[i];
1996 const Vector& lbvec = lpi->
spx->lowerRealInternal();
1997 const Vector& ubvec = lpi->
spx->upperRealInternal();
1998 for( i = firstcol; i <= lastcol; ++i )
2000 lb[i-firstcol] = lbvec[i];
2001 ub[i-firstcol] = ubvec[i];
2005 const Vector& lbvec = lpi->
spx->lowerReal();
2006 const Vector& ubvec = lpi->
spx->upperReal();
2008 for( i = firstcol; i <= lastcol; ++i )
2010 lb[i-firstcol] = lbvec[i];
2011 ub[i-firstcol] = ubvec[i];
2019 for( i = firstcol; i <= lastcol; ++i )
2021 beg[i-firstcol] = *nnonz;
2023 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2024 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2027 lpi->
spx->getColVectorReal(i, cvec);
2028 for( j = 0; j < cvec.size(); ++j )
2030 ind[*nnonz] = cvec.index(j);
2031 val[*nnonz] = cvec.value(j);
2037 const SVector& cvec = lpi->
spx->colVectorRealInternal(i);
2038 for( j = 0; j < cvec.size(); ++j )
2040 ind[*nnonz] = cvec.index(j);
2041 val[*nnonz] = cvec.value(j);
2046 const SVector& cvec = lpi->
spx->colVectorReal(i);
2047 for( j = 0; j < cvec.size(); ++j )
2049 ind[*nnonz] = cvec.index(j);
2050 val[*nnonz] = cvec.value(j);
2081 assert(lpi !=
NULL);
2083 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2089 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2090 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2092 DVector lhsvec(lpi->
spx->numRowsReal());
2093 DVector rhsvec(lpi->
spx->numRowsReal());
2094 lpi->
spx->getLhsReal(lhsvec);
2095 lpi->
spx->getRhsReal(rhsvec);
2096 for( i = firstrow; i <= lastrow; ++i )
2098 lhs[i-firstrow] = lhsvec[i];
2099 rhs[i-firstrow] = rhsvec[i];
2104 const Vector& lhsvec = lpi->
spx->lhsRealInternal();
2105 const Vector& rhsvec = lpi->
spx->rhsRealInternal();
2106 for( i = firstrow; i <= lastrow; ++i )
2108 lhs[i-firstrow] = lhsvec[i];
2109 rhs[i-firstrow] = rhsvec[i];
2113 const Vector& lhsvec = lpi->
spx->lhsReal();
2114 const Vector& rhsvec = lpi->
spx->rhsReal();
2115 for( i = firstrow; i <= lastrow; ++i )
2117 lhs[i-firstrow] = lhsvec[i];
2118 rhs[i-firstrow] = rhsvec[i];
2126 for( i = firstrow; i <= lastrow; ++i )
2128 beg[i-firstrow] = *nnonz;
2130 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2131 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2134 lpi->
spx->getRowVectorReal(i, rvec);
2135 for( j = 0; j < rvec.size(); ++j )
2137 ind[*nnonz] = rvec.index(j);
2138 val[*nnonz] = rvec.value(j);
2144 const SVector& rvec = lpi->
spx->rowVectorRealInternal(i);
2145 for( j = 0; j < rvec.size(); ++j )
2147 ind[*nnonz] = rvec.index(j);
2148 val[*nnonz] = rvec.value(j);
2153 const SVector& rvec = lpi->
spx->rowVectorReal(i);
2154 for( j = 0; j < rvec.size(); ++j )
2156 ind[*nnonz] = rvec.index(j);
2157 val[*nnonz] = rvec.value(j);
2174 int namestoragesize,
2178 assert( lpi !=
NULL );
2180 assert( colnames !=
NULL || namestoragesize == 0 );
2181 assert( namestorage !=
NULL || namestoragesize == 0 );
2182 assert( namestoragesize >= 0 );
2183 assert( storageleft !=
NULL );
2184 assert( 0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal() );
2200 int namestoragesize,
2204 assert( lpi !=
NULL );
2206 assert( rownames !=
NULL || namestoragesize == 0 );
2207 assert( namestorage !=
NULL || namestoragesize == 0 );
2208 assert( namestoragesize >= 0 );
2209 assert( storageleft !=
NULL );
2210 assert( 0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal() );
2227 assert(lpi !=
NULL);
2229 assert(objsen !=
NULL);
2248 assert(lpi !=
NULL);
2250 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2251 assert(vals !=
NULL);
2253 for( i = firstcol; i <= lastcol; ++i )
2254 vals[i-firstcol] = lpi->
spx->objReal(i);
2272 assert(lpi !=
NULL);
2274 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2276 for( i = firstcol; i <= lastcol; ++i )
2279 lbs[i-firstcol] = lpi->
spx->lowerReal(i);
2281 ubs[i-firstcol] = lpi->
spx->upperReal(i);
2300 assert(lpi !=
NULL);
2302 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2304 for( i = firstrow; i <= lastrow; ++i )
2307 lhss[i-firstrow] = lpi->
spx->lhsReal(i);
2309 rhss[i-firstrow] = lpi->
spx->rhsReal(i);
2325 assert(lpi !=
NULL);
2327 assert(0 <= col && col < lpi->spx->numColsReal());
2328 assert(0 <= row && row < lpi->spx->numRowsReal());
2329 assert(val !=
NULL);
2331 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2332 *val = lpi->
spx->coefReal(row, col);
2334 *val = lpi->
spx->colVectorReal(col)[row];
2358 assert( lpi !=
NULL );
2361 SPxOut::Verbosity verbosity;
2363 verbosity = lpi->
spx->spxout.getVerbosity();
2366 SCIPdebugMessage(
"calling SoPlex solve(): %d cols, %d rows\n", lpi->
spx->numColsReal(), lpi->
spx->numRowsReal());
2370 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2372 #ifdef SCIP_WITH_LPSCHECK 2373 lpi->
spx->setDoubleCheck(CHECK_SPXSOLVE);
2377 if( lpi->
spx->getFromScratch() )
2381 lpi->
spx->clearBasis();
2384 catch(
const SPxException&
x)
2386 std::string s = x.what();
2389 catch(
const SPxException&)
2392 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
2396 assert(!lpi->
spx->getFromScratch() || lpi->
spx->status() == SPxSolver::NO_PROBLEM);
2399 SCIPdebugMessage(
" -> SoPlex status: %d, basis status: %d\n", lpi->
spx->status(), lpi->
spx->basisStatus());
2403 lpi->
spx->spxout.setVerbosity(verbosity);
2407 case SPxSolver::ABORT_TIME:
2408 case SPxSolver::ABORT_ITER:
2409 case SPxSolver::ABORT_VALUE:
2410 case SPxSolver::SINGULAR:
2411 case SPxSolver::REGULAR:
2413 case SPxSolver::OPTIMAL:
2414 #if SOPLEX_APIVERSION >= 3 2415 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2417 case SPxSolver::UNBOUNDED:
2418 case SPxSolver::INFEASIBLE:
2432 assert(lpi !=
NULL);
2435 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2446 assert(lpi !=
NULL);
2449 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2459 assert(lpi !=
NULL);
2473 assert(lpi !=
NULL);
2476 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2477 lpi->
spx->savePreStrongbranchingBasis();
2487 assert(lpi !=
NULL);
2490 assert( ! lpi->
spx->preStrongbranchingBasisFreed() );
2491 lpi->
spx->restorePreStrongbranchingBasis();
2492 lpi->
spx->freePreStrongbranchingBasis();
2513 assert(lpi !=
NULL);
2522 bool fromparentbasis;
2525 SPxOut::Verbosity verbosity;
2528 verbosity = lpi->
spx->spxout.getVerbosity();
2531 SCIPdebugMessage(
"calling SCIPlpiStrongbranch() on variable %d (%d iterations)\n", col, itlim);
2533 assert(lpi !=
NULL);
2537 assert(downvalid !=
NULL);
2538 assert(upvalid !=
NULL);
2541 #ifndef STRONGBRANCH_RESTOREBASIS 2542 fromparentbasis =
false;
2545 oldItlim = spx->intParam(SoPlex::ITERLIMIT);
2548 oldlb = spx->lowerReal(col);
2549 oldub = spx->upperReal(col);
2558 (void) spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2561 newub =
EPSCEIL(psol-1.0, lpi->
spx->feastol());
2562 if( newub >= oldlb - 0.5 && down !=
NULL )
2564 SCIPdebugMessage(
"strong branching down on x%d (%g) with %d iterations\n", col, psol, itlim);
2566 spx->changeUpperReal(col, newub);
2567 assert(spx->lowerReal(col) <= spx->upperReal(col));
2569 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2572 #ifndef STRONGBRANCH_RESTOREBASIS 2575 #ifdef SCIP_WITH_LPSCHECK 2576 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2578 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2579 #if SOPLEX_APIVERSION > 11 2580 status = spx->optimize(spx->getInterrupt());
2582 status = spx->optimize();
2585 status = spx->solve();
2590 case SPxSolver::OPTIMAL:
2591 *down = spx->objValueReal();
2595 case SPxSolver::ABORT_TIME:
2596 case SPxSolver::ABORT_ITER:
2597 case SPxSolver::ABORT_CYCLING:
2598 #if SOPLEX_APIVERSION >= 3 2599 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2601 *down = spx->objValueReal();
2603 case SPxSolver::ABORT_VALUE:
2604 case SPxSolver::INFEASIBLE:
2605 *down = spx->getObjLimit();
2613 (*iter) += spx->numIterations();
2615 #ifdef STRONGBRANCH_RESTOREBASIS 2617 assert( ! spx->preStrongbranchingBasisFreed() );
2618 spx->restorePreStrongbranchingBasis();
2619 fromparentbasis =
false;
2623 #if SOPLEX_APIVERSION >= 3 2624 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2625 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2627 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2628 && !fromparentbasis && spx->numIterations() < itlim);
2630 if( repeatstrongbranching )
2632 SCIPdebugMessage(
" --> Repeat strong branching down with %d iterations after restoring basis\n",
2633 itlim - spx->numIterations());
2634 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2635 spx->restorePreStrongbranchingBasis();
2636 fromparentbasis =
true;
2641 fromparentbasis =
false;
2644 while( fromparentbasis );
2646 spx->changeUpperReal(col, oldub);
2647 assert(spx->lowerReal(col) <= spx->upperReal(col));
2649 else if( down !=
NULL )
2651 *down = spx->getObjLimit();
2661 if( newlb <= oldub + 0.5 && up !=
NULL )
2663 SCIPdebugMessage(
"strong branching up on x%d (%g) with %d iterations\n", col, psol, itlim);
2665 spx->changeLowerReal(col, newlb);
2666 assert(spx->lowerReal(col) <= spx->upperReal(col));
2668 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2671 #ifndef STRONGBRANCH_RESTOREBASIS 2674 #ifdef SCIP_WITH_LPSCHECK 2675 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2677 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2678 #if SOPLEX_APIVERSION > 11 2679 status = spx->optimize(spx->getInterrupt());
2681 status = spx->optimize();
2684 status = spx->solve();
2689 case SPxSolver::OPTIMAL:
2690 *up = spx->objValueReal();
2694 case SPxSolver::ABORT_TIME:
2695 case SPxSolver::ABORT_ITER:
2696 case SPxSolver::ABORT_CYCLING:
2697 #if SOPLEX_APIVERSION >= 3 2698 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2700 *up = spx->objValueReal();
2702 case SPxSolver::ABORT_VALUE:
2703 case SPxSolver::INFEASIBLE:
2704 *up = spx->getObjLimit();
2712 (*iter) += spx->numIterations();
2714 #ifdef STRONGBRANCH_RESTOREBASIS 2716 assert( ! spx->preStrongbranchingBasisFreed() );
2717 spx->restorePreStrongbranchingBasis();
2718 fromparentbasis =
false;
2722 #if SOPLEX_APIVERSION >= 3 2723 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2724 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2726 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2727 && !fromparentbasis && spx->numIterations() < itlim);
2729 if( repeatstrongbranching )
2731 SCIPdebugMessage(
" --> Repeat strong branching up with %d iterations after restoring basis\n", itlim - spx->numIterations());
2732 spx->restorePreStrongbranchingBasis();
2733 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2735 fromparentbasis =
true;
2739 fromparentbasis =
false;
2742 while( fromparentbasis );
2744 spx->changeLowerReal(col, oldlb);
2745 assert(spx->lowerReal(col) <= spx->upperReal(col));
2747 else if( up !=
NULL )
2749 *up = spx->getObjLimit();
2757 (void) spx->setIntParam(SoPlex::ITERLIMIT, oldItlim);
2760 lpi->
spx->spxout.setVerbosity(verbosity);
2764 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2789 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2819 assert( cols !=
NULL );
2820 assert( psols !=
NULL );
2821 assert( down !=
NULL );
2822 assert( up !=
NULL );
2823 assert( downvalid !=
NULL );
2824 assert( upvalid !=
NULL );
2825 assert( down !=
NULL );
2830 for (
int j = 0; j < ncols; ++j)
2833 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2863 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2893 assert( cols !=
NULL );
2894 assert( psols !=
NULL );
2895 assert( down !=
NULL );
2896 assert( up !=
NULL );
2897 assert( downvalid !=
NULL );
2898 assert( upvalid !=
NULL );
2899 assert( down !=
NULL );
2904 for (
int j = 0; j < ncols; ++j)
2907 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2936 assert(lpi !=
NULL);
2959 assert(lpi !=
NULL);
2960 assert(primalfeasible !=
NULL);
2961 assert(dualfeasible !=
NULL);
2978 assert(lpi !=
NULL);
2981 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
2993 assert(lpi !=
NULL);
2996 return lpi->
spx->hasPrimalRay();
3006 assert(lpi !=
NULL);
3009 assert(lpi->
spx->status() != SPxSolver::UNBOUNDED || lpi->
spx->basisStatus() == SPxBasis::UNBOUNDED);
3014 return lpi->
spx->status() == SPxSolver::UNBOUNDED;
3024 assert(lpi !=
NULL);
3027 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3037 assert(lpi !=
NULL);
3040 return lpi->
spx->basisStatus() == SPxBasis::OPTIMAL || lpi->
spx->basisStatus() == SPxBasis::PRIMAL;
3052 assert(lpi !=
NULL);
3055 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3067 assert(lpi !=
NULL);
3070 return lpi->
spx->hasDualFarkas();
3080 assert(lpi !=
NULL);
3083 return lpi->
spx->status() == SPxSolver::INFEASIBLE && lpi->
spx->basisStatus() == SPxBasis::DUAL;
3093 assert(lpi !=
NULL);
3096 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3106 assert(lpi !=
NULL);
3109 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->
spx->basisStatus() == SPxBasis::DUAL;
3119 assert(lpi !=
NULL);
3121 assert((lpi->
spx->basisStatus() == SPxBasis::OPTIMAL)
3124 return (lpi->
spx->status() == SPxSolver::OPTIMAL);
3140 assert(lpi !=
NULL);
3145 #if SOPLEX_APIVERSION >= 3 3146 if( lpi->
spx->status() == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS )
3177 assert(lpi !=
NULL);
3180 return (lpi->
spx->status() == SPxSolver::ABORT_VALUE);
3190 assert(lpi !=
NULL);
3193 return (lpi->
spx->status() == SPxSolver::ABORT_ITER);
3203 assert(lpi !=
NULL);
3206 return (lpi->
spx->status() == SPxSolver::ABORT_TIME);
3216 assert(lpi !=
NULL);
3219 return static_cast<int>(lpi->
spx->status());
3230 assert(lpi !=
NULL);
3232 assert(success !=
NULL);
3234 #if SOPLEX_APIVERSION >= 4 3235 *success = lpi->
spx->ignoreUnscaledViolations();
3251 assert(lpi !=
NULL);
3253 assert(objval !=
NULL);
3255 *objval = lpi->
spx->objValueReal();
3276 assert(lpi !=
NULL);
3279 if( objval !=
NULL )
3280 *objval = lpi->
spx->objValueReal();
3284 if( primsol !=
NULL )
3286 #if SOPLEX_APIVERSION > 10 3287 (void)lpi->
spx->getPrimalReal(primsol, lpi->
spx->numColsReal());
3289 Vector tmp(lpi->
spx->numColsReal(), primsol);
3290 (void)lpi->
spx->getPrimalReal(tmp);
3293 if( dualsol !=
NULL )
3295 #if SOPLEX_APIVERSION > 10 3296 (void)lpi->
spx->getDualReal(dualsol, lpi->
spx->numRowsReal());
3298 Vector tmp(lpi->
spx->numRowsReal(), dualsol);
3299 (void)lpi->
spx->getDualReal(tmp);
3302 if( activity !=
NULL )
3304 #if SOPLEX_APIVERSION > 10 3305 (void)lpi->
spx->getSlacksReal(activity, lpi->
spx->numRowsReal());
3307 Vector tmp(lpi->
spx->numRowsReal(), activity);
3308 (void)lpi->
spx->getSlacksReal(tmp);
3311 if( redcost !=
NULL )
3313 #if SOPLEX_APIVERSION > 10 3314 (void)lpi->
spx->getRedCostReal(redcost, lpi->
spx->numColsReal());
3316 Vector tmp(lpi->
spx->numColsReal(), redcost);
3317 (void)lpi->
spx->getRedCostReal(tmp);
3322 catch(
const SPxException&
x )
3324 std::string s =
x.what();
3327 catch(
const SPxException& )
3344 assert(lpi !=
NULL);
3346 assert(lpi->
spx->hasPrimalRay());
3347 assert(ray !=
NULL);
3351 #if SOPLEX_APIVERSION > 10 3352 (void)lpi->
spx->getPrimalRayReal(ray, lpi->
spx->numColsReal());
3354 Vector tmp(lpi->
spx->numColsReal(), ray);
3355 (void)lpi->
spx->getPrimalRayReal(tmp);
3359 catch(
const SPxException&
x )
3361 std::string s =
x.what();
3364 catch(
const SPxException& )
3381 assert(lpi !=
NULL);
3383 assert(lpi->
spx->hasDualFarkas());
3384 assert(dualfarkas !=
NULL);
3388 #if SOPLEX_APIVERSION > 10 3389 (void)lpi->
spx->getDualFarkasReal(dualfarkas, lpi->
spx->numRowsReal());
3391 Vector tmp(lpi->
spx->numRowsReal(), dualfarkas);
3392 (void)lpi->
spx->getDualFarkasReal(tmp);
3396 catch(
const SPxException&
x )
3398 std::string s =
x.what();
3401 catch(
const SPxException& )
3418 assert(lpi !=
NULL);
3420 assert(iterations !=
NULL);
3422 *iterations = lpi->
spx->numIterations();
3440 assert(lpi !=
NULL);
3441 assert(quality !=
NULL);
3445 SCIPdebugMessage(
"requesting solution quality from SoPlex: quality %d\n", qualityindicator);
3447 switch( qualityindicator )
3450 success = lpi->
spx->getEstimatedCondition(*quality);
3454 success = lpi->
spx->getExactCondition(*quality);
3495 assert(lpi !=
NULL);
3498 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3502 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
3504 switch( lpi->
spx->basisRowStatus(i) )
3506 case SPxSolver::BASIC:
3510 case SPxSolver::ON_LOWER:
3513 case SPxSolver::ON_UPPER:
3516 case SPxSolver::ZERO:
3517 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3519 case SPxSolver::UNDEFINED:
3530 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
3533 switch( lpi->
spx->basisColStatus(i) )
3535 case SPxSolver::BASIC:
3552 case SPxSolver::ON_LOWER:
3555 case SPxSolver::ON_UPPER:
3558 case SPxSolver::ZERO:
3561 case SPxSolver::UNDEFINED:
3586 assert(lpi !=
NULL);
3592 assert(cstat !=
NULL || ncols == 0);
3593 assert(rstat !=
NULL || nrows == 0);
3595 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3598 DataArray<SPxSolver::VarStatus>& _colstat = lpi->
spx->colStat();
3599 DataArray<SPxSolver::VarStatus>& _rowstat = lpi->
spx->rowStat();
3601 _colstat.reSize(ncols);
3602 _rowstat.reSize(nrows);
3604 for( i = 0; i < nrows; ++i )
3609 _rowstat[i] = SPxSolver::ON_LOWER;
3612 _rowstat[i] = SPxSolver::BASIC;
3615 _rowstat[i] = SPxSolver::ON_UPPER;
3618 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3627 for( i = 0; i < ncols; ++i )
3632 _colstat[i] = SPxSolver::ON_LOWER;
3635 _colstat[i] = SPxSolver::BASIC;
3638 _colstat[i] = SPxSolver::ON_UPPER;
3641 _colstat[i] = SPxSolver::ZERO;
3651 lpi->
spx->freePreStrongbranchingBasis();
3664 assert(lpi !=
NULL);
3666 assert(bind !=
NULL);
3668 assert(lpi->
spx->preStrongbranchingBasisFreed());
3670 lpi->
spx->getBasisInd(bind);
3693 assert(lpi !=
NULL);
3695 assert(lpi->
spx->preStrongbranchingBasisFreed());
3696 assert(coef !=
NULL);
3699 assert(r < lpi->spx->numRowsReal());
3701 if( ! lpi->
spx->getBasisInverseRowReal(
r, coef, inds, ninds) )
3728 assert( lpi !=
NULL );
3730 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3731 assert(coef !=
NULL);
3733 if( ! lpi->
spx->getBasisInverseColReal(c, coef, inds, ninds) )
3763 assert(lpi !=
NULL);
3765 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3766 assert(coef !=
NULL);
3768 nrows = lpi->
spx->numRowsReal();
3769 ncols = lpi->
spx->numColsReal();
3773 if( binvrow ==
NULL )
3782 assert(binv !=
NULL);
3790 Vector binvvec(nrows, binv);
3792 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3797 for( c = 0; c < ncols; ++c )
3799 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3800 lpi->
spx->getColVectorReal(c, acol);
3801 coef[c] = binvvec * acol;
3803 coef[c] = binvvec * lpi->
spx->colVectorReal(c);
3829 DVector col(lpi->
spx->numRowsReal());
3831 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3838 assert( lpi !=
NULL );
3840 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3841 assert(coef !=
NULL);
3845 assert(c < lpi->spx->numColsReal());
3855 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3856 lpi->
spx->getColVectorReal(c, colsparse);
3860 col = lpi->
spx->colVectorReal(c);
3864 if( ! lpi->
spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3894 assert(blkmem !=
NULL);
3895 assert(lpi !=
NULL);
3897 assert(lpistate !=
NULL);
3899 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3901 ncols = lpi->
spx->numColsReal();
3902 nrows = lpi->
spx->numRowsReal();
3917 (*lpistate)->ncols = ncols;
3918 (*lpistate)->nrows = nrows;
3939 assert(lpi !=
NULL);
3941 assert(lpistate !=
NULL);
3944 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3946 lpncols = lpi->
spx->numColsReal();
3947 lpnrows = lpi->
spx->numRowsReal();
3948 assert(lpistate->
ncols <= lpncols);
3949 assert(lpistate->
nrows <= lpnrows);
3959 for( i = lpistate->
ncols; i < lpncols; ++i )
3965 bnd = lpi->
spx->lowerReal(i);
3977 for( i = lpistate->
nrows; i < lpnrows; ++i )
3993 assert(lpi !=
NULL);
3998 lpi->
spx->clearBasis();
4001 catch(
const SPxException&
x )
4003 std::string s = x.what();
4006 catch(
const SPxException& )
4009 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
4025 assert(lpi !=
NULL);
4026 assert(lpistate !=
NULL);
4027 assert(blkmem !=
NULL);
4029 if ( *lpistate !=
NULL )
4041 assert(lpi !=
NULL);
4052 assert(lpi !=
NULL);
4054 assert(fname !=
NULL);
4056 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4070 assert(lpi !=
NULL);
4072 assert(fname !=
NULL);
4075 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4107 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4111 assert(blkmem !=
NULL);
4112 assert(lpi !=
NULL);
4114 assert(lpinorms !=
NULL);
4116 lpi->
spx->getNdualNorms(nrows, ncols);
4118 if( nrows == 0 && ncols == 0)
4127 (*lpinorms)->nrows = 0;
4128 (*lpinorms)->ncols = 0;
4130 SCIPdebugMessage(
"storing SoPlex LPi pricing norms in %p (%d rows, %d cols)\n", (
void *) *lpinorms, nrows, ncols);
4132 if( !lpi->
spx->getDualNorms((*lpinorms)->nrows, (*lpinorms)->ncols, (*lpinorms)->norms) )
4137 assert(*lpinorms ==
NULL);
4142 assert(nrows == (*lpinorms)->nrows);
4143 assert(ncols == (*lpinorms)->ncols);
4162 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4163 assert(blkmem !=
NULL);
4164 assert(lpi !=
NULL);
4168 if( lpinorms ==
NULL )
4171 assert(lpinorms->
nrows <= lpi->
spx->numRowsReal());
4172 assert(lpinorms->
ncols <= lpi->
spx->numColsReal());
4174 if( lpinorms->
nrows == 0 )
4177 SCIPdebugMessage(
"loading LPi simplex norms %p (%d rows, %d cols) into SoPlex LP with %d rows and %d cols\n",
4178 (
const void *) lpinorms, lpinorms->
nrows, lpinorms->
ncols, lpi->
spx->numRowsReal(), lpi->
spx->numColsReal());
4193 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4194 assert(lpi !=
NULL);
4195 assert(lpinorms !=
NULL);
4201 assert(*lpinorms ==
NULL);
4230 assert(lpi !=
NULL);
4232 assert(ival !=
NULL);
4237 *ival = lpi->
spx->getFromScratch();
4240 *ival = lpi->
spx->getLpInfo();
4243 *ival = lpi->
spx->intParam(SoPlex::ITERLIMIT);
4248 *ival = lpi->
spx->intParam(SoPlex::SIMPLIFIER);
4254 scaleparam = lpi->
spx->intParam(SoPlex::SCALER);
4256 if( scaleparam == SoPlex::SCALER_OFF )
4258 else if( scaleparam == SoPlex::SCALER_BIEQUI )
4260 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4263 assert(scaleparam == SoPlex::SCALER_LEASTSQ);
4269 assert(scaleparam == SoPlex::SCALER_GEO8);
4274 #if SOPLEX_VERSION >= 201 4276 *ival = (int) (lpi->
spx->intParam(SoPlex::TIMER));
4279 #if SOPLEX_VERSION >= 230 || (SOPLEX_VERSION == 220 && SOPLEX_SUBVERSION >= 3) 4281 *ival = (int) lpi->
spx->randomSeed();
4284 #if SOPLEX_APIVERSION >= 1 4286 *ival = (int) lpi->
spx->intParam(SoPlex::FACTOR_UPDATE_MAX);
4305 assert(lpi !=
NULL);
4312 lpi->
spx->setFromScratch(
bool(ival));
4316 lpi->
spx->setLpInfo(
bool(ival));
4319 assert( ival >= 0 );
4321 if( ival >= INT_MAX )
4323 (void) lpi->
spx->setIntParam(SoPlex::ITERLIMIT, ival);
4327 #if SOPLEX_APIVERSION < 13 4330 assert(ival == 1 || ival == 0 || ival == 2);
4332 (void) lpi->
spx->setIntParam(SoPlex::SIMPLIFIER, ival);
4340 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_AUTO);
4343 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4346 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_PARMULT);
4349 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4352 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_QUICKSTEEP);
4355 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_DEVEX);
4362 assert(ival >= 0 && ival <= 2);
4364 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_OFF);
4365 else if( ival == 1 )
4366 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_BIEQUI);
4368 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4369 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_LEASTSQ);
4371 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_GEO8);
4375 #if SOPLEX_VERSION >= 201 4377 assert(ival >= 0 && ival < 3);
4378 (void) lpi->
spx->setIntParam(SoPlex::TIMER, ival);
4381 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3) 4383 lpi->
spx->setRandomSeed((
unsigned long)(
long)ival);
4386 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION >= 221 && SOPLEX_SUBVERSION >= 3) 4388 assert(ival >= 0 && ival < 3);
4389 (void) lpi->
spx->setIntParam(SoPlex::SOLUTION_POLISHING, ival);
4392 #if SOPLEX_APIVERSION >= 1 4395 (void) lpi->
spx->setIntParam(SoPlex::FACTOR_UPDATE_MAX, ival);
4415 assert(lpi !=
NULL);
4417 assert(dval !=
NULL);
4422 *dval = lpi->
spx->feastol();
4425 *dval = lpi->
spx->opttol();
4428 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4429 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_UPPER);
4431 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_LOWER);
4434 *dval = lpi->
spx->realParam(SoPlex::TIMELIMIT);
4437 *dval = lpi->
spx->realParam(SoPlex::REPRESENTATION_SWITCH);
4445 #if (SOPLEX_APIVERSION >= 9) 4446 *dval = lpi->
spx->realParam(SoPlex::MIN_MARKOWITZ);
4465 assert(lpi !=
NULL);
4472 assert( dval > 0.0 );
4473 lpi->
spx->setFeastol(dval);
4477 assert( dval > 0.0 );
4478 lpi->
spx->setOpttol(dval);
4482 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4483 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_UPPER, dval);
4485 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_LOWER, dval);
4488 assert( dval > 0.0 );
4490 (void) lpi->
spx->setRealParam(SoPlex::TIMELIMIT, dval);
4494 assert( dval >= 0.0 || dval == -1.0 );
4498 (
void) lpi->
spx->setRealParam(SoPlex::REPRESENTATION_SWITCH, dval);
4505 #if (SOPLEX_APIVERSION >= 9) 4509 else if( dval > 0.9999 )
4512 (void) lpi->
spx->setRealParam(SoPlex::MIN_MARKOWITZ, dval);
4528 assert(lpi !=
NULL);
4531 lpi->
spx->setInterrupt(interrupt);
4553 assert(lpi !=
NULL);
4556 return lpi->
spx->realParam(SoPlex::INFTY);
4565 assert(lpi !=
NULL);
4568 return (val >= lpi->
spx->realParam(SoPlex::INFTY));
4586 const char* filename
4591 f = fopen(filename,
"r");
4608 assert(lpi !=
NULL);
4610 assert(fname !=
NULL);
4612 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4619 assert(lpi->
spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4620 if( !lpi->
spx->readFile(fname) )
4624 catch(
const SPxException&
x )
4626 std::string s =
x.what();
4629 catch(
const SPxException& )
4646 assert(lpi !=
NULL);
4648 assert(fname !=
NULL);
4652 (void) lpi->
spx->writeFileReal(fname);
4655 catch(
const SPxException&
x )
4657 std::string s =
x.what();
4660 catch(
const SPxException& )
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *, const SCIP_LPISTATE *lpistate)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_RETCODE SCIPlpiStartStrongbranch(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 SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
enum SCIP_ObjSen SCIP_OBJSEN
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
interface methods for specific LP solvers
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
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)
static void invalidateSolution(SCIP_LPI *lpi)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
enum SCIP_LPParam SCIP_LPPARAM
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
#define BMSallocMemoryArray(ptr, num)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiHasDualSolve(void)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
#define BMSfreeMemory(ptr)
SCIP_RETCODE SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
enum SCIP_Pricing SCIP_PRICING
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPlpiClearState(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 SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
static SCIP_RETCODE ensureRstatMem(SCIP_LPI *lpi, int num)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
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_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
#define SOPLEX_TRY(messagehdlr, x)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
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)
polyscip::Polyscip::PolyscipStatus Status
abbreviation
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
static SCIP_RETCODE ensureCstatMem(SCIP_LPI *lpi, int num)
packing single and dual bit values
static int colpacketNum(int ncols)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
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 SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
static SCIP_RETCODE pricing(SCIP *scip, SCIP_PRICER *pricer, SCIP_Real *lowerbound, SCIP_Bool farkas)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
static const char spxname[20]
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
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)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
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)
const char * SCIPlpiGetSolverDesc(void)
SCIP_Bool SCIPlpiHasBarrierSolve(void)
static void setIntParam(SCIP_LPI *lpi, int const param, int const parval)
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 SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
static SCIP_Bool fileExists(const char *filename)
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
#define CHECK_SOPLEX_PARAM(x)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
#define SOPLEX_SUBVERSION
#define BMSfreeBlockMemory(mem, ptr)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
#define BMSallocBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
#define BMSallocMemoryCPP(size)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
static SCIP_RETCODE spxSolve(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, const int *cstat, const int *rstat)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasPrimalSolve(void)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
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 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_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiEndStrongbranch(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)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
public methods for message output
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_DUALPACKET COLPACKET
#define BMSallocMemory(ptr)
#define BMSreallocMemoryArray(ptr, num)
SCIP_DUALPACKET ROWPACKET
#define SOPLEX_TRY_ABORT(x)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *obj)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
SCIP_MESSAGEHDLR * messagehdlr
#define BMSallocBlockMemory(mem, ptr)
SCIP_RETCODE SCIPlpiInterrupt(SCIP_LPI *lpi, SCIP_Bool interrupt)
struct fixed_graph_components FIXED
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)