46#include "tinycthread/tinycthread.h"
49#define snprintf _snprintf
52#if ( GRB_VERSION_MAJOR < 6 || ( GRB_VERSION_MAJOR == 7 && GRB_VERSION_MINOR == 0 && GRB_VERSION_TECHNICAL < 2 ) )
53#error "The Gurobi interface only works for Gurobi versions at least 7.0.2"
57 #if defined(_Thread_local)
60 static _Thread_local
int numlp = 0;
71#define CHECK_ZERO(messagehdlr, x) do { int _restat_; \
72 if( (_restat_ = (x)) != 0 ) \
74 SCIPmessagePrintWarning((messagehdlr), "Gurobi error %d: %s\n", _restat_, GRBgeterrormsg(lpi->grbenv)); \
75 return SCIP_LPERROR; \
80#define CHECK_ZERO_STAR(messagehdlr, x) do { int _restat_; \
81 if( (_restat_ = (x)) != 0 ) \
83 SCIPmessagePrintWarning((messagehdlr), "Gurobi error %d: %s\n", _restat_, GRBgeterrormsg((*lpi)->grbenv)); \
84 return SCIP_LPERROR; \
89#define SVECTOR GRBsvec
93#define SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4)
96#define COLS_PER_PACKET SCIP_DUALPACKETSIZE
98#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE
104#define GRB_REFACTORMAXITERS 50
112 GRB_INT_PAR_SCALEFLAG,
113 GRB_INT_PAR_PRESOLVE,
114 GRB_INT_PAR_SIMPLEXPRICING,
115 GRB_INT_PAR_OUTPUTFLAG,
125 GRB_DBL_PAR_FEASIBILITYTOL,
126 GRB_DBL_PAR_OPTIMALITYTOL,
127 GRB_DBL_PAR_BARCONVTOL,
129 GRB_DBL_PAR_TIMELIMIT,
130 GRB_DBL_PAR_ITERATIONLIMIT,
131 GRB_DBL_PAR_MARKOWITZTOL
242 assert(num <= lpi->sidechgsize);
265 assert(num <= lpi->valsize);
287 assert(num <= lpi->cstatsize);
309 assert(num <= lpi->rstatsize);
334 assert(num <= lpi->rngrowmapsize);
357 assert(num <= lpi->rngrowssize);
378 if ( success !=
NULL )
389 res = GRBgetintattrarray(lpi->
grbmodel, GRB_INT_ATTR_VBASIS, 0, ncols, lpi->
cstat);
390 if ( res == GRB_ERROR_DATA_NOT_AVAILABLE )
393 if ( success !=
NULL )
403 res = GRBgetintattrarray(lpi->
grbmodel, GRB_INT_ATTR_CBASIS, 0, nrows, lpi->
rstat);
404 if ( res == GRB_ERROR_DATA_NOT_AVAILABLE )
407 if ( success !=
NULL )
483 {0x00000000, 0x00000001, 0x00000002, 0x00000003},
484 {0x00000000, 0x00000004, 0x00000008, 0x0000000C},
485 {0x00000000, 0x00000010, 0x00000020, 0x00000030},
486 {0x00000000, 0x00000040, 0x00000080, 0x000000C0},
487 {0x00000000, 0x00000100, 0x00000200, 0x00000300},
488 {0x00000000, 0x00000400, 0x00000800, 0x00000C00},
489 {0x00000000, 0x00001000, 0x00002000, 0x00003000},
490 {0x00000000, 0x00004000, 0x00008000, 0x0000C000},
491 {0x00000000, 0x00010000, 0x00020000, 0x00030000},
492 {0x00000000, 0x00040000, 0x00080000, 0x000C0000},
493 {0x00000000, 0x00100000, 0x00200000, 0x00300000},
494 {0x00000000, 0x00400000, 0x00800000, 0x00C00000},
495 {0x00000000, 0x01000000, 0x02000000, 0x03000000},
496 {0x00000000, 0x04000000, 0x08000000, 0x0C000000},
497 {0x00000000, 0x10000000, 0x20000000, 0x30000000},
498 {0x00000000, 0x40000000, 0x80000000, 0xC0000000}
510 nfull = count - rest;
521 assert(0 <= -inp[j] && -inp[j] <= 3);
525 mask[0][-inp[0]] | mask[1][-inp[1]] | mask[2][-inp[2]] | mask[3][-inp[3]]
526 | mask[4][-inp[4]] | mask[5][-inp[5]] | mask[6][-inp[6]]
527 | mask[7][-inp[7]] | mask[8][-inp[8]] | mask[9][-inp[9]]
528 | mask[10][-inp[10]] | mask[11][-inp[11]] | mask[12][-inp[12]]
529 | mask[13][-inp[13]] | mask[14][-inp[14]] | mask[15][-inp[15]];
539 for(
i = 0;
i < rest;
i++ )
540 m |= mask[
i][-inp[
i]];
564 nfull = count - rest;
573 *out++ = -(int)(m & 3);
575 *out++ = -(int)(m & 3);
577 *out++ = -(int)(m & 3);
579 *out++ = -(int)(m & 3);
581 *out++ = -(int)(m & 3);
583 *out++ = -(int)(m & 3);
585 *out++ = -(int)(m & 3);
587 *out++ = -(int)(m & 3);
589 *out++ = -(int)(m & 3);
591 *out++ = -(int)(m & 3);
593 *out++ = -(int)(m & 3);
595 *out++ = -(int)(m & 3);
597 *out++ = -(int)(m & 3);
599 *out++ = -(int)(m & 3);
601 *out++ = -(int)(m & 3);
603 *out++ = -(int)(m & 3);
613 for(
i = 0;
i < rest;
i++ )
615 *out++ = -(int)(m & 3);
795 dest->intparval[
i] = source->intparval[
i];
797 dest->dblparval[
i] = source->dblparval[
i];
915 const SCIP_Real* lhs,
916 const SCIP_Real* rhs,
930 for(
i = 0;
i < nrows; ++
i )
934 if( lhs[
i] == rhs[
i] )
936 assert(-GRB_INFINITY < rhs[
i] && rhs[
i] < GRB_INFINITY);
941 else if( lhs[
i] <= -GRB_INFINITY )
944 assert(-GRB_INFINITY < rhs[
i]);
948 else if( rhs[
i] >= GRB_INFINITY )
950 assert(-GRB_INFINITY < lhs[
i] && lhs[
i] < GRB_INFINITY);
957 assert(-GRB_INFINITY < lhs[
i] && lhs[
i] < GRB_INFINITY);
958 assert(-GRB_INFINITY < rhs[
i] && rhs[
i] < GRB_INFINITY);
981 nrows = lastrow-firstrow+1;
986 for (
i = 0;
i < nrows; ++
i)
1007 case GRB_LESS_EQUAL:
1009 lhs[
i] = -GRB_INFINITY;
1014 case GRB_GREATER_EQUAL:
1018 rhs[
i] = GRB_INFINITY;
1085 for (
i = 0;
i < nrows;
i++)
1090 assert(-1 <= rngrow && rngrow < lpi->nrngrows);
1102#define checkRangeInfo(lpi)
1120 double coeff = -1.0;
1211 for (
r = firstrow;
r < nrows;
r++)
1218 for (
i = 0;
i < rngcount;
i++)
1224 row = firstrow + pos;
1246static const char grbname[] = {
'G',
'u',
'r',
'o',
'b',
'i',
' ',
1247#if GRB_VERSION_MAJOR < 10
1248 GRB_VERSION_MAJOR +
'0',
1250 (GRB_VERSION_MAJOR/10) +
'0', (GRB_VERSION_MAJOR%10) +
'0',
1252 '.', GRB_VERSION_MINOR +
'0',
'.', GRB_VERSION_TECHNICAL +
'0',
'\0'};
1270 return "Linear Programming Solver developed by Gurobi Optimization (www.gurobi.com)";
1295 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1343 assert(
sizeof(SCIP_Real) ==
sizeof(
double));
1344 assert(
sizeof(SCIP_Bool) ==
sizeof(
int));
1369#if GRB_VERSION_MAJOR >= 8
1373 SCIPmessagePrintWarning(messagehdlr,
"Gurobi error %d: Something went wrong with creating the environment.\n", restat);
1385 SCIPmessagePrintWarning(messagehdlr,
"Gurobi error %d: Something went wrong with creating the environment.\n", restat);
1401 (*lpi)->grbenv = GRBgetenv((*lpi)->grbmodel);
1404 (*lpi)->numlp = &
numlp;
1412#if GRB_VERSION_MAJOR >= 8
1416 CHECK_ZERO_STAR( messagehdlr, GRBsetintparam((*lpi)->grbenv, GRB_INT_PAR_OUTPUTFLAG, 0) );
1423 CHECK_ZERO_STAR( messagehdlr, GRBsetintparam((*lpi)->grbenv, GRB_INT_PAR_OUTPUTFLAG, 0) );
1427 CHECK_ZERO_STAR( messagehdlr, GRBsetintparam((*lpi)->grbenv, GRB_INT_PAR_INFUNBDINFO, 1) );
1435 (*lpi)->senarray =
NULL;
1436 (*lpi)->rhsarray =
NULL;
1437 (*lpi)->rngarray =
NULL;
1438 (*lpi)->rngidxarray =
NULL;
1439 (*lpi)->valarray =
NULL;
1440 (*lpi)->cstat =
NULL;
1441 (*lpi)->rstat =
NULL;
1442 (*lpi)->indarray =
NULL;
1443 (*lpi)->rngrowmap =
NULL;
1444 (*lpi)->rngrows =
NULL;
1445 (*lpi)->rngvals =
NULL;
1446 (*lpi)->sidechgsize = 0;
1447 (*lpi)->valsize = 0;
1448 (*lpi)->cstatsize = 0;
1449 (*lpi)->rstatsize = 0;
1450 (*lpi)->rngrowmapsize = 0;
1451 (*lpi)->nrngrows = 0;
1452 (*lpi)->rngrowssize = 0;
1453 (*lpi)->rngvarsadded =
FALSE;
1454 (*lpi)->iterations = 0;
1455 (*lpi)->solisbasic =
FALSE;
1456 (*lpi)->fromscratch =
FALSE;
1457 (*lpi)->conditionlimit = -1.0;
1458 (*lpi)->checkcondition =
FALSE;
1460 (*lpi)->messagehdlr = messagehdlr;
1491 CHECK_ZERO_STAR( (*lpi)->messagehdlr, GRBfreemodel((*lpi)->grbmodel) );
1509 assert(*(*lpi)->numlp > 0);
1512 if( *(*lpi)->numlp == 0 )
1515 GRBfreeenv(*(*lpi)->reusegrbenv);
1516 *(*lpi)->reusegrbenv =
NULL;
1520 GRBfreeenv((*lpi)->grbenv);
1545 const SCIP_Real*
obj,
1546 const SCIP_Real* lb,
1547 const SCIP_Real* ub,
1550 const SCIP_Real* lhs,
1551 const SCIP_Real* rhs,
1556 const SCIP_Real* val
1567 for( j = 0; j < nnonz; j++ )
1584 SCIPdebugMessage(
"loading LP in column format into Gurobi: %d cols, %d rows\n", ncols, nrows);
1598 for(
c = 0;
c < ncols-1; ++
c )
1600 cnt[
c] = beg[
c+1] - beg[
c];
1603 cnt[ncols-1] = nnonz - beg[ncols-1];
1604 assert(cnt[ncols-1] >= 0);
1608 lpi->
senarray, lpi->
rhsarray, (
int*)beg, cnt, (
int*)ind, (SCIP_Real*)val, (SCIP_Real*)lb, (SCIP_Real*)ub,
NULL, colnames, rownames) );
1645 const SCIP_Real*
obj,
1646 const SCIP_Real* lb,
1647 const SCIP_Real* ub,
1652 const SCIP_Real* val
1666 SCIPdebugMessage(
"adding %d columns with %d nonzeros to Gurobi\n", ncols, nnonz);
1678 for (j = 0; j < nnonz; ++j)
1680 assert( 0 <= ind[j] && ind[j] < nrows );
1695 (SCIP_Real*)
obj, (SCIP_Real*)lb, (SCIP_Real*)ub,
NULL, colnames) );
1714 ndelcols = lastcol-firstcol+1;
1723 assert(0 <= firstcol && firstcol <= lastcol && lastcol < temp);
1727 SCIPdebugMessage(
"deleting %d columns from Gurobi\n", lastcol - firstcol + 1);
1733 for( j = firstcol; j <= lastcol; ++j )
1734 which[j - firstcol] = j;
1772 for( j = 0; j < ncols; ++j )
1783 for( j = 0; j < ncols; ++j )
1805 const SCIP_Real* lhs,
1806 const SCIP_Real* rhs,
1811 const SCIP_Real* val
1826 SCIPdebugMessage(
"adding %d rows with %d nonzeros to Gurobi\n", nrows, nnonz);
1838 for (j = 0; j < nnonz; ++j) {
1839 assert( 0 <= ind[j] && ind[j] < ncols );
1849 if ( lpi->
nrngrows > 0 || rngcount > 0 )
1871 for (
r = oldnrows;
r < oldnrows+nrows;
r++)
1891 ndelrows = lastrow-firstrow+1;
1899 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
1909 for(
i = firstrow;
i <= lastrow; ++
i )
1910 which[
i - firstrow] =
i;
1946 lpi->
rngrows[nrngrows] = oldrow - ndelrows;
1960 if ( nrngrows == 0 )
1966 for (
i = firstrow;
i < nrows;
i++)
2002 for(
i = 0;
i < nrows; ++
i )
2012 for(
i = 0;
i < nrows; ++
i )
2034 int newrow = dstat[oldrow];
2038 lpi->
rngrows[nrngrows] = newrow;
2056 if ( nrngrows == 0 )
2061 for (
i = 0;
i < nrows;
i++)
2063 int newrow = dstat[
i];
2109#ifdef SCIP_DISABLED_CODE
2129 const SCIP_Real* lb,
2143 for (
i = 0;
i < ncols; ++
i)
2149 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[
i]);
2154 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[
i]);
2176 const SCIP_Real* lhs,
2177 const SCIP_Real* rhs
2203 if ( rngcount > 0 || lpi->
nrngrows > 0 )
2206 int nnewrngrows = 0;
2216 for (
i = 0;
i < nrows;
i++)
2224 assert(-1 <= rngrowidx && rngrowidx < lpi->nrngrows);
2229 if ( rngrowidx >= 0 )
2254 if ( rngrowidx >= 0 )
2275 if ( nnewrngrows > 0 )
2297 if ( nrngrows == 0 )
2318 SCIPdebugMessage(
"changing coefficient row %d, column %d in Gurobi to %g\n", row, col, newval);
2359 const SCIP_Real*
obj
2395 SCIPdebugMessage(
"scaling row %d with factor %g in Gurobi\n", row, scaleval);
2406 for (
i = 0;
i < nnonz; ++
i )
2412 if( lhs > -GRB_INFINITY )
2414 else if( scaleval < 0.0 )
2416 if( rhs < GRB_INFINITY )
2418 else if( scaleval < 0.0 )
2419 rhs = -GRB_INFINITY;
2420 if( scaleval > 0.0 )
2455 SCIPdebugMessage(
"scaling column %d with factor %g in Gurobi\n", col, scaleval);
2469 for(
i = 0;
i < nnonz; ++
i )
2479 if( lb > -GRB_INFINITY )
2481 else if( scaleval < 0.0 )
2483 if( ub < GRB_INFINITY )
2485 else if( scaleval < 0.0 )
2487 if( scaleval > 0.0 )
2596 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
2642 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
2674 for (
i = firstrow;
i <= lastrow;
i++)
2683 int newnz = (
i < lastrow ? beg[
i - firstrow +1]-1 : (*nnonz)-1);
2686 for (;
i <= lastrow;
i++)
2691 thebeg = beg[
i - firstrow];
2692 theend = (
i < lastrow ? beg[
i - firstrow +1] : *nnonz);
2698 assert( theend >= thebeg );
2699 memmove(&ind[newnz], &ind[thebeg], ((
size_t) (theend - thebeg)) *
sizeof(*ind));
2700 memmove(&val[newnz], &val[thebeg], ((
size_t) (theend - thebeg)) *
sizeof(*val));
2701 beg[
i - firstrow] = newnz;
2702 newnz += theend - thebeg;
2720 int namestoragesize,
2726 assert(colnames !=
NULL || namestoragesize == 0);
2727 assert(namestorage !=
NULL || namestoragesize == 0);
2728 assert(namestoragesize >= 0);
2730 assert(0 <= firstcol && firstcol <= lastcol);
2742 int namestoragesize,
2748 assert(rownames !=
NULL || namestoragesize == 0);
2749 assert(namestorage !=
NULL || namestoragesize == 0);
2750 assert(namestoragesize >= 0);
2752 assert(0 <= firstrow && firstrow <= lastrow);
2772 assert(grbobjsen == GRB_MINIMIZE || grbobjsen == GRB_MAXIMIZE);
2789 assert(firstcol <= lastcol);
2792 SCIPdebugMessage(
"getting objective values %d to %d\n", firstcol, lastcol);
2814 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
2844 assert(firstrow <= lastrow);
2911 SCIPdebugMessage(
"calling Gurobi primal simplex: %d cols, %d rows\n", ncols, nrows);
2919#if GRB_VERSION_MAJOR < 8
2938 retval = GRBoptimize(lpi->
grbmodel);
2943 case GRB_ERROR_OUT_OF_MEMORY:
2955 SCIPdebugMessage(
"Gurobi primal simplex needed %d iterations to gain LP status %d\n", (
int) cnt, lpi->
solstat);
2959 if( lpi->
solstat == GRB_INFEASIBLE )
2967 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi primal simplex again without presolve\n");
2972 retval = GRBoptimize(lpi->
grbmodel);
2977 case GRB_ERROR_OUT_OF_MEMORY:
2992 if( lpi->
solstat == GRB_INF_OR_UNBD )
2995 SCIPerrorMessage(
"Gurobi primal simplex returned GRB_INF_OR_UNBD after presolving was turned off\n");
2999 else if ( lpi->
solstat == GRB_UNBOUNDED )
3003 SCIP_Real* zeroobjcoefs;
3004 SCIP_Real* objcoefs;
3005 SCIP_Real oldobjcutoff;
3024 if ( grbobjsen == GRB_MINIMIZE )
3031 assert( grbobjsen == GRB_MAXIMIZE );
3056 case GRB_INF_OR_UNBD:
3057 case GRB_INFEASIBLE:
3058 lpi->
solstat = GRB_INFEASIBLE;
3068 case GRB_ITERATION_LIMIT:
3069 case GRB_TIME_LIMIT:
3093 int oldprimdual = 0;
3094 int oldpresolve = GRB_PRESOLVE_OFF;
3108 SCIPdebugMessage(
"calling Gurobi dual simplex: %d cols, %d rows\n", ncols, nrows);
3116#if GRB_VERSION_MAJOR < 8
3137 if ( itlim < GRB_INFINITY )
3141 if ( oldprimdual != 0 )
3149 if ( oldpresolve != GRB_PRESOLVE_OFF )
3155 retval = GRBoptimize(lpi->
grbmodel);
3160 case GRB_ERROR_OUT_OF_MEMORY:
3174 if( lpi->
solstat == GRB_INF_OR_UNBD )
3182 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi dual simplex again without presolve\n");
3188 retval = GRBoptimize(lpi->
grbmodel);
3193 case GRB_ERROR_OUT_OF_MEMORY:
3208 if( lpi->
solstat == GRB_INF_OR_UNBD )
3211 SCIPerrorMessage(
"Gurobi dual simplex returned GRB_INF_OR_UNBD after presolving was turned off.\n");
3219 if ( oldprimdual != 0 )
3223 if ( oldpresolve != GRB_PRESOLVE_OFF )
3249 SCIPdebugMessage(
"calling Gurobi barrier: %d cols, %d rows\n", ncols, nrows);
3257#if GRB_VERSION_MAJOR < 8
3288 retval = GRBoptimize(lpi->
grbmodel);
3293 case GRB_ERROR_OUT_OF_MEMORY:
3307 if( lpi->
solstat == GRB_INF_OR_UNBD )
3315 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi barrier again without presolve\n");
3321 retval = GRBoptimize(lpi->
grbmodel);
3326 case GRB_ERROR_OUT_OF_MEMORY:
3341 if( lpi->
solstat == GRB_INF_OR_UNBD )
3344 SCIPerrorMessage(
"Gurobi barrier returned GRB_INF_OR_UNBD after presolving was turned off\n");
3389 SCIP_Bool* downvalid,
3401 SCIP_Bool error =
FALSE;
3413 SCIPdebugMessage(
"performing strong branching on variable %d (%d iterations)\n", col, itlim);
3429#if GRB_VERSION_MAJOR < 8
3450 newub =
EPSCEIL(psol-1.0, 1e-06);
3451 if( newub >= oldlb - 0.5 )
3453 SCIPdebugMessage(
"strong branching down (%g) on x%d (%g) with %d iterations\n", newub, col, psol, itlim);
3503 if( newlb <= oldub + 0.5 )
3505 SCIPdebugMessage(
"strong branching up (%g) on x%d (%g) with %d iterations\n", newlb, col, psol, itlim);
3573 SCIP_Bool* downvalid,
3597 SCIP_Bool* downvalid,
3617 for( j = 0; j < ncols; ++j )
3620 SCIP_CALL(
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) );
3636 SCIP_Bool* downvalid,
3660 SCIP_Bool* downvalid,
3680 for( j = 0; j < ncols; ++j )
3683 SCIP_CALL(
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) );
3724 SCIP_Bool* primalfeasible,
3725 SCIP_Bool* dualfeasible
3754 return (lpi->
solstat == GRB_UNBOUNDED);
3772 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3779 return (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL);
3795 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3805 return (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL);
3820 return (lpi->
solstat == GRB_INFEASIBLE);
3838 if ( lpi->
solstat == GRB_OPTIMAL )
3841 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3847 if ( algo != GRB_METHOD_PRIMAL )
3850 if( lpi->
solstat == GRB_ITERATION_LIMIT )
3857 res = GRBgetdblparam(lpi->
grbenv, GRB_DBL_PAR_FEASIBILITYTOL, &
eps);
3863 res = GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_CONSTR_VIO, &consviol);
3869 res = GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_BOUND_VIO, &boundviol);
3876 if ( consviol <=
eps && boundviol <=
eps )
3894 return (lpi->
solstat == GRB_INFEASIBLE);
3912 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3919 return (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL);
3937 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3944 return (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL);
3958 return (lpi->
solstat == GRB_UNBOUNDED);
3976 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3983 return (lpi->
solstat == GRB_OPTIMAL ||
3984 (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL) ||
3985 (lpi->
solstat == GRB_ITERATION_LIMIT && algo == GRB_METHOD_DUAL) );
3997 return (lpi->
solstat == GRB_OPTIMAL);
4015 double optimalitytol;
4047 res = GRBgetdblparam(lpi->
grbenv, GRB_DBL_PAR_FEASIBILITYTOL, &feastol);
4053 res = GRBgetdblparam(lpi->
grbenv, GRB_DBL_PAR_OPTIMALITYTOL, &optimalitytol);
4061 res = GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_CONSTR_VIO, &consviol);
4067 res = GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_BOUND_VIO, &boundviol);
4073 res = GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_DUAL_VIO, &dualviol);
4080 return ( consviol <= feastol && boundviol <= feastol && dualviol <= optimalitytol );
4083 return (lpi->
solstat != GRB_NUMERIC);
4095 return (lpi->
solstat == GRB_CUTOFF);
4107 return (lpi->
solstat == GRB_ITERATION_LIMIT);
4119 return (lpi->
solstat == GRB_TIME_LIMIT);
4157 double oval = GRB_INFINITY;
4158 double obnd = -GRB_INFINITY;
4168 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJVAL, &oval);
4169 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJBOUND, &obnd);
4176 assert( ret == 0 || ret == GRB_ERROR_DATA_NOT_AVAILABLE );
4180 if( lpi->
solstat == GRB_ITERATION_LIMIT )
4182 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJBOUND,
objval);
4184 else if( lpi->
solstat == GRB_CUTOFF )
4192#ifdef SCIP_DISABLED_CODE
4225 SCIP_Real* activity,
4240 assert( ncols >= 0 && nrows >= 0 );
4252 if( dualsol !=
NULL )
4257 if( activity !=
NULL )
4269 for(
i = 0;
i < nrows; ++
i )
4287 case GRB_LESS_EQUAL:
4290 case GRB_GREATER_EQUAL:
4301 if( redcost !=
NULL )
4335 SCIP_Real* dualfarkas
4354 for (
i = 0;
i < nrows; ++
i)
4355 dualfarkas[
i] *= -1.0;
4393 SCIPdebugMessage(
"requesting solution quality from Gurobi: quality %d\n", qualityindicator);
4395 switch( qualityindicator )
4398 what = GRB_DBL_ATTR_KAPPA;
4402 what = GRB_DBL_ATTR_KAPPA_EXACT;
4410 ret = GRBgetdblattr(lpi->
grbmodel, what, quality);
4442 SCIPdebugMessage(
"saving Gurobi basis into %p/%p\n", (
void*) cstat, (
void*) rstat);
4456 for(
i = 0;
i < nrows; ++
i )
4473 case GRB_NONBASIC_LOWER:
4477 case GRB_NONBASIC_UPPER:
4482 case GRB_SUPERBASIC:
4498 case GRB_NONBASIC_LOWER:
4509 case GRB_NONBASIC_UPPER:
4510 case GRB_SUPERBASIC:
4526 for( j = 0; j < ncols; ++j )
4534 case GRB_NONBASIC_LOWER:
4538 case GRB_NONBASIC_UPPER:
4542 case GRB_SUPERBASIC:
4579 SCIPdebugMessage(
"loading basis %p/%p into Gurobi\n", (
void*) cstat, (
void*) rstat);
4586 for(
i = 0;
i < nrows; ++
i )
4596 lpi->
rstat[
i] = GRB_NONBASIC_LOWER;
4606 lpi->
rstat[
i] = GRB_BASIC;
4617 lpi->
rstat[
i] = GRB_NONBASIC_LOWER;
4626 assert( sense ==
'>' || sense ==
'=' );
4628 lpi->
rstat[
i] = GRB_NONBASIC_LOWER;
4641 for( j = 0; j < ncols; ++j )
4646 lpi->
cstat[j] = GRB_BASIC;
4650 lpi->
cstat[j] = GRB_NONBASIC_LOWER;
4654 lpi->
cstat[j] = GRB_NONBASIC_UPPER;
4658 lpi->
cstat[j] = GRB_SUPERBASIC;
4702 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4718 for (
i = 0;
i < nrows; ++
i)
4721 if ( bhead[
i] < ncols )
4723 else if ( bhead[
i] < ngrbcols )
4726 int rngrow = bhead[
i]-ncols;
4727 assert(rngrow < lpi->nrngrows);
4731 bind[
i] = -1 - lpi->
rngrows[rngrow];
4736 bind[
i] = -1 - (bhead[
i] - ngrbcols);
4776 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4794 val = (
x.ind)[
r] >= 0 ? 1.0 : -1.0;
4805 if ( ninds !=
NULL && inds !=
NULL )
4811 for (
i = 0;
i <
x.len; ++
i)
4814 assert( idx >= 0 && idx < nrows );
4816 coef[idx] = (
x.val)[
i];
4827 for (
i = 0;
i <
x.len; ++
i)
4830 assert( idx >= 0 && idx < nrows );
4831 coef[idx] = (
x.val)[
i];
4879 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4909 if ( ninds !=
NULL && inds !=
NULL )
4915 for (
i = 0;
i <
x.len; ++
i)
4918 assert( idx >= 0 && idx < nrows );
4920 coef[idx] = (
x.val)[
i];
4933 for (
i = 0;
i <
x.len; ++
i)
4936 assert( idx >= 0 && idx < nrows );
4937 coef[idx] = (
x.val)[
i];
4962 const SCIP_Real* binvrow,
4974 SCIP_Bool isslackvar;
4985 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
5003 isslackvar = ((
x.ind)[
r] < 0);
5009 assert(
x.len <= ngrbcols + nrows );
5012 if ( ninds !=
NULL && inds !=
NULL )
5023 for (j = 0; j <
x.len; ++j)
5026 assert( idx >= 0 && idx < ngrbcols+nrows );
5030 coef[idx] = (
x.val)[j];
5044 for (j = 0; j <
x.len; ++j)
5047 assert( idx >= 0 && idx < ngrbcols+nrows );
5050 coef[idx] = (
x.val)[j];
5094 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
5115 if ( ninds !=
NULL && inds !=
NULL )
5121 for (j = 0; j <
x.len; ++j)
5124 assert( idx >= 0 && idx < nrows );
5126 coef[idx] = (
x.val)[j];
5139 for (j = 0; j <
x.len; ++j)
5142 assert( idx >= 0 && idx < nrows );
5143 coef[idx] = (
x.val)[j];
5204 (*lpistate)->ncols = ncols;
5205 (*lpistate)->nrows = nrows;
5206 (*lpistate)->nrngrows = lpi->
nrngrows;
5208 SCIPdebugMessage(
"stored Gurobi LPI state in %p (%d cols, %d rows, %d ranged rows)\n",
5209 (
void*) *lpistate, ncols, nrows, lpi->
nrngrows);
5220 (*lpistate)->ncols = ncols;
5221 (*lpistate)->nrows = nrows;
5222 (*lpistate)->nrngrows = lpi->
nrngrows;
5223 (*lpistate)->packrstat =
NULL;
5224 (*lpistate)->packcstat =
NULL;
5257 SCIPdebugMessage(
"loading LPI state %p (%d cols, %d rows, %d ranged rows) into Gurobi LP with %d cols, %d rows, and %d ranged rows\n",
5260 if( lpistate->
ncols == 0 || lpistate->
nrows == 0 )
5277 for(
i = lpistate->
ncols;
i < ncols; ++
i )
5295 for(
i = lpistate->
nrows;
i < nrows; ++
i )
5312#if GRB_VERSION_MAJOR < 8
5332 if( *lpistate !=
NULL )
5364 if ( l > 4 && fname[l-4] ==
'.' && fname[l-3] ==
'b' && fname[l-2] ==
'a' && fname[l-1] ==
's' )
5370 SCIPerrorMessage(
"To read a basis with gurobi, the extension has to be '.bas'.\n");
5393 if ( l > 4 && fname[l-4] ==
'.' && fname[l-3] ==
'b' && fname[l-2] ==
'a' && fname[l-1] ==
's' )
5464 (*lpinorms)->ncols = ncols;
5465 (*lpinorms)->nrows = nrows;
5489 if( lpinorms ==
NULL )
5493 error = GRBsetdblattrarray(lpi->
grbmodel, GRB_DBL_ATTR_VDUALNORM, 0, lpinorms->
ncols, lpinorms->
colnorm);
5505 error = GRBsetdblattrarray(lpi->
grbmodel, GRB_DBL_ATTR_CDUALNORM, 0, lpinorms->
nrows, lpinorms->
rownorm);
5530 if ( *lpinorms !=
NULL )
5578 assert(temp >= -1 && temp <= 3);
5586 assert( temp == GRB_PRESOLVE_AUTO || temp == GRB_PRESOLVE_OFF || temp == GRB_PRESOLVE_CONSERVATIVE || temp == GRB_PRESOLVE_AGGRESSIVE );
5587 *ival = (temp == GRB_PRESOLVE_OFF) ?
FALSE :
TRUE;
5594 assert( temp == 0 || temp == 1 );
5600 if( dtemp >= INT_MAX )
5603 *ival = (int) dtemp;
5692 itlim = (ival >= INT_MAX ? GRB_INFINITY : ival);
5773 else if( dval > 1e-2 )
5783 else if( dval > 1e-2 )
5814 else if( dval > 0.999 )
5859 return GRB_INFINITY;
5869 return (val >= GRB_INFINITY);
unsigned int SCIP_DUALPACKET
#define SCIP_CALL_QUIET(x)
#define SCIP_CALL_ABORT(x)
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 *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 **rownames, 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)
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 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 **colnames, 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 **rownames, 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)
void SCIPsortIntReal(int *intarray, SCIP_Real *realarray, int len)
assert(minobj< SCIPgetCutoffbound(scip))
interface methods for specific LP solvers
SCIP_DUALPACKET ROWPACKET
SCIP_DUALPACKET COLPACKET
static void SCIPdecodeDualBitNeg(const SCIP_DUALPACKET *inp, int *out, int count)
static SCIP_RETCODE setBase(SCIP_LPI *lpi)
static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
static SCIP_RETCODE getDblParam(SCIP_LPI *lpi, const char *param, double *p)
static SCIP_RETCODE getBase(SCIP_LPI *lpi, SCIP_Bool *success)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
static int rowpacketNum(int nrows)
static SCIP_RETCODE reconvertSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs)
static SCIP_RETCODE addRangeVars(SCIP_LPI *lpi)
static void copyParameterValues(GRBPARAM *dest, const GRBPARAM *source)
static SCIP_RETCODE ensureCstatMem(SCIP_LPI *lpi, int num)
static GRBenv * reusegrbenv
static SCIP_RETCODE getIntParam(SCIP_LPI *lpi, const char *param, int *p)
static void checkRangeInfo(SCIP_LPI *lpi)
static SCIP_RETCODE ensureRngrowmapMem(SCIP_LPI *lpi, int num)
static SCIP_RETCODE convertSides(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, int *rngcount)
static SCIP_RETCODE delRangeVars(SCIP_LPI *lpi)
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
static SCIP_RETCODE restoreLPData(SCIP_LPI *lpi)
static void SCIPencodeDualBitNeg(const int *inp, SCIP_DUALPACKET *out, int count)
#define CHECK_ZERO(messagehdlr, x)
static const double dblparammin[NUMDBLPARAM]
#define SCIP_DUALPACKETSIZE
static SCIP_RETCODE ensureRstatMem(SCIP_LPI *lpi, int num)
static int colpacketNum(int ncols)
static SCIP_RETCODE ensureRngrowsMem(SCIP_LPI *lpi, int num)
static SCIP_RETCODE setParameterValues(SCIP_LPI *lpi, GRBPARAM *grbparam)
static SCIP_RETCODE ensureSidechgMem(SCIP_LPI *lpi, int num)
static const char * dblparam[NUMDBLPARAM]
static SCIP_RETCODE getParameterValues(SCIP_LPI *lpi, GRBPARAM *grbparam)
static void clearRangeInfo(SCIP_LPI *lpi)
static const char grbname[]
static SCIP_RETCODE addRangeInfo(SCIP_LPI *lpi, int rngcount, int firstrow)
static const char * intparam[NUMINTPARAM]
#define CHECK_ZERO_STAR(messagehdlr, x)
static SCIP_RETCODE setIntParam(SCIP_LPI *lpi, const char *param, int parval)
static SCIP_RETCODE checkParameterValues(SCIP_LPI *lpi)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows, int nrngrows)
static SCIP_RETCODE setDblParam(SCIP_LPI *lpi, const char *param, double parval)
static void invalidateSolution(SCIP_LPI *lpi)
#define GRB_REFACTORMAXITERS
static SCIP_RETCODE ensureValMem(SCIP_LPI *lpi, int num)
#define BMSfreeMemory(ptr)
#define BMSfreeBlockMemory(mem, ptr)
#define BMSallocBlockMemory(mem, ptr)
#define BMSreallocMemoryArray(ptr, num)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
#define BMSallocMemoryArray(ptr, num)
#define BMSfreeMemoryArray(ptr)
#define BMSallocBlockMemoryArray(mem, ptr, num)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
#define BMSclearMemoryArray(ptr, num)
#define BMSallocClearMemoryArray(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
methods for sorting joint arrays of various types
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool *vanished)
double dblparval[NUMDBLPARAM]
int intparval[NUMINTPARAM]
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_BARRIERCONVTOL
@ SCIP_LPPAR_CONDITIONLIMIT
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
enum SCIP_ObjSen SCIP_OBJSEN
enum SCIP_Retcode SCIP_RETCODE