41 #define snprintf _snprintf 44 #if ( GRB_VERSION_MAJOR < 6 || ( GRB_VERSION_MAJOR == 7 && GRB_VERSION_MINOR == 0 && GRB_VERSION_TECHNICAL < 2 ) ) 45 #error "The Gurobi intreface only works for Gurobi versions at least 7.0.2" 52 #define GRB_INFBOUND 1e+20 54 #define CHECK_ZERO(messagehdlr, x) do { int _restat_; \ 55 if( (_restat_ = (x)) != 0 ) \ 57 SCIPmessagePrintWarning((messagehdlr), "Gurobi error %d: %s\n", _restat_, GRBgeterrormsg(grbenv)); \ 58 return SCIP_LPERROR; \ 63 #define SVECTOR GRBsvec 67 #define SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4) 70 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 72 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 78 #define GRB_REFACTORMAXITERS 50 86 GRB_INT_PAR_SCALEFLAG,
88 GRB_INT_PAR_SIMPLEXPRICING,
89 GRB_INT_PAR_OUTPUTFLAG
97 GRB_DBL_PAR_FEASIBILITYTOL,
98 GRB_DBL_PAR_OPTIMALITYTOL,
100 GRB_DBL_PAR_TIMELIMIT,
101 GRB_DBL_PAR_ITERATIONLIMIT,
102 GRB_DBL_PAR_MARKOWITZTOL
210 assert(num <= lpi->sidechgsize);
233 assert(num <= lpi->valsize);
255 assert(num <= lpi->cstatsize);
277 assert(num <= lpi->rstatsize);
302 assert(num <= lpi->rngrowmapsize);
325 assert(num <= lpi->rngrowssize);
341 assert( lpi !=
NULL );
346 if ( success !=
NULL )
357 res = GRBgetintattrarray(lpi->
grbmodel, GRB_INT_ATTR_VBASIS, 0, ncols, lpi->
cstat);
358 if ( res == GRB_ERROR_DATA_NOT_AVAILABLE )
361 if ( success !=
NULL )
371 res = GRBgetintattrarray(lpi->
grbmodel, GRB_INT_ATTR_CBASIS, 0, nrows, lpi->
rstat);
372 if ( res == GRB_ERROR_DATA_NOT_AVAILABLE )
375 if ( success !=
NULL )
397 assert( lpi !=
NULL );
451 {0x00000000, 0x00000001, 0x00000002, 0x00000003},
452 {0x00000000, 0x00000004, 0x00000008, 0x0000000C},
453 {0x00000000, 0x00000010, 0x00000020, 0x00000030},
454 {0x00000000, 0x00000040, 0x00000080, 0x000000C0},
455 {0x00000000, 0x00000100, 0x00000200, 0x00000300},
456 {0x00000000, 0x00000400, 0x00000800, 0x00000C00},
457 {0x00000000, 0x00001000, 0x00002000, 0x00003000},
458 {0x00000000, 0x00004000, 0x00008000, 0x0000C000},
459 {0x00000000, 0x00010000, 0x00020000, 0x00030000},
460 {0x00000000, 0x00040000, 0x00080000, 0x000C0000},
461 {0x00000000, 0x00100000, 0x00200000, 0x00300000},
462 {0x00000000, 0x00400000, 0x00800000, 0x00C00000},
463 {0x00000000, 0x01000000, 0x02000000, 0x03000000},
464 {0x00000000, 0x04000000, 0x08000000, 0x0C000000},
465 {0x00000000, 0x10000000, 0x20000000, 0x30000000},
466 {0x00000000, 0x40000000, 0x80000000, 0xC0000000}
472 assert(inp !=
NULL || count == 0);
473 assert(out !=
NULL || count == 0);
478 nfull = count - rest;
489 assert(0 <= -inp[j] && -inp[j] <= 3);
493 mask[0][-inp[0]] | mask[1][-inp[1]] | mask[2][-inp[2]] | mask[3][-inp[3]]
494 | mask[4][-inp[4]] | mask[5][-inp[5]] | mask[6][-inp[6]]
495 | mask[7][-inp[7]] | mask[8][-inp[8]] | mask[9][-inp[9]]
496 | mask[10][-inp[10]] | mask[11][-inp[11]] | mask[12][-inp[12]]
497 | mask[13][-inp[13]] | mask[14][-inp[14]] | mask[15][-inp[15]];
507 for( i = 0; i < rest; i++ )
508 m |= mask[i][-inp[i]];
526 assert(inp !=
NULL || count == 0);
527 assert(out !=
NULL || count == 0);
532 nfull = count - rest;
541 *out++ = -(int)(m & 3);
543 *out++ = -(int)(m & 3);
545 *out++ = -(int)(m & 3);
547 *out++ = -(int)(m & 3);
549 *out++ = -(int)(m & 3);
551 *out++ = -(int)(m & 3);
553 *out++ = -(int)(m & 3);
555 *out++ = -(int)(m & 3);
557 *out++ = -(int)(m & 3);
559 *out++ = -(int)(m & 3);
561 *out++ = -(int)(m & 3);
563 *out++ = -(int)(m & 3);
565 *out++ = -(int)(m & 3);
567 *out++ = -(int)(m & 3);
569 *out++ = -(int)(m & 3);
571 *out++ = -(int)(m & 3);
581 for( i = 0; i < rest; i++ )
583 *out++ = -(int)(m & 3);
597 assert(lpistate !=
NULL);
613 assert(lpistate !=
NULL);
631 assert(lpistate !=
NULL);
632 assert(blkmem !=
NULL);
650 assert(blkmem !=
NULL);
651 assert(lpistate !=
NULL);
652 assert(*lpistate !=
NULL);
674 assert( lpi !=
NULL );
676 assert( grbparam !=
NULL );
721 assert( lpi !=
NULL );
723 assert( grbparam !=
NULL );
763 dest->intparval[i] = source->intparval[i];
765 dest->dblparval[i] = source->dblparval[i];
778 assert( lpi !=
NULL );
782 if( strcmp(
intparam[i], param) == 0 )
803 assert( lpi !=
NULL );
807 if( strcmp(
intparam[i], param) == 0 )
809 lpi->
grbparam.intparval[i] = parval;
828 if( strcmp(
dblparam[i], param) == 0 )
849 assert( lpi !=
NULL );
853 if( strcmp(
dblparam[i], param) == 0 )
855 lpi->
grbparam.dblparval[i] = parval;
890 assert(rngcount !=
NULL);
894 for( i = 0; i < nrows; ++i )
896 assert(lhs[i] <= rhs[i]);
898 if( lhs[i] == rhs[i] )
900 assert(-GRB_INFINITY < rhs[i] && rhs[i] < GRB_INFINITY);
907 assert(-GRB_INFINITY < rhs[i] && rhs[i] < GRB_INFINITY);
913 assert(-GRB_INFINITY < lhs[i] && lhs[i] < GRB_INFINITY);
914 lpi->
senarray[i] = GRB_GREATER_EQUAL;
920 assert(-GRB_INFINITY < lhs[i] && lhs[i] < GRB_INFINITY);
921 assert(-GRB_INFINITY < rhs[i] && rhs[i] < GRB_INFINITY);
944 nrows = lastrow-firstrow+1;
951 for (i = 0; i < nrows; ++i)
977 case GRB_GREATER_EQUAL:
987 assert(lhs[i] <= rhs[i]);
998 assert( lpi !=
NULL );
1046 for (i = 0; i < nrows; i++)
1051 assert(-1 <= rngrow && rngrow < lpi->nrngrows);
1054 assert(lpi->
rngrows[rngrow] == i);
1055 assert(lpi->
rngvals[rngrow] > 0.0);
1063 #define checkRangeInfo(lpi) 1079 for (i = 0; i < lpi->
nrngrows; i++)
1081 double coeff = -1.0;
1114 for (i = 0; i < lpi->
nrngrows; i++)
1157 assert( lpi !=
NULL );
1172 for (r = firstrow; r < nrows; r++)
1179 for (i = 0; i < rngcount; i++)
1185 row = firstrow + pos;
1221 GRBversion(&majorversion, &minorversion, &technical);
1222 sprintf(
grbname,
"Gurobi %d.%d.%d", majorversion, minorversion, technical);
1231 return "Linear Programming Solver developed by Gurobi Optimization (www.gurobi.com)";
1252 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1276 assert(
sizeof(
SCIP_Real) ==
sizeof(
double));
1277 assert(
sizeof(
SCIP_Bool) ==
sizeof(
int));
1278 assert(lpi !=
NULL);
1293 CHECK_ZERO( messagehdlr, GRBsetintparam(
grbenv, GRB_INT_PAR_OUTPUTFLAG, 0) );
1296 CHECK_ZERO( messagehdlr, GRBsetintparam(
grbenv, GRB_INT_PAR_INFUNBDINFO, 1) );
1305 (*lpi)->grbenv = GRBgetenv((*lpi)->grbmodel);
1306 (*lpi)->senarray =
NULL;
1307 (*lpi)->rhsarray =
NULL;
1308 (*lpi)->rngarray =
NULL;
1309 (*lpi)->rngidxarray =
NULL;
1310 (*lpi)->valarray =
NULL;
1311 (*lpi)->cstat =
NULL;
1312 (*lpi)->rstat =
NULL;
1313 (*lpi)->indarray =
NULL;
1314 (*lpi)->rngrowmap =
NULL;
1315 (*lpi)->rngrows =
NULL;
1316 (*lpi)->rngvals =
NULL;
1317 (*lpi)->sidechgsize = 0;
1318 (*lpi)->valsize = 0;
1319 (*lpi)->cstatsize = 0;
1320 (*lpi)->rstatsize = 0;
1321 (*lpi)->rngrowmapsize = 0;
1322 (*lpi)->nrngrows = 0;
1323 (*lpi)->rngrowssize = 0;
1324 (*lpi)->rngvarsadded =
FALSE;
1325 (*lpi)->iterations = 0;
1326 (*lpi)->solisbasic =
FALSE;
1327 (*lpi)->fromscratch =
FALSE;
1329 (*lpi)->messagehdlr = messagehdlr;
1361 assert(lpi !=
NULL);
1362 assert(*lpi !=
NULL);
1367 CHECK_ZERO( (*lpi)->messagehdlr, GRBfreemodel((*lpi)->grbmodel) );
1427 assert(lpi !=
NULL);
1432 SCIPdebugMessage(
"loading LP in column format into Gurobi: %d cols, %d rows\n", ncols, nrows);
1446 for( c = 0; c < ncols-1; ++c )
1448 cnt[c] = beg[c+1] - beg[c];
1449 assert(cnt[c] >= 0);
1451 cnt[ncols-1] = nnonz - beg[ncols-1];
1452 assert(cnt[ncols-1] >= 0);
1460 lpi->
senarray, lpi->
rhsarray, (
int*)beg, cnt, (
int*)ind, (
SCIP_Real*)val, (
SCIP_Real*)lb, (
SCIP_Real*)ub,
NULL, colnames, rownames) );
1477 assert(temp == ncols);
1480 assert(temp == nrows);
1483 assert(temp == nnonz);
1506 assert(lpi !=
NULL);
1511 assert(nnonz == 0 || beg != 0);
1512 assert(nnonz == 0 || ind != 0);
1513 assert(nnonz == 0 || val != 0);
1517 SCIPdebugMessage(
"adding %d columns with %d nonzeros to Gurobi\n", ncols, nnonz);
1529 for (j = 0; j < nnonz; ++j)
1530 assert( 0 <= ind[j] && ind[j] < nrows );
1565 ndelcols = lastcol-firstcol+1;
1567 assert(lpi !=
NULL);
1574 assert(0 <= firstcol && firstcol <= lastcol && lastcol < temp);
1578 SCIPdebugMessage(
"deleting %d columns from Gurobi\n", lastcol - firstcol + 1);
1584 for( j = firstcol; j <= lastcol; ++j )
1585 which[j - firstcol] = j;
1610 assert(lpi !=
NULL);
1622 for( j = 0; j < ncols; ++j )
1633 for( j = 0; j < ncols; ++j )
1667 assert(lpi !=
NULL);
1671 SCIPdebugMessage(
"adding %d rows with %d nonzeros to Gurobi\n", nrows, nnonz);
1683 for (j = 0; j < nnonz; ++j)
1684 assert( 0 <= ind[j] && ind[j] < ncols );
1692 if ( lpi->
nrngrows > 0 || rngcount > 0 )
1714 for (r = oldnrows; r < oldnrows+nrows; r++)
1734 ndelrows = lastrow-firstrow+1;
1736 assert(lpi !=
NULL);
1742 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
1752 for( i = firstrow; i <= lastrow; ++i )
1753 which[i - firstrow] = i;
1770 for (i = 0; i < lpi->
nrngrows; i++)
1772 if ( lpi->
rngrows[i] >= firstrow )
1780 if ( lpi->
rngrows[i] > lastrow )
1789 lpi->
rngrows[nrngrows] = oldrow - ndelrows;
1803 if ( nrngrows == 0 )
1809 for (i = firstrow; i < nrows; i++)
1835 assert(lpi !=
NULL);
1845 for( i = 0; i < nrows; ++i )
1855 for( i = 0; i < nrows; ++i )
1874 for (i = 0; i < lpi->
nrngrows; i++)
1877 int newrow = dstat[oldrow];
1881 lpi->
rngrows[nrngrows] = newrow;
1899 if ( nrngrows == 0 )
1904 for (i = 0; i < nrows; i++)
1906 int newrow = dstat[i];
1907 assert(newrow <= i);
1929 assert( lpi !=
NULL );
1960 assert(lpi !=
NULL);
1962 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1966 for (i = 0; i < ncols; ++i)
1972 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1977 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
2005 assert(lpi !=
NULL);
2015 assert( rngcount == 0 );
2024 if ( rngcount > 0 || lpi->
nrngrows > 0 )
2027 int nnewrngrows = 0;
2037 for (i = 0; i < nrows; i++)
2045 assert(-1 <= rngrowidx && rngrowidx < lpi->nrngrows);
2050 if ( rngrowidx >= 0 )
2075 if ( rngrowidx >= 0 )
2096 if ( nnewrngrows > 0 )
2104 for (i = 0; i < lpi->
nrngrows; i++)
2118 if ( nrngrows == 0 )
2136 assert(lpi !=
NULL);
2139 SCIPdebugMessage(
"changing coefficient row %d, column %d in Gurobi to %g\n", row, col, newval);
2155 assert(lpi !=
NULL);
2181 assert(lpi !=
NULL);
2206 assert(lpi !=
NULL);
2208 assert(scaleval != 0.0);
2210 SCIPdebugMessage(
"scaling row %d with factor %g in Gurobi\n", row, scaleval);
2221 for ( i = 0; i < nnonz; ++i )
2229 else if( scaleval < 0.0 )
2233 else if( scaleval < 0.0 )
2235 if( scaleval > 0.0 )
2266 assert(lpi !=
NULL);
2268 assert(scaleval != 0.0);
2270 SCIPdebugMessage(
"scaling column %d with factor %g in Gurobi\n", col, scaleval);
2284 for( i = 0; i < nnonz; ++i )
2294 if( lb > -GRB_INFINITY )
2296 else if( scaleval < 0.0 )
2298 if( ub < GRB_INFINITY )
2300 else if( scaleval < 0.0 )
2302 if( scaleval > 0.0 )
2334 assert(lpi !=
NULL);
2335 assert(nrows !=
NULL);
2350 assert(lpi !=
NULL);
2351 assert(ncols !=
NULL);
2370 assert(lpi !=
NULL);
2371 assert(nnonz !=
NULL);
2399 assert(lpi !=
NULL);
2405 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
2421 for (j = 0; j < lastcol-firstcol+1; j++)
2434 assert(beg !=
NULL);
2435 assert(ind !=
NULL);
2436 assert(val !=
NULL);
2443 assert(beg ==
NULL);
2444 assert(ind ==
NULL);
2445 assert(val ==
NULL);
2467 assert(lpi !=
NULL);
2474 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
2493 assert(beg !=
NULL);
2494 assert(ind !=
NULL);
2495 assert(val !=
NULL);
2508 for (i = firstrow; i <= lastrow; i++)
2517 int newnz = (i < lastrow ? beg[i+1]-1 : (*nnonz)-1);
2520 for (; i <= lastrow; i++)
2526 theend = (i < lastrow ? beg[i+1] : *nnonz);
2532 memmove(&ind[newnz], &ind[thebeg], (theend - thebeg) *
sizeof(*ind));
2533 memmove(&val[newnz], &val[thebeg], (theend - thebeg) *
sizeof(*val));
2535 newnz += theend - thebeg;
2537 assert(newnz < *nnonz);
2544 assert(beg ==
NULL);
2545 assert(ind ==
NULL);
2546 assert(val ==
NULL);
2559 int namestoragesize,
2574 int namestoragesize,
2590 assert( lpi !=
NULL );
2592 assert( objsen !=
NULL );
2597 assert(grbobjsen == GRB_MINIMIZE || grbobjsen == GRB_MAXIMIZE);
2612 assert(lpi !=
NULL);
2614 assert(firstcol <= lastcol);
2615 assert(vals !=
NULL);
2617 SCIPdebugMessage(
"getting objective values %d to %d\n", firstcol, lastcol);
2633 assert(lpi !=
NULL);
2639 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
2667 assert(lpi !=
NULL);
2669 assert(firstrow <= lastrow);
2693 assert(lpi !=
NULL);
2726 assert( lpi !=
NULL );
2735 SCIPdebugMessage(
"calling Gurobi primal simplex: %d cols, %d rows\n", ncols, nrows);
2758 retval = GRBoptimize(lpi->
grbmodel);
2763 case GRB_ERROR_OUT_OF_MEMORY:
2775 SCIPdebugMessage(
"Gurobi primal simplex needed %d iterations to gain LP status %d\n", (
int) cnt, lpi->
solstat);
2784 if( presolve != GRB_PRESOLVE_OFF )
2786 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi primal simplex again without presolve\n");
2791 retval = GRBoptimize(lpi->
grbmodel);
2796 case GRB_ERROR_OUT_OF_MEMORY:
2811 if( lpi->
solstat == GRB_INF_OR_UNBD )
2814 SCIPerrorMessage(
"Gurobi primal simplex returned GRB_INF_OR_UNBD after presolving was turned off\n");
2831 int oldprimdual = 0;
2832 int oldpresolve = GRB_PRESOLVE_OFF;
2837 assert( lpi !=
NULL );
2846 SCIPdebugMessage(
"calling Gurobi dual simplex: %d cols, %d rows\n", ncols, nrows);
2871 if ( itlim < GRB_INFINITY )
2875 if ( oldprimdual != 0 )
2883 if ( oldpresolve != GRB_PRESOLVE_OFF )
2889 retval = GRBoptimize(lpi->
grbmodel);
2894 case GRB_ERROR_OUT_OF_MEMORY:
2908 if( lpi->
solstat == GRB_INF_OR_UNBD )
2913 if( presolve != GRB_PRESOLVE_OFF )
2916 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi dual simplex again without presolve\n");
2922 retval = GRBoptimize(lpi->
grbmodel);
2927 case GRB_ERROR_OUT_OF_MEMORY:
2942 if( lpi->
solstat == GRB_INF_OR_UNBD )
2945 SCIPerrorMessage(
"Gurobi dual simplex returned GRB_INF_OR_UNBD after presolving was turned off.\n");
2952 if ( oldprimdual != 0 )
2956 if ( oldpresolve != GRB_PRESOLVE_OFF )
2973 assert( lpi !=
NULL );
2982 SCIPdebugMessage(
"calling Gurobi barrier: %d cols, %d rows\n", ncols, nrows);
3017 retval = GRBoptimize(lpi->
grbmodel);
3022 case GRB_ERROR_OUT_OF_MEMORY:
3036 if( lpi->
solstat == GRB_INF_OR_UNBD )
3041 if( presolve != GRB_PRESOLVE_OFF )
3044 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi barrier again without presolve\n");
3050 retval = GRBoptimize(lpi->
grbmodel);
3055 case GRB_ERROR_OUT_OF_MEMORY:
3070 if( lpi->
solstat == GRB_INF_OR_UNBD )
3073 SCIPerrorMessage(
"Gurobi dual simplex returned GRB_INF_OR_UNBD after presolving was turned off\n");
3125 assert( lpi !=
NULL );
3128 assert( down !=
NULL );
3129 assert( up !=
NULL );
3130 assert( downvalid !=
NULL );
3131 assert( upvalid !=
NULL );
3133 SCIPdebugMessage(
"performing strong branching on variable %d (%d iterations)\n", col, itlim);
3166 newub =
EPSCEIL(psol-1.0, 1e-06);
3167 if( newub >= oldlb - 0.5 )
3169 SCIPdebugMessage(
"strong branching down (%g) on x%d (%g) with %d iterations\n", newub, col, psol, itlim);
3200 assert( b == oldub );
3219 if( newlb <= oldub + 0.5 )
3221 SCIPdebugMessage(
"strong branching up (%g) on x%d (%g) with %d iterations\n", newlb, col, psol, itlim);
3252 assert( b == oldlb );
3322 assert( cols !=
NULL );
3323 assert( psols !=
NULL );
3324 assert( down !=
NULL );
3325 assert( up !=
NULL );
3326 assert( downvalid !=
NULL );
3327 assert( upvalid !=
NULL );
3328 assert( down !=
NULL );
3333 for( j = 0; j < ncols; ++j )
3336 SCIP_CALL(
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) );
3385 assert( iter !=
NULL );
3386 assert( cols !=
NULL );
3387 assert( psols !=
NULL );
3388 assert( down !=
NULL );
3389 assert( up !=
NULL );
3390 assert( downvalid !=
NULL );
3391 assert( upvalid !=
NULL );
3392 assert( down !=
NULL );
3397 for( j = 0; j < ncols; ++j )
3400 SCIP_CALL(
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) );
3424 assert(lpi !=
NULL);
3438 assert( lpi !=
NULL );
3447 if( primalfeasible !=
NULL )
3450 if( dualfeasible !=
NULL )
3463 assert(lpi !=
NULL);
3467 return (lpi->
solstat == GRB_UNBOUNDED);
3480 assert( lpi !=
NULL );
3485 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3492 return (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL);
3503 assert( lpi !=
NULL );
3508 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3515 return (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL);
3523 assert(lpi !=
NULL);
3529 assert( lpi->
solstat != GRB_INF_OR_UNBD );
3530 return (lpi->
solstat == GRB_INFEASIBLE);
3541 assert( lpi !=
NULL );
3548 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3555 return (lpi->
solstat == GRB_OPTIMAL || (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL));
3565 assert(lpi !=
NULL);
3569 return (lpi->
solstat == GRB_INFEASIBLE);
3582 assert( lpi !=
NULL );
3587 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3594 return (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL);
3605 assert( lpi !=
NULL );
3612 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3619 return (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL);
3627 assert( lpi !=
NULL );
3633 return (lpi->
solstat == GRB_UNBOUNDED);
3644 assert( lpi !=
NULL );
3651 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3658 return (lpi->
solstat == GRB_OPTIMAL ||
3659 (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL) ||
3660 (lpi->
solstat == GRB_ITERATION_LIMIT && algo == GRB_METHOD_DUAL) );
3668 assert(lpi !=
NULL);
3672 return (lpi->
solstat == GRB_OPTIMAL);
3680 assert(lpi !=
NULL);
3686 return (lpi->
solstat != GRB_NUMERIC);
3694 assert(lpi !=
NULL);
3698 return (lpi->
solstat == GRB_CUTOFF);
3706 assert(lpi !=
NULL);
3710 return (lpi->
solstat == GRB_ITERATION_LIMIT);
3718 assert(lpi !=
NULL);
3722 return (lpi->
solstat == GRB_TIME_LIMIT);
3730 assert(lpi !=
NULL);
3742 assert(lpi !=
NULL);
3744 assert(success !=
NULL);
3761 double oval = GRB_INFINITY;
3762 double obnd = -GRB_INFINITY;
3765 assert(lpi !=
NULL);
3771 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJVAL, &oval);
3772 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJBOUND, &obnd);
3774 assert(lpi->
solstat != GRB_OPTIMAL || oval == obnd);
3795 assert(lpi !=
NULL);
3803 assert( ncols >= 0 && nrows >= 0 );
3805 if( objval !=
NULL )
3810 if( primsol !=
NULL )
3815 if( dualsol !=
NULL )
3820 if( activity !=
NULL )
3832 for( i = 0; i < nrows; ++i )
3843 activity[i] = lpi->
rhsarray[i] + solval;
3847 activity[i] = lpi->
rhsarray[i] - activity[i];
3850 case GRB_LESS_EQUAL:
3851 activity[i] = lpi->
rhsarray[i] - activity[i];
3853 case GRB_GREATER_EQUAL:
3854 activity[i] = lpi->
rhsarray[i] - activity[i];
3864 if( redcost !=
NULL )
3880 assert(lpi !=
NULL);
3885 assert( ncols >= 0 );
3902 assert(lpi !=
NULL);
3905 assert(dualfarkas !=
NULL);
3908 assert( nrows >= 0 );
3923 assert(lpi !=
NULL);
3925 assert(iterations !=
NULL);
3943 assert(lpi !=
NULL);
3944 assert(quality !=
NULL);
3973 assert(lpi !=
NULL);
3976 SCIPdebugMessage(
"saving Gurobi basis into %p/%p\n", (
void*) cstat, (
void*) rstat);
3987 for( i = 0; i < nrows; ++i )
4005 case GRB_NONBASIC_LOWER:
4009 case GRB_NONBASIC_UPPER:
4013 case GRB_SUPERBASIC:
4031 for( j = 0; j < ncols; ++j )
4039 case GRB_NONBASIC_LOWER:
4043 case GRB_NONBASIC_UPPER:
4046 case GRB_SUPERBASIC:
4074 assert(lpi !=
NULL);
4076 assert(cstat !=
NULL);
4077 assert(rstat !=
NULL);
4079 SCIPdebugMessage(
"loading basis %p/%p into Gurobi\n", (
void*) cstat, (
void*) rstat);
4089 for( i = 0; i < nrows; ++i )
4094 lpi->
rstat[i] = GRB_BASIC;
4098 lpi->
rstat[i] = GRB_NONBASIC_LOWER;
4102 lpi->
rstat[i] = GRB_NONBASIC_UPPER;
4106 lpi->
rstat[i] = GRB_SUPERBASIC;
4123 lpi->
rstat[i] = GRB_NONBASIC_LOWER;
4130 for( j = 0; j < ncols; ++j )
4135 lpi->
cstat[j] = GRB_BASIC;
4139 lpi->
cstat[j] = GRB_NONBASIC_LOWER;
4143 lpi->
cstat[j] = GRB_NONBASIC_UPPER;
4147 lpi->
cstat[j] = GRB_SUPERBASIC;
4158 assert(nrngsfound == lpi->
nrngrows);
4180 assert(lpi !=
NULL);
4187 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4202 for (i = 0; i < nrows; ++i)
4205 if ( bhead[i] < ncols )
4207 else if ( bhead[i] < ngrbcols )
4210 int rngrow = bhead[i]-ncols;
4211 assert(rngrow < lpi->nrngrows);
4215 bind[i] = -1 - lpi->
rngrows[rngrow];
4220 bind[i] = -1 - (bhead[i] - ngrbcols);
4254 assert(lpi !=
NULL);
4261 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4284 assert( x.len <= nrows );
4287 if ( ninds !=
NULL && inds !=
NULL )
4292 for (i = 0; i < x.len; ++i)
4296 coef[idx] = (x.val)[i];
4304 for (i = 0; i < nrows; ++i)
4306 assert( k <= x.len );
4307 if ( k < x.len && (x.ind)[k] == i )
4308 coef[i] = (x.val)[k++];
4351 assert(lpi !=
NULL);
4358 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4381 assert( x.len <= nrows );
4384 if ( ninds !=
NULL && inds !=
NULL )
4389 for (i = 0; i < x.len; ++i)
4393 coef[idx] = (x.val)[i];
4401 for (i = 0; i < nrows; ++i)
4403 assert( k <= x.len );
4404 if ( k < x.len && (x.ind)[k] == i )
4405 coef[i] = (x.val)[k++];
4444 assert(lpi !=
NULL);
4451 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4467 assert( x.len <= ngrbcols + nrows );
4472 for (k = 0; k < x.len; k++)
4475 assert(0 <= j && j < ngrbcols);
4478 SCIPerrorMessage(
"range variable in basis inverse row: not yet implemented\n");
4485 if ( ninds !=
NULL && inds !=
NULL )
4490 for (j = 0; j < x.len; ++j)
4494 coef[idx] = (x.val)[j];
4501 for (j = 0; j < ncols; ++j)
4503 assert( k <= x.len );
4504 if ( k < x.len && (x.ind)[k] == j )
4505 coef[j] = (x.val)[k++];
4541 assert(lpi !=
NULL);
4548 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4562 assert( x.len <= nrows );
4565 if ( ninds !=
NULL && inds !=
NULL )
4570 for (j = 0; j < x.len; ++j)
4574 coef[idx] = (x.val)[j];
4581 for (j = 0; j < nrows; ++j)
4583 assert( k <= x.len );
4584 if ( k < x.len && (x.ind)[k] == j )
4585 coef[j] = (x.val)[k++];
4621 assert(blkmem !=
NULL);
4622 assert(lpi !=
NULL);
4624 assert(lpistate !=
NULL);
4645 (*lpistate)->ncols = ncols;
4646 (*lpistate)->nrows = nrows;
4647 (*lpistate)->nrngrows = lpi->
nrngrows;
4649 SCIPdebugMessage(
"stored Gurobi LPI state in %p (%d cols, %d rows, %d ranged rows)\n",
4650 (
void*) *lpistate, ncols, nrows, lpi->
nrngrows);
4661 (*lpistate)->ncols = ncols;
4662 (*lpistate)->nrows = nrows;
4663 (*lpistate)->nrngrows = lpi->
nrngrows;
4664 (*lpistate)->packrstat =
NULL;
4665 (*lpistate)->packcstat =
NULL;
4684 assert(blkmem !=
NULL);
4685 assert(lpi !=
NULL);
4694 assert(lpistate->
ncols <= ncols);
4695 assert(lpistate->
nrows <= nrows);
4698 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",
4699 (
void*) lpistate, lpistate->
ncols, lpistate->nrows, lpistate->nrngrows, ncols, nrows, lpi->
nrngrows);
4701 if( lpistate->ncols == 0 || lpistate->nrows == 0 )
4711 if ( lpistate->nrngrows > 0 && lpistate->ncols < ncols )
4714 memmove(&lpi->
cstat[ncols], &lpi->
cstat[lpistate->ncols], lpistate->nrngrows *
sizeof(*lpi->
cstat));
4718 for( i = lpistate->ncols; i < ncols; ++i )
4734 for( i = lpistate->nrngrows; i < lpi->nrngrows; ++i )
4736 for( i = lpistate->nrows; i < nrows; ++i )
4750 assert(lpi !=
NULL);
4764 assert(lpi !=
NULL);
4765 assert(lpistate !=
NULL);
4767 if( *lpistate !=
NULL )
4790 assert(lpi !=
NULL);
4797 if ( l > 4 && fname[l-4] ==
'.' && fname[l-3] ==
'b' && fname[l-2] ==
'a' && fname[l-1] ==
's' )
4803 SCIPerrorMessage(
"To read a basis with gurobi, the extension has to be '.bas'.\n");
4818 assert(lpi !=
NULL);
4825 if ( l > 4 && fname[l-4] ==
'.' && fname[l-3] ==
'b' && fname[l-2] ==
'a' && fname[l-1] ==
's' )
4869 assert(blkmem !=
NULL);
4870 assert(lpi !=
NULL);
4871 assert(lpinorms !=
NULL);
4895 (*lpinorms)->ncols = ncols;
4896 (*lpinorms)->nrows = nrows;
4916 assert(blkmem !=
NULL);
4917 assert(lpi !=
NULL);
4920 if( lpinorms ==
NULL )
4924 error = GRBsetdblattrarray(lpi->
grbmodel, GRB_DBL_ATTR_VDUALNORM, 0, lpinorms->
ncols, lpinorms->
colnorm);
4938 error = GRBsetdblattrarray(lpi->
grbmodel, GRB_DBL_ATTR_CDUALNORM, 0, lpinorms->
nrows, lpinorms->
rownorm);
4962 assert(lpi !=
NULL);
4963 assert(lpinorms !=
NULL);
4965 if ( *lpinorms !=
NULL )
4997 assert(lpi !=
NULL);
4999 assert(ival !=
NULL);
5013 assert(temp >= 0 && temp <= 2);
5018 assert( temp == GRB_PRESOLVE_AUTO || temp == GRB_PRESOLVE_OFF || temp == GRB_PRESOLVE_CONSERVATIVE || temp == GRB_PRESOLVE_AGGRESSIVE );
5019 *ival = (temp == GRB_PRESOLVE_OFF) ?
FALSE :
TRUE;
5026 assert( temp == 0 || temp == 1 );
5031 assert( dtemp >= 0.0 );
5032 if( dtemp >= INT_MAX )
5035 *ival = (int) dtemp;
5051 assert(lpi !=
NULL);
5066 assert(ival >= 0 && ival <= 2);
5114 itlim = (ival >= INT_MAX ? GRB_INFINITY : ival);
5134 assert(lpi !=
NULL);
5136 assert(dval !=
NULL);
5152 if( objsen == GRB_MAXIMIZE )
5159 if( objsen == GRB_MINIMIZE )
5186 assert(lpi !=
NULL);
5203 if( objsen == GRB_MAXIMIZE )
5210 if( objsen == GRB_MINIMIZE )
5247 return GRB_INFINITY;
5256 return (val >= GRB_INFINITY);
5277 assert(lpi !=
NULL);
5293 assert(lpi !=
NULL);
static SCIP_RETCODE setParameterValues(SCIP_LPI *lpi, GRBPARAM *grbparam)
static SCIP_RETCODE restoreLPData(SCIP_LPI *lpi)
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)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
static SCIP_RETCODE addRangeVars(SCIP_LPI *lpi)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
static SCIP_RETCODE getDblParam(SCIP_LPI *lpi, const char *param, double *p)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_DUALPACKET COLPACKET
#define BMSfreeMemoryArrayNull(ptr)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetCols(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lb, SCIP_Real *ub, int *nnonz, int *beg, int *ind, SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
double dblparval[NUMDBLPARAM]
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
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)
static const char * dblparam[NUMDBLPARAM]
static SCIP_RETCODE getBase(SCIP_LPI *lpi, SCIP_Bool *success)
enum SCIP_ObjSen SCIP_OBJSEN
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
static SCIP_RETCODE ensureRngrowmapMem(SCIP_LPI *lpi, int num)
interface methods for specific LP solvers
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
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)
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
enum SCIP_LPParam SCIP_LPPARAM
static SCIP_RETCODE setDblParam(SCIP_LPI *lpi, const char *param, double parval)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
#define BMSallocMemoryArray(ptr, num)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
#define BMSfreeMemory(ptr)
enum SCIP_Pricing SCIP_PRICING
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
#define GRB_REFACTORMAXITERS
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
static SCIP_RETCODE delRangeVars(SCIP_LPI *lpi)
static SCIP_RETCODE setIntParam(SCIP_LPI *lpi, const char *param, int parval)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
static const char * intparam[NUMINTPARAM]
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)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
#define SCIP_DUALPACKETSIZE
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
static SCIP_RETCODE getIntParam(SCIP_LPI *lpi, const char *param, int *p)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
#define BMSfreeMemoryArray(ptr)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
static SCIP_RETCODE ensureCstatMem(SCIP_LPI *lpi, int num)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible)
static void checkRangeInfo(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_DUALPACKET ROWPACKET
static SCIP_RETCODE reconvertSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs)
static SCIP_RETCODE convertSides(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, int *rngcount)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
static unsigned char warnedbeta
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
static SCIP_RETCODE ensureRstatMem(SCIP_LPI *lpi, int num)
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
#define BMSfreeBlockMemory(mem, ptr)
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
static void SCIPencodeDualBitNeg(const int *inp, SCIP_DUALPACKET *out, int count)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
static SCIP_RETCODE checkParameterValues(SCIP_LPI *lpi)
static SCIP_RETCODE setBase(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
#define BMSallocBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, const int *cstat, const int *rstat)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
const char * SCIPlpiGetSolverDesc(void)
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
static SCIP_RETCODE addRangeInfo(SCIP_LPI *lpi, int rngcount, int firstrow)
static SCIP_RETCODE ensureValMem(SCIP_LPI *lpi, int num)
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_Real SCIPlpiInfinity(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)
#define SCIP_CALL_QUIET(x)
methods for sorting joint arrays of various types
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
SCIP_DUALPACKET ROWPACKET
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
#define SCIP_DEFAULT_INFINITY
static SCIP_RETCODE getParameterValues(SCIP_LPI *lpi, GRBPARAM *grbparam)
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)
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
static int colpacketNum(int ncols)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
static const double dblparammin[NUMDBLPARAM]
static void copyParameterValues(GRBPARAM *dest, const GRBPARAM *source)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows, int nrngrows)
public methods for message output
static int rowpacketNum(int nrows)
static void clearRangeInfo(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPISTATE *lpistate)
#define BMSallocMemory(ptr)
#define BMSreallocMemoryArray(ptr, num)
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
int intparval[NUMINTPARAM]
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_MESSAGEHDLR * messagehdlr
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
static SCIP_RETCODE ensureSidechgMem(SCIP_LPI *lpi, int num)
static SCIP_RETCODE ensureRngrowsMem(SCIP_LPI *lpi, int num)
#define BMSallocBlockMemory(mem, ptr)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
struct BMS_BlkMem BMS_BLKMEM
#define CHECK_ZERO(messagehdlr, x)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
#define SCIP_CALL_ABORT(x)
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 SCIPlpiGetRows(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs, int *nnonz, int *beg, int *ind, SCIP_Real *val)
static void SCIPdecodeDualBitNeg(const SCIP_DUALPACKET *inp, int *out, int count)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *obj)
static void invalidateSolution(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
void SCIPsortIntReal(int *intarray, SCIP_Real *realarray, int len)