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
146using namespace soplex;
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()); \
217class SPxSCIP :
public SoPlex
225#ifdef SCIP_WITH_LPSCHECK
236 const char* probname =
NULL
243 _messagehdlr(messagehdlr)
245 if ( probname !=
NULL )
248#if SOPLEX_APIVERSION >= 2
252#ifdef SCIP_WITH_LPSCHECK
265 if( _probname !=
NULL )
268 freePreStrongbranchingBasis();
270#ifdef SCIP_WITH_LPSCHECK
306 Real getObjLimit()
const
308 return (
intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MINIMIZE)
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)
351 if( _probname !=
NULL )
356 memcpy(_probname, probname, len + 1);
359 void setRep(SPxSolver::Representation
p_rep)
373#ifdef SCIP_WITH_LPSCHECK
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:
399 case SPxSolver::UNKNOWN:
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:
425 return "ABORT_VALUE";
429 return "CPX_STAT_OPTIMAL_INFEAS: OPT SOL INFEASIBLE AFTER UNSCALING";
435 return "INFEASIBLE or UNBOUNDED";
437 return "CPX_STAT_NUM_BEST: SOL AVAILABLE BUT NOT PROVEN OPTIMAL DUE TO NUM TROUBLE";
445 bool checkConsistentBounds()
const
451 SCIPerrorMessage(
"inconsistent bounds on column %d: lower=%.17g, upper=%.17g\n",
460 bool checkConsistentSides()
const
483#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
484#if SOPLEX_APIVERSION > 11
495 std::string s =
x.what();
505 assert(status() != SPxSolver::OPTIMAL);
536 assert(checkConsistentBounds());
537 assert(checkConsistentSides());
539#ifdef SCIP_WITH_LPSCHECK
551#ifdef SCIP_WITH_LPSCHECK
581 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s)\n",
590 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
595 else if(
spxStatus == SPxSolver::ABORT_VALUE )
603 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
611 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
620 SCIPerrorMessage(
"In %s: SoPlex returned status=%d (%s) while CPLEX claims obj=%.10f %s %.10f=obj.limit (%s) (checknum=%d)\n",
628 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
635 SCIPerrorMessage(
"In %s: SoPlex status=%d (%s) while CPLEX status=%d (%s) (checknum=%d)\n",
641 else if(
spxStatus == SPxSolver::OPTIMAL )
670 void savePreStrongbranchingBasis()
677 getBasis(_rowStat.get_ptr(), _colStat.get_ptr());
682 std::string s =
x.what();
689 assert(status() != SPxSolver::OPTIMAL);
698 void restorePreStrongbranchingBasis()
705 setBasis(_rowStat.get_ptr(), _colStat.get_ptr());
710 std::string s =
x.what();
720 assert(status() != SPxSolver::OPTIMAL);
725 void freePreStrongbranchingBasis()
732 bool preStrongbranchingBasisFreed()
const
734 return ((_rowStat.size() == 0 ) && (_colStat.size() == 0));
762#define COLS_PER_PACKET SCIP_DUALPACKETSIZE
764#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE
778 SCIP_Real conditionlimit;
779 SCIP_Bool checkcondition;
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'};
982const 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',
':',
' ',
1020 return (
void*) lpi->
spx;
1034#if (SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 3))
1036 lpi->
spx->setIntegralityInformation(ncols,
intInfo);
1039 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
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);
1144 (*lpi)->spx->~SPxSCIP();
1172 const SCIP_Real*
obj,
1173 const SCIP_Real* lb,
1174 const SCIP_Real* ub,
1177 const SCIP_Real* lhs,
1178 const SCIP_Real* rhs,
1183 const SCIP_Real* val
1189 for(
j = 0;
j < nnonz;
j++ )
1208 assert(lpi->
spx->preStrongbranchingBasisFreed());
1212 SPxSCIP* spx = lpi->
spx;
1223 for(
i = 0;
i < nrows; ++
i )
1225 spx->addRowsReal(rows);
1233 std::string s =
x.what();
1249 const SCIP_Real*
obj,
1250 const SCIP_Real* lb,
1251 const SCIP_Real* ub,
1256 const SCIP_Real* val
1274 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1280 int nrows = lpi->
spx->numRowsReal();
1281 for (
int j = 0;
j < nnonz; ++
j)
1289 SPxSCIP* spx = lpi->
spx;
1299 for(
i = 0;
i < ncols; ++
i )
1305 last = (
i == ncols-1 ? nnonz :
beg[
i+1]);
1310 spx->addColsReal(cols);
1315 std::string s =
x.what();
1342 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1368 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1370 ncols = lpi->
spx->numColsReal();
1373 for(
i = 0;
i < ncols; ++
i )
1385 const SCIP_Real* lhs,
1386 const SCIP_Real* rhs,
1391 const SCIP_Real* val
1406 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1412 int ncols = lpi->
spx->numColsReal();
1413 for (
int j = 0;
j < nnonz; ++
j)
1423 SPxSCIP* spx = lpi->
spx;
1431 for(
i = 0;
i < nrows; ++
i )
1437 last = (
i == nrows-1 ? nnonz :
beg[
i+1]);
1442 spx->addRowsReal(rows);
1447 std::string s =
x.what();
1474 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1499 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1501 nrows = lpi->
spx->numRowsReal();
1504 for(
i = 0;
i < nrows; ++
i )
1524 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1535 const SCIP_Real* lb,
1551 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1555 for(
i = 0;
i < ncols; ++
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));
1577 std::string s =
x.what();
1594 const SCIP_Real* lhs,
1595 const SCIP_Real* rhs
1612 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1616 for(
i = 0;
i < nrows; ++
i )
1619 lpi->
spx->changeRangeReal(
ind[
i], lhs[
i], rhs[
i]);
1626 std::string s =
x.what();
1655 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1675 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1687 const SCIP_Real*
obj
1701 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1705 for(
i = 0;
i < ncols; ++
i )
1714 std::string s =
x.what();
1746 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1749#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
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);
1767 else if( scaleval < 0.0 )
1768 rhs = -lpi->
spx->realParam(SoPlex::INFTY);
1769 if( scaleval < 0.0 )
1780 lpi->
spx->changeRowReal(row,
lprow);
1781 assert(lpi->
spx->lhsReal(row) <= lpi->
spx->rhsReal(row));
1786 std::string s =
x.what();
1821 assert( lpi->
spx->preStrongbranchingBasisFreed() );
1824#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
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 )
1850 SCIP_Real
oldlb = lb;
1859 lpi->
spx->changeColReal(col,
lpcol);
1860 assert(lpi->
spx->lowerReal(col) <= lpi->
spx->upperReal(col));
1865 std::string s =
x.what();
1901 *nrows = lpi->
spx->numRowsReal();
1918 *ncols = lpi->
spx->numColsReal();
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();
1990#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
1991 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
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 )
2040 val[*nnonz] =
cvec.value(
j);
2047 for(
j = 0;
j <
cvec.size(); ++
j )
2050 val[*nnonz] =
cvec.value(
j);
2056 for(
j = 0;
j <
cvec.size(); ++
j )
2059 val[*nnonz] =
cvec.value(
j);
2098#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
2099 if( lpi->
spx->boolParam(SoPlex::PERSISTENTSCALING) )
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 )
2147 val[*nnonz] =
rvec.value(
j);
2154 for(
j = 0;
j <
rvec.size(); ++
j )
2157 val[*nnonz] =
rvec.value(
j);
2163 for(
j = 0;
j <
rvec.size(); ++
j )
2166 val[*nnonz] =
rvec.value(
j);
2316 lhss[
i-firstrow] = lpi->
spx->lhsReal(
i);
2318 rhss[
i-firstrow] = lpi->
spx->rhsReal(
i);
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];
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
2386 if( lpi->
spx->getFromScratch() )
2390 lpi->
spx->clearBasis();
2395 std::string s =
x.what();
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());
2416 case SPxSolver::ABORT_TIME:
2417 case SPxSolver::ABORT_ITER:
2418 case SPxSolver::ABORT_VALUE:
2419 case SPxSolver::SINGULAR:
2420 case SPxSolver::REGULAR:
2421 case SPxSolver::UNKNOWN:
2422 case SPxSolver::OPTIMAL:
2423#if SOPLEX_APIVERSION >= 3
2424 case SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS:
2426 case SPxSolver::UNBOUNDED:
2427 case SPxSolver::INFEASIBLE:
2444 (
void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_PRIMAL);
2458 (
void) lpi->
spx->setIntParam(SoPlex::ALGORITHM, SoPlex::ALGORITHM_DUAL);
2485 assert( lpi->
spx->preStrongbranchingBasisFreed() );
2486 lpi->
spx->savePreStrongbranchingBasis();
2499 assert( ! lpi->
spx->preStrongbranchingBasisFreed() );
2500 lpi->
spx->restorePreStrongbranchingBasis();
2501 lpi->
spx->freePreStrongbranchingBasis();
2526 SPxSolver::Status status;
2550#ifndef STRONGBRANCH_RESTOREBASIS
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);
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
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();
2632#if SOPLEX_APIVERSION >= 3
2633 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
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();
2655 spx->changeUpperReal(col,
oldub);
2656 assert(spx->lowerReal(col) <= spx->upperReal(col));
2660 *
down = spx->getObjLimit();
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
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();
2731#if SOPLEX_APIVERSION >= 3
2732 repeatstrongbranching = ((status == SPxSolver::ABORT_CYCLING || status == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS
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());
2753 spx->changeLowerReal(col,
oldlb);
2754 assert(spx->lowerReal(col) <= spx->upperReal(col));
2758 *
up = spx->getObjLimit();
2773 SCIPdebugMessage(
"SCIPlpiStrongbranch() returned SoPlex status %d\n",
int(status));
2839 for (
int j = 0;
j < ncols; ++
j)
2913 for (
int j = 0;
j < ncols; ++
j)
2962 SCIP_Bool* primalfeasible,
2963 SCIP_Bool* dualfeasible
2990 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3005 return lpi->
spx->hasPrimalRay();
3018 assert(lpi->
spx->status() != SPxSolver::UNBOUNDED || lpi->
spx->basisStatus() == SPxBasis::UNBOUNDED);
3023 return lpi->
spx->status() == SPxSolver::UNBOUNDED;
3036 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3049 return lpi->
spx->basisStatus() == SPxBasis::OPTIMAL || lpi->
spx->basisStatus() == SPxBasis::PRIMAL;
3064 return (lpi->
spx->status() == SPxSolver::INFEASIBLE);
3079 return lpi->
spx->hasDualFarkas();
3092 return lpi->
spx->status() == SPxSolver::INFEASIBLE && lpi->
spx->basisStatus() == SPxBasis::DUAL;
3105 return (lpi->
spx->status() == SPxSolver::UNBOUNDED);
3118 return (lpi->
spx->basisStatus() == SPxBasis::OPTIMAL) || lpi->
spx->basisStatus() == SPxBasis::DUAL;
3130 assert((lpi->
spx->basisStatus() == SPxBasis::OPTIMAL)
3133 return (lpi->
spx->status() == SPxSolver::OPTIMAL);
3152 if( lpi->
spx->status() == SPxSolver::ERROR || lpi->
spx->status() == SPxSolver::SINGULAR )
3154#if SOPLEX_APIVERSION >= 3
3155 if( lpi->
spx->status() == SPxSolver::OPTIMAL_UNSCALED_VIOLATIONS )
3183 if( lpi->
spx->intParam(SoPlex::OBJSENSE) == SoPlex::OBJSENSE_MAXIMIZE )
3204 return (lpi->
spx->status() == SPxSolver::ABORT_VALUE);
3217 return (lpi->
spx->status() == SPxSolver::ABORT_ITER);
3230 return (lpi->
spx->status() == SPxSolver::ABORT_TIME);
3243 return static_cast<int>(lpi->
spx->status());
3258#if SOPLEX_APIVERSION >= 4
3259 *
success = lpi->
spx->ignoreUnscaledViolations();
3294 SCIP_Real* activity,
3310#if SOPLEX_APIVERSION > 10
3317 if( dualsol !=
NULL )
3319#if SOPLEX_APIVERSION > 10
3320 (
void)lpi->
spx->getDualReal(dualsol, lpi->
spx->numRowsReal());
3326 if( activity !=
NULL )
3328#if SOPLEX_APIVERSION > 10
3329 (
void)lpi->
spx->getSlacksReal(activity, lpi->
spx->numRowsReal());
3335 if( redcost !=
NULL )
3337#if SOPLEX_APIVERSION > 10
3338 (
void)lpi->
spx->getRedCostReal(redcost, lpi->
spx->numColsReal());
3348 std::string s =
x.what();
3375#if SOPLEX_APIVERSION > 10
3376 (
void)lpi->
spx->getPrimalRayReal(
ray, lpi->
spx->numColsReal());
3385 std::string s =
x.what();
3400 SCIP_Real* dualfarkas
3412#if SOPLEX_APIVERSION > 10
3413 (
void)lpi->
spx->getDualFarkasReal(dualfarkas, lpi->
spx->numRowsReal());
3422 std::string s =
x.what();
3446 *iterations = lpi->
spx->numIterations();
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:
3619 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3628 for(
i = 0;
i < nrows; ++
i )
3642 SCIPerrorMessage(
"slack variable has basis status ZERO (should not occur)\n");
3651 for(
i = 0;
i < ncols; ++
i )
3675 lpi->
spx->freePreStrongbranchingBasis();
3692 assert(lpi->
spx->preStrongbranchingBasisFreed());
3719 assert(lpi->
spx->preStrongbranchingBasisFreed());
3725 if( ! lpi->
spx->getBasisInverseRowReal(
r, coef, inds,
ninds) )
3754 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3757 if( ! lpi->
spx->getBasisInverseColReal(
c, coef, inds,
ninds) )
3789 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3792 nrows = lpi->
spx->numRowsReal();
3793 ncols = lpi->
spx->numColsReal();
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);
3855#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
3864 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3879#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 4)
3884 col = lpi->
spx->colVectorReal(
c);
3888 if( ! lpi->
spx->getBasisInverseTimesVecReal(col.get_ptr(), coef) )
3923 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3925 ncols = lpi->
spx->numColsReal();
3926 nrows = lpi->
spx->numRowsReal();
3941 (*lpistate)->ncols = ncols;
3942 (*lpistate)->nrows = nrows;
3968 assert( lpi->
spx->preStrongbranchingBasisFreed() );
3985 SCIP_Real
bnd = lpi->
spx->lowerReal(
i);
4022 lpi->
spx->clearBasis();
4027 std::string s =
x.what();
4033 assert( lpi->
spx->status() != SPxSolver::OPTIMAL );
4053 if ( *lpistate !=
NULL )
4080 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4099 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4131#if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201)
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) )
4166 assert(nrows == (*lpinorms)->nrows);
4167 assert(ncols == (*lpinorms)->ncols);
4186#if ((SOPLEX_VERSION == 201 && SOPLEX_SUBVERSION >= 3) || SOPLEX_VERSION > 201)
4192 if( lpinorms ==
NULL )
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)
4261 *
ival = lpi->
spx->getFromScratch();
4264 *
ival = lpi->
spx->getLpInfo();
4267 *
ival = lpi->
spx->intParam(SoPlex::ITERLIMIT);
4272 *
ival = lpi->
spx->intParam(SoPlex::SIMPLIFIER);
4282 else if(
scaleparam == SoPlex::SCALER_BIEQUI )
4284#if SOPLEX_VERSION > 221 || (SOPLEX_VERSION == 221 && SOPLEX_SUBVERSION >= 2)
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);
4336 lpi->
spx->setFromScratch(
bool(
ival));
4340 lpi->
spx->setLpInfo(
bool(
ival));
4347 (
void) lpi->
spx->setIntParam(SoPlex::ITERLIMIT,
ival);
4351#if SOPLEX_APIVERSION < 13
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);
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
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)
4413 (
void) lpi->
spx->setIntParam(SoPlex::SOLUTION_POLISHING,
ival);
4416#if SOPLEX_APIVERSION >= 1
4419 (
void) lpi->
spx->setIntParam(SoPlex::FACTOR_UPDATE_MAX,
ival);
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);
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);
4514 (
void) lpi->
spx->setRealParam(SoPlex::TIMELIMIT,
dval);
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);
4555 lpi->
spx->setInterrupt(interrupt);
4580 return lpi->
spx->realParam(SoPlex::INFTY);
4592 return (val >= lpi->
spx->realParam(SoPlex::INFTY));
4610 const char* filename
4615 f =
fopen(filename,
"r");
4636 assert( lpi->
spx->preStrongbranchingBasisFreed() );
4643 assert(lpi->
spx->intParam(SoPlex::READMODE) == SoPlex::READMODE_REAL);
4650 std::string s =
x.what();
4681 std::string s =
x.what();
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
packing single and dual bit values
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *, const SCIP_LPISTATE *lpistate)
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)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
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 SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
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)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
SCIP_Bool SCIPlpiHasPrimalSolve(void)
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 SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_Bool SCIPlpiHasBarrierSolve(void)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
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_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
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 SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, const int *cstat, const int *rstat)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
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 SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
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_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
const char * SCIPlpiGetSolverDesc(void)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_Bool SCIPlpiHasDualSolve(void)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
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 SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
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 SCIPlpiSolvePrimal(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_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *obj)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
SCIP_RETCODE SCIPlpiInterrupt(SCIP_LPI *lpi, SCIP_Bool interrupt)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
assert(minobj< SCIPgetCutoffbound(scip))
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)
interface methods for specific LP solvers
SCIP_DUALPACKET ROWPACKET
SCIP_DUALPACKET COLPACKET
static void setIntParam(SCIP_LPI *lpi, int const param, int const parval)
static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
static SCIP_Bool fileExists(const char *filename)
#define SOPLEX_TRY(messagehdlr, x)
static int rowpacketNum(int nrows)
static SCIP_RETCODE spxSolve(SCIP_LPI *lpi)
SCIP_DUALPACKET ROWPACKET
static SCIP_RETCODE ensureCstatMem(SCIP_LPI *lpi, int num)
static const char spxdesc[200]
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
SCIP_DUALPACKET COLPACKET
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)
static SCIP_RETCODE ensureRstatMem(SCIP_LPI *lpi, int num)
static int colpacketNum(int ncols)
#define CHECK_SOPLEX_PARAM(x)
#define SOPLEX_SUBVERSION
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
#define SOPLEX_TRY_ABORT(x)
static const char spxname[20]
static void invalidateSolution(SCIP_LPI *lpi)
#define BMSfreeMemory(ptr)
#define BMSfreeBlockMemory(mem, ptr)
#define BMSallocBlockMemory(mem, ptr)
#define BMSreallocMemoryArray(ptr, num)
#define BMSallocMemoryArray(ptr, num)
#define BMSallocMemoryCPP(size)
#define BMSallocBlockMemoryArray(mem, ptr, num)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
struct BMS_BlkMem BMS_BLKMEM
#define BMSfreeMemoryArrayNull(ptr)
#define BMSallocMemory(ptr)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
public methods for message output
SCIP_MESSAGEHDLR * messagehdlr
@ SCIP_PRICING_STEEPQSTART
@ SCIP_PRICING_LPIDEFAULT
enum SCIP_Pricing SCIP_PRICING
enum SCIP_LPParam SCIP_LPPARAM
@ SCIP_LPSOLQUALITY_EXACTCONDITION
@ SCIP_LPSOLQUALITY_ESTIMCONDITION
@ SCIP_LPPAR_CONDITIONLIMIT
@ SCIP_LPPAR_ROWREPSWITCH
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
enum SCIP_ObjSen SCIP_OBJSEN
enum SCIP_Retcode SCIP_RETCODE