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);
979 #if (SOPLEX_SUBVERSION > 0) 980 (void)snprintf(
spxname, 100,
"SoPlex %d.%d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10,
SOPLEX_SUBVERSION);
982 (void)snprintf(
spxname, 100,
"SoPlex %d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10);
992 (void)snprintf(
spxdesc, 200,
"%s [GitHash: %s]",
"Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de)" 993 #ifdef SCIP_WITH_LPSCHECK
994 " - including CPLEX double check" 1006 return (
void*) lpi->
spx;
1016 assert( lpi !=
NULL );
1017 assert( ncols >= 0 );
1018 assert( ncols == 0 || intInfo !=
NULL );
1020 #if (SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3)) 1021 assert(ncols == lpi->
spx->numColsReal() || (ncols == 0 && intInfo ==
NULL));
1022 lpi->
spx->setIntegralityInformation(ncols, intInfo);
1025 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1074 assert(lpi !=
NULL);
1075 assert(name !=
NULL);
1082 SOPLEX_TRY( messagehdlr, (*lpi)->spx = new ((*lpi)->spx) SPxSCIP(messagehdlr, name) );
1083 (void) (*lpi)->spx->setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_ONLYREAL);
1084 (void) (*lpi)->spx->setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_REAL);
1085 (void) (*lpi)->spx->setIntParam(SoPlex::REPRESENTATION, SoPlex::REPRESENTATION_AUTO);
1088 #if SOPLEX_APIVERSION >= 10 1089 (void) (*lpi)->spx->setIntParam(SoPlex::STATTIMER, 0);
1092 (*lpi)->cstat =
NULL;
1093 (*lpi)->rstat =
NULL;
1094 (*lpi)->cstatsize = 0;
1095 (*lpi)->rstatsize = 0;
1097 (*lpi)->conditionlimit = -1.0;
1098 (*lpi)->checkcondition =
FALSE;
1099 (*lpi)->messagehdlr = messagehdlr;
1110 (*lpi)->spx->setInterrupt(
FALSE);
1111 SPxOut::Verbosity verbosity = (*lpi)->spx->spxout.getVerbosity();
1112 (*lpi)->spx->spxout.setVerbosity((SPxOut::Verbosity)((*lpi)->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
1113 (*lpi)->spx->printVersion();
1114 (*lpi)->spx->spxout.setVerbosity(verbosity);
1125 assert(lpi !=
NULL);
1126 assert(*lpi !=
NULL);
1127 assert((*lpi)->spx !=
NULL);
1130 (*lpi)->spx->~SPxSCIP();
1175 for( j = 0; j < nnonz; j++ )
1176 assert( val[j] != 0 );
1182 assert(lpi !=
NULL);
1184 assert(lhs !=
NULL);
1185 assert(rhs !=
NULL);
1186 assert(obj !=
NULL);
1189 assert(beg !=
NULL);
1190 assert(ind !=
NULL);
1191 assert(val !=
NULL);
1194 assert(lpi->
spx->preStrongbranchingBasisFreed());
1198 SPxSCIP* spx = lpi->
spx;
1199 LPRowSet rows(nrows);
1200 DSVector emptyVector(0);
1206 (void) spx->setIntParam(SoPlex::OBJSENSE, (objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE));
1209 for( i = 0; i < nrows; ++i )
1210 rows.add(lhs[i], emptyVector, rhs[i]);
1211 spx->addRowsReal(rows);
1217 catch(
const SPxException&
x )
1219 std::string s =
x.what();
1222 catch(
const SPxException& )
1247 assert(lpi !=
NULL);
1249 assert(obj !=
NULL);
1252 assert(nnonz == 0 || beg !=
NULL);
1253 assert(nnonz == 0 || ind !=
NULL);
1254 assert(nnonz == 0 || val !=
NULL);
1260 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1266 int nrows = lpi->
spx->numRowsReal();
1267 for (
int j = 0; j < nnonz; ++j)
1269 assert( 0 <= ind[j] && ind[j] < nrows );
1270 assert( val[j] != 0.0 );
1275 SPxSCIP* spx = lpi->
spx;
1278 LPColSet cols(ncols);
1279 DSVector colVector(ncols);
1285 for( i = 0; i < ncols; ++i )
1291 last = (i == ncols-1 ? nnonz : beg[i+1]);
1292 colVector.add( last-start, &ind[start], &val[start] );
1294 cols.add(obj[i], lb[i], colVector, ub[i]);
1296 spx->addColsReal(cols);
1299 catch(
const SPxException&
x )
1301 std::string s =
x.what();
1304 catch(
const SPxException& )
1322 assert(lpi !=
NULL);
1324 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1328 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1348 assert(lpi !=
NULL);
1350 assert(dstat !=
NULL);
1354 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1356 ncols = lpi->
spx->numColsReal();
1359 for( i = 0; i < ncols; ++i )
1382 assert(lpi !=
NULL);
1384 assert(lhs !=
NULL);
1385 assert(rhs !=
NULL);
1386 assert(nnonz == 0 || beg !=
NULL);
1387 assert(nnonz == 0 || ind !=
NULL);
1388 assert(nnonz == 0 || val !=
NULL);
1392 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1398 int ncols = lpi->
spx->numColsReal();
1399 for (
int j = 0; j < nnonz; ++j)
1401 assert( val[j] != 0.0 );
1402 assert( 0 <= ind[j] && ind[j] < ncols );
1409 SPxSCIP* spx = lpi->
spx;
1410 LPRowSet rows(nrows);
1417 for( i = 0; i < nrows; ++i )
1423 last = (i == nrows-1 ? nnonz : beg[i+1]);
1424 rowVector.add( last-start, &ind[start], &val[start] );
1426 rows.add(lhs[i], rowVector, rhs[i]);
1428 spx->addRowsReal(rows);
1431 catch(
const SPxException&
x )
1433 std::string s =
x.what();
1436 catch(
const SPxException& )
1454 assert(lpi !=
NULL);
1456 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1460 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1480 assert(lpi !=
NULL);
1485 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1487 nrows = lpi->
spx->numRowsReal();
1490 for( i = 0; i < nrows; ++i )
1505 assert(lpi !=
NULL);
1510 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1529 assert(lpi !=
NULL);
1531 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1537 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1541 for( i = 0; i < ncols; ++i )
1543 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1547 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1552 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1556 lpi->
spx->changeBoundsReal(ind[i], lb[i], ub[i]);
1557 assert(lpi->
spx->lowerReal(ind[i]) <= lpi->
spx->upperReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1561 catch(
const SPxException&
x )
1563 std::string s =
x.what();
1566 catch(
const SPxException& )
1588 assert(lpi !=
NULL);
1590 assert(ind !=
NULL);
1591 assert(lhs !=
NULL);
1592 assert(rhs !=
NULL);
1598 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1602 for( i = 0; i < nrows; ++i )
1604 assert(0 <= ind[i] && ind[i] < lpi->
spx->numRowsReal());
1605 lpi->
spx->changeRangeReal(ind[i], lhs[i], rhs[i]);
1606 assert(lpi->
spx->lhsReal(ind[i]) <= lpi->
spx->rhsReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1610 catch(
const SPxException&
x )
1612 std::string s =
x.what();
1615 catch(
const SPxException& )
1634 assert(lpi !=
NULL);
1636 assert(0 <= row && row < lpi->spx->numRowsReal());
1637 assert(0 <= col && col < lpi->spx->numColsReal());
1641 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1656 assert(lpi !=
NULL);
1661 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1680 assert(lpi !=
NULL);
1682 assert(ind !=
NULL);
1683 assert(obj !=
NULL);
1687 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1691 for( i = 0; i < ncols; ++i )
1693 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1694 lpi->
spx->changeObjReal(ind[i], obj[i]);
1698 catch(
const SPxException&
x )
1700 std::string s =
x.what();
1703 catch(
const SPxException& )
1724 assert(lpi !=
NULL);
1726 assert(scaleval != 0.0);
1732 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1735 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1736 SVector rowvec = lpi->
spx->rowVectorRealInternal(row);
1738 SVector rowvec = lpi->
spx->rowVectorReal(row);
1740 lhs = lpi->
spx->lhsReal(row);
1741 rhs = lpi->
spx->rhsReal(row);
1747 if( lhs > -lpi->
spx->realParam(SoPlex::INFTY) )
1749 else if( scaleval < 0.0 )
1750 lhs = lpi->
spx->realParam(SoPlex::INFTY);
1751 if( rhs < lpi->spx->realParam(SoPlex::INFTY) )
1753 else if( scaleval < 0.0 )
1754 rhs = -lpi->
spx->realParam(SoPlex::INFTY);
1755 if( scaleval < 0.0 )
1763 LPRow lprow(lhs, rowvec, rhs);
1766 lpi->
spx->changeRowReal(row, lprow);
1767 assert(lpi->
spx->lhsReal(row) <= lpi->
spx->rhsReal(row));
1770 catch(
const SPxException&
x )
1772 std::string s =
x.what();
1775 catch(
const SPxException& )
1799 assert(lpi !=
NULL);
1801 assert(scaleval != 0.0);
1807 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1810 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1811 SVector colvec = lpi->
spx->colVectorRealInternal(col);
1813 SVector colvec = lpi->
spx->colVectorReal(col);
1815 obj = lpi->
spx->objReal(col);
1816 lb = lpi->
spx->lowerReal(col);
1817 ub = lpi->
spx->upperReal(col);
1826 if( lb > -lpi->
spx->realParam(SoPlex::INFTY) )
1828 else if( scaleval < 0.0 )
1829 lb = lpi->
spx->realParam(SoPlex::INFTY);
1830 if( ub < lpi->spx->realParam(SoPlex::INFTY) )
1832 else if( scaleval < 0.0 )
1833 ub = -lpi->
spx->realParam(SoPlex::INFTY);
1834 if( scaleval < 0.0 )
1842 LPCol lpcol(obj, colvec, ub, lb);
1845 lpi->
spx->changeColReal(col, lpcol);
1846 assert(lpi->
spx->lowerReal(col) <= lpi->
spx->upperReal(col));
1849 catch(
const SPxException&
x )
1851 std::string s =
x.what();
1854 catch(
const SPxException& )
1883 assert(lpi !=
NULL);
1885 assert(nrows !=
NULL);
1887 *nrows = lpi->
spx->numRowsReal();
1900 assert(lpi !=
NULL);
1902 assert(ncols !=
NULL);
1904 *ncols = lpi->
spx->numColsReal();
1919 assert(lpi !=
NULL);
1921 assert(nnonz !=
NULL);
1925 if( lpi->
spx->numRowsReal() < lpi->
spx->numColsReal() )
1927 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
1929 (*nnonz) += lpi->
spx->rowVectorRealInternal(i).size();
1931 (*nnonz) += lpi->
spx->rowVectorReal(i).size();
1936 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
1938 (*nnonz) += lpi->
spx->colVectorRealInternal(i).size();
1940 (*nnonz) += lpi->
spx->colVectorReal(i).size();
1968 assert(lpi !=
NULL);
1970 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1976 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1977 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1979 DVector lbvec(lpi->
spx->numColsReal());
1980 DVector ubvec(lpi->
spx->numColsReal());
1981 lpi->
spx->getLowerReal(lbvec);
1982 lpi->
spx->getUpperReal(ubvec);
1983 for( i = firstcol; i <= lastcol; ++i )
1985 lb[i-firstcol] = lbvec[i];
1986 ub[i-firstcol] = ubvec[i];
1991 const Vector& lbvec = lpi->
spx->lowerRealInternal();
1992 const Vector& ubvec = lpi->
spx->upperRealInternal();
1993 for( i = firstcol; i <= lastcol; ++i )
1995 lb[i-firstcol] = lbvec[i];
1996 ub[i-firstcol] = ubvec[i];
2000 const Vector& lbvec = lpi->
spx->lowerReal();
2001 const Vector& ubvec = lpi->
spx->upperReal();
2003 for( i = firstcol; i <= lastcol; ++i )
2005 lb[i-firstcol] = lbvec[i];
2006 ub[i-firstcol] = ubvec[i];
2014 for( i = firstcol; i <= lastcol; ++i )
2016 beg[i-firstcol] = *nnonz;
2018 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2019 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2022 lpi->
spx->getColVectorReal(i, cvec);
2023 for( j = 0; j < cvec.size(); ++j )
2025 ind[*nnonz] = cvec.index(j);
2026 val[*nnonz] = cvec.value(j);
2032 const SVector& cvec = lpi->
spx->colVectorRealInternal(i);
2033 for( j = 0; j < cvec.size(); ++j )
2035 ind[*nnonz] = cvec.index(j);
2036 val[*nnonz] = cvec.value(j);
2041 const SVector& cvec = lpi->
spx->colVectorReal(i);
2042 for( j = 0; j < cvec.size(); ++j )
2044 ind[*nnonz] = cvec.index(j);
2045 val[*nnonz] = cvec.value(j);
2076 assert(lpi !=
NULL);
2078 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2084 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2085 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2087 DVector lhsvec(lpi->
spx->numRowsReal());
2088 DVector rhsvec(lpi->
spx->numRowsReal());
2089 lpi->
spx->getLhsReal(lhsvec);
2090 lpi->
spx->getRhsReal(rhsvec);
2091 for( i = firstrow; i <= lastrow; ++i )
2093 lhs[i-firstrow] = lhsvec[i];
2094 rhs[i-firstrow] = rhsvec[i];
2099 const Vector& lhsvec = lpi->
spx->lhsRealInternal();
2100 const Vector& rhsvec = lpi->
spx->rhsRealInternal();
2101 for( i = firstrow; i <= lastrow; ++i )
2103 lhs[i-firstrow] = lhsvec[i];
2104 rhs[i-firstrow] = rhsvec[i];
2108 const Vector& lhsvec = lpi->
spx->lhsReal();
2109 const Vector& rhsvec = lpi->
spx->rhsReal();
2110 for( i = firstrow; i <= lastrow; ++i )
2112 lhs[i-firstrow] = lhsvec[i];
2113 rhs[i-firstrow] = rhsvec[i];
2121 for( i = firstrow; i <= lastrow; ++i )
2123 beg[i-firstrow] = *nnonz;
2125 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2126 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2129 lpi->
spx->getRowVectorReal(i, rvec);
2130 for( j = 0; j < rvec.size(); ++j )
2132 ind[*nnonz] = rvec.index(j);
2133 val[*nnonz] = rvec.value(j);
2139 const SVector& rvec = lpi->
spx->rowVectorRealInternal(i);
2140 for( j = 0; j < rvec.size(); ++j )
2142 ind[*nnonz] = rvec.index(j);
2143 val[*nnonz] = rvec.value(j);
2148 const SVector& rvec = lpi->
spx->rowVectorReal(i);
2149 for( j = 0; j < rvec.size(); ++j )
2151 ind[*nnonz] = rvec.index(j);
2152 val[*nnonz] = rvec.value(j);
2169 int namestoragesize,
2173 assert( lpi !=
NULL );
2175 assert( colnames !=
NULL || namestoragesize == 0 );
2176 assert( namestorage !=
NULL || namestoragesize == 0 );
2177 assert( namestoragesize >= 0 );
2178 assert( storageleft !=
NULL );
2179 assert( 0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal() );
2195 int namestoragesize,
2199 assert( lpi !=
NULL );
2201 assert( rownames !=
NULL || namestoragesize == 0 );
2202 assert( namestorage !=
NULL || namestoragesize == 0 );
2203 assert( namestoragesize >= 0 );
2204 assert( storageleft !=
NULL );
2205 assert( 0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal() );
2222 assert(lpi !=
NULL);
2224 assert(objsen !=
NULL);
2243 assert(lpi !=
NULL);
2245 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2246 assert(vals !=
NULL);
2248 for( i = firstcol; i <= lastcol; ++i )
2249 vals[i-firstcol] = lpi->
spx->objReal(i);
2267 assert(lpi !=
NULL);
2269 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2271 for( i = firstcol; i <= lastcol; ++i )
2274 lbs[i-firstcol] = lpi->
spx->lowerReal(i);
2276 ubs[i-firstcol] = lpi->
spx->upperReal(i);
2295 assert(lpi !=
NULL);
2297 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2299 for( i = firstrow; i <= lastrow; ++i )
2302 lhss[i-firstrow] = lpi->
spx->lhsReal(i);
2304 rhss[i-firstrow] = lpi->
spx->rhsReal(i);
2320 assert(lpi !=
NULL);
2322 assert(0 <= col && col < lpi->spx->numColsReal());
2323 assert(0 <= row && row < lpi->spx->numRowsReal());
2324 assert(val !=
NULL);
2326 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2327 *val = lpi->
spx->coefReal(row, col);
2329 *val = lpi->
spx->colVectorReal(col)[row];
2353 assert( lpi !=
NULL );
2356 SPxOut::Verbosity verbosity;
2358 verbosity = lpi->
spx->spxout.getVerbosity();
2361 SCIPdebugMessage(
"calling SoPlex solve(): %d cols, %d rows\n", lpi->
spx->numColsReal(), lpi->
spx->numRowsReal());
2365 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2367 #ifdef SCIP_WITH_LPSCHECK 2368 lpi->
spx->setDoubleCheck(CHECK_SPXSOLVE);
2372 if( lpi->
spx->getFromScratch() )
2376 lpi->
spx->clearBasis();
2379 catch(
const SPxException&
x)
2381 std::string s = x.what();
2384 catch(
const SPxException&)
2387 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
2391 assert(!lpi->
spx->getFromScratch() || lpi->
spx->status() == SPxSolver::NO_PROBLEM);
2394 SCIPdebugMessage(
" -> SoPlex status: %d, basis status: %d\n", lpi->
spx->status(), lpi->
spx->basisStatus());
2398 lpi->
spx->spxout.setVerbosity(verbosity);
2402 case SPxSolver::ABORT_TIME:
2403 case SPxSolver::ABORT_ITER:
2404 case SPxSolver::ABORT_VALUE:
2405 case SPxSolver::SINGULAR:
2406 case SPxSolver::REGULAR:
2408 case SPxSolver::OPTIMAL:
2409 #if SOPLEX_APIVERSION >= 3 2410 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2412 case SPxSolver::UNBOUNDED:
2413 case SPxSolver::INFEASIBLE:
2427 assert(lpi !=
NULL);
2430 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2441 assert(lpi !=
NULL);
2444 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2454 assert(lpi !=
NULL);
2468 assert(lpi !=
NULL);
2471 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2472 lpi->
spx->savePreStrongbranchingBasis();
2482 assert(lpi !=
NULL);
2485 assert( ! lpi->
spx->preStrongbranchingBasisFreed() );
2486 lpi->
spx->restorePreStrongbranchingBasis();
2487 lpi->
spx->freePreStrongbranchingBasis();
2508 assert(lpi !=
NULL);
2517 bool fromparentbasis;
2520 SPxOut::Verbosity verbosity;
2523 verbosity = lpi->
spx->spxout.getVerbosity();
2526 SCIPdebugMessage(
"calling SCIPlpiStrongbranch() on variable %d (%d iterations)\n", col, itlim);
2528 assert(lpi !=
NULL);
2532 assert(downvalid !=
NULL);
2533 assert(upvalid !=
NULL);
2536 #ifndef STRONGBRANCH_RESTOREBASIS 2537 fromparentbasis =
false;
2540 oldItlim = spx->intParam(SoPlex::ITERLIMIT);
2543 oldlb = spx->lowerReal(col);
2544 oldub = spx->upperReal(col);
2553 (void) spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2556 newub =
EPSCEIL(psol-1.0, lpi->
spx->feastol());
2557 if( newub >= oldlb - 0.5 && down !=
NULL )
2559 SCIPdebugMessage(
"strong branching down on x%d (%g) with %d iterations\n", col, psol, itlim);
2561 spx->changeUpperReal(col, newub);
2562 assert(spx->lowerReal(col) <= spx->upperReal(col));
2564 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2567 #ifndef STRONGBRANCH_RESTOREBASIS 2570 #ifdef SCIP_WITH_LPSCHECK 2571 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2573 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2574 #if SOPLEX_APIVERSION > 11 2575 status = spx->optimize(spx->getInterrupt());
2577 status = spx->optimize();
2580 status = spx->solve();
2585 case SPxSolver::OPTIMAL:
2586 *down = spx->objValueReal();
2590 case SPxSolver::ABORT_TIME:
2591 case SPxSolver::ABORT_ITER:
2592 case SPxSolver::ABORT_CYCLING:
2593 #if SOPLEX_APIVERSION >= 3 2594 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2596 *down = spx->objValueReal();
2598 case SPxSolver::ABORT_VALUE:
2599 case SPxSolver::INFEASIBLE:
2600 *down = spx->getObjLimit();
2608 (*iter) += spx->numIterations();
2610 #ifdef STRONGBRANCH_RESTOREBASIS 2612 assert( ! spx->preStrongbranchingBasisFreed() );
2613 spx->restorePreStrongbranchingBasis();
2614 fromparentbasis =
false;
2618 #if SOPLEX_APIVERSION >= 3 2619 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2620 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2622 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2623 && !fromparentbasis && spx->numIterations() < itlim);
2625 if( repeatstrongbranching )
2627 SCIPdebugMessage(
" --> Repeat strong branching down with %d iterations after restoring basis\n",
2628 itlim - spx->numIterations());
2629 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2630 spx->restorePreStrongbranchingBasis();
2631 fromparentbasis =
true;
2636 fromparentbasis =
false;
2639 while( fromparentbasis );
2641 spx->changeUpperReal(col, oldub);
2642 assert(spx->lowerReal(col) <= spx->upperReal(col));
2644 else if( down !=
NULL )
2646 *down = spx->getObjLimit();
2656 if( newlb <= oldub + 0.5 && up !=
NULL )
2658 SCIPdebugMessage(
"strong branching up on x%d (%g) with %d iterations\n", col, psol, itlim);
2660 spx->changeLowerReal(col, newlb);
2661 assert(spx->lowerReal(col) <= spx->upperReal(col));
2663 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2666 #ifndef STRONGBRANCH_RESTOREBASIS 2669 #ifdef SCIP_WITH_LPSCHECK 2670 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2672 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2673 #if SOPLEX_APIVERSION > 11 2674 status = spx->optimize(spx->getInterrupt());
2676 status = spx->optimize();
2679 status = spx->solve();
2684 case SPxSolver::OPTIMAL:
2685 *up = spx->objValueReal();
2689 case SPxSolver::ABORT_TIME:
2690 case SPxSolver::ABORT_ITER:
2691 case SPxSolver::ABORT_CYCLING:
2692 #if SOPLEX_APIVERSION >= 3 2693 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2695 *up = spx->objValueReal();
2697 case SPxSolver::ABORT_VALUE:
2698 case SPxSolver::INFEASIBLE:
2699 *up = spx->getObjLimit();
2707 (*iter) += spx->numIterations();
2709 #ifdef STRONGBRANCH_RESTOREBASIS 2711 assert( ! spx->preStrongbranchingBasisFreed() );
2712 spx->restorePreStrongbranchingBasis();
2713 fromparentbasis =
false;
2717 #if SOPLEX_APIVERSION >= 3 2718 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2719 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2721 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2722 && !fromparentbasis && spx->numIterations() < itlim);
2724 if( repeatstrongbranching )
2726 SCIPdebugMessage(
" --> Repeat strong branching up with %d iterations after restoring basis\n", itlim - spx->numIterations());
2727 spx->restorePreStrongbranchingBasis();
2728 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2730 fromparentbasis =
true;
2734 fromparentbasis =
false;
2737 while( fromparentbasis );
2739 spx->changeLowerReal(col, oldlb);
2740 assert(spx->lowerReal(col) <= spx->upperReal(col));
2742 else if( up !=
NULL )
2744 *up = spx->getObjLimit();
2752 (void) spx->setIntParam(SoPlex::ITERLIMIT, oldItlim);
2755 lpi->
spx->spxout.setVerbosity(verbosity);
2759 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2784 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2814 assert( cols !=
NULL );
2815 assert( psols !=
NULL );
2816 assert( down !=
NULL );
2817 assert( up !=
NULL );
2818 assert( downvalid !=
NULL );
2819 assert( upvalid !=
NULL );
2820 assert( down !=
NULL );
2825 for (
int j = 0; j < ncols; ++j)
2828 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2858 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2888 assert( cols !=
NULL );
2889 assert( psols !=
NULL );
2890 assert( down !=
NULL );
2891 assert( up !=
NULL );
2892 assert( downvalid !=
NULL );
2893 assert( upvalid !=
NULL );
2894 assert( down !=
NULL );
2899 for (
int j = 0; j < ncols; ++j)
2902 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2931 assert(lpi !=
NULL);
2954 assert(lpi !=
NULL);
2955 assert(primalfeasible !=
NULL);
2956 assert(dualfeasible !=
NULL);
2973 assert(lpi !=
NULL);
2976 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
2988 assert(lpi !=
NULL);
2991 return lpi->
spx->hasPrimalRay();
3001 assert(lpi !=
NULL);
3004 assert(lpi->
spx->status() != SPxSolver::UNBOUNDED || lpi->
spx->basisStatus() == SPxBasis::UNBOUNDED);
3009 return lpi->
spx->status() == SPxSolver::UNBOUNDED;
3019 assert(lpi !=
NULL);
3022 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3032 assert(lpi !=
NULL);
3035 return lpi->
spx->basisStatus() == SPxBasis::OPTIMAL || lpi->
spx->basisStatus() == SPxBasis::PRIMAL;
3047 assert(lpi !=
NULL);
3050 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3062 assert(lpi !=
NULL);
3065 return lpi->
spx->hasDualFarkas();
3075 assert(lpi !=
NULL);
3078 return lpi->
spx->status() == SPxSolver::INFEASIBLE && lpi->
spx->basisStatus() == SPxBasis::DUAL;
3088 assert(lpi !=
NULL);
3091 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3101 assert(lpi !=
NULL);
3104 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->
spx->basisStatus() == SPxBasis::DUAL;
3114 assert(lpi !=
NULL);
3116 assert((lpi->
spx->basisStatus() == SPxBasis::OPTIMAL)
3119 return (lpi->
spx->status() == SPxSolver::OPTIMAL);
3135 assert(lpi !=
NULL);
3140 #if SOPLEX_APIVERSION >= 3 3141 if( lpi->
spx->status() == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS )
3172 assert(lpi !=
NULL);
3175 return (lpi->
spx->status() == SPxSolver::ABORT_VALUE);
3185 assert(lpi !=
NULL);
3188 return (lpi->
spx->status() == SPxSolver::ABORT_ITER);
3198 assert(lpi !=
NULL);
3201 return (lpi->
spx->status() == SPxSolver::ABORT_TIME);
3211 assert(lpi !=
NULL);
3214 return static_cast<int>(lpi->
spx->status());
3225 assert(lpi !=
NULL);
3227 assert(success !=
NULL);
3229 #if SOPLEX_APIVERSION >= 4 3230 *success = lpi->
spx->ignoreUnscaledViolations();
3246 assert(lpi !=
NULL);
3248 assert(objval !=
NULL);
3250 *objval = lpi->
spx->objValueReal();
3271 assert(lpi !=
NULL);
3274 if( objval !=
NULL )
3275 *objval = lpi->
spx->objValueReal();
3279 if( primsol !=
NULL )
3281 #if SOPLEX_APIVERSION > 10 3282 (void)lpi->
spx->getPrimalReal(primsol, lpi->
spx->numColsReal());
3284 Vector tmp(lpi->
spx->numColsReal(), primsol);
3285 (void)lpi->
spx->getPrimalReal(tmp);
3288 if( dualsol !=
NULL )
3290 #if SOPLEX_APIVERSION > 10 3291 (void)lpi->
spx->getDualReal(dualsol, lpi->
spx->numRowsReal());
3293 Vector tmp(lpi->
spx->numRowsReal(), dualsol);
3294 (void)lpi->
spx->getDualReal(tmp);
3297 if( activity !=
NULL )
3299 #if SOPLEX_APIVERSION > 10 3300 (void)lpi->
spx->getSlacksReal(activity, lpi->
spx->numRowsReal());
3302 Vector tmp(lpi->
spx->numRowsReal(), activity);
3303 (void)lpi->
spx->getSlacksReal(tmp);
3306 if( redcost !=
NULL )
3308 #if SOPLEX_APIVERSION > 10 3309 (void)lpi->
spx->getRedCostReal(redcost, lpi->
spx->numColsReal());
3311 Vector tmp(lpi->
spx->numColsReal(), redcost);
3312 (void)lpi->
spx->getRedCostReal(tmp);
3317 catch(
const SPxException&
x )
3319 std::string s =
x.what();
3322 catch(
const SPxException& )
3339 assert(lpi !=
NULL);
3341 assert(lpi->
spx->hasPrimalRay());
3342 assert(ray !=
NULL);
3346 #if SOPLEX_APIVERSION > 10 3347 (void)lpi->
spx->getPrimalRayReal(ray, lpi->
spx->numColsReal());
3349 Vector tmp(lpi->
spx->numColsReal(), ray);
3350 (void)lpi->
spx->getPrimalRayReal(tmp);
3354 catch(
const SPxException&
x )
3356 std::string s =
x.what();
3359 catch(
const SPxException& )
3376 assert(lpi !=
NULL);
3378 assert(lpi->
spx->hasDualFarkas());
3379 assert(dualfarkas !=
NULL);
3383 #if SOPLEX_APIVERSION > 10 3384 (void)lpi->
spx->getDualFarkasReal(dualfarkas, lpi->
spx->numRowsReal());
3386 Vector tmp(lpi->
spx->numRowsReal(), dualfarkas);
3387 (void)lpi->
spx->getDualFarkasReal(tmp);
3391 catch(
const SPxException&
x )
3393 std::string s =
x.what();
3396 catch(
const SPxException& )
3413 assert(lpi !=
NULL);
3415 assert(iterations !=
NULL);
3417 *iterations = lpi->
spx->numIterations();
3435 assert(lpi !=
NULL);
3436 assert(quality !=
NULL);
3440 SCIPdebugMessage(
"requesting solution quality from SoPlex: quality %d\n", qualityindicator);
3442 switch( qualityindicator )
3445 success = lpi->
spx->getEstimatedCondition(*quality);
3449 success = lpi->
spx->getExactCondition(*quality);
3490 assert(lpi !=
NULL);
3493 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3497 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
3499 switch( lpi->
spx->basisRowStatus(i) )
3501 case SPxSolver::BASIC:
3505 case SPxSolver::ON_LOWER:
3508 case SPxSolver::ON_UPPER:
3511 case SPxSolver::ZERO:
3512 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3514 case SPxSolver::UNDEFINED:
3525 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
3528 switch( lpi->
spx->basisColStatus(i) )
3530 case SPxSolver::BASIC:
3547 case SPxSolver::ON_LOWER:
3550 case SPxSolver::ON_UPPER:
3553 case SPxSolver::ZERO:
3556 case SPxSolver::UNDEFINED:
3581 assert(lpi !=
NULL);
3587 assert(cstat !=
NULL || ncols == 0);
3588 assert(rstat !=
NULL || nrows == 0);
3590 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3593 DataArray<SPxSolver::VarStatus>& _colstat = lpi->
spx->colStat();
3594 DataArray<SPxSolver::VarStatus>& _rowstat = lpi->
spx->rowStat();
3596 _colstat.reSize(ncols);
3597 _rowstat.reSize(nrows);
3599 for( i = 0; i < nrows; ++i )
3604 _rowstat[i] = SPxSolver::ON_LOWER;
3607 _rowstat[i] = SPxSolver::BASIC;
3610 _rowstat[i] = SPxSolver::ON_UPPER;
3613 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3622 for( i = 0; i < ncols; ++i )
3627 _colstat[i] = SPxSolver::ON_LOWER;
3630 _colstat[i] = SPxSolver::BASIC;
3633 _colstat[i] = SPxSolver::ON_UPPER;
3636 _colstat[i] = SPxSolver::ZERO;
3646 lpi->
spx->freePreStrongbranchingBasis();
3659 assert(lpi !=
NULL);
3661 assert(bind !=
NULL);
3663 assert(lpi->
spx->preStrongbranchingBasisFreed());
3665 lpi->
spx->getBasisInd(bind);
3688 assert(lpi !=
NULL);
3690 assert(lpi->
spx->preStrongbranchingBasisFreed());
3691 assert(coef !=
NULL);
3694 assert(r < lpi->spx->numRowsReal());
3696 if( ! lpi->
spx->getBasisInverseRowReal(
r, coef, inds, ninds) )
3723 assert( lpi !=
NULL );
3725 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3726 assert(coef !=
NULL);
3728 if( ! lpi->
spx->getBasisInverseColReal(c, coef, inds, ninds) )
3758 assert(lpi !=
NULL);
3760 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3761 assert(coef !=
NULL);
3763 nrows = lpi->
spx->numRowsReal();
3764 ncols = lpi->
spx->numColsReal();
3768 if( binvrow ==
NULL )
3777 assert(binv !=
NULL);
3785 Vector binvvec(nrows, binv);
3787 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3792 for( c = 0; c < ncols; ++c )
3794 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3795 lpi->
spx->getColVectorReal(c, acol);
3796 coef[c] = binvvec * acol;
3798 coef[c] = binvvec * lpi->
spx->colVectorReal(c);
3824 DVector col(lpi->
spx->numRowsReal());
3826 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3833 assert( lpi !=
NULL );
3835 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3836 assert(coef !=
NULL);
3840 assert(c < lpi->spx->numColsReal());
3850 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3851 lpi->
spx->getColVectorReal(c, colsparse);
3855 col = lpi->
spx->colVectorReal(c);
3859 if( ! lpi->
spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3889 assert(blkmem !=
NULL);
3890 assert(lpi !=
NULL);
3892 assert(lpistate !=
NULL);
3894 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3896 ncols = lpi->
spx->numColsReal();
3897 nrows = lpi->
spx->numRowsReal();
3912 (*lpistate)->ncols = ncols;
3913 (*lpistate)->nrows = nrows;
3934 assert(lpi !=
NULL);
3936 assert(lpistate !=
NULL);
3939 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3941 lpncols = lpi->
spx->numColsReal();
3942 lpnrows = lpi->
spx->numRowsReal();
3943 assert(lpistate->
ncols <= lpncols);
3944 assert(lpistate->
nrows <= lpnrows);
3954 for( i = lpistate->
ncols; i < lpncols; ++i )
3960 bnd = lpi->
spx->lowerReal(i);
3972 for( i = lpistate->
nrows; i < lpnrows; ++i )
3988 assert(lpi !=
NULL);
3993 lpi->
spx->clearBasis();
3996 catch(
const SPxException&
x )
3998 std::string s = x.what();
4001 catch(
const SPxException& )
4004 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
4020 assert(lpi !=
NULL);
4021 assert(lpistate !=
NULL);
4022 assert(blkmem !=
NULL);
4024 if ( *lpistate !=
NULL )
4036 assert(lpi !=
NULL);
4047 assert(lpi !=
NULL);
4049 assert(fname !=
NULL);
4051 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4065 assert(lpi !=
NULL);
4067 assert(fname !=
NULL);
4070 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4102 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4106 assert(blkmem !=
NULL);
4107 assert(lpi !=
NULL);
4109 assert(lpinorms !=
NULL);
4111 lpi->
spx->getNdualNorms(nrows, ncols);
4113 if( nrows == 0 && ncols == 0)
4122 (*lpinorms)->nrows = 0;
4123 (*lpinorms)->ncols = 0;
4125 SCIPdebugMessage(
"storing SoPlex LPi pricing norms in %p (%d rows, %d cols)\n", (
void *) *lpinorms, nrows, ncols);
4127 if( !lpi->
spx->getDualNorms((*lpinorms)->nrows, (*lpinorms)->ncols, (*lpinorms)->norms) )
4132 assert(*lpinorms ==
NULL);
4137 assert(nrows == (*lpinorms)->nrows);
4138 assert(ncols == (*lpinorms)->ncols);
4157 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4158 assert(blkmem !=
NULL);
4159 assert(lpi !=
NULL);
4163 if( lpinorms ==
NULL )
4166 assert(lpinorms->
nrows <= lpi->
spx->numRowsReal());
4167 assert(lpinorms->
ncols <= lpi->
spx->numColsReal());
4169 if( lpinorms->
nrows == 0 )
4172 SCIPdebugMessage(
"loading LPi simplex norms %p (%d rows, %d cols) into SoPlex LP with %d rows and %d cols\n",
4173 (
const void *) lpinorms, lpinorms->
nrows, lpinorms->
ncols, lpi->
spx->numRowsReal(), lpi->
spx->numColsReal());
4188 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4189 assert(lpi !=
NULL);
4190 assert(lpinorms !=
NULL);
4196 assert(*lpinorms ==
NULL);
4225 assert(lpi !=
NULL);
4227 assert(ival !=
NULL);
4232 *ival = lpi->
spx->getFromScratch();
4235 *ival = lpi->
spx->getLpInfo();
4238 *ival = lpi->
spx->intParam(SoPlex::ITERLIMIT);
4243 *ival = lpi->
spx->intParam(SoPlex::SIMPLIFIER);
4249 scaleparam = lpi->
spx->intParam(SoPlex::SCALER);
4251 if( scaleparam == SoPlex::SCALER_OFF )
4253 else if( scaleparam == SoPlex::SCALER_BIEQUI )
4255 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4258 assert(scaleparam == SoPlex::SCALER_LEASTSQ);
4264 assert(scaleparam == SoPlex::SCALER_GEO8);
4269 #if SOPLEX_VERSION >= 201 4271 *ival = (int) (lpi->
spx->intParam(SoPlex::TIMER));
4274 #if SOPLEX_VERSION >= 230 || (SOPLEX_VERSION == 220 && SOPLEX_SUBVERSION >= 3) 4276 *ival = (int) lpi->
spx->randomSeed();
4279 #if SOPLEX_APIVERSION >= 1 4281 *ival = (int) lpi->
spx->intParam(SoPlex::FACTOR_UPDATE_MAX);
4300 assert(lpi !=
NULL);
4307 lpi->
spx->setFromScratch(
bool(ival));
4311 lpi->
spx->setLpInfo(
bool(ival));
4314 assert( ival >= 0 );
4316 if( ival >= INT_MAX )
4318 (void) lpi->
spx->setIntParam(SoPlex::ITERLIMIT, ival);
4322 #if SOPLEX_APIVERSION < 13 4325 assert(ival == 1 || ival == 0 || ival == 2);
4327 (void) lpi->
spx->setIntParam(SoPlex::SIMPLIFIER, ival);
4335 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_AUTO);
4338 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4341 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_PARMULT);
4344 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4347 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_QUICKSTEEP);
4350 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_DEVEX);
4357 assert(ival >= 0 && ival <= 2);
4359 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_OFF);
4360 else if( ival == 1 )
4361 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_BIEQUI);
4363 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4364 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_LEASTSQ);
4366 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_GEO8);
4370 #if SOPLEX_VERSION >= 201 4372 assert(ival >= 0 && ival < 3);
4373 (void) lpi->
spx->setIntParam(SoPlex::TIMER, ival);
4376 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3) 4378 lpi->
spx->setRandomSeed((
unsigned long)(
long)ival);
4381 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION >= 221 && SOPLEX_SUBVERSION >= 3) 4383 assert(ival >= 0 && ival < 3);
4384 (void) lpi->
spx->setIntParam(SoPlex::SOLUTION_POLISHING, ival);
4387 #if SOPLEX_APIVERSION >= 1 4390 (void) lpi->
spx->setIntParam(SoPlex::FACTOR_UPDATE_MAX, ival);
4410 assert(lpi !=
NULL);
4412 assert(dval !=
NULL);
4417 *dval = lpi->
spx->feastol();
4420 *dval = lpi->
spx->opttol();
4423 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4424 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_UPPER);
4426 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_LOWER);
4429 *dval = lpi->
spx->realParam(SoPlex::TIMELIMIT);
4432 *dval = lpi->
spx->realParam(SoPlex::REPRESENTATION_SWITCH);
4440 #if (SOPLEX_APIVERSION >= 9) 4441 *dval = lpi->
spx->realParam(SoPlex::MIN_MARKOWITZ);
4460 assert(lpi !=
NULL);
4467 assert( dval > 0.0 );
4468 lpi->
spx->setFeastol(dval);
4472 assert( dval > 0.0 );
4473 lpi->
spx->setOpttol(dval);
4477 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4478 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_UPPER, dval);
4480 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_LOWER, dval);
4483 assert( dval > 0.0 );
4485 (void) lpi->
spx->setRealParam(SoPlex::TIMELIMIT, dval);
4489 assert( dval >= 0.0 || dval == -1.0 );
4493 (
void) lpi->
spx->setRealParam(SoPlex::REPRESENTATION_SWITCH, dval);
4500 #if (SOPLEX_APIVERSION >= 9) 4504 else if( dval > 0.9999 )
4507 (void) lpi->
spx->setRealParam(SoPlex::MIN_MARKOWITZ, dval);
4523 assert(lpi !=
NULL);
4526 lpi->
spx->setInterrupt(interrupt);
4548 assert(lpi !=
NULL);
4551 return lpi->
spx->realParam(SoPlex::INFTY);
4560 assert(lpi !=
NULL);
4563 return (val >= lpi->
spx->realParam(SoPlex::INFTY));
4581 const char* filename
4586 f = fopen(filename,
"r");
4603 assert(lpi !=
NULL);
4605 assert(fname !=
NULL);
4607 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4614 assert(lpi->
spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4615 if( !lpi->
spx->readFile(fname) )
4619 catch(
const SPxException&
x )
4621 std::string s =
x.what();
4624 catch(
const SPxException& )
4641 assert(lpi !=
NULL);
4643 assert(fname !=
NULL);
4647 (void) lpi->
spx->writeFileReal(fname);
4650 catch(
const SPxException&
x )
4652 std::string s =
x.what();
4655 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)
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)