30 #define STRONGBRANCH_RESTOREBASIS 39 #define CHECK_SPXSOLVE true 40 #define CHECK_SPXSTRONGBRANCH true 42 #define EXIT_AT_WRONG_RESULT false 43 #define EXIT_AT_CPXERROR false 45 #define CPX_CALL(x) do \ 48 if( (_cpxstat_ = (x)) != 0 ) \ 50 SCIPmessagePrintWarning(_messagehdlr, "CPLEX error <%d>; SoPlex result unchecked\n", _cpxstat_); \ 51 if( EXIT_AT_CPXERROR ) \ 65 #define CHECK_SOPLEX_PARAM(x) \ 68 SCIPmessagePrintWarning(_messagehdlr, "SoPlex: unsupported parameter value\n"); \ 81 #ifndef SOPLEX_SUBVERSION 82 #define SOPLEX_SUBVERSION 0 86 #if (SOPLEX_VERSION < 200 || (SOPLEX_VERSION == 200 && SOPLEX_SUBVERSION < 2) || (SOPLEX_VERSION > 200 && SOPLEX_VERSION < 201)) 87 #error "This interface is not compatible with SoPlex versions prior to 2.0.0.2" 90 #include "spxgithash.h" 100 #if defined(_MSC_VER) && _MSC_VER < 1900 102 #define snprintf _snprintf 106 #define SOPLEX_VERBLEVEL 5 127 #define SOPLEX_TRY(messagehdlr, x) do \ 133 catch( const SPxMemoryException& E ) \ 135 std::string s = E.what(); \ 136 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 139 catch( const SPxException& E ) \ 141 std::string s = E.what(); \ 142 SCIPmessagePrintWarning((messagehdlr), "SoPlex threw an exception: %s\n", s.c_str()); \ 143 return SCIP_LPERROR; \ 149 #define SOPLEX_TRY(messagehdlr, x) do \ 155 catch( const SPxMemoryException& E ) \ 157 std::string s = E.what(); \ 158 SCIPerrorMessage("SoPlex threw a memory exception: %s\n", s.c_str()); \ 161 catch( const SPxException& ) \ 163 return SCIP_LPERROR; \ 172 #define SOPLEX_TRY_ABORT(x) do \ 178 catch( const SPxException& E ) \ 180 std::string s = E.what(); \ 181 SCIPerrorMessage("SoPlex threw an exception: %s\n", s.c_str()); \ 190 class SPxSCIP :
public SoPlex 195 DataArray<SPxSolver::VarStatus> _colStat;
196 DataArray<SPxSolver::VarStatus> _rowStat;
208 const char* probname =
NULL 215 _messagehdlr(messagehdlr)
217 if ( probname !=
NULL )
223 _doublecheck =
false;
224 _cpxenv = CPXopenCPLEX(&cpxstat);
225 assert(_cpxenv !=
NULL);
226 _cpxlp = CPXcreateprob(_cpxenv, &cpxstat, probname !=
NULL ? probname :
"spxcheck");
227 (void) CPXsetintparam(_cpxenv, CPX_PARAM_SCRIND, 0);
233 if( _probname !=
NULL )
236 freePreStrongbranchingBasis();
239 (void) CPXfreeprob(_cpxenv, &_cpxlp);
240 (void) CPXcloseCPLEX(&_cpxenv);
262 return realParam(OPTTOL);
274 Real getObjLimit()
const 276 return (intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE)
277 ? realParam(SoPlex::OBJLIMIT_UPPER)
278 : realParam(SoPlex::OBJLIMIT_LOWER);
282 bool getFromScratch()
const 287 void setFromScratch(
bool fs)
293 bool getLpInfo()
const 298 void setLpInfo(
bool lpinfo)
304 void setProbname(
const char* probname)
308 assert(probname !=
NULL);
309 if( _probname !=
NULL )
311 len = (int)strlen(probname);
312 spx_alloc(_probname, len + 1);
313 strncpy(_probname, probname, len);
314 _probname[len] =
'\0';
317 void setRep(SPxSolver::Representation p_rep)
319 if( p_rep == SPxSolver::COLUMN && intParam(REPRESENTATION) == REPRESENTATION_ROW )
324 else if( (p_rep == SPxSolver::ROW && intParam(REPRESENTATION) == REPRESENTATION_COLUMN) )
332 bool getDoubleCheck()
335 return _doublecheck && _checknum + 1 >= CHECK_START;
338 void setDoubleCheck(
bool dc)
343 const char* spxStatusString(
const SPxSolver::Status stat)
const 347 case SPxSolver::ABORT_TIME:
349 case SPxSolver::ABORT_ITER:
351 case SPxSolver::ABORT_VALUE:
352 return "ABORT_VALUE";
353 case SPxSolver::SINGULAR:
355 case SPxSolver::REGULAR:
359 case SPxSolver::OPTIMAL:
361 case SPxSolver::UNBOUNDED:
363 case SPxSolver::INFEASIBLE:
370 const char* cpxStatusString(
const int stat)
const 374 case CPX_STAT_ABORT_TIME_LIM:
376 case CPX_STAT_ABORT_IT_LIM:
378 case CPX_STAT_ABORT_OBJ_LIM:
379 return "ABORT_VALUE";
380 case CPX_STAT_OPTIMAL:
382 case CPX_STAT_OPTIMAL_INFEAS:
383 return "CPX_STAT_OPTIMAL_INFEAS: OPT SOL INFEASIBLE AFTER UNSCALING";
384 case CPX_STAT_UNBOUNDED:
386 case CPX_STAT_INFEASIBLE:
388 case CPX_STAT_INForUNBD:
389 return "INFEASIBLE or UNBOUNDED";
390 case CPX_STAT_NUM_BEST:
391 return "CPX_STAT_NUM_BEST: SOL AVAILABLE BUT NOT PROVEN OPTIMAL DUE TO NUM TROUBLE";
399 bool checkConsistentBounds()
const 401 for(
int i = 0; i < numColsReal(); ++i )
403 if( lowerReal(i) > upperReal(i) + realParam(SoPlex::EPSILON_ZERO) )
405 SCIPerrorMessage(
"inconsistent bounds on column %d: lower=%.17g, upper=%.17g\n",
406 i, lowerReal(i), upperReal(i));
414 bool checkConsistentSides()
const 416 for(
int i = 0; i < numRowsReal(); ++i )
418 if( lhsReal(i) > rhsReal(i) + realParam(SoPlex::EPSILON_ZERO) )
421 i, lhsReal(i), rhsReal(i));
430 void trySolve(
bool printwarning =
true)
437 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 443 catch(
const SPxException& x)
445 std::string s = x.what();
455 assert(status() != SPxSolver::OPTIMAL);
458 assert(intParam(ITERLIMIT) < 0 || numIterations() <= intParam(ITERLIMIT));
461 timespent = solveTime();
465 timelimit = realParam(TIMELIMIT);
466 if( timelimit > timespent )
467 timelimit -= timespent;
471 assert(timelimit >= 0);
476 SPxSolver::Status doSolve(
bool printwarning =
true)
478 SPxOut::Verbosity verbosity;
480 SPxSolver::Status spxStatus;
483 verbosity = spxout.getVerbosity();
484 spxout.setVerbosity((SPxOut::Verbosity)(getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
486 assert(checkConsistentBounds());
487 assert(checkConsistentSides());
491 if( getDoubleCheck() )
492 writeStateReal(
"spxcheck",
NULL,
NULL);
495 trySolve(printwarning);
496 spxStatus = status();
502 bool minimize = intParam(OBJSENSE) == OBJSENSE_MINIMIZE;
503 Real objLimitUpper = realParam(OBJLIMIT_UPPER);
504 Real objLimitLower = realParam(OBJLIMIT_LOWER);
507 if( getDoubleCheck() && (spxStatus == SPxSolver::OPTIMAL || spxStatus == SPxSolver::UNBOUNDED || spxStatus == SPxSolver::INFEASIBLE || spxStatus == SPxSolver::ABORT_VALUE) )
513 CPX_CALL( CPXreadcopyprob(_cpxenv, _cpxlp,
"spxcheck.mps",
NULL) );
514 CPX_CALL( CPXreadcopybase(_cpxenv, _cpxlp,
"spxcheck.bas") );
517 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPOPT,
MAX(opttol(), 1e-9)) );
518 CPX_CALL( CPXsetdblparam(_cpxenv, CPX_PARAM_EPRHS,
MAX(feastol(), 1e-9)) );
521 CPX_CALL( CPXlpopt(_cpxenv, _cpxlp) );
524 CPX_CALL( CPXsolution(_cpxenv, _cpxlp, &cpxstat, &cpxobj,
NULL,
NULL,
NULL,
NULL) );
529 if( cpxstat == CPX_STAT_OPTIMAL_INFEAS )
531 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s)\n",
532 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat));
533 if( EXIT_AT_CPXERROR )
536 else if( (spxStatus == SPxSolver::OPTIMAL && cpxstat != CPX_STAT_OPTIMAL)
537 || (spxStatus == SPxSolver::UNBOUNDED && cpxstat != CPX_STAT_UNBOUNDED)
538 || (spxStatus == SPxSolver::INFEASIBLE && cpxstat != CPX_STAT_INFEASIBLE) )
540 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
541 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
542 if( EXIT_AT_WRONG_RESULT )
545 else if( spxStatus == SPxSolver::ABORT_VALUE )
549 case CPX_STAT_OPTIMAL:
550 if( (minimize && LTrel(cpxobj, objLimitUpper, 2*opttol()))
551 || (!minimize && GTrel(cpxobj, objLimitLower, 2*opttol())) )
553 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
554 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
555 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
556 if( EXIT_AT_WRONG_RESULT )
559 else if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
561 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
562 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize?
"<" :
">",
563 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
566 case CPX_STAT_OPTIMAL_INFEAS:
567 case CPX_STAT_NUM_BEST:
568 if( (minimize && cpxobj < objLimitUpper) || (!minimize && cpxobj > objLimitLower) )
570 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
571 _probname, spxStatus, spxStatusString(spxStatus), cpxobj, minimize ?
"<" :
">",
572 minimize ? objLimitUpper : objLimitLower, cpxStatusString(cpxstat), _checknum);
575 case CPX_STAT_INFEASIBLE:
577 case CPX_STAT_UNBOUNDED:
578 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
579 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
580 if( EXIT_AT_WRONG_RESULT )
583 case CPX_STAT_INForUNBD:
585 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
586 _probname, spxStatus, spxStatusString(spxStatus), cpxstat, cpxStatusString(cpxstat), _checknum);
591 else if( spxStatus == SPxSolver::OPTIMAL )
593 if( (minimize && LTrel(objValueReal(), cpxobj, 2*opttol()))
594 || (!minimize && GTrel(objValueReal(), cpxobj, 2*opttol())) )
599 else if( (minimize && GTrel(objValueReal(), cpxobj, 2*opttol()))
600 || (!minimize && LTrel(objValueReal(), cpxobj, 2*opttol())) )
602 SCIPerrorMessage(
"In %s: LP optimal; SoPlex value=%.10f %s CPLEX value=%.10f suboptimal (checknum=%d)\n", objValueReal(),
603 _probname, minimize ?
">" :
"<", cpxobj, _checknum);
604 if( EXIT_AT_WRONG_RESULT )
614 spxout.setVerbosity(verbosity);
620 void savePreStrongbranchingBasis()
622 _rowStat.reSize(numRowsReal());
623 _colStat.reSize(numColsReal());
627 getBasis(_rowStat.get_ptr(), _colStat.get_ptr());
630 catch(
const SPxException& x)
632 std::string s = x.what();
639 assert(status() != SPxSolver::OPTIMAL);
642 catch(
const SPxException&)
648 void restorePreStrongbranchingBasis()
650 assert(_rowStat.size() == numRowsReal());
651 assert(_colStat.size() == numColsReal());
655 setBasis(_rowStat.get_ptr(), _colStat.get_ptr());
658 catch(
const SPxException& x)
660 std::string s = x.what();
663 catch(
const SPxException&)
670 assert(status() != SPxSolver::OPTIMAL);
675 void freePreStrongbranchingBasis()
682 bool preStrongbranchingBasisFreed()
const 684 return ((_rowStat.size() == 0 ) && (_colStat.size() == 0));
688 DataArray<SPxSolver::VarStatus>& rowStat()
694 DataArray<SPxSolver::VarStatus>& colStat()
712 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 714 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 738 COLPACKET* packcstat;
739 ROWPACKET* packrstat;
773 assert(num <= lpi->cstatsize);
795 assert(num <= lpi->rstatsize);
833 assert(lpistate !=
NULL);
849 assert(lpistate !=
NULL);
866 assert(lpistate !=
NULL);
867 assert(blkmem !=
NULL);
888 assert(blkmem !=
NULL);
889 assert(lpistate !=
NULL);
890 assert(*lpistate !=
NULL);
940 #if (SOPLEX_SUBVERSION > 0) 941 snprintf(
spxname, 100,
"SoPlex %d.%d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10,
SOPLEX_SUBVERSION);
943 snprintf(
spxname, 100,
"SoPlex %d.%d.%d", SOPLEX_VERSION/100, (SOPLEX_VERSION % 100)/10, SOPLEX_VERSION % 10);
953 snprintf(
spxdesc, 200,
"%s [GitHash: %s]",
"Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de)" 955 " - including CPLEX double check" 967 return (
void*) lpi->
spx;
977 #if (SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3)) 978 assert(ncols == lpi->
spx->numColsReal() || (ncols == 0 && intInfo ==
NULL));
979 lpi->
spx->setIntegralityInformation(ncols, intInfo);
982 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1007 assert(lpi !=
NULL);
1014 SOPLEX_TRY( messagehdlr, (*lpi)->spx = new ((*lpi)->spx) SPxSCIP(messagehdlr, name) );
1015 (void) (*lpi)->spx->setIntParam(SoPlex::SYNCMODE, SoPlex::SYNCMODE_ONLYREAL);
1016 (void) (*lpi)->spx->setIntParam(SoPlex::SOLVEMODE, SoPlex::SOLVEMODE_REAL);
1017 (void) (*lpi)->spx->setIntParam(SoPlex::REPRESENTATION, SoPlex::REPRESENTATION_AUTO);
1019 (*lpi)->cstat =
NULL;
1020 (*lpi)->rstat =
NULL;
1021 (*lpi)->cstatsize = 0;
1022 (*lpi)->rstatsize = 0;
1024 (*lpi)->conditionlimit = -1.0;
1025 (*lpi)->checkcondition =
FALSE;
1026 (*lpi)->messagehdlr = messagehdlr;
1037 SPxOut::Verbosity verbosity = (*lpi)->spx->spxout.getVerbosity();
1038 (*lpi)->spx->spxout.setVerbosity((SPxOut::Verbosity)((*lpi)->spx->getLpInfo() ?
SOPLEX_VERBLEVEL : 0));
1039 (*lpi)->spx->printVersion();
1040 (*lpi)->spx->spxout.setVerbosity(verbosity);
1051 assert(lpi !=
NULL);
1052 assert(*lpi !=
NULL);
1053 assert((*lpi)->spx !=
NULL);
1056 (*lpi)->spx->~SPxSCIP();
1100 assert(lpi !=
NULL);
1102 assert(lhs !=
NULL);
1103 assert(rhs !=
NULL);
1106 assert(lpi->
spx->preStrongbranchingBasisFreed());
1110 SPxSCIP* spx = lpi->
spx;
1111 LPRowSet rows(nrows);
1112 DSVector emptyVector(0);
1118 (void) spx->setIntParam(SoPlex::OBJSENSE, (objsen ==
SCIP_OBJSEN_MINIMIZE ? SoPlex::OBJSENSE_MINIMIZE : SoPlex::OBJSENSE_MAXIMIZE));
1121 for( i = 0; i < nrows; ++i )
1122 rows.add(lhs[i], emptyVector, rhs[i]);
1123 spx->addRowsReal(rows);
1129 catch(
const SPxException& x )
1131 std::string s = x.what();
1134 catch(
const SPxException& )
1159 assert(lpi !=
NULL);
1161 assert(obj !=
NULL);
1164 assert(nnonz == 0 || beg !=
NULL);
1165 assert(nnonz == 0 || ind !=
NULL);
1166 assert(nnonz == 0 || val !=
NULL);
1172 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1178 int nrows = lpi->
spx->numRowsReal();
1179 for (
int j = 0; j < nnonz; ++j)
1180 assert( 0 <= ind[j] && ind[j] < nrows );
1184 SPxSCIP* spx = lpi->
spx;
1187 LPColSet cols(ncols);
1188 DSVector colVector(ncols);
1194 for( i = 0; i < ncols; ++i )
1200 last = (i == ncols-1 ? nnonz : beg[i+1]);
1201 colVector.add( last-start, &ind[start], &val[start] );
1203 cols.add(obj[i], lb[i], colVector, ub[i]);
1205 spx->addColsReal(cols);
1208 catch(
const SPxException& x )
1210 std::string s = x.what();
1213 catch(
const SPxException& )
1231 assert(lpi !=
NULL);
1233 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1237 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1257 assert(lpi !=
NULL);
1262 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1264 ncols = lpi->
spx->numColsReal();
1267 for( i = 0; i < ncols; ++i )
1290 assert(lpi !=
NULL);
1292 assert(lhs !=
NULL);
1293 assert(rhs !=
NULL);
1294 assert(nnonz == 0 || beg !=
NULL);
1295 assert(nnonz == 0 || ind !=
NULL);
1296 assert(nnonz == 0 || val !=
NULL);
1300 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1306 int ncols = lpi->
spx->numColsReal();
1307 for (
int j = 0; j < nnonz; ++j)
1308 assert( 0 <= ind[j] && ind[j] < ncols );
1314 SPxSCIP* spx = lpi->
spx;
1315 LPRowSet rows(nrows);
1322 for( i = 0; i < nrows; ++i )
1328 last = (i == nrows-1 ? nnonz : beg[i+1]);
1329 rowVector.add( last-start, &ind[start], &val[start] );
1331 rows.add(lhs[i], rowVector, rhs[i]);
1333 spx->addRowsReal(rows);
1336 catch(
const SPxException& x )
1338 std::string s = x.what();
1341 catch(
const SPxException& )
1359 assert(lpi !=
NULL);
1361 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1365 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1385 assert(lpi !=
NULL);
1390 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1392 nrows = lpi->
spx->numRowsReal();
1395 for( i = 0; i < nrows; ++i )
1410 assert(lpi !=
NULL);
1415 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1434 assert(lpi !=
NULL);
1436 assert(ind !=
NULL);
1442 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1446 for( i = 0; i < ncols; ++i )
1448 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1452 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1457 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1461 lpi->
spx->changeBoundsReal(ind[i], lb[i], ub[i]);
1462 assert(lpi->
spx->lowerReal(ind[i]) <= lpi->
spx->upperReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1466 catch(
const SPxException& x )
1468 std::string s = x.what();
1471 catch(
const SPxException& )
1493 assert(lpi !=
NULL);
1495 assert(ind !=
NULL);
1496 assert(lhs !=
NULL);
1497 assert(rhs !=
NULL);
1501 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1505 for( i = 0; i < nrows; ++i )
1507 assert(0 <= ind[i] && ind[i] < lpi->
spx->numRowsReal());
1508 lpi->
spx->changeRangeReal(ind[i], lhs[i], rhs[i]);
1509 assert(lpi->
spx->lhsReal(ind[i]) <= lpi->
spx->rhsReal(ind[i]) + lpi->
spx->realParam(SoPlex::EPSILON_ZERO));
1513 catch(
const SPxException& x )
1515 std::string s = x.what();
1518 catch(
const SPxException& )
1537 assert(lpi !=
NULL);
1539 assert(0 <= row && row < lpi->spx->numRowsReal());
1540 assert(0 <= col && col < lpi->spx->numColsReal());
1544 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1559 assert(lpi !=
NULL);
1564 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1583 assert(lpi !=
NULL);
1585 assert(ind !=
NULL);
1586 assert(obj !=
NULL);
1590 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1594 for( i = 0; i < ncols; ++i )
1596 assert(0 <= ind[i] && ind[i] < lpi->
spx->numColsReal());
1597 lpi->
spx->changeObjReal(ind[i], obj[i]);
1601 catch(
const SPxException& x )
1603 std::string s = x.what();
1606 catch(
const SPxException& )
1627 assert(lpi !=
NULL);
1629 assert(scaleval != 0.0);
1635 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1638 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1639 SVector rowvec = lpi->
spx->rowVectorRealInternal(row);
1641 SVector rowvec = lpi->
spx->rowVectorReal(row);
1643 lhs = lpi->
spx->lhsReal(row);
1644 rhs = lpi->
spx->rhsReal(row);
1650 if( lhs > -lpi->
spx->realParam(SoPlex::INFTY) )
1652 else if( scaleval < 0.0 )
1653 lhs = lpi->
spx->realParam(SoPlex::INFTY);
1654 if( rhs < lpi->spx->realParam(SoPlex::INFTY) )
1656 else if( scaleval < 0.0 )
1657 rhs = -lpi->
spx->realParam(SoPlex::INFTY);
1658 if( scaleval < 0.0 )
1666 LPRow lprow(lhs, rowvec, rhs);
1669 lpi->
spx->changeRowReal(row, lprow);
1670 assert(lpi->
spx->lhsReal(row) <= lpi->
spx->rhsReal(row));
1673 catch(
const SPxException& x )
1675 std::string s = x.what();
1678 catch(
const SPxException& )
1702 assert(lpi !=
NULL);
1704 assert(scaleval != 0.0);
1710 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1713 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1714 SVector colvec = lpi->
spx->colVectorRealInternal(col);
1716 SVector colvec = lpi->
spx->colVectorReal(col);
1718 obj = lpi->
spx->objReal(col);
1719 lb = lpi->
spx->lowerReal(col);
1720 ub = lpi->
spx->upperReal(col);
1729 if( lb > -lpi->
spx->realParam(SoPlex::INFTY) )
1731 else if( scaleval < 0.0 )
1732 lb = lpi->
spx->realParam(SoPlex::INFTY);
1733 if( ub < lpi->spx->realParam(SoPlex::INFTY) )
1735 else if( scaleval < 0.0 )
1736 ub = -lpi->
spx->realParam(SoPlex::INFTY);
1737 if( scaleval < 0.0 )
1745 LPCol lpcol(obj, colvec, ub, lb);
1748 lpi->
spx->changeColReal(col, lpcol);
1749 assert(lpi->
spx->lowerReal(col) <= lpi->
spx->upperReal(col));
1752 catch(
const SPxException& x )
1754 std::string s = x.what();
1757 catch(
const SPxException& )
1786 assert(lpi !=
NULL);
1788 assert(nrows !=
NULL);
1790 *nrows = lpi->
spx->numRowsReal();
1803 assert(lpi !=
NULL);
1805 assert(ncols !=
NULL);
1807 *ncols = lpi->
spx->numColsReal();
1822 assert(lpi !=
NULL);
1824 assert(nnonz !=
NULL);
1828 if( lpi->
spx->numRowsReal() < lpi->
spx->numColsReal() )
1830 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
1832 (*nnonz) += lpi->
spx->rowVectorRealInternal(i).size();
1834 (*nnonz) += lpi->
spx->rowVectorReal(i).size();
1839 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
1841 (*nnonz) += lpi->
spx->colVectorRealInternal(i).size();
1843 (*nnonz) += lpi->
spx->colVectorReal(i).size();
1871 assert(lpi !=
NULL);
1873 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
1879 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1880 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1882 DVector lbvec(lpi->
spx->numColsReal());
1883 DVector ubvec(lpi->
spx->numColsReal());
1884 lpi->
spx->getLowerReal(lbvec);
1885 lpi->
spx->getUpperReal(ubvec);
1886 for( i = firstcol; i <= lastcol; ++i )
1888 lb[i-firstcol] = lbvec[i];
1889 ub[i-firstcol] = ubvec[i];
1894 const Vector& lbvec = lpi->
spx->lowerRealInternal();
1895 const Vector& ubvec = lpi->
spx->upperRealInternal();
1896 for( i = firstcol; i <= lastcol; ++i )
1898 lb[i-firstcol] = lbvec[i];
1899 ub[i-firstcol] = ubvec[i];
1903 const Vector& lbvec = lpi->
spx->lowerReal();
1904 const Vector& ubvec = lpi->
spx->upperReal();
1906 for( i = firstcol; i <= lastcol; ++i )
1908 lb[i-firstcol] = lbvec[i];
1909 ub[i-firstcol] = ubvec[i];
1919 for( i = firstcol; i <= lastcol; ++i )
1921 beg[i-firstcol] = *nnonz;
1923 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1924 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1927 lpi->
spx->getColVectorReal(i, cvec);
1928 for( j = 0; j < cvec.size(); ++j )
1930 ind[*nnonz] = cvec.index(j);
1931 val[*nnonz] = cvec.value(j);
1937 const SVector& cvec = lpi->
spx->colVectorRealInternal(i);
1938 for( j = 0; j < cvec.size(); ++j )
1940 ind[*nnonz] = cvec.index(j);
1941 val[*nnonz] = cvec.value(j);
1946 const SVector& cvec = lpi->
spx->colVectorReal(i);
1947 for( j = 0; j < cvec.size(); ++j )
1949 ind[*nnonz] = cvec.index(j);
1950 val[*nnonz] = cvec.value(j);
1958 assert(beg ==
NULL);
1959 assert(ind ==
NULL);
1960 assert(val ==
NULL);
1987 assert(lpi !=
NULL);
1989 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
1993 assert(rhs !=
NULL);
1995 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 1996 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
1998 DVector lhsvec(lpi->
spx->numRowsReal());
1999 DVector rhsvec(lpi->
spx->numRowsReal());
2000 lpi->
spx->getLhsReal(lhsvec);
2001 lpi->
spx->getRhsReal(rhsvec);
2002 for( i = firstrow; i <= lastrow; ++i )
2004 lhs[i-firstrow] = lhsvec[i];
2005 rhs[i-firstrow] = rhsvec[i];
2010 const Vector& lhsvec = lpi->
spx->lhsRealInternal();
2011 const Vector& rhsvec = lpi->
spx->rhsRealInternal();
2012 for( i = firstrow; i <= lastrow; ++i )
2014 lhs[i-firstrow] = lhsvec[i];
2015 rhs[i-firstrow] = rhsvec[i];
2019 const Vector& lhsvec = lpi->
spx->lhsReal();
2020 const Vector& rhsvec = lpi->
spx->rhsReal();
2021 for( i = firstrow; i <= lastrow; ++i )
2023 lhs[i-firstrow] = lhsvec[i];
2024 rhs[i-firstrow] = rhsvec[i];
2029 assert(rhs ==
NULL);
2034 for( i = firstrow; i <= lastrow; ++i )
2036 beg[i-firstrow] = *nnonz;
2038 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2039 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
2042 lpi->
spx->getRowVectorReal(i, rvec);
2043 for( j = 0; j < rvec.size(); ++j )
2045 ind[*nnonz] = rvec.index(j);
2046 val[*nnonz] = rvec.value(j);
2052 const SVector& rvec = lpi->
spx->rowVectorRealInternal(i);
2053 for( j = 0; j < rvec.size(); ++j )
2055 ind[*nnonz] = rvec.index(j);
2056 val[*nnonz] = rvec.value(j);
2061 const SVector& rvec = lpi->
spx->rowVectorReal(i);
2062 for( j = 0; j < rvec.size(); ++j )
2064 ind[*nnonz] = rvec.index(j);
2065 val[*nnonz] = rvec.value(j);
2073 assert(beg ==
NULL);
2074 assert(ind ==
NULL);
2075 assert(val ==
NULL);
2088 int namestoragesize,
2092 assert( lpi !=
NULL );
2094 assert( colnames !=
NULL || namestoragesize == 0 );
2095 assert( namestorage !=
NULL || namestoragesize == 0 );
2096 assert( namestoragesize >= 0 );
2097 assert( storageleft !=
NULL );
2098 assert( 0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal() );
2114 int namestoragesize,
2118 assert( lpi !=
NULL );
2120 assert( rownames !=
NULL || namestoragesize == 0 );
2121 assert( namestorage !=
NULL || namestoragesize == 0 );
2122 assert( namestoragesize >= 0 );
2123 assert( storageleft !=
NULL );
2124 assert( 0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal() );
2141 assert(lpi !=
NULL);
2143 assert(objsen !=
NULL);
2162 assert(lpi !=
NULL);
2164 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2165 assert(vals !=
NULL);
2167 for( i = firstcol; i <= lastcol; ++i )
2168 vals[i-firstcol] = lpi->
spx->objReal(i);
2186 assert(lpi !=
NULL);
2188 assert(0 <= firstcol && firstcol <= lastcol && lastcol < lpi->spx->numColsReal());
2190 for( i = firstcol; i <= lastcol; ++i )
2193 lbs[i-firstcol] = lpi->
spx->lowerReal(i);
2195 ubs[i-firstcol] = lpi->
spx->upperReal(i);
2214 assert(lpi !=
NULL);
2216 assert(0 <= firstrow && firstrow <= lastrow && lastrow < lpi->spx->numRowsReal());
2218 for( i = firstrow; i <= lastrow; ++i )
2221 lhss[i-firstrow] = lpi->
spx->lhsReal(i);
2223 rhss[i-firstrow] = lpi->
spx->rhsReal(i);
2239 assert(lpi !=
NULL);
2241 assert(0 <= col && col < lpi->spx->numColsReal());
2242 assert(0 <= row && row < lpi->spx->numRowsReal());
2243 assert(val !=
NULL);
2245 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2246 *val = lpi->
spx->coefReal(row, col);
2248 *val = lpi->
spx->colVectorReal(col)[row];
2272 assert( lpi !=
NULL );
2275 SPxOut::Verbosity verbosity;
2277 verbosity = lpi->
spx->spxout.getVerbosity();
2280 SCIPdebugMessage(
"calling SoPlex solve(): %d cols, %d rows\n", lpi->
spx->numColsReal(), lpi->
spx->numRowsReal());
2284 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2286 #ifdef WITH_LPSCHECK 2287 lpi->
spx->setDoubleCheck(CHECK_SPXSOLVE);
2291 if( lpi->
spx->getFromScratch() )
2295 lpi->
spx->clearBasis();
2298 catch(
const SPxException& x)
2300 std::string s = x.what();
2303 catch(
const SPxException&)
2306 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
2310 assert(!lpi->
spx->getFromScratch() || lpi->
spx->status() == SPxSolver::NO_PROBLEM);
2312 SPxSolver::Status status = lpi->
spx->doSolve();
2313 SCIPdebugMessage(
" -> SoPlex status: %d, basis status: %d\n", lpi->
spx->status(), lpi->
spx->basisStatus());
2317 lpi->
spx->spxout.setVerbosity(verbosity);
2321 case SPxSolver::ABORT_TIME:
2322 case SPxSolver::ABORT_ITER:
2323 case SPxSolver::ABORT_VALUE:
2324 case SPxSolver::SINGULAR:
2325 case SPxSolver::REGULAR:
2327 case SPxSolver::OPTIMAL:
2328 case SPxSolver::UNBOUNDED:
2329 case SPxSolver::INFEASIBLE:
2343 assert(lpi !=
NULL);
2346 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2357 assert(lpi !=
NULL);
2360 (void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2381 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2382 lpi->
spx->savePreStrongbranchingBasis();
2392 assert( ! lpi->
spx->preStrongbranchingBasisFreed() );
2393 lpi->
spx->restorePreStrongbranchingBasis();
2394 lpi->
spx->freePreStrongbranchingBasis();
2416 SPxSolver::Status status;
2421 bool fromparentbasis;
2424 SPxOut::Verbosity verbosity;
2427 verbosity = lpi->
spx->spxout.getVerbosity();
2430 SCIPdebugMessage(
"calling SCIPlpiStrongbranch() on variable %d (%d iterations)\n", col, itlim);
2432 assert(lpi !=
NULL);
2436 assert(downvalid !=
NULL);
2437 assert(upvalid !=
NULL);
2440 #ifndef STRONGBRANCH_RESTOREBASIS 2441 fromparentbasis =
false;
2444 oldItlim = spx->intParam(SoPlex::ITERLIMIT);
2447 oldlb = spx->lowerReal(col);
2448 oldub = spx->upperReal(col);
2457 (void) spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2460 newub =
EPSCEIL(psol-1.0, lpi->
spx->feastol());
2461 if( newub >= oldlb - 0.5 && down !=
NULL )
2463 SCIPdebugMessage(
"strong branching down on x%d (%g) with %d iterations\n", col, psol, itlim);
2465 spx->changeUpperReal(col, newub);
2466 assert(spx->lowerReal(col) <= spx->upperReal(col));
2468 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2471 #ifdef WITH_LPSCHECK 2472 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2474 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2475 status = spx->optimize();
2477 status = spx->solve();
2482 case SPxSolver::OPTIMAL:
2483 *down = spx->objValueReal();
2487 case SPxSolver::ABORT_TIME:
2488 case SPxSolver::ABORT_ITER:
2489 case SPxSolver::ABORT_CYCLING:
2490 *down = spx->objValueReal();
2492 case SPxSolver::ABORT_VALUE:
2493 case SPxSolver::INFEASIBLE:
2494 *down = spx->getObjLimit();
2502 (*iter) += spx->numIterations();
2504 #ifdef STRONGBRANCH_RESTOREBASIS 2506 assert( ! spx->preStrongbranchingBasisFreed() );
2507 spx->restorePreStrongbranchingBasis();
2508 fromparentbasis =
false;
2512 if( (status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim )
2514 SCIPdebugMessage(
" --> Repeat strong branching down with %d iterations after restoring basis\n",
2515 itlim - spx->numIterations());
2516 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2517 assert( ! spx->hasPreStrongbranchingBasis() );
2518 spx->restorePreStrongbranchingBasis();
2519 fromparentbasis =
true;
2524 fromparentbasis =
false;
2527 while( fromparentbasis );
2529 spx->changeUpperReal(col, oldub);
2530 assert(spx->lowerReal(col) <= spx->upperReal(col));
2532 else if( down !=
NULL )
2534 *down = spx->getObjLimit();
2544 if( newlb <= oldub + 0.5 && up !=
NULL )
2546 SCIPdebugMessage(
"strong branching up on x%d (%g) with %d iterations\n", col, psol, itlim);
2548 spx->changeLowerReal(col, newlb);
2549 assert(spx->lowerReal(col) <= spx->upperReal(col));
2551 (void) spx->setIntParam(SoPlex::ITERLIMIT, itlim);
2554 #ifdef WITH_LPSCHECK 2555 spx->setDoubleCheck(CHECK_SPXSTRONGBRANCH);
2557 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 2558 status = spx->optimize();
2560 status = spx->solve();
2565 case SPxSolver::OPTIMAL:
2566 *up = spx->objValueReal();
2570 case SPxSolver::ABORT_TIME:
2571 case SPxSolver::ABORT_ITER:
2572 case SPxSolver::ABORT_CYCLING:
2573 *up = spx->objValueReal();
2575 case SPxSolver::ABORT_VALUE:
2576 case SPxSolver::INFEASIBLE:
2577 *up = spx->getObjLimit();
2585 (*iter) += spx->numIterations();
2587 #ifdef STRONGBRANCH_RESTOREBASIS 2589 assert( ! spx->preStrongbranchingBasisFreed() );
2590 spx->restorePreStrongbranchingBasis();
2591 fromparentbasis =
false;
2595 else if( (status == SPxSolver::ABORT_CYCLING || status == SPxSolver::SINGULAR) && !fromparentbasis && spx->numIterations() < itlim )
2597 SCIPdebugMessage(
" --> Repeat strong branching up with %d iterations after restoring basis\n", itlim - spx->numIterations());
2598 assert( ! spx->hasPreStrongbranchingBasis() );
2599 spx->restorePreStrongbranchingBasis();
2600 spx->setIntParam(SoPlex::ITERLIMIT, itlim - spx->numIterations());
2602 fromparentbasis =
true;
2606 fromparentbasis =
false;
2609 while( fromparentbasis );
2611 spx->changeLowerReal(col, oldlb);
2612 assert(spx->lowerReal(col) <= spx->upperReal(col));
2614 else if( up !=
NULL )
2616 *up = spx->getObjLimit();
2624 (void) spx->setIntParam(SoPlex::ITERLIMIT, oldItlim);
2627 lpi->
spx->spxout.setVerbosity(verbosity);
2631 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2656 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2686 assert( cols !=
NULL );
2687 assert( psols !=
NULL );
2688 assert( down !=
NULL );
2689 assert( up !=
NULL );
2690 assert( downvalid !=
NULL );
2691 assert( upvalid !=
NULL );
2692 assert( down !=
NULL );
2697 for (
int j = 0; j < ncols; ++j)
2700 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2730 retcode =
lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter);
2760 assert( cols !=
NULL );
2761 assert( psols !=
NULL );
2762 assert( down !=
NULL );
2763 assert( up !=
NULL );
2764 assert( downvalid !=
NULL );
2765 assert( upvalid !=
NULL );
2766 assert( down !=
NULL );
2771 for (
int j = 0; j < ncols; ++j)
2774 retcode =
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter);
2803 assert(lpi !=
NULL);
2817 assert(lpi !=
NULL);
2818 assert(primalfeasible !=
NULL);
2819 assert(dualfeasible !=
NULL);
2836 assert(lpi !=
NULL);
2839 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
2851 assert(lpi !=
NULL);
2854 return lpi->
spx->hasPrimalRay();
2864 assert(lpi !=
NULL);
2867 assert(lpi->
spx->status() != SPxSolver::UNBOUNDED || lpi->
spx->basisStatus() == SPxBasis::UNBOUNDED);
2872 return lpi->
spx->status() == SPxSolver::UNBOUNDED;
2882 assert(lpi !=
NULL);
2885 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
2893 SPxBasis::SPxStatus basestatus;
2897 assert(lpi !=
NULL);
2900 basestatus = lpi->
spx->basisStatus();
2905 assert(basestatus == SPxBasis::OPTIMAL || lpi->
spx->status() != SPxSolver::OPTIMAL);
2907 return basestatus == SPxBasis::OPTIMAL || basestatus == SPxBasis::PRIMAL;
2919 assert(lpi !=
NULL);
2922 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
2934 assert(lpi !=
NULL);
2937 return lpi->
spx->hasDualFarkas();
2947 assert(lpi !=
NULL);
2950 return lpi->
spx->status() == SPxSolver::INFEASIBLE && lpi->
spx->basisStatus() == SPxBasis::DUAL;
2960 assert(lpi !=
NULL);
2963 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
2973 assert(lpi !=
NULL);
2979 assert(lpi->
spx->basisStatus() == SPxBasis::OPTIMAL || lpi->
spx->status() != SPxSolver::OPTIMAL);
2981 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->
spx->basisStatus() == SPxBasis::DUAL;
2991 assert(lpi !=
NULL);
2992 assert((lpi->
spx->basisStatus() == SPxBasis::OPTIMAL)
2998 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL);
3008 assert(lpi !=
NULL);
3011 if( lpi->
spx->status() == SPxSolver::ERROR || lpi->
spx->status() == SPxSolver::SINGULAR )
3043 assert(lpi !=
NULL);
3046 return (lpi->
spx->status() == SPxSolver::ABORT_VALUE);
3056 assert(lpi !=
NULL);
3059 return (lpi->
spx->status() == SPxSolver::ABORT_ITER);
3069 assert(lpi !=
NULL);
3072 return (lpi->
spx->status() == SPxSolver::ABORT_TIME);
3082 assert(lpi !=
NULL);
3085 return static_cast<int>(lpi->
spx->status());
3096 assert(lpi !=
NULL);
3113 assert(lpi !=
NULL);
3115 assert(objval !=
NULL);
3117 *objval = lpi->
spx->objValueReal();
3134 assert(lpi !=
NULL);
3137 if( objval !=
NULL )
3138 *objval = lpi->
spx->objValueReal();
3142 if( primsol !=
NULL )
3144 Vector tmp(lpi->
spx->numColsReal(), primsol);
3145 (void)lpi->
spx->getPrimalReal(tmp);
3147 if( dualsol !=
NULL )
3149 Vector tmp(lpi->
spx->numRowsReal(), dualsol);
3150 (void)lpi->
spx->getDualReal(tmp);
3152 if( activity !=
NULL )
3154 Vector tmp(lpi->
spx->numRowsReal(), activity);
3155 (void)lpi->
spx->getSlacksReal(tmp);
3157 if( redcost !=
NULL )
3159 Vector tmp(lpi->
spx->numColsReal(), redcost);
3160 (void)lpi->
spx->getRedCostReal(tmp);
3164 catch(
const SPxException& x )
3166 std::string s = x.what();
3169 catch(
const SPxException& )
3186 assert(lpi !=
NULL);
3188 assert(lpi->
spx->hasPrimalRay());
3192 Vector tmp(lpi->
spx->numColsReal(), ray);
3193 (void)lpi->
spx->getPrimalRayReal(tmp);
3196 catch(
const SPxException& x )
3198 std::string s = x.what();
3201 catch(
const SPxException& )
3218 assert(lpi !=
NULL);
3220 assert(lpi->
spx->hasDualFarkas());
3224 Vector tmp(lpi->
spx->numRowsReal(), dualfarkas);
3225 (void)lpi->
spx->getDualFarkasReal(tmp);
3228 catch(
const SPxException& x )
3230 std::string s = x.what();
3233 catch(
const SPxException& )
3250 assert(lpi !=
NULL);
3253 *iterations = lpi->
spx->numIterations();
3271 assert(lpi !=
NULL);
3272 assert(quality !=
NULL);
3276 assert(lpi !=
NULL);
3277 assert(quality !=
NULL);
3279 SCIPdebugMessage(
"requesting solution quality from SoPlex: quality %d\n", qualityindicator);
3281 switch( qualityindicator )
3284 success = lpi->
spx->getEstimatedCondition(*quality);
3288 success = lpi->
spx->getExactCondition(*quality);
3329 assert(lpi !=
NULL);
3332 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3334 if( rstat !=
NULL && cstat !=
NULL )
3336 for( i = 0; i < lpi->
spx->numRowsReal(); ++i )
3338 switch( lpi->
spx->basisRowStatus(i) )
3340 case SPxSolver::BASIC:
3343 case SPxSolver::FIXED:
3344 case SPxSolver::ON_LOWER:
3347 case SPxSolver::ON_UPPER:
3350 case SPxSolver::ZERO:
3351 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3353 case SPxSolver::UNDEFINED:
3364 for( i = 0; i < lpi->
spx->numColsReal(); ++i )
3367 switch( lpi->
spx->basisColStatus(i) )
3369 case SPxSolver::BASIC:
3372 case SPxSolver::FIXED:
3386 case SPxSolver::ON_LOWER:
3389 case SPxSolver::ON_UPPER:
3392 case SPxSolver::ZERO:
3395 case SPxSolver::UNDEFINED:
3415 int nCols = lpi->
spx->numColsReal();
3416 int nRows = lpi->
spx->numRowsReal();
3420 assert(lpi !=
NULL);
3422 assert(cstat !=
NULL || nCols == 0);
3423 assert(rstat !=
NULL || nRows == 0);
3425 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3428 DataArray<SPxSolver::VarStatus>& _colstat = lpi->
spx->colStat();
3429 DataArray<SPxSolver::VarStatus>& _rowstat = lpi->
spx->rowStat();
3431 _colstat.reSize(nCols);
3432 _rowstat.reSize(nRows);
3434 for( i = 0; i < nRows; ++i )
3439 _rowstat[i] = SPxSolver::ON_LOWER;
3442 _rowstat[i] = SPxSolver::BASIC;
3445 _rowstat[i] = SPxSolver::ON_UPPER;
3448 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3457 for( i = 0; i < nCols; ++i )
3462 _colstat[i] = SPxSolver::ON_LOWER;
3465 _colstat[i] = SPxSolver::BASIC;
3468 _colstat[i] = SPxSolver::ON_UPPER;
3471 _colstat[i] = SPxSolver::ZERO;
3481 lpi->
spx->freePreStrongbranchingBasis();
3494 assert(lpi !=
NULL);
3497 assert(lpi->
spx->preStrongbranchingBasisFreed());
3499 lpi->
spx->getBasisInd(bind);
3522 assert( lpi !=
NULL);
3524 assert(lpi->
spx->preStrongbranchingBasisFreed());
3527 assert(r < lpi->spx->numRowsReal());
3529 if( ! lpi->
spx->getBasisInverseRowReal(r, coef, inds, ninds) )
3556 assert( lpi !=
NULL );
3558 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3560 if( ! lpi->
spx->getBasisInverseColReal(c, coef, inds, ninds) )
3590 assert(lpi !=
NULL);
3592 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3594 nrows = lpi->
spx->numRowsReal();
3595 ncols = lpi->
spx->numColsReal();
3599 if( binvrow ==
NULL )
3608 assert(binv !=
NULL);
3616 Vector binvvec(nrows, binv);
3618 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3623 for( c = 0; c < ncols; ++c )
3625 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3626 lpi->
spx->getColVectorReal(c, acol);
3627 coef[c] = binvvec * acol;
3629 coef[c] = binvvec * lpi->
spx->colVectorReal(c);
3655 DVector col(lpi->
spx->numRowsReal());
3657 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3664 assert( lpi !=
NULL );
3666 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3670 assert(c < lpi->spx->numColsReal());
3680 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4) 3681 lpi->
spx->getColVectorReal(c, colsparse);
3685 col = lpi->
spx->colVectorReal(c);
3689 if( ! lpi->
spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3719 assert(blkmem !=
NULL);
3720 assert(lpi !=
NULL);
3722 assert(lpistate !=
NULL);
3724 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3726 ncols = lpi->
spx->numColsReal();
3727 nrows = lpi->
spx->numRowsReal();
3742 (*lpistate)->ncols = ncols;
3743 (*lpistate)->nrows = nrows;
3764 assert(lpi !=
NULL);
3766 assert(lpistate !=
NULL);
3768 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3770 lpncols = lpi->
spx->numColsReal();
3771 lpnrows = lpi->
spx->numRowsReal();
3772 assert(lpistate->
ncols <= lpncols);
3773 assert(lpistate->
nrows <= lpnrows);
3783 for( i = lpistate->
ncols; i < lpncols; ++i )
3789 bnd = lpi->
spx->lowerReal(i);
3801 for( i = lpistate->
nrows; i < lpnrows; ++i )
3817 assert(lpi !=
NULL);
3822 lpi->
spx->clearBasis();
3825 catch(
const SPxException& x )
3827 std::string s = x.what();
3830 catch(
const SPxException& )
3833 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
3849 assert(lpi !=
NULL);
3850 assert(lpistate !=
NULL);
3852 if ( *lpistate !=
NULL )
3875 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3891 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3923 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 3927 assert(blkmem !=
NULL);
3928 assert(lpi !=
NULL);
3930 assert(lpinorms !=
NULL);
3932 lpi->
spx->getNdualNorms(nrows, ncols);
3934 if( nrows == 0 && ncols == 0)
3943 (*lpinorms)->nrows = 0;
3944 (*lpinorms)->ncols = 0;
3946 SCIPdebugMessage(
"storing SoPlex LPi pricing norms in %p (%d rows, %d cols)\n", (
void *) *lpinorms, nrows, ncols);
3948 if( !lpi->
spx->getDualNorms((*lpinorms)->nrows, (*lpinorms)->ncols, (*lpinorms)->norms) )
3953 assert(*lpinorms ==
NULL);
3958 assert(nrows == (*lpinorms)->nrows);
3959 assert(ncols == (*lpinorms)->ncols);
3978 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 3979 assert(blkmem !=
NULL);
3980 assert(lpi !=
NULL);
3984 if( lpinorms ==
NULL )
3987 assert(lpinorms->
nrows <= lpi->
spx->numRowsReal());
3988 assert(lpinorms->
ncols <= lpi->
spx->numColsReal());
3990 if( lpinorms->
nrows == 0 )
3993 SCIPdebugMessage(
"loading LPi simplex norms %p (%d rows, %d cols) into SoPlex LP with %d rows and %d cols\n",
3994 (
const void *) lpinorms, lpinorms->
nrows, lpinorms->
ncols, lpi->
spx->numRowsReal(), lpi->
spx->numColsReal());
4009 #if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201) 4010 assert(lpi !=
NULL);
4011 assert(lpinorms !=
NULL);
4017 assert(*lpinorms ==
NULL);
4046 assert(lpi !=
NULL);
4048 assert(ival !=
NULL);
4053 *ival = lpi->
spx->getFromScratch();
4056 *ival = lpi->
spx->getLpInfo();
4059 *ival = lpi->
spx->intParam(SoPlex::ITERLIMIT);
4062 *ival = lpi->
spx->intParam(SoPlex::SIMPLIFIER) == SoPlex::SIMPLIFIER_AUTO;
4068 scaleparam = lpi->
spx->intParam(SoPlex::SCALER);
4070 if( scaleparam == SoPlex::SCALER_OFF )
4072 else if( scaleparam == SoPlex::SCALER_BIEQUI )
4074 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4077 assert(scaleparam == SoPlex::SCALER_LEASTSQ);
4082 #if SOPLEX_VERSION >= 201 4084 *ival = (int) (lpi->
spx->intParam(SoPlex::TIMER));
4087 #if SOPLEX_VERSION >= 230 || (SOPLEX_VERSION == 220 && SOPLEX_SUBVERSION >= 3) 4089 *ival = (int) lpi->
spx->randomSeed();
4108 assert(lpi !=
NULL);
4115 lpi->
spx->setFromScratch(
bool(ival));
4119 lpi->
spx->setLpInfo(
bool(ival));
4123 (void) lpi->
spx->setIntParam(SoPlex::ITERLIMIT, ival);
4127 (void) lpi->
spx->setIntParam(SoPlex::SIMPLIFIER, (ival ? SoPlex::SIMPLIFIER_AUTO : SoPlex::SIMPLIFIER_OFF));
4135 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_AUTO);
4138 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4141 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_PARMULT);
4144 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_STEEP);
4147 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_QUICKSTEEP);
4150 (void) lpi->
spx->setIntParam(SoPlex::PRICER, SoPlex::PRICER_DEVEX);
4157 assert(ival >= 0 && ival <= 2);
4159 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_OFF);
4160 else if( ival == 1 )
4161 (void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_BIEQUI);
4162 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2) 4164 (
void) lpi->
spx->setIntParam(SoPlex::SCALER, SoPlex::SCALER_LEASTSQ);
4168 #if SOPLEX_VERSION >= 201 4170 assert(ival >= 0 && ival < 3);
4171 (void) lpi->
spx->setIntParam(SoPlex::TIMER, ival);
4174 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3) 4176 lpi->
spx->setRandomSeed((
unsigned long)(
long)ival);
4179 #if SOPLEX_VERSION > 221 || (SOPLEX_VERSION >= 221 && SOPLEX_SUBVERSION >= 3) 4181 assert(ival >= 0 && ival < 3);
4182 (void) lpi->
spx->setIntParam(SoPlex::SOLUTION_POLISHING, ival);
4201 assert(lpi !=
NULL);
4203 assert(dval !=
NULL);
4208 *dval = lpi->
spx->feastol();
4211 *dval = lpi->
spx->opttol();
4214 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_LOWER);
4217 *dval = lpi->
spx->realParam(SoPlex::OBJLIMIT_UPPER);
4220 *dval = lpi->
spx->realParam(SoPlex::TIMELIMIT);
4223 *dval = lpi->
spx->realParam(SoPlex::REPRESENTATION_SWITCH);
4246 assert(lpi !=
NULL);
4252 lpi->
spx->setFeastol(dval);
4255 lpi->
spx->setOpttol(dval);
4258 (void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_LOWER, dval);
4261 (void) lpi->
spx->setRealParam(SoPlex::OBJLIMIT_UPPER, dval);
4264 (void) lpi->
spx->setRealParam(SoPlex::TIMELIMIT, dval);
4267 assert(dval >= -1.5);
4271 (
void) lpi->
spx->setRealParam(SoPlex::REPRESENTATION_SWITCH, dval);
4303 return lpi->
spx->realParam(SoPlex::INFTY);
4314 return (val >= lpi->
spx->realParam(SoPlex::INFTY));
4332 const char* filename
4337 f = fopen(filename,
"r");
4354 assert(lpi !=
NULL);
4357 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4364 assert(lpi->
spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4365 if( !lpi->
spx->readFile(fname) )
4369 catch(
const SPxException& x )
4371 std::string s = x.what();
4374 catch(
const SPxException& )
4391 assert(lpi !=
NULL);
4396 (void) lpi->
spx->writeFileReal(fname);
4399 catch(
const SPxException& x )
4401 std::string s = x.what();
4404 catch(
const SPxException& )
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiStrongbranchFrac(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
enum SCIP_ObjSen SCIP_OBJSEN
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
interface methods for specific LP solvers
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
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 SCIPlpiSolveDual(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *, const SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiAddCols(SCIP_LPI *lpi, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
enum SCIP_LPParam SCIP_LPPARAM
const char * SCIPlpiGetSolverName(void)
#define BMSallocMemoryArray(ptr, num)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
#define BMSfreeMemory(ptr)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
enum SCIP_Pricing SCIP_PRICING
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
static SCIP_RETCODE ensureRstatMem(SCIP_LPI *lpi, int num)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
#define SOPLEX_TRY(messagehdlr, x)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_RETCODE SCIPlpiLoadColLP(SCIP_LPI *lpi, SCIP_OBJSEN objsen, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *obj)
static SCIP_RETCODE ensureCstatMem(SCIP_LPI *lpi, int num)
packing single and dual bit values
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
static int colpacketNum(int ncols)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
static void setIntParam(SCIP_LPI *lpi, int const param, int const parval)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, const int *cstat, const int *rstat)
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 SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
static SCIP_Bool fileExists(const char *filename)
SCIP_RETCODE SCIPlpiStrongbranchInt(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
const char * SCIPlpiGetSolverDesc(void)
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
#define CHECK_SOPLEX_PARAM(x)
#define SOPLEX_SUBVERSION
#define BMSfreeBlockMemory(mem, ptr)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
#define BMSallocBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
static void setFeastol(SCIP_NLPIPROBLEM *nlpiproblem, SCIP_Real feastol)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
#define BMSallocMemoryCPP(size)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
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)
static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_RETCODE SCIPlpiStrongbranchesInt(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
static SCIP_RETCODE spxSolve(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetCols(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lb, SCIP_Real *ub, int *nnonz, int *beg, int *ind, SCIP_Real *val)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
public methods for message output
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_DUALPACKET COLPACKET
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
#define BMSallocMemory(ptr)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
#define BMSreallocMemoryArray(ptr, num)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
SCIP_DUALPACKET ROWPACKET
#define SOPLEX_TRY_ABORT(x)
SCIP_MESSAGEHDLR * messagehdlr
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)
#define BMSallocBlockMemory(mem, ptr)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)