40 #if ( GRB_VERSION_MAJOR < 6 || ( GRB_VERSION_MAJOR == 7 && GRB_VERSION_TECHNICAL < 2 ) ) 41 #error "The Gurobi intreface only works for Gurobi versions at least 7.0.2" 48 #define GRB_INFBOUND 1e+20 50 #define CHECK_ZERO(messagehdlr, x) do { int _restat_; \ 51 if( (_restat_ = (x)) != 0 ) \ 53 SCIPmessagePrintWarning((messagehdlr), "Gurobi error %d: %s\n", _restat_, GRBgeterrormsg(grbenv)); \ 54 return SCIP_LPERROR; \ 59 #define SVECTOR GRBsvec 63 #define SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4) 66 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 68 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 74 #define GRB_REFACTORMAXITERS 50 82 GRB_INT_PAR_SCALEFLAG,
84 GRB_INT_PAR_SIMPLEXPRICING,
85 GRB_INT_PAR_OUTPUTFLAG
93 GRB_DBL_PAR_FEASIBILITYTOL,
94 GRB_DBL_PAR_OPTIMALITYTOL,
96 GRB_DBL_PAR_TIMELIMIT,
97 GRB_DBL_PAR_ITERATIONLIMIT,
98 GRB_DBL_PAR_MARKOWITZTOL
206 assert(num <= lpi->sidechgsize);
229 assert(num <= lpi->valsize);
251 assert(num <= lpi->cstatsize);
273 assert(num <= lpi->rstatsize);
298 assert(num <= lpi->rngrowmapsize);
321 assert(num <= lpi->rngrowssize);
337 assert( lpi !=
NULL );
342 if ( success !=
NULL )
353 res = GRBgetintattrarray(lpi->
grbmodel, GRB_INT_ATTR_VBASIS, 0, ncols, lpi->
cstat);
354 if ( res == GRB_ERROR_DATA_NOT_AVAILABLE )
357 if ( success !=
NULL )
367 res = GRBgetintattrarray(lpi->
grbmodel, GRB_INT_ATTR_CBASIS, 0, nrows, lpi->
rstat);
368 if ( res == GRB_ERROR_DATA_NOT_AVAILABLE )
371 if ( success !=
NULL )
393 assert( lpi !=
NULL );
447 {0x00000000, 0x00000001, 0x00000002, 0x00000003},
448 {0x00000000, 0x00000004, 0x00000008, 0x0000000C},
449 {0x00000000, 0x00000010, 0x00000020, 0x00000030},
450 {0x00000000, 0x00000040, 0x00000080, 0x000000C0},
451 {0x00000000, 0x00000100, 0x00000200, 0x00000300},
452 {0x00000000, 0x00000400, 0x00000800, 0x00000C00},
453 {0x00000000, 0x00001000, 0x00002000, 0x00003000},
454 {0x00000000, 0x00004000, 0x00008000, 0x0000C000},
455 {0x00000000, 0x00010000, 0x00020000, 0x00030000},
456 {0x00000000, 0x00040000, 0x00080000, 0x000C0000},
457 {0x00000000, 0x00100000, 0x00200000, 0x00300000},
458 {0x00000000, 0x00400000, 0x00800000, 0x00C00000},
459 {0x00000000, 0x01000000, 0x02000000, 0x03000000},
460 {0x00000000, 0x04000000, 0x08000000, 0x0C000000},
461 {0x00000000, 0x10000000, 0x20000000, 0x30000000},
462 {0x00000000, 0x40000000, 0x80000000, 0xC0000000}
468 assert(inp !=
NULL || count == 0);
469 assert(out !=
NULL || count == 0);
474 nfull = count - rest;
485 assert(0 <= -inp[j] && -inp[j] <= 3);
489 mask[0][-inp[0]] | mask[1][-inp[1]] | mask[2][-inp[2]] | mask[3][-inp[3]]
490 | mask[4][-inp[4]] | mask[5][-inp[5]] | mask[6][-inp[6]]
491 | mask[7][-inp[7]] | mask[8][-inp[8]] | mask[9][-inp[9]]
492 | mask[10][-inp[10]] | mask[11][-inp[11]] | mask[12][-inp[12]]
493 | mask[13][-inp[13]] | mask[14][-inp[14]] | mask[15][-inp[15]];
503 for( i = 0; i < rest; i++ )
504 m |= mask[i][-inp[i]];
522 assert(inp !=
NULL || count == 0);
523 assert(out !=
NULL || count == 0);
528 nfull = count - rest;
537 *out++ = -(int)(m & 3);
539 *out++ = -(int)(m & 3);
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);
577 for( i = 0; i < rest; i++ )
579 *out++ = -(int)(m & 3);
593 assert(lpistate !=
NULL);
609 assert(lpistate !=
NULL);
627 assert(lpistate !=
NULL);
628 assert(blkmem !=
NULL);
646 assert(blkmem !=
NULL);
647 assert(lpistate !=
NULL);
648 assert(*lpistate !=
NULL);
670 assert( lpi !=
NULL );
672 assert( grbparam !=
NULL );
717 assert( lpi !=
NULL );
719 assert( grbparam !=
NULL );
759 dest->intparval[i] = source->intparval[i];
761 dest->dblparval[i] = source->dblparval[i];
774 assert( lpi !=
NULL );
778 if( strcmp(
intparam[i], param) == 0 )
799 assert( lpi !=
NULL );
803 if( strcmp(
intparam[i], param) == 0 )
805 lpi->
grbparam.intparval[i] = parval;
824 if( strcmp(
dblparam[i], param) == 0 )
845 assert( lpi !=
NULL );
849 if( strcmp(
dblparam[i], param) == 0 )
851 lpi->
grbparam.dblparval[i] = parval;
886 assert(rngcount !=
NULL);
890 for( i = 0; i < nrows; ++i )
892 assert(lhs[i] <= rhs[i]);
894 if( lhs[i] == rhs[i] )
896 assert(-GRB_INFINITY < rhs[i] && rhs[i] < GRB_INFINITY);
903 assert(-GRB_INFINITY < rhs[i] && rhs[i] < GRB_INFINITY);
909 assert(-GRB_INFINITY < lhs[i] && lhs[i] < GRB_INFINITY);
910 lpi->
senarray[i] = GRB_GREATER_EQUAL;
916 assert(-GRB_INFINITY < lhs[i] && lhs[i] < GRB_INFINITY);
917 assert(-GRB_INFINITY < rhs[i] && rhs[i] < GRB_INFINITY);
940 nrows = lastrow-firstrow+1;
947 for (i = 0; i < nrows; ++i)
973 case GRB_GREATER_EQUAL:
983 assert(lhs[i] <= rhs[i]);
994 assert( lpi !=
NULL );
1042 for (i = 0; i < nrows; i++)
1047 assert(-1 <= rngrow && rngrow < lpi->nrngrows);
1050 assert(lpi->
rngrows[rngrow] == i);
1051 assert(lpi->
rngvals[rngrow] > 0.0);
1059 #define checkRangeInfo(lpi) 1075 for (i = 0; i < lpi->
nrngrows; i++)
1077 double coeff = -1.0;
1110 for (i = 0; i < lpi->
nrngrows; i++)
1153 assert( lpi !=
NULL );
1168 for (r = firstrow; r < nrows; r++)
1175 for (i = 0; i < rngcount; i++)
1181 row = firstrow + pos;
1217 GRBversion(&majorversion, &minorversion, &technical);
1218 sprintf(
grbname,
"Gurobi %d.%d.%d", majorversion, minorversion, technical);
1227 return "Linear Programming Solver developed by Gurobi Optimization (www.gurobi.com)";
1248 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
1272 assert(
sizeof(
SCIP_Real) ==
sizeof(
double));
1273 assert(
sizeof(
SCIP_Bool) ==
sizeof(
int));
1274 assert(lpi !=
NULL);
1289 CHECK_ZERO( messagehdlr, GRBsetintparam(
grbenv, GRB_INT_PAR_OUTPUTFLAG, 0) );
1292 CHECK_ZERO( messagehdlr, GRBsetintparam(
grbenv, GRB_INT_PAR_INFUNBDINFO, 1) );
1301 (*lpi)->grbenv = GRBgetenv((*lpi)->grbmodel);
1302 (*lpi)->senarray =
NULL;
1303 (*lpi)->rhsarray =
NULL;
1304 (*lpi)->rngarray =
NULL;
1305 (*lpi)->rngidxarray =
NULL;
1306 (*lpi)->valarray =
NULL;
1307 (*lpi)->cstat =
NULL;
1308 (*lpi)->rstat =
NULL;
1309 (*lpi)->indarray =
NULL;
1310 (*lpi)->rngrowmap =
NULL;
1311 (*lpi)->rngrows =
NULL;
1312 (*lpi)->rngvals =
NULL;
1313 (*lpi)->sidechgsize = 0;
1314 (*lpi)->valsize = 0;
1315 (*lpi)->cstatsize = 0;
1316 (*lpi)->rstatsize = 0;
1317 (*lpi)->rngrowmapsize = 0;
1318 (*lpi)->nrngrows = 0;
1319 (*lpi)->rngrowssize = 0;
1320 (*lpi)->rngvarsadded =
FALSE;
1321 (*lpi)->iterations = 0;
1322 (*lpi)->solisbasic =
FALSE;
1323 (*lpi)->fromscratch =
FALSE;
1325 (*lpi)->messagehdlr = messagehdlr;
1357 assert(lpi !=
NULL);
1358 assert(*lpi !=
NULL);
1363 CHECK_ZERO( (*lpi)->messagehdlr, GRBfreemodel((*lpi)->grbmodel) );
1423 assert(lpi !=
NULL);
1428 SCIPdebugMessage(
"loading LP in column format into Gurobi: %d cols, %d rows\n", ncols, nrows);
1442 for( c = 0; c < ncols-1; ++c )
1444 cnt[c] = beg[c+1] - beg[c];
1445 assert(cnt[c] >= 0);
1447 cnt[ncols-1] = nnonz - beg[ncols-1];
1448 assert(cnt[ncols-1] >= 0);
1456 lpi->
senarray, lpi->
rhsarray, (
int*)beg, cnt, (
int*)ind, (
SCIP_Real*)val, (
SCIP_Real*)lb, (
SCIP_Real*)ub,
NULL, colnames, rownames) );
1473 assert(temp == ncols);
1476 assert(temp == nrows);
1479 assert(temp == nnonz);
1502 assert(lpi !=
NULL);
1507 assert(nnonz == 0 || beg != 0);
1508 assert(nnonz == 0 || ind != 0);
1509 assert(nnonz == 0 || val != 0);
1513 SCIPdebugMessage(
"adding %d columns with %d nonzeros to Gurobi\n", ncols, nnonz);
1525 for (j = 0; j < nnonz; ++j)
1526 assert( 0 <= ind[j] && ind[j] < nrows );
1561 ndelcols = lastcol-firstcol+1;
1563 assert(lpi !=
NULL);
1570 assert(0 <= firstcol && firstcol <= lastcol && lastcol < temp);
1574 SCIPdebugMessage(
"deleting %d columns from Gurobi\n", lastcol - firstcol + 1);
1580 for( j = firstcol; j <= lastcol; ++j )
1581 which[j - firstcol] = j;
1606 assert(lpi !=
NULL);
1618 for( j = 0; j < ncols; ++j )
1629 for( j = 0; j < ncols; ++j )
1663 assert(lpi !=
NULL);
1667 SCIPdebugMessage(
"adding %d rows with %d nonzeros to Gurobi\n", nrows, nnonz);
1679 for (j = 0; j < nnonz; ++j)
1680 assert( 0 <= ind[j] && ind[j] < ncols );
1688 if ( lpi->
nrngrows > 0 || rngcount > 0 )
1710 for (r = oldnrows; r < oldnrows+nrows; r++)
1730 ndelrows = lastrow-firstrow+1;
1732 assert(lpi !=
NULL);
1738 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
1748 for( i = firstrow; i <= lastrow; ++i )
1749 which[i - firstrow] = i;
1766 for (i = 0; i < lpi->
nrngrows; i++)
1768 if ( lpi->
rngrows[i] >= firstrow )
1776 if ( lpi->
rngrows[i] > lastrow )
1785 lpi->
rngrows[nrngrows] = oldrow - ndelrows;
1799 if ( nrngrows == 0 )
1805 for (i = firstrow; i < nrows; i++)
1831 assert(lpi !=
NULL);
1841 for( i = 0; i < nrows; ++i )
1851 for( i = 0; i < nrows; ++i )
1870 for (i = 0; i < lpi->
nrngrows; i++)
1873 int newrow = dstat[oldrow];
1877 lpi->
rngrows[nrngrows] = newrow;
1895 if ( nrngrows == 0 )
1900 for (i = 0; i < nrows; i++)
1902 int newrow = dstat[i];
1903 assert(newrow <= i);
1925 assert( lpi !=
NULL );
1956 assert(lpi !=
NULL);
1958 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1962 for (i = 0; i < ncols; ++i)
1968 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1973 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
2001 assert(lpi !=
NULL);
2011 assert( rngcount == 0 );
2020 if ( rngcount > 0 || lpi->
nrngrows > 0 )
2023 int nnewrngrows = 0;
2033 for (i = 0; i < nrows; i++)
2041 assert(-1 <= rngrowidx && rngrowidx < lpi->nrngrows);
2046 if ( rngrowidx >= 0 )
2071 if ( rngrowidx >= 0 )
2092 if ( nnewrngrows > 0 )
2100 for (i = 0; i < lpi->
nrngrows; i++)
2114 if ( nrngrows == 0 )
2132 assert(lpi !=
NULL);
2135 SCIPdebugMessage(
"changing coefficient row %d, column %d in Gurobi to %g\n", row, col, newval);
2151 assert(lpi !=
NULL);
2177 assert(lpi !=
NULL);
2202 assert(lpi !=
NULL);
2204 assert(scaleval != 0.0);
2206 SCIPdebugMessage(
"scaling row %d with factor %g in Gurobi\n", row, scaleval);
2217 for ( i = 0; i < nnonz; ++i )
2225 else if( scaleval < 0.0 )
2229 else if( scaleval < 0.0 )
2231 if( scaleval > 0.0 )
2262 assert(lpi !=
NULL);
2264 assert(scaleval != 0.0);
2266 SCIPdebugMessage(
"scaling column %d with factor %g in Gurobi\n", col, scaleval);
2280 for( i = 0; i < nnonz; ++i )
2290 if( lb > -GRB_INFINITY )
2292 else if( scaleval < 0.0 )
2294 if( ub < GRB_INFINITY )
2296 else if( scaleval < 0.0 )
2298 if( scaleval > 0.0 )
2330 assert(lpi !=
NULL);
2331 assert(nrows !=
NULL);
2346 assert(lpi !=
NULL);
2347 assert(ncols !=
NULL);
2366 assert(lpi !=
NULL);
2367 assert(nnonz !=
NULL);
2395 assert(lpi !=
NULL);
2401 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
2417 for (j = 0; j < lastcol-firstcol+1; j++)
2430 assert(beg !=
NULL);
2431 assert(ind !=
NULL);
2432 assert(val !=
NULL);
2439 assert(beg ==
NULL);
2440 assert(ind ==
NULL);
2441 assert(val ==
NULL);
2463 assert(lpi !=
NULL);
2470 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
2489 assert(beg !=
NULL);
2490 assert(ind !=
NULL);
2491 assert(val !=
NULL);
2504 for (i = firstrow; i <= lastrow; i++)
2513 int newnz = (i < lastrow ? beg[i+1]-1 : (*nnonz)-1);
2516 for (; i <= lastrow; i++)
2522 theend = (i < lastrow ? beg[i+1] : *nnonz);
2528 memmove(&ind[newnz], &ind[thebeg], (theend - thebeg) *
sizeof(*ind));
2529 memmove(&val[newnz], &val[thebeg], (theend - thebeg) *
sizeof(*val));
2531 newnz += theend - thebeg;
2533 assert(newnz < *nnonz);
2540 assert(beg ==
NULL);
2541 assert(ind ==
NULL);
2542 assert(val ==
NULL);
2555 int namestoragesize,
2570 int namestoragesize,
2586 assert( lpi !=
NULL );
2588 assert( objsen !=
NULL );
2593 assert(grbobjsen == GRB_MINIMIZE || grbobjsen == GRB_MAXIMIZE);
2608 assert(lpi !=
NULL);
2610 assert(firstcol <= lastcol);
2611 assert(vals !=
NULL);
2613 SCIPdebugMessage(
"getting objective values %d to %d\n", firstcol, lastcol);
2629 assert(lpi !=
NULL);
2635 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
2663 assert(lpi !=
NULL);
2665 assert(firstrow <= lastrow);
2689 assert(lpi !=
NULL);
2722 assert( lpi !=
NULL );
2731 SCIPdebugMessage(
"calling Gurobi primal simplex: %d cols, %d rows\n", ncols, nrows);
2754 retval = GRBoptimize(lpi->
grbmodel);
2759 case GRB_ERROR_OUT_OF_MEMORY:
2771 SCIPdebugMessage(
"Gurobi primal simplex needed %d iterations to gain LP status %d\n", (
int) cnt, lpi->
solstat);
2780 if( presolve != GRB_PRESOLVE_OFF )
2782 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi primal simplex again without presolve\n");
2787 retval = GRBoptimize(lpi->
grbmodel);
2792 case GRB_ERROR_OUT_OF_MEMORY:
2807 if( lpi->
solstat == GRB_INF_OR_UNBD )
2810 SCIPerrorMessage(
"Gurobi primal simplex returned GRB_INF_OR_UNBD after presolving was turned off\n");
2827 int oldprimdual = 0;
2828 int oldpresolve = GRB_PRESOLVE_OFF;
2833 assert( lpi !=
NULL );
2842 SCIPdebugMessage(
"calling Gurobi dual simplex: %d cols, %d rows\n", ncols, nrows);
2867 if ( itlim < GRB_INFINITY )
2871 if ( oldprimdual != 0 )
2879 if ( oldpresolve != GRB_PRESOLVE_OFF )
2885 retval = GRBoptimize(lpi->
grbmodel);
2890 case GRB_ERROR_OUT_OF_MEMORY:
2904 if( lpi->
solstat == GRB_INF_OR_UNBD )
2909 if( presolve != GRB_PRESOLVE_OFF )
2912 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi dual simplex again without presolve\n");
2918 retval = GRBoptimize(lpi->
grbmodel);
2923 case GRB_ERROR_OUT_OF_MEMORY:
2938 if( lpi->
solstat == GRB_INF_OR_UNBD )
2941 SCIPerrorMessage(
"Gurobi dual simplex returned GRB_INF_OR_UNBD after presolving was turned off.\n");
2948 if ( oldprimdual != 0 )
2952 if ( oldpresolve != GRB_PRESOLVE_OFF )
2969 assert( lpi !=
NULL );
2978 SCIPdebugMessage(
"calling Gurobi barrier: %d cols, %d rows\n", ncols, nrows);
3013 retval = GRBoptimize(lpi->
grbmodel);
3018 case GRB_ERROR_OUT_OF_MEMORY:
3032 if( lpi->
solstat == GRB_INF_OR_UNBD )
3037 if( presolve != GRB_PRESOLVE_OFF )
3040 SCIPdebugMessage(
"presolver may have solved the problem -> calling Gurobi barrier again without presolve\n");
3046 retval = GRBoptimize(lpi->
grbmodel);
3051 case GRB_ERROR_OUT_OF_MEMORY:
3066 if( lpi->
solstat == GRB_INF_OR_UNBD )
3069 SCIPerrorMessage(
"Gurobi dual simplex returned GRB_INF_OR_UNBD after presolving was turned off\n");
3121 assert( lpi !=
NULL );
3124 assert( down !=
NULL );
3125 assert( up !=
NULL );
3126 assert( downvalid !=
NULL );
3127 assert( upvalid !=
NULL );
3129 SCIPdebugMessage(
"performing strong branching on variable %d (%d iterations)\n", col, itlim);
3162 newub =
EPSCEIL(psol-1.0, 1e-06);
3163 if( newub >= oldlb - 0.5 )
3165 SCIPdebugMessage(
"strong branching down (%g) on x%d (%g) with %d iterations\n", newub, col, psol, itlim);
3196 assert( b == oldub );
3215 if( newlb <= oldub + 0.5 )
3217 SCIPdebugMessage(
"strong branching up (%g) on x%d (%g) with %d iterations\n", newlb, col, psol, itlim);
3248 assert( b == oldlb );
3318 assert( cols !=
NULL );
3319 assert( psols !=
NULL );
3320 assert( down !=
NULL );
3321 assert( up !=
NULL );
3322 assert( downvalid !=
NULL );
3323 assert( upvalid !=
NULL );
3324 assert( down !=
NULL );
3329 for( j = 0; j < ncols; ++j )
3332 SCIP_CALL(
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) );
3381 assert( iter !=
NULL );
3382 assert( cols !=
NULL );
3383 assert( psols !=
NULL );
3384 assert( down !=
NULL );
3385 assert( up !=
NULL );
3386 assert( downvalid !=
NULL );
3387 assert( upvalid !=
NULL );
3388 assert( down !=
NULL );
3393 for( j = 0; j < ncols; ++j )
3396 SCIP_CALL(
lpiStrongbranch(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) );
3420 assert(lpi !=
NULL);
3434 assert( lpi !=
NULL );
3443 if( primalfeasible !=
NULL )
3446 if( dualfeasible !=
NULL )
3459 assert(lpi !=
NULL);
3463 return (lpi->
solstat == GRB_UNBOUNDED);
3476 assert( lpi !=
NULL );
3481 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3488 return (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL);
3499 assert( lpi !=
NULL );
3504 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3511 return (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL);
3519 assert(lpi !=
NULL);
3525 assert( lpi->
solstat != GRB_INF_OR_UNBD );
3526 return (lpi->
solstat == GRB_INFEASIBLE);
3537 assert( lpi !=
NULL );
3544 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3551 return (lpi->
solstat == GRB_OPTIMAL || (lpi->
solstat == GRB_UNBOUNDED && algo == GRB_METHOD_PRIMAL));
3561 assert(lpi !=
NULL);
3565 return (lpi->
solstat == GRB_INFEASIBLE);
3578 assert( lpi !=
NULL );
3583 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3590 return (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL);
3601 assert( lpi !=
NULL );
3608 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3615 return (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL);
3623 assert( lpi !=
NULL );
3629 return (lpi->
solstat == GRB_UNBOUNDED);
3640 assert( lpi !=
NULL );
3647 res = GRBgetintparam(lpi->
grbenv, GRB_INT_PAR_METHOD, &algo);
3654 return (lpi->
solstat == GRB_OPTIMAL ||
3655 (lpi->
solstat == GRB_INFEASIBLE && algo == GRB_METHOD_DUAL) ||
3656 (lpi->
solstat == GRB_ITERATION_LIMIT && algo == GRB_METHOD_DUAL) );
3664 assert(lpi !=
NULL);
3668 return (lpi->
solstat == GRB_OPTIMAL);
3676 assert(lpi !=
NULL);
3682 return (lpi->
solstat != GRB_NUMERIC);
3690 assert(lpi !=
NULL);
3694 return (lpi->
solstat == GRB_CUTOFF);
3702 assert(lpi !=
NULL);
3706 return (lpi->
solstat == GRB_ITERATION_LIMIT);
3714 assert(lpi !=
NULL);
3718 return (lpi->
solstat == GRB_TIME_LIMIT);
3726 assert(lpi !=
NULL);
3738 assert(lpi !=
NULL);
3740 assert(success !=
NULL);
3757 double oval = GRB_INFINITY;
3758 double obnd = -GRB_INFINITY;
3761 assert(lpi !=
NULL);
3767 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJVAL, &oval);
3768 (void)GRBgetdblattr(lpi->
grbmodel, GRB_DBL_ATTR_OBJBOUND, &obnd);
3770 assert(lpi->
solstat != GRB_OPTIMAL || oval == obnd);
3791 assert(lpi !=
NULL);
3799 assert( ncols >= 0 && nrows >= 0 );
3801 if( objval !=
NULL )
3806 if( primsol !=
NULL )
3811 if( dualsol !=
NULL )
3816 if( activity !=
NULL )
3828 for( i = 0; i < nrows; ++i )
3839 activity[i] = lpi->
rhsarray[i] + solval;
3843 activity[i] = lpi->
rhsarray[i] - activity[i];
3846 case GRB_LESS_EQUAL:
3847 activity[i] = lpi->
rhsarray[i] - activity[i];
3849 case GRB_GREATER_EQUAL:
3850 activity[i] = lpi->
rhsarray[i] - activity[i];
3860 if( redcost !=
NULL )
3876 assert(lpi !=
NULL);
3881 assert( ncols >= 0 );
3898 assert(lpi !=
NULL);
3901 assert(dualfarkas !=
NULL);
3904 assert( nrows >= 0 );
3919 assert(lpi !=
NULL);
3921 assert(iterations !=
NULL);
3939 assert(lpi !=
NULL);
3940 assert(quality !=
NULL);
3969 assert(lpi !=
NULL);
3972 SCIPdebugMessage(
"saving Gurobi basis into %p/%p\n", (
void*) cstat, (
void*) rstat);
3983 for( i = 0; i < nrows; ++i )
4001 case GRB_NONBASIC_LOWER:
4005 case GRB_NONBASIC_UPPER:
4009 case GRB_SUPERBASIC:
4027 for( j = 0; j < ncols; ++j )
4035 case GRB_NONBASIC_LOWER:
4039 case GRB_NONBASIC_UPPER:
4042 case GRB_SUPERBASIC:
4070 assert(lpi !=
NULL);
4072 assert(cstat !=
NULL);
4073 assert(rstat !=
NULL);
4075 SCIPdebugMessage(
"loading basis %p/%p into Gurobi\n", (
void*) cstat, (
void*) rstat);
4085 for( i = 0; i < nrows; ++i )
4090 lpi->
rstat[i] = GRB_BASIC;
4094 lpi->
rstat[i] = GRB_NONBASIC_LOWER;
4098 lpi->
rstat[i] = GRB_NONBASIC_UPPER;
4102 lpi->
rstat[i] = GRB_SUPERBASIC;
4119 lpi->
rstat[i] = GRB_NONBASIC_LOWER;
4126 for( j = 0; j < ncols; ++j )
4131 lpi->
cstat[j] = GRB_BASIC;
4135 lpi->
cstat[j] = GRB_NONBASIC_LOWER;
4139 lpi->
cstat[j] = GRB_NONBASIC_UPPER;
4143 lpi->
cstat[j] = GRB_SUPERBASIC;
4154 assert(nrngsfound == lpi->
nrngrows);
4176 assert(lpi !=
NULL);
4183 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4198 for (i = 0; i < nrows; ++i)
4201 if ( bhead[i] < ncols )
4203 else if ( bhead[i] < ngrbcols )
4206 int rngrow = bhead[i]-ncols;
4207 assert(rngrow < lpi->nrngrows);
4211 bind[i] = -1 - lpi->
rngrows[rngrow];
4216 bind[i] = -1 - (bhead[i] - ngrbcols);
4250 assert(lpi !=
NULL);
4257 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4280 assert( x.len <= nrows );
4283 if ( ninds !=
NULL && inds !=
NULL )
4288 for (i = 0; i < x.len; ++i)
4292 coef[idx] = (x.val)[i];
4300 for (i = 0; i < nrows; ++i)
4302 assert( k <= x.len );
4303 if ( k < x.len && (x.ind)[k] == i )
4304 coef[i] = (x.val)[k++];
4347 assert(lpi !=
NULL);
4354 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4377 assert( x.len <= nrows );
4380 if ( ninds !=
NULL && inds !=
NULL )
4385 for (i = 0; i < x.len; ++i)
4389 coef[idx] = (x.val)[i];
4397 for (i = 0; i < nrows; ++i)
4399 assert( k <= x.len );
4400 if ( k < x.len && (x.ind)[k] == i )
4401 coef[i] = (x.val)[k++];
4440 assert(lpi !=
NULL);
4447 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4463 assert( x.len <= ngrbcols + nrows );
4468 for (k = 0; k < x.len; k++)
4471 assert(0 <= j && j < ngrbcols);
4474 SCIPerrorMessage(
"range variable in basis inverse row: not yet implemented\n");
4481 if ( ninds !=
NULL && inds !=
NULL )
4486 for (j = 0; j < x.len; ++j)
4490 coef[idx] = (x.val)[j];
4497 for (j = 0; j < ncols; ++j)
4499 assert( k <= x.len );
4500 if ( k < x.len && (x.ind)[k] == j )
4501 coef[j] = (x.val)[k++];
4537 assert(lpi !=
NULL);
4544 if ( status == GRB_LOADED || status == GRB_INTERRUPTED || status == GRB_INPROGRESS )
4558 assert( x.len <= nrows );
4561 if ( ninds !=
NULL && inds !=
NULL )
4566 for (j = 0; j < x.len; ++j)
4570 coef[idx] = (x.val)[j];
4577 for (j = 0; j < nrows; ++j)
4579 assert( k <= x.len );
4580 if ( k < x.len && (x.ind)[k] == j )
4581 coef[j] = (x.val)[k++];
4617 assert(blkmem !=
NULL);
4618 assert(lpi !=
NULL);
4620 assert(lpistate !=
NULL);
4641 (*lpistate)->ncols = ncols;
4642 (*lpistate)->nrows = nrows;
4643 (*lpistate)->nrngrows = lpi->
nrngrows;
4645 SCIPdebugMessage(
"stored Gurobi LPI state in %p (%d cols, %d rows, %d ranged rows)\n",
4646 (
void*) *lpistate, ncols, nrows, lpi->
nrngrows);
4657 (*lpistate)->ncols = ncols;
4658 (*lpistate)->nrows = nrows;
4659 (*lpistate)->nrngrows = lpi->
nrngrows;
4660 (*lpistate)->packrstat =
NULL;
4661 (*lpistate)->packcstat =
NULL;
4680 assert(blkmem !=
NULL);
4681 assert(lpi !=
NULL);
4690 assert(lpistate->
ncols <= ncols);
4691 assert(lpistate->
nrows <= nrows);
4694 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",
4695 (
void*) lpistate, lpistate->
ncols, lpistate->nrows, lpistate->nrngrows, ncols, nrows, lpi->
nrngrows);
4697 if( lpistate->ncols == 0 || lpistate->nrows == 0 )
4707 if ( lpistate->nrngrows > 0 && lpistate->ncols < ncols )
4710 memmove(&lpi->
cstat[ncols], &lpi->
cstat[lpistate->ncols], lpistate->nrngrows *
sizeof(*lpi->
cstat));
4714 for( i = lpistate->ncols; i < ncols; ++i )
4730 for( i = lpistate->nrngrows; i < lpi->nrngrows; ++i )
4732 for( i = lpistate->nrows; i < nrows; ++i )
4746 assert(lpi !=
NULL);
4760 assert(lpi !=
NULL);
4761 assert(lpistate !=
NULL);
4763 if( *lpistate !=
NULL )
4786 assert(lpi !=
NULL);
4793 if ( l > 4 && fname[l-4] ==
'.' && fname[l-3] ==
'b' && fname[l-2] ==
'a' && fname[l-1] ==
's' )
4799 SCIPerrorMessage(
"To read a basis with gurobi, the extension has to be '.bas'.\n");
4814 assert(lpi !=
NULL);
4821 if ( l > 4 && fname[l-4] ==
'.' && fname[l-3] ==
'b' && fname[l-2] ==
'a' && fname[l-1] ==
's' )
4865 assert(blkmem !=
NULL);
4866 assert(lpi !=
NULL);
4867 assert(lpinorms !=
NULL);
4891 (*lpinorms)->ncols = ncols;
4892 (*lpinorms)->nrows = nrows;
4912 assert(blkmem !=
NULL);
4913 assert(lpi !=
NULL);
4916 if( lpinorms ==
NULL )
4920 error = GRBsetdblattrarray(lpi->
grbmodel, GRB_DBL_ATTR_VDUALNORM, 0, lpinorms->
ncols, lpinorms->
colnorm);
4926 error = GRBsetdblattrarray(lpi->
grbmodel, GRB_DBL_ATTR_CDUALNORM, 0, lpinorms->
nrows, lpinorms->
rownorm);
4942 assert(lpi !=
NULL);
4943 assert(lpinorms !=
NULL);
4945 if ( *lpinorms !=
NULL )
4977 assert(lpi !=
NULL);
4979 assert(ival !=
NULL);
4993 assert(temp >= 0 && temp <= 2);
4998 assert( temp == GRB_PRESOLVE_AUTO || temp == GRB_PRESOLVE_OFF || temp == GRB_PRESOLVE_CONSERVATIVE || temp == GRB_PRESOLVE_AGGRESSIVE );
4999 *ival = (temp == GRB_PRESOLVE_OFF) ?
FALSE :
TRUE;
5006 assert( temp == 0 || temp == 1 );
5011 assert( dtemp >= 0.0 );
5012 if( dtemp >= INT_MAX )
5015 *ival = (int) dtemp;
5031 assert(lpi !=
NULL);
5046 assert(ival >= 0 && ival <= 2);
5094 itlim = (ival >= INT_MAX ? GRB_INFINITY : ival);
5114 assert(lpi !=
NULL);
5116 assert(dval !=
NULL);
5132 if( objsen == GRB_MAXIMIZE )
5139 if( objsen == GRB_MINIMIZE )
5166 assert(lpi !=
NULL);
5183 if( objsen == GRB_MAXIMIZE )
5190 if( objsen == GRB_MINIMIZE )
5227 return GRB_INFINITY;
5236 return (val >= GRB_INFINITY);
5257 assert(lpi !=
NULL);
5273 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)