39 #define STRONGBRANCH_RESTOREBASIS 47 #ifndef NO_CONFIG_HEADER 48 #include "scip/config.h" 52 #ifdef SCIP_WITH_LPSCHECK 55 #define CHECK_SPXSOLVE true 56 #define CHECK_SPXSTRONGBRANCH true 58 #define EXIT_AT_WRONG_RESULT false 59 #define EXIT_AT_CPXERROR false 61 #define CPX_CALL(x) do \ 64 if( (_cpxstat_ = (x)) != 0 ) \ 66 SCIPmessagePrintWarning(_messagehdlr, "CPLEX error <%d>; SoPlex result unchecked\n", _cpxstat_); \ 67 if( EXIT_AT_CPXERROR ) \ 81 #define CHECK_SOPLEX_PARAM(x) \ 84 SCIPmessagePrintWarning(_messagehdlr, "SoPlex: unsupported parameter value\n"); \ 95 #pragma GCC visibility push(default) 102 #ifndef SOPLEX_SUBVERSION 103 #define SOPLEX_SUBVERSION 0 106 #ifndef SOPLEX_APIVERSION 107 #define SOPLEX_APIVERSION 0 111 #if (SOPLEX_VERSION < 200 || (SOPLEX_VERSION == 200 && SOPLEX_SUBVERSION < 2) || (SOPLEX_VERSION > 200 && SOPLEX_VERSION < 201)) 112 #error "This interface is not compatible with SoPlex versions prior to 2.0.0.2" 115 #if (SOPLEX_APIVERSION <= 5) 116 #include "spxgithash.h" 127 #if defined(_MSC_VER) && _MSC_VER < 1900 129 #define snprintf _snprintf 133 #define SOPLEX_VERBLEVEL 5 154 #define SOPLEX_TRY(messagehdlr, x) do \ 160 catch( const SPxMemoryException& E ) \ 162 std::string s = E.what(); \ 163 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 166 catch( const SPxException& E ) \ 168 std::string s = E.what(); \ 169 SCIPmessagePrintWarning((messagehdlr), "SoPlex threw an exception: %s\n", s.c_str()); \ 170 return SCIP_LPERROR; \ 176 #define SOPLEX_TRY(messagehdlr, x) do \ 182 catch( const SPxMemoryException& E ) \ 184 std::string s = E.what(); \ 185 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 188 catch( const SPxException& ) \ 190 return SCIP_LPERROR; \ 199 #define SOPLEX_TRY_ABORT(x) do \ 205 catch( const SPxException& E ) \ 207 std::string s = E.what(); \ 208 SCIPerrorMessage("SoPlex threw an exception: %s\n", s.c_str()); \ 217 class SPxSCIP :
public SoPlex 223 DataArray<SPxSolver::VarStatus> _colStat;
224 DataArray<SPxSolver::VarStatus> _rowStat;
225 #ifdef SCIP_WITH_LPSCHECK 236 const char* probname =
NULL 243 _messagehdlr(messagehdlr)
245 if ( probname !=
NULL )
248 #if SOPLEX_APIVERSION >= 2 249 (void)setBoolParam(SoPlex::ENSURERAY,
true);
252 #ifdef SCIP_WITH_LPSCHECK 255 _doublecheck =
false;
256 _cpxenv = CPXopenCPLEX(&cpxstat);
257 assert(_cpxenv !=
NULL);
258 _cpxlp = CPXcreateprob(_cpxenv, &cpxstat, probname !=
NULL ? probname :
"spxcheck");
259 (void) CPXsetintparam(_cpxenv, CPX_PARAM_SCRIND, 0);
265 if( _probname !=
NULL )
268 freePreStrongbranchingBasis();
270 #ifdef SCIP_WITH_LPSCHECK 271 (void) CPXfreeprob(_cpxenv, &_cpxlp);
272 (void) CPXcloseCPLEX(&_cpxenv);
294 return realParam(OPTTOL);
306 Real getObjLimit()
const 308 return (intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE)
309 ? realParam(SoPlex::OBJLIMIT_UPPER)
310 : realParam(SoPlex::OBJLIMIT_LOWER);
314 bool getFromScratch()
const 319 void setFromScratch(
bool fs)
324 void setInterrupt(
bool interrupt)
326 _interrupt = interrupt;
335 bool getLpInfo()
const 340 void setLpInfo(
bool lpinfo)
346 void setProbname(
const char* probname)
350 assert(probname !=
NULL);
351 if( _probname !=
NULL )
354 len = strlen(probname);
355 spx_alloc(_probname, len + 1);
356 memcpy(_probname, probname, len + 1);
359 void setRep(SPxSolver::Representation p_rep)
361 if( p_rep == SPxSolver::COLUMN && intParam(REPRESENTATION) == REPRESENTATION_ROW )
366 else if( (p_rep == SPxSolver::ROW && intParam(REPRESENTATION) == REPRESENTATION_COLUMN) )
373 #ifdef SCIP_WITH_LPSCHECK 374 bool getDoubleCheck()
377 return _doublecheck && _checknum + 1 >= CHECK_START;
380 void setDoubleCheck(
bool dc)
385 const char* spxStatusString(
const SPxSolver::Status stat)
const 389 case SPxSolver::ABORT_TIME:
391 case SPxSolver::ABORT_ITER:
393 case SPxSolver::ABORT_VALUE:
394 return "ABORT_VALUE";
395 case SPxSolver::SINGULAR:
397 case SPxSolver::REGULAR:
401 case SPxSolver::OPTIMAL:
403 #if SOPLEX_APIVERSION >= 3 404 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
405 return "OPTIMAL_UNSCALED_VIOLATIONS";
407 case SPxSolver::UNBOUNDED:
409 case SPxSolver::INFEASIBLE:
416 const char* cpxStatusString(
const int stat)
const 420 case CPX_STAT_ABORT_TIME_LIM:
422 case CPX_STAT_ABORT_IT_LIM:
424 case CPX_STAT_ABORT_OBJ_LIM:
425 return "ABORT_VALUE";
426 case CPX_STAT_OPTIMAL:
428 case CPX_STAT_OPTIMAL_INFEAS:
429 return "CPX_STAT_OPTIMAL_INFEAS: OPT SOL INFEASIBLE AFTER UNSCALING";
430 case CPX_STAT_UNBOUNDED:
432 case CPX_STAT_INFEASIBLE:
434 case CPX_STAT_INForUNBD:
435 return "INFEASIBLE or UNBOUNDED";
436 case CPX_STAT_NUM_BEST:
437 return "CPX_STAT_NUM_BEST: SOL AVAILABLE BUT NOT PROVEN OPTIMAL DUE TO NUM TROUBLE";
445 bool checkConsistentBounds()
const 447 for(
int i = 0; i < numColsReal(); ++i )
449 if( lowerReal(i) > upperReal(i) + realParam(SoPlex::EPSILON_ZERO) )
451 SCIPerrorMessage(
"inconsistent bounds on column %d: lower=%.17g, upper=%.17g\n",
452 i, lowerReal(i), upperReal(i));
460 bool checkConsistentSides()
const 462 for(
int i = 0; i < numRowsReal(); ++i )
464 if( lhsReal(i) > rhsReal(i) + realParam(SoPlex::EPSILON_ZERO) )
467 i, lhsReal(i), rhsReal(i));
476 void trySolve(
bool printwarning =
true)
483 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 484 #if SOPLEX_APIVERSION > 11 493 catch(
const SPxException&
x)
495 std::string s = x.what();
505 assert(status() != SPxSolver::OPTIMAL);
508 assert(intParam(ITERLIMIT) < 0 || numIterations() <= intParam(ITERLIMIT));
511 timespent = solveTime();
515 timelimit = realParam(TIMELIMIT);
516 if( timelimit > timespent )
517 timelimit -= timespent;
521 assert(timelimit >= 0);
526 SPxSolver::Status doSolve(
bool printwarning =
true)
528 SPxOut::Verbosity verbosity;
530 SPxSolver::Status spxStatus;
533 verbosity = spxout.getVerbosity();
534 spxout.setVerbosity((SPxOut::Verbosity)(getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
536 assert(checkConsistentBounds());
537 assert(checkConsistentSides());
539 #ifdef SCIP_WITH_LPSCHECK 541 if( getDoubleCheck() )
542 writeStateReal(
"spxcheck",
NULL,
NULL);
545 trySolve(printwarning);
546 spxStatus = status();
551 #ifdef SCIP_WITH_LPSCHECK 552 bool minimize = intParam(OBJSENSE) == OBJSENSE_MINIMIZE;
553 Real objLimitUpper = realParam(OBJLIMIT_UPPER);
554 Real objLimitLower = realParam(OBJLIMIT_LOWER);
557 if( getDoubleCheck() && (spxStatus == SPxSolver::OPTIMAL || spxStatus == SPxSolver::UNBOUNDED || spxStatus == SPxSolver::INFEASIBLE || spxStatus == SPxSolver::ABORT_VALUE) )
563 CPX_CALL( CPXreadcopyprob(_cpxenv, _cpxlp,
"spxcheck.mps",
NULL) );
564 CPX_CALL( CPXreadcopybase(_cpxenv, _cpxlp,
"spxcheck.bas") );
567 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPOPT,
MAX(opttol(), 1e-9)) );
568 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPRHS,
MAX(feastol(), 1e-9)) );
571 CPX_CALL( CPXlpopt(_cpxenv, _cpxlp) );
574 CPX_CALL( CPXsolution(_cpxenv, _cpxlp, &cpxstat, &cpxobj,
NULL,
NULL,
NULL,
NULL) );
579 if( cpxstat == CPX_STAT_OPTIMAL_INFEAS )
581 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s)\n",
582 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat));
583 if( EXIT_AT_CPXERROR )
586 else if( (spxStatus == SPxSolver::OPTIMAL && cpxstat != CPX_STAT_OPTIMAL)
587 || (spxStatus == SPxSolver::UNBOUNDED && cpxstat != CPX_STAT_UNBOUNDED)
588 || (spxStatus == SPxSolver::INFEASIBLE && cpxstat != CPX_STAT_INFEASIBLE) )
590 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
591 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
592 if( EXIT_AT_WRONG_RESULT )
595 else if( spxStatus == SPxSolver::ABORT_VALUE )
599 case CPX_STAT_OPTIMAL:
600 if( (minimize && LTrel(cpxobj, objLimitUpper, 2*opttol()))
601 || (!minimize && GTrel(cpxobj, objLimitLower, 2*opttol())) )
603 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
604 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
605 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
606 if( EXIT_AT_WRONG_RESULT )
609 else if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
611 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
612 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize?
"<" :
">",
613 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
616 case CPX_STAT_OPTIMAL_INFEAS:
617 case CPX_STAT_NUM_BEST:
618 if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
620 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
621 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
622 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
625 case CPX_STAT_INFEASIBLE:
627 case CPX_STAT_UNBOUNDED:
628 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
629 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
630 if( EXIT_AT_WRONG_RESULT )
633 case CPX_STAT_INForUNBD:
635 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
636 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
641 else if( spxStatus == SPxSolver::OPTIMAL )
643 if( (minimize && LTrel(objValueReal(), cpxobj, 2*opttol()))
644 || (!minimize && GTrel(objValueReal(), cpxobj, 2*opttol())) )
649 else if( (minimize && GTrel(objValueReal(), cpxobj, 2*opttol()))
650 || (!minimize && LTrel(objValueReal(), cpxobj, 2*opttol())) )
652 SCIPerrorMessage(
"In %s: LP optimal; SoPlex value=%.10f %s CPLEX value=%.10f suboptimal (checknum=%d)\n", _probname, objValueReal(),
653 minimize ?
">" :
"<", cpxobj, _checknum);
654 if( EXIT_AT_WRONG_RESULT )
664 spxout.setVerbosity(verbosity);
670 void savePreStrongbranchingBasis()
672 _rowStat.reSize(numRowsReal());
673 _colStat.reSize(numColsReal());
677 getBasis(_rowStat.get_ptr(), _colStat.get_ptr());
680 catch(
const SPxException&
x)
682 std::string s = x.what();
689 assert(status() != SPxSolver::OPTIMAL);
692 catch(
const SPxException&)
698 void restorePreStrongbranchingBasis()
700 assert(_rowStat.size() == numRowsReal());
701 assert(_colStat.size() == numColsReal());
705 setBasis(_rowStat.get_ptr(), _colStat.get_ptr());
708 catch(
const SPxException&
x)
710 std::string s = x.what();
713 catch(
const SPxException&)
720 assert(status() != SPxSolver::OPTIMAL);
725 void freePreStrongbranchingBasis()
732 bool preStrongbranchingBasisFreed()
const 734 return ((_rowStat.size() == 0 ) && (_colStat.size() == 0));
738 DataArray<SPxSolver::VarStatus>& rowStat()
744 DataArray<SPxSolver::VarStatus>& colStat()
762 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 764 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 788 COLPACKET* packcstat;
789 ROWPACKET* packrstat;
823 assert(num <= lpi->cstatsize);
845 assert(num <= lpi->rstatsize);
883 assert(lpistate !=
NULL);
899 assert(lpistate !=
NULL);
916 assert(lpistate !=
NULL);
917 assert(blkmem !=
NULL);
938 assert(blkmem !=
NULL);
939 assert(lpistate !=
NULL);
940 assert(*lpistate !=
NULL);
977 #if (SOPLEX_SUBVERSION > 0) 978 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'};
980 const static char spxname[20] = {
'S',
'o',
'p',
'l',
'e',
'x',
' ', SOPLEX_VERSION/100 +
'0',
'.', (SOPLEX_VERSION % 100)/10 +
'0',
'.', SOPLEX_VERSION % 10 +
'0'};
982 const static char spxdesc[200] = {
'L',
'i',
'n',
'e',
'a',
'r',
' ',
'P',
'r',
'o',
'g',
'r',
'a',
'm',
'm',
'i',
'n',
'g',
983 ' ',
'S',
'o',
'l',
'v',
'e',
'r',
' ' ,
'd',
'e',
'v',
'e',
'l',
'o',
'p',
'e',
'd',
984 ' ',
'a',
't',
' ',
'Z',
'u',
's',
'e',
' ',
'I',
'n',
's',
't',
'i',
't',
'u',
't',
'e',
985 ' ',
'B',
'e',
'r',
'l',
'i',
'n',
' ',
'(',
's',
'o',
'p',
'l',
'e',
'x',
'.',
'z',
'i',
'b',
'.',
'd',
'e',
')',
986 #ifdef SCIP_WITH_LPSCHECK 987 ' ',
'-',
' ',
'i',
'n',
'c',
'l',
'u',
'd',
'i',
'n',
'g',
' ',
'C',
'P',
'L',
'E',
'X',
988 ' ',
'd',
'o',
'u',
'b',
'l',
'e',
' ',
'c',
'h',
'e',
'c',
'k',
990 ' ',
'[',
'G',
'i',
't',
'H',
'a',
's',
'h',
':',
' ',
991 getGitHash()[0], getGitHash()[1], getGitHash()[2], getGitHash()[3],
992 getGitHash()[4], getGitHash()[5], getGitHash()[6], getGitHash()[7],
1020 return (
void*) lpi->
spx;
1030 assert( lpi !=
NULL );
1031 assert( ncols >= 0 );
1032 assert( ncols == 0 || intInfo !=
NULL );
1034 #if (SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3)) 1035 assert(ncols == lpi->
spx->numColsReal() || (ncols == 0 && intInfo ==
NULL));
1036 lpi->
spx->setIntegralityInformation(ncols, intInfo);
1039 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1088 assert(lpi !=
NULL);
1089 assert(name !=
NULL);
1096 SOPLEX_TRY( messagehdlr, (*lpi)->spx = new ((*lpi)->spx) SPxSCIP(messagehdlr, name) );
1097 (void) (*lpi)->spx->setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_ONLYREAL);
1098 (void) (*lpi)->spx->setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_REAL);
1099 (void) (*lpi)->spx->setIntParam(SoPlex::REPRESENTATION, SoPlex::REPRESENTATION_AUTO);
1102 #if SOPLEX_APIVERSION >= 10 1103 (void) (*lpi)->spx->setIntParam(SoPlex::STATTIMER, 0);
1106 (*lpi)->cstat =
NULL;
1107 (*lpi)->rstat =
NULL;
1108 (*lpi)->cstatsize = 0;
1109 (*lpi)->rstatsize = 0;
1111 (*lpi)->conditionlimit = -1.0;
1112 (*lpi)->checkcondition =
FALSE;
1113 (*lpi)->messagehdlr = messagehdlr;
1124 (*lpi)->spx->setInterrupt(
FALSE);
1125 SPxOut::Verbosity verbosity = (*lpi)->spx->spxout.getVerbosity();
1126 (*lpi)->spx->spxout.setVerbosity((SPxOut::Verbosity)((*lpi)->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
1127 (*lpi)->spx->printVersion();
1128 (*lpi)->spx->spxout.setVerbosity(verbosity);
1139 assert(lpi !=
NULL);
1140 assert(*lpi !=
NULL);
1141 assert((*lpi)->spx !=
NULL);
1144 (*lpi)->spx->~SPxSCIP();
1189 for( j = 0; j < nnonz; j++ )
1190 assert( val[j] != 0 );
1196 assert(lpi !=
NULL);
1198 assert(lhs !=
NULL);
1199 assert(rhs !=
NULL);
1200 assert(obj !=
NULL);
1203 assert(beg !=
NULL);
1204 assert(ind !=
NULL);
1205 assert(val !=
NULL);
1208 assert(lpi->
spx->preStrongbranchingBasisFreed());
1212 SPxSCIP* spx = lpi->
spx;
1213 LPRowSet rows(nrows);
1214 DSVector emptyVector(0);
1220 (void) spx->setIntParam(SoPlex::OBJSENSE, (objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE));
1223 for( i = 0; i < nrows; ++i )
1224 rows.add(lhs[i], emptyVector, rhs[i]);
1225 spx->addRowsReal(rows);
1231 catch(
const SPxException&
x )
1233 std::string s =
x.what();
1236 catch(
const SPxException& )
1261 assert(lpi !=
NULL);
1263 assert(obj !=
NULL);
1266 assert(nnonz == 0 || beg !=
NULL);
1267 assert(nnonz == 0 || ind !=
NULL);
1268 assert(nnonz == 0 || val !=
NULL);
1274 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1280 int nrows = lpi->
spx->numRowsReal();
1281 for (
int j = 0; j < nnonz; ++j)
1283 assert( 0 <= ind[j] && ind[j] < nrows );
1284 assert( val[j] != 0.0 );
1289 SPxSCIP* spx = lpi->
spx;
1292 LPColSet cols(ncols);
1293 DSVector colVector(ncols);
1299 for( i = 0; i < ncols; ++i )
1305 last = (i == ncols-1 ? nnonz : beg[i+1]);
1306 colVector.add( last-start, &ind[start], &val[start] );
1308 cols.add(obj[i], lb[i], colVector, ub[i]);
1310 spx->addColsReal(cols);
1313 catch(
const SPxException&
x )
1315 std::string s =
x.what();
1318 catch(
const SPxException& )
1336 assert(lpi !=
NULL);
1338 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1342 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1362 assert(lpi !=
NULL);
1364 assert(dstat !=
NULL);
1368 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1370 ncols = lpi->
spx->numColsReal();
1373 for( i = 0; i < ncols; ++i )
1396 assert(lpi !=
NULL);
1398 assert(lhs !=
NULL);
1399 assert(rhs !=
NULL);
1400 assert(nnonz == 0 || beg !=
NULL);
1401 assert(nnonz == 0 || ind !=
NULL);
1402 assert(nnonz == 0 || val !=
NULL);
1406 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1412 int ncols = lpi->
spx->numColsReal();
1413 for (
int j = 0; j < nnonz; ++j)
1415 assert( val[j] != 0.0 );
1416 assert( 0 <= ind[j] && ind[j] < ncols );
1423 SPxSCIP* spx = lpi->
spx;
1424 LPRowSet rows(nrows);
1431 for( i = 0; i < nrows; ++i )
1437 last = (i == nrows-1 ? nnonz : beg[i+1]);
1438 rowVector.add( last-start, &ind[start], &val[start] );
1440 rows.add(lhs[i], rowVector, rhs[i]);
1442 spx->addRowsReal(rows);
1445 catch(
const SPxException&
x )
1447 std::string s =
x.what();
1450 catch(
const SPxException& )
1468 assert(lpi !=
NULL);
1470 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1474 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1494 assert(lpi !=
NULL);
1499 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1501 nrows = lpi->
spx->numRowsReal();
1504 for( i = 0; i < nrows; ++i )
1519 assert(lpi !=
NULL);
1524 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1543 assert(lpi !=
NULL);
1545 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1551 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1555 for( i = 0; i < ncols; ++i )
1557 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1561 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1566 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1570 lpi->
spx->changeBoundsReal(ind[i], lb[i], ub[i]);
1571 assert(lpi->
spx->lowerReal(ind[i]) <= lpi->
spx->upperReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1575 catch(
const SPxException&
x )
1577 std::string s =
x.what();
1580 catch(
const SPxException& )
1602 assert(lpi !=
NULL);
1604 assert(ind !=
NULL);
1605 assert(lhs !=
NULL);
1606 assert(rhs !=
NULL);
1612 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1616 for( i = 0; i < nrows; ++i )
1618 assert(0 <= ind[i] && ind[i] < lpi->
spx->numRowsReal());
1619 lpi->
spx->changeRangeReal(ind[i], lhs[i], rhs[i]);
1620 assert(lpi->
spx->lhsReal(ind[i]) <= lpi->
spx->rhsReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1624 catch(
const SPxException&
x )
1626 std::string s =
x.what();
1629 catch(
const SPxException& )
1648 assert(lpi !=
NULL);
1650 assert(0 <= row && row < lpi->spx->numRowsReal());
1651 assert(0 <= col && col < lpi->spx->numColsReal());
1655 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1670 assert(lpi !=
NULL);
1675 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1694 assert(lpi !=
NULL);
1696 assert(ind !=
NULL);
1697 assert(obj !=
NULL);
1701 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1705 for( i = 0; i < ncols; ++i )
1707 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1708 lpi->
spx->changeObjReal(ind[i], obj[i]);
1712 catch(
const SPxException&
x )
1714 std::string s =
x.what();
1717 catch(
const SPxException& )
1738 assert(lpi !=
NULL);
1740 assert(scaleval != 0.0);
1746 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1749 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1750 SVector rowvec = lpi->
spx->rowVectorRealInternal(row);
1752 SVector rowvec = lpi->
spx->rowVectorReal(row);
1754 lhs = lpi->
spx->lhsReal(row);
1755 rhs = lpi->
spx->rhsReal(row);
1761 if( lhs > -lpi->
spx->realParam(SoPlex::INFTY) )
1763 else if( scaleval < 0.0 )
1764 lhs = lpi->
spx->realParam(SoPlex::INFTY);
1765 if( rhs < lpi->spx->realParam(SoPlex::INFTY) )
1767 else if( scaleval < 0.0 )
1768 rhs = -lpi->
spx->realParam(SoPlex::INFTY);
1769 if( scaleval < 0.0 )
1777 LPRow lprow(lhs, rowvec, rhs);
1780 lpi->
spx->changeRowReal(row, lprow);
1781 assert(lpi->
spx->lhsReal(row) <= lpi->
spx->rhsReal(row));
1784 catch(
const SPxException&
x )
1786 std::string s =
x.what();
1789 catch(
const SPxException& )
1813 assert(lpi !=
NULL);
1815 assert(scaleval != 0.0);
1821 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1824 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1825 SVector colvec = lpi->
spx->colVectorRealInternal(col);
1827 SVector colvec = lpi->
spx->colVectorReal(col);
1829 obj = lpi->
spx->objReal(col);
1830 lb = lpi->
spx->lowerReal(col);
1831 ub = lpi->
spx->upperReal(col);
1840 if( lb > -lpi->
spx->realParam(SoPlex::INFTY) )
1842 else if( scaleval < 0.0 )
1843 lb = lpi->
spx->realParam(SoPlex::INFTY);
1844 if( ub < lpi->spx->realParam(SoPlex::INFTY) )
1846 else if( scaleval < 0.0 )
1847 ub = -lpi->
spx->realParam(SoPlex::INFTY);
1848 if( scaleval < 0.0 )
1856 LPCol lpcol(obj, colvec, ub, lb);
1859 lpi->
spx->changeColReal(col, lpcol);
1860 assert(lpi->
spx->lowerReal(col) <= lpi->
spx->upperReal(col));
1863 catch(
const SPxException&
x )
1865 std::string s =
x.what();
1868 catch(
const SPxException& )
1897 assert(lpi !=
NULL);
1899 assert(nrows !=
NULL);
1901 *nrows = lpi->
spx->numRowsReal();
1914 assert(lpi !=
NULL);
1916 assert(ncols !=
NULL);
1918 *ncols = lpi->
spx->numColsReal();
1933 assert(lpi !=
NULL);
1935 assert(nnonz !=
NULL);
1939 if( lpi->
spx->numRowsReal() < lpi->
spx->numColsReal() )
1941 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
1943 (*nnonz) += lpi->
spx->rowVectorRealInternal(i).size();
1945 (*nnonz) += lpi->
spx->rowVectorReal(i).size();
1950 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
1952 (*nnonz) += lpi->
spx->colVectorRealInternal(i).size();
1954 (*nnonz) += lpi->
spx->colVectorReal(i).size();
1982 assert(lpi !=
NULL);
1984 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1990 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1991 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1993 DVector lbvec(lpi->
spx->numColsReal());
1994 DVector ubvec(lpi->
spx->numColsReal());
1995 lpi->
spx->getLowerReal(lbvec);
1996 lpi->
spx->getUpperReal(ubvec);
1997 for( i = firstcol; i <= lastcol; ++i )
1999 lb[i-firstcol] = lbvec[i];
2000 ub[i-firstcol] = ubvec[i];
2005 const Vector& lbvec = lpi->
spx->lowerRealInternal();
2006 const Vector& ubvec = lpi->
spx->upperRealInternal();
2007 for( i = firstcol; i <= lastcol; ++i )
2009 lb[i-firstcol] = lbvec[i];
2010 ub[i-firstcol] = ubvec[i];
2014 const Vector& lbvec = lpi->
spx->lowerReal();
2015 const Vector& ubvec = lpi->
spx->upperReal();
2017 for( i = firstcol; i <= lastcol; ++i )
2019 lb[i-firstcol] = lbvec[i];
2020 ub[i-firstcol] = ubvec[i];
2028 for( i = firstcol; i <= lastcol; ++i )
2030 beg[i-firstcol] = *nnonz;
2032 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2033 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2036 lpi->
spx->getColVectorReal(i, cvec);
2037 for( j = 0; j < cvec.size(); ++j )
2039 ind[*nnonz] = cvec.index(j);
2040 val[*nnonz] = cvec.value(j);
2046 const SVector& cvec = lpi->
spx->colVectorRealInternal(i);
2047 for( j = 0; j < cvec.size(); ++j )
2049 ind[*nnonz] = cvec.index(j);
2050 val[*nnonz] = cvec.value(j);
2055 const SVector& cvec = lpi->
spx->colVectorReal(i);
2056 for( j = 0; j < cvec.size(); ++j )
2058 ind[*nnonz] = cvec.index(j);
2059 val[*nnonz] = cvec.value(j);
2090 assert(lpi !=
NULL);
2092 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2098 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2099 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2101 DVector lhsvec(lpi->
spx->numRowsReal());
2102 DVector rhsvec(lpi->
spx->numRowsReal());
2103 lpi->
spx->getLhsReal(lhsvec);
2104 lpi->
spx->getRhsReal(rhsvec);
2105 for( i = firstrow; i <= lastrow; ++i )
2107 lhs[i-firstrow] = lhsvec[i];
2108 rhs[i-firstrow] = rhsvec[i];
2113 const Vector& lhsvec = lpi->
spx->lhsRealInternal();
2114 const Vector& rhsvec = lpi->
spx->rhsRealInternal();
2115 for( i = firstrow; i <= lastrow; ++i )
2117 lhs[i-firstrow] = lhsvec[i];
2118 rhs[i-firstrow] = rhsvec[i];
2122 const Vector& lhsvec = lpi->
spx->lhsReal();
2123 const Vector& rhsvec = lpi->
spx->rhsReal();
2124 for( i = firstrow; i <= lastrow; ++i )
2126 lhs[i-firstrow] = lhsvec[i];
2127 rhs[i-firstrow] = rhsvec[i];
2135 for( i = firstrow; i <= lastrow; ++i )
2137 beg[i-firstrow] = *nnonz;
2139 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2140 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2143 lpi->
spx->getRowVectorReal(i, rvec);
2144 for( j = 0; j < rvec.size(); ++j )
2146 ind[*nnonz] = rvec.index(j);
2147 val[*nnonz] = rvec.value(j);
2153 const SVector& rvec = lpi->
spx->rowVectorRealInternal(i);
2154 for( j = 0; j < rvec.size(); ++j )
2156 ind[*nnonz] = rvec.index(j);
2157 val[*nnonz] = rvec.value(j);
2162 const SVector& rvec = lpi->
spx->rowVectorReal(i);
2163 for( j = 0; j < rvec.size(); ++j )
2165 ind[*nnonz] = rvec.index(j);
2166 val[*nnonz] = rvec.value(j);
2183 int namestoragesize,
2187 assert( lpi !=
NULL );
2189 assert( colnames !=
NULL || namestoragesize == 0 );
2190 assert( namestorage !=
NULL || namestoragesize == 0 );
2191 assert( namestoragesize >= 0 );
2192 assert( storageleft !=
NULL );
2193 assert( 0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal() );
2209 int namestoragesize,
2213 assert( lpi !=
NULL );
2215 assert( rownames !=
NULL || namestoragesize == 0 );
2216 assert( namestorage !=
NULL || namestoragesize == 0 );
2217 assert( namestoragesize >= 0 );
2218 assert( storageleft !=
NULL );
2219 assert( 0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal() );
2236 assert(lpi !=
NULL);
2238 assert(objsen !=
NULL);
2257 assert(lpi !=
NULL);
2259 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2260 assert(vals !=
NULL);
2262 for( i = firstcol; i <= lastcol; ++i )
2263 vals[i-firstcol] = lpi->
spx->objReal(i);
2281 assert(lpi !=
NULL);
2283 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2285 for( i = firstcol; i <= lastcol; ++i )
2288 lbs[i-firstcol] = lpi->
spx->lowerReal(i);
2290 ubs[i-firstcol] = lpi->
spx->upperReal(i);
2309 assert(lpi !=
NULL);
2311 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2313 for( i = firstrow; i <= lastrow; ++i )
2316 lhss[i-firstrow] = lpi->
spx->lhsReal(i);
2318 rhss[i-firstrow] = lpi->
spx->rhsReal(i);
2334 assert(lpi !=
NULL);
2336 assert(0 <= col && col < lpi->spx->numColsReal());
2337 assert(0 <= row && row < lpi->spx->numRowsReal());
2338 assert(val !=
NULL);
2340 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2341 *val = lpi->
spx->coefReal(row, col);
2343 *val = lpi->
spx->colVectorReal(col)[row];
2367 assert( lpi !=
NULL );
2370 SPxOut::Verbosity verbosity;
2372 verbosity = lpi->
spx->spxout.getVerbosity();
2375 SCIPdebugMessage(
"calling SoPlex solve(): %d cols, %d rows\n", lpi->
spx->numColsReal(), lpi->
spx->numRowsReal());
2379 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2381 #ifdef SCIP_WITH_LPSCHECK 2382 lpi->
spx->setDoubleCheck(CHECK_SPXSOLVE);
2386 if( lpi->
spx->getFromScratch() )
2390 lpi->
spx->clearBasis();
2393 catch(
const SPxException&
x)
2395 std::string s = x.what();
2398 catch(
const SPxException&)
2401 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
2405 assert(!lpi->
spx->getFromScratch() || lpi->
spx->status() == SPxSolver::NO_PROBLEM);
2407 SPxSolver::Status status = lpi->
spx->doSolve();
2408 SCIPdebugMessage(
" -> SoPlex status: %d, basis status: %d\n", lpi->
spx->status(), lpi->
spx->basisStatus());
2412 lpi->
spx->spxout.setVerbosity(verbosity);
2416 case SPxSolver::ABORT_TIME:
2417 case SPxSolver::ABORT_ITER:
2418 case SPxSolver::ABORT_VALUE:
2419 case SPxSolver::SINGULAR:
2420 case SPxSolver::REGULAR:
2422 case SPxSolver::OPTIMAL:
2423 #if SOPLEX_APIVERSION >= 3 2424 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2426 case SPxSolver::UNBOUNDED:
2427 case SPxSolver::INFEASIBLE:
2441 assert(lpi !=
NULL);
2444 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2455 assert(lpi !=
NULL);
2458 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2468 assert(lpi !=
NULL);
2482 assert(lpi !=
NULL);
2485 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2486 lpi->
spx->savePreStrongbranchingBasis();
2496 assert(lpi !=
NULL);
2499 assert( ! lpi->
spx->preStrongbranchingBasisFreed() );
2500 lpi->
spx->restorePreStrongbranchingBasis();
2501 lpi->
spx->freePreStrongbranchingBasis();
2522 assert(lpi !=
NULL);
2526 SPxSolver::Status status;
2531 bool fromparentbasis;
2534 SPxOut::Verbosity verbosity;
2537 verbosity = lpi->
spx->spxout.getVerbosity();
2540 SCIPdebugMessage(
"calling SCIPlpiStrongbranch() on variable %d (%d iterations)\n", col, itlim);
2542 assert(lpi !=
NULL);
2546 assert(downvalid !=
NULL);
2547 assert(upvalid !=
NULL);
2550 #ifndef STRONGBRANCH_RESTOREBASIS 2551 fromparentbasis =
false;
2554 oldItlim = spx->intParam(SoPlex::ITERLIMIT);
2557 oldlb = spx->lowerReal(col);
2558 oldub = spx->upperReal(col);
2567 (void) spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2570 newub =
EPSCEIL(psol-1.0, lpi->
spx->feastol());
2571 if( newub >= oldlb - 0.5 && down !=
NULL )
2573 SCIPdebugMessage(
"strong branching down on x%d (%g) with %d iterations\n", col, psol, itlim);
2575 spx->changeUpperReal(col, newub);
2576 assert(spx->lowerReal(col) <= spx->upperReal(col));
2578 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2581 #ifndef STRONGBRANCH_RESTOREBASIS 2584 #ifdef SCIP_WITH_LPSCHECK 2585 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2587 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2588 #if SOPLEX_APIVERSION > 11 2589 status = spx->optimize(spx->getInterrupt());
2591 status = spx->optimize();
2594 status = spx->solve();
2599 case SPxSolver::OPTIMAL:
2600 *down = spx->objValueReal();
2604 case SPxSolver::ABORT_TIME:
2605 case SPxSolver::ABORT_ITER:
2606 case SPxSolver::ABORT_CYCLING:
2607 #if SOPLEX_APIVERSION >= 3 2608 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2610 *down = spx->objValueReal();
2612 case SPxSolver::ABORT_VALUE:
2613 case SPxSolver::INFEASIBLE:
2614 *down = spx->getObjLimit();
2622 (*iter) += spx->numIterations();
2624 #ifdef STRONGBRANCH_RESTOREBASIS 2626 assert( ! spx->preStrongbranchingBasisFreed() );
2627 spx->restorePreStrongbranchingBasis();
2628 fromparentbasis =
false;
2632 #if SOPLEX_APIVERSION >= 3 2633 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2634 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2636 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2637 && !fromparentbasis && spx->numIterations() < itlim);
2639 if( repeatstrongbranching )
2641 SCIPdebugMessage(
" --> Repeat strong branching down with %d iterations after restoring basis\n",
2642 itlim - spx->numIterations());
2643 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2644 spx->restorePreStrongbranchingBasis();
2645 fromparentbasis =
true;
2650 fromparentbasis =
false;
2653 while( fromparentbasis );
2655 spx->changeUpperReal(col, oldub);
2656 assert(spx->lowerReal(col) <= spx->upperReal(col));
2658 else if( down !=
NULL )
2660 *down = spx->getObjLimit();
2670 if( newlb <= oldub + 0.5 && up !=
NULL )
2672 SCIPdebugMessage(
"strong branching up on x%d (%g) with %d iterations\n", col, psol, itlim);
2674 spx->changeLowerReal(col, newlb);
2675 assert(spx->lowerReal(col) <= spx->upperReal(col));
2677 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2680 #ifndef STRONGBRANCH_RESTOREBASIS 2683 #ifdef SCIP_WITH_LPSCHECK 2684 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2686 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2687 #if SOPLEX_APIVERSION > 11 2688 status = spx->optimize(spx->getInterrupt());
2690 status = spx->optimize();
2693 status = spx->solve();
2698 case SPxSolver::OPTIMAL:
2699 *up = spx->objValueReal();
2703 case SPxSolver::ABORT_TIME:
2704 case SPxSolver::ABORT_ITER:
2705 case SPxSolver::ABORT_CYCLING:
2706 #if SOPLEX_APIVERSION >= 3 2707 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2709 *up = spx->objValueReal();
2711 case SPxSolver::ABORT_VALUE:
2712 case SPxSolver::INFEASIBLE:
2713 *up = spx->getObjLimit();
2721 (*iter) += spx->numIterations();
2723 #ifdef STRONGBRANCH_RESTOREBASIS 2725 assert( ! spx->preStrongbranchingBasisFreed() );
2726 spx->restorePreStrongbranchingBasis();
2727 fromparentbasis =
false;
2731 #if SOPLEX_APIVERSION >= 3 2732 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
2733 || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim);
2735 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR)
2736 && !fromparentbasis && spx->numIterations() < itlim);
2738 if( repeatstrongbranching )
2740 SCIPdebugMessage(
" --> Repeat strong branching up with %d iterations after restoring basis\n", itlim - spx->numIterations());
2741 spx->restorePreStrongbranchingBasis();
2742 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2744 fromparentbasis =
true;
2748 fromparentbasis =
false;
2751 while( fromparentbasis );
2753 spx->changeLowerReal(col, oldlb);
2754 assert(spx->lowerReal(col) <= spx->upperReal(col));
2756 else if( up !=
NULL )
2758 *up = spx->getObjLimit();
2766 (void) spx->setIntParam(SoPlex::ITERLIMIT, oldItlim);
2769 lpi->
spx->spxout.setVerbosity(verbosity);
2773 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2798 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2828 assert( cols !=
NULL );
2829 assert( psols !=
NULL );
2830 assert( down !=
NULL );
2831 assert( up !=
NULL );
2832 assert( downvalid !=
NULL );
2833 assert( upvalid !=
NULL );
2834 assert( down !=
NULL );
2839 for (
int j = 0; j < ncols; ++j)
2842 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2872 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2902 assert( cols !=
NULL );
2903 assert( psols !=
NULL );
2904 assert( down !=
NULL );
2905 assert( up !=
NULL );
2906 assert( downvalid !=
NULL );
2907 assert( upvalid !=
NULL );
2908 assert( down !=
NULL );
2913 for (
int j = 0; j < ncols; ++j)
2916 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2945 assert(lpi !=
NULL);
2968 assert(lpi !=
NULL);
2969 assert(primalfeasible !=
NULL);
2970 assert(dualfeasible !=
NULL);
2987 assert(lpi !=
NULL);
2990 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3002 assert(lpi !=
NULL);
3005 return lpi->
spx->hasPrimalRay();
3015 assert(lpi !=
NULL);
3018 assert(lpi->
spx->status() != SPxSolver::UNBOUNDED || lpi->
spx->basisStatus() == SPxBasis::UNBOUNDED);
3023 return lpi->
spx->status() == SPxSolver::UNBOUNDED;
3033 assert(lpi !=
NULL);
3036 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3046 assert(lpi !=
NULL);
3049 return lpi->
spx->basisStatus() == SPxBasis::OPTIMAL || lpi->
spx->basisStatus() == SPxBasis::PRIMAL;
3061 assert(lpi !=
NULL);
3064 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3076 assert(lpi !=
NULL);
3079 return lpi->
spx->hasDualFarkas();
3089 assert(lpi !=
NULL);
3092 return lpi->
spx->status() == SPxSolver::INFEASIBLE && lpi->
spx->basisStatus() == SPxBasis::DUAL;
3102 assert(lpi !=
NULL);
3105 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3115 assert(lpi !=
NULL);
3118 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->
spx->basisStatus() == SPxBasis::DUAL;
3128 assert(lpi !=
NULL);
3130 assert((lpi->
spx->basisStatus() == SPxBasis::OPTIMAL)
3133 return (lpi->
spx->status() == SPxSolver::OPTIMAL);
3149 assert(lpi !=
NULL);
3154 #if SOPLEX_APIVERSION >= 3 3155 if( lpi->
spx->status() == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS )
3183 if( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MAXIMIZE )
3201 assert(lpi !=
NULL);
3204 return (lpi->
spx->status() == SPxSolver::ABORT_VALUE);
3214 assert(lpi !=
NULL);
3217 return (lpi->
spx->status() == SPxSolver::ABORT_ITER);
3227 assert(lpi !=
NULL);
3230 return (lpi->
spx->status() == SPxSolver::ABORT_TIME);
3240 assert(lpi !=
NULL);
3243 return static_cast<int>(lpi->
spx->status());
3254 assert(lpi !=
NULL);
3256 assert(success !=
NULL);
3258 #if SOPLEX_APIVERSION >= 4 3259 *success = lpi->
spx->ignoreUnscaledViolations();
3275 assert(lpi !=
NULL);
3277 assert(objval !=
NULL);
3279 *objval = lpi->
spx->objValueReal();
3300 assert(lpi !=
NULL);
3303 if( objval !=
NULL )
3304 *objval = lpi->
spx->objValueReal();
3308 if( primsol !=
NULL )
3310 #if SOPLEX_APIVERSION > 10 3311 (void)lpi->
spx->getPrimalReal(primsol, lpi->
spx->numColsReal());
3313 Vector tmp(lpi->
spx->numColsReal(), primsol);
3314 (void)lpi->
spx->getPrimalReal(tmp);
3317 if( dualsol !=
NULL )
3319 #if SOPLEX_APIVERSION > 10 3320 (void)lpi->
spx->getDualReal(dualsol, lpi->
spx->numRowsReal());
3322 Vector tmp(lpi->
spx->numRowsReal(), dualsol);
3323 (void)lpi->
spx->getDualReal(tmp);
3326 if( activity !=
NULL )
3328 #if SOPLEX_APIVERSION > 10 3329 (void)lpi->
spx->getSlacksReal(activity, lpi->
spx->numRowsReal());
3331 Vector tmp(lpi->
spx->numRowsReal(), activity);
3332 (void)lpi->
spx->getSlacksReal(tmp);
3335 if( redcost !=
NULL )
3337 #if SOPLEX_APIVERSION > 10 3338 (void)lpi->
spx->getRedCostReal(redcost, lpi->
spx->numColsReal());
3340 Vector tmp(lpi->
spx->numColsReal(), redcost);
3341 (void)lpi->
spx->getRedCostReal(tmp);
3346 catch(
const SPxException&
x )
3348 std::string s =
x.what();
3351 catch(
const SPxException& )
3368 assert(lpi !=
NULL);
3370 assert(lpi->
spx->hasPrimalRay());
3371 assert(ray !=
NULL);
3375 #if SOPLEX_APIVERSION > 10 3376 (void)lpi->
spx->getPrimalRayReal(ray, lpi->
spx->numColsReal());
3378 Vector tmp(lpi->
spx->numColsReal(), ray);
3379 (void)lpi->
spx->getPrimalRayReal(tmp);
3383 catch(
const SPxException&
x )
3385 std::string s =
x.what();
3388 catch(
const SPxException& )
3405 assert(lpi !=
NULL);
3407 assert(lpi->
spx->hasDualFarkas());
3408 assert(dualfarkas !=
NULL);
3412 #if SOPLEX_APIVERSION > 10 3413 (void)lpi->
spx->getDualFarkasReal(dualfarkas, lpi->
spx->numRowsReal());
3415 Vector tmp(lpi->
spx->numRowsReal(), dualfarkas);
3416 (void)lpi->
spx->getDualFarkasReal(tmp);
3420 catch(
const SPxException&
x )
3422 std::string s =
x.what();
3425 catch(
const SPxException& )
3442 assert(lpi !=
NULL);
3444 assert(iterations !=
NULL);
3446 *iterations = lpi->
spx->numIterations();
3464 assert(lpi !=
NULL);
3465 assert(quality !=
NULL);
3469 SCIPdebugMessage(
"requesting solution quality from SoPlex: quality %d\n", qualityindicator);
3471 switch( qualityindicator )
3474 success = lpi->
spx->getEstimatedCondition(*quality);
3478 success = lpi->
spx->getExactCondition(*quality);
3519 assert(lpi !=
NULL);
3522 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3526 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
3528 switch( lpi->
spx->basisRowStatus(i) )
3530 case SPxSolver::BASIC:
3533 case SPxSolver::FIXED:
3534 case SPxSolver::ON_LOWER:
3537 case SPxSolver::ON_UPPER:
3540 case SPxSolver::ZERO:
3541 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3543 case SPxSolver::UNDEFINED:
3554 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
3557 switch( lpi->
spx->basisColStatus(i) )
3559 case SPxSolver::BASIC:
3562 case SPxSolver::FIXED:
3576 case SPxSolver::ON_LOWER:
3579 case SPxSolver::ON_UPPER:
3582 case SPxSolver::ZERO:
3585 case SPxSolver::UNDEFINED:
3610 assert(lpi !=
NULL);
3616 assert(cstat !=
NULL || ncols == 0);
3617 assert(rstat !=
NULL || nrows == 0);
3619 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3622 DataArray<SPxSolver::VarStatus>& _colstat = lpi->
spx->colStat();
3623 DataArray<SPxSolver::VarStatus>& _rowstat = lpi->
spx->rowStat();
3625 _colstat.reSize(ncols);
3626 _rowstat.reSize(nrows);
3628 for( i = 0; i < nrows; ++i )
3633 _rowstat[i] = SPxSolver::ON_LOWER;
3636 _rowstat[i] = SPxSolver::BASIC;
3639 _rowstat[i] = SPxSolver::ON_UPPER;
3642 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3651 for( i = 0; i < ncols; ++i )
3656 _colstat[i] = SPxSolver::ON_LOWER;
3659 _colstat[i] = SPxSolver::BASIC;
3662 _colstat[i] = SPxSolver::ON_UPPER;
3665 _colstat[i] = SPxSolver::ZERO;
3675 lpi->
spx->freePreStrongbranchingBasis();
3688 assert(lpi !=
NULL);
3690 assert(bind !=
NULL);
3692 assert(lpi->
spx->preStrongbranchingBasisFreed());
3694 lpi->
spx->getBasisInd(bind);
3717 assert(lpi !=
NULL);
3719 assert(lpi->
spx->preStrongbranchingBasisFreed());
3720 assert(coef !=
NULL);
3723 assert(r < lpi->spx->numRowsReal());
3725 if( ! lpi->
spx->getBasisInverseRowReal(
r, coef, inds, ninds) )
3752 assert( lpi !=
NULL );
3754 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3755 assert(coef !=
NULL);
3757 if( ! lpi->
spx->getBasisInverseColReal(c, coef, inds, ninds) )
3787 assert(lpi !=
NULL);
3789 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3790 assert(coef !=
NULL);
3792 nrows = lpi->
spx->numRowsReal();
3793 ncols = lpi->
spx->numColsReal();
3797 if( binvrow ==
NULL )
3806 assert(binv !=
NULL);
3814 Vector binvvec(nrows, binv);
3816 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3821 for( c = 0; c < ncols; ++c )
3823 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3824 lpi->
spx->getColVectorReal(c, acol);
3825 coef[c] = binvvec * acol;
3827 coef[c] = binvvec * lpi->
spx->colVectorReal(c);
3853 DVector col(lpi->
spx->numRowsReal());
3855 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3862 assert( lpi !=
NULL );
3864 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3865 assert(coef !=
NULL);
3869 assert(c < lpi->spx->numColsReal());
3879 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3880 lpi->
spx->getColVectorReal(c, colsparse);
3884 col = lpi->
spx->colVectorReal(c);
3888 if( ! lpi->
spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3918 assert(blkmem !=
NULL);
3919 assert(lpi !=
NULL);
3921 assert(lpistate !=
NULL);
3923 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3925 ncols = lpi->
spx->numColsReal();
3926 nrows = lpi->
spx->numRowsReal();
3941 (*lpistate)->ncols = ncols;
3942 (*lpistate)->nrows = nrows;
3963 assert(lpi !=
NULL);
3965 assert(lpistate !=
NULL);
3968 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3970 lpncols = lpi->
spx->numColsReal();
3971 lpnrows = lpi->
spx->numRowsReal();
3972 assert(lpistate->
ncols <= lpncols);
3973 assert(lpistate->
nrows <= lpnrows);
3983 for( i = lpistate->
ncols; i < lpncols; ++i )
3989 bnd = lpi->
spx->lowerReal(i);
4001 for( i = lpistate->
nrows; i < lpnrows; ++i )
4017 assert(lpi !=
NULL);
4022 lpi->
spx->clearBasis();
4025 catch(
const SPxException&
x )
4027 std::string s = x.what();
4030 catch(
const SPxException& )
4033 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
4049 assert(lpi !=
NULL);
4050 assert(lpistate !=
NULL);
4051 assert(blkmem !=
NULL);
4053 if ( *lpistate !=
NULL )
4065 assert(lpi !=
NULL);
4076 assert(lpi !=
NULL);
4078 assert(fname !=
NULL);
4080 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4094 assert(lpi !=
NULL);
4096 assert(fname !=
NULL);
4099 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4131 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4135 assert(blkmem !=
NULL);
4136 assert(lpi !=
NULL);
4138 assert(lpinorms !=
NULL);
4140 lpi->
spx->getNdualNorms(nrows, ncols);
4142 if( nrows == 0 && ncols == 0)
4151 (*lpinorms)->nrows = 0;
4152 (*lpinorms)->ncols = 0;
4154 SCIPdebugMessage(
"storing SoPlex LPi pricing norms in %p (%d rows, %d cols)\n", (
void *) *lpinorms, nrows, ncols);
4156 if( !lpi->
spx->getDualNorms((*lpinorms)->nrows, (*lpinorms)->ncols, (*lpinorms)->norms) )
4161 assert(*lpinorms ==
NULL);
4166 assert(nrows == (*lpinorms)->nrows);
4167 assert(ncols == (*lpinorms)->ncols);
4186 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4187 assert(blkmem !=
NULL);
4188 assert(lpi !=
NULL);
4192 if( lpinorms ==
NULL )
4195 assert(lpinorms->
nrows <= lpi->
spx->numRowsReal());
4196 assert(lpinorms->
ncols <= lpi->
spx->numColsReal());
4198 if( lpinorms->
nrows == 0 )
4201 SCIPdebugMessage(
"loading LPi simplex norms %p (%d rows, %d cols) into SoPlex LP with %d rows and %d cols\n",
4202 (
const void *) lpinorms, lpinorms->
nrows, lpinorms->
ncols, lpi->
spx->numRowsReal(), lpi->
spx->numColsReal());
4217 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4218 assert(lpi !=
NULL);
4219 assert(lpinorms !=
NULL);
4225 assert(*lpinorms ==
NULL);
4254 assert(lpi !=
NULL);
4256 assert(ival !=
NULL);
4261 *ival = lpi->
spx->getFromScratch();
4264 *ival = lpi->
spx->getLpInfo();
4267 *ival = lpi->
spx->intParam(SoPlex::ITERLIMIT);
4272 *ival = lpi->
spx->intParam(SoPlex::SIMPLIFIER);
4278 scaleparam = lpi->
spx->intParam(SoPlex::SCALER);
4280 if( scaleparam == SoPlex::SCALER_OFF )
4282 else if( scaleparam == SoPlex::SCALER_BIEQUI )
4284 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4287 assert(scaleparam == SoPlex::SCALER_LEASTSQ);
4293 assert(scaleparam == SoPlex::SCALER_GEO8);
4298 #if SOPLEX_VERSION >= 201 4300 *ival = (int) (lpi->
spx->intParam(SoPlex::TIMER));
4303 #if SOPLEX_VERSION >= 230 || (SOPLEX_VERSION == 220 && SOPLEX_SUBVERSION >= 3) 4305 *ival = (int) lpi->
spx->randomSeed();
4308 #if SOPLEX_APIVERSION >= 1 4310 *ival = (int) lpi->
spx->intParam(SoPlex::FACTOR_UPDATE_MAX);
4329 assert(lpi !=
NULL);
4336 lpi->
spx->setFromScratch(
bool(ival));
4340 lpi->
spx->setLpInfo(
bool(ival));
4343 assert( ival >= 0 );
4345 if( ival >= INT_MAX )
4347 (void) lpi->
spx->setIntParam(SoPlex::ITERLIMIT, ival);
4351 #if SOPLEX_APIVERSION < 13 4354 assert(ival == 1 || ival == 0 || ival == 2);
4356 (void) lpi->
spx->setIntParam(SoPlex::SIMPLIFIER, ival);
4364 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_AUTO);
4367 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4370 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_PARMULT);
4373 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4376 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_QUICKSTEEP);
4379 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_DEVEX);
4386 assert(ival >= 0 && ival <= 2);
4388 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_OFF);
4389 else if( ival == 1 )
4390 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_BIEQUI);
4392 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4393 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_LEASTSQ);
4395 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_GEO8);
4399 #if SOPLEX_VERSION >= 201 4401 assert(ival >= 0 && ival < 3);
4402 (void) lpi->
spx->setIntParam(SoPlex::TIMER, ival);
4405 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3) 4407 lpi->
spx->setRandomSeed((
unsigned long)(
long)ival);
4410 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION >= 221 && SOPLEX_SUBVERSION >= 3) 4412 assert(ival >= 0 && ival < 3);
4413 (void) lpi->
spx->setIntParam(SoPlex::SOLUTION_POLISHING, ival);
4416 #if SOPLEX_APIVERSION >= 1 4419 (void) lpi->
spx->setIntParam(SoPlex::FACTOR_UPDATE_MAX, ival);
4439 assert(lpi !=
NULL);
4441 assert(dval !=
NULL);
4446 *dval = lpi->
spx->feastol();
4449 *dval = lpi->
spx->opttol();
4452 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4453 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_UPPER);
4455 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_LOWER);
4458 *dval = lpi->
spx->realParam(SoPlex::TIMELIMIT);
4461 *dval = lpi->
spx->realParam(SoPlex::REPRESENTATION_SWITCH);
4469 #if (SOPLEX_APIVERSION >= 9) 4470 *dval = lpi->
spx->realParam(SoPlex::MIN_MARKOWITZ);
4489 assert(lpi !=
NULL);
4496 assert( dval > 0.0 );
4497 lpi->
spx->setFeastol(dval);
4501 assert( dval > 0.0 );
4502 lpi->
spx->setOpttol(dval);
4506 if ( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE )
4507 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_UPPER, dval);
4509 (
void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_LOWER, dval);
4512 assert( dval > 0.0 );
4514 (void) lpi->
spx->setRealParam(SoPlex::TIMELIMIT, dval);
4518 assert( dval >= 0.0 || dval == -1.0 );
4522 (
void) lpi->
spx->setRealParam(SoPlex::REPRESENTATION_SWITCH, dval);
4529 #if (SOPLEX_APIVERSION >= 9) 4533 else if( dval > 0.9999 )
4536 (void) lpi->
spx->setRealParam(SoPlex::MIN_MARKOWITZ, dval);
4552 assert(lpi !=
NULL);
4555 lpi->
spx->setInterrupt(interrupt);
4577 assert(lpi !=
NULL);
4580 return lpi->
spx->realParam(SoPlex::INFTY);
4589 assert(lpi !=
NULL);
4592 return (val >= lpi->
spx->realParam(SoPlex::INFTY));
4610 const char* filename
4615 f = fopen(filename,
"r");
4632 assert(lpi !=
NULL);
4634 assert(fname !=
NULL);
4636 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4643 assert(lpi->
spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4644 if( !lpi->
spx->readFile(fname) )
4648 catch(
const SPxException&
x )
4650 std::string s =
x.what();
4653 catch(
const SPxException& )
4670 assert(lpi !=
NULL);
4672 assert(fname !=
NULL);
4676 (void) lpi->
spx->writeFileReal(fname);
4679 catch(
const SPxException&
x )
4681 std::string s =
x.what();
4684 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)
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)
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)
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)
static const char spxdesc[200]
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)