|
Go to the documentation of this file. 36 #include "scip/bitencode.h" 39 #ifndef XPRS_LPQUICKPRESOLVE 40 #define XPRS_LPQUICKPRESOLVE 8207 44 #define XPRS_LP_OPTIMAL_SCALEDINFEAS 16 46 #define CHECK_ZERO(messagehdlr, x) { int _restat_; \ 47 if( (_restat_ = (x)) != 0 ) \ 49 SCIPmessagePrintWarning((messagehdlr), "LP Error: Xpress returned %d\n", _restat_); \ 50 return SCIP_LPERROR; \ 55 #define ABORT_ZERO(messagehdlr, retval, x) { int _restat_; \ 56 if( (_restat_ = (x)) != 0 ) \ 58 SCIPmessagePrintWarning((messagehdlr), "LP Error: Xpress returned %d\n", _restat_); \ 66 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 68 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 128 void debugCheckColrang( 136 (void)XPRSgetintattrib(lpi->xprslp, XPRS_COLS, &ncols); 137 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols); 142 void debugCheckRowrang( 150 (void)XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows); 151 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows); 156 void debugCheckObjsen( 164 assert(curobjsens == objsen); 170 #define debugCheckColrang(lpi, firstcol, lastcol) 171 #define debugCheckRowrang(lpi, firstrow, lastrow) 172 #define debugCheckObjsen(lpi, objsen) 194 if( num > lpi->boundchgsize ) 199 newsize = MAX(2*lpi->boundchgsize, num); 200 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->larray, newsize) ); 201 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->uarray, newsize) ); 202 for( i = lpi->boundchgsize; i < newsize; ++i ) 204 lpi->larray[i] = 'L'; 205 lpi->uarray[i] = 'U'; 207 lpi->boundchgsize = newsize; 209 assert(num <= lpi->boundchgsize); 223 if( num > lpi->sidechgsize ) 227 newsize = MAX(2*lpi->sidechgsize, num); 228 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->senarray, newsize) ); 229 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->rhsarray, newsize) ); 230 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->rngarray, newsize) ); 231 lpi->sidechgsize = newsize; 233 assert(num <= lpi->sidechgsize); 247 if( num > lpi->valsize ) 251 newsize = MAX(2*lpi->valsize, num); 252 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->valarray, newsize) ); 253 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->indarray, newsize) ); 254 lpi->valsize = newsize; 256 assert(num <= lpi->valsize); 270 if( num > lpi->cstatsize ) 274 newsize = MAX(2*lpi->cstatsize, num); 275 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->cstat, newsize) ); 276 lpi->cstatsize = newsize; 278 assert(num <= lpi->cstatsize); 292 if( num > lpi->rstatsize ) 296 newsize = MAX(2*lpi->rstatsize, num); 297 SCIP_ALLOC( BMSreallocMemoryArray(&lpi->rstat, newsize) ); 298 lpi->rstatsize = newsize; 300 assert(num <= lpi->rstatsize); 339 assert(lpistate != NULL); 340 assert(lpistate->packcstat != NULL); 341 assert(lpistate->packrstat != NULL); 343 SCIPencodeDualBit(cstat, lpistate->packcstat, lpistate->ncols); 344 SCIPencodeDualBit(rstat, lpistate->packrstat, lpistate->nrows); 355 assert(lpistate != NULL); 356 assert(lpistate->packcstat != NULL); 357 assert(lpistate->packrstat != NULL); 359 SCIPdecodeDualBit(lpistate->packcstat, cstat, lpistate->ncols); 360 SCIPdecodeDualBit(lpistate->packrstat, rstat, lpistate->nrows); 372 assert(lpistate != NULL); 373 assert(blkmem != NULL); 377 SCIP_ALLOC( BMSallocBlockMemory(blkmem, lpistate) ); 378 SCIP_ALLOC( BMSallocBlockMemoryArray(blkmem, &(*lpistate)->packcstat, colpacketNum(ncols)) ); 379 SCIP_ALLOC( BMSallocBlockMemoryArray(blkmem, &(*lpistate)->packrstat, rowpacketNum(nrows)) ); 391 assert(blkmem != NULL); 392 assert(lpistate != NULL); 393 assert(*lpistate != NULL); 395 BMSfreeBlockMemoryArray(blkmem, &(*lpistate)->packcstat, colpacketNum((*lpistate)->ncols)); 396 BMSfreeBlockMemoryArray(blkmem, &(*lpistate)->packrstat, rowpacketNum((*lpistate)->nrows)); 397 BMSfreeBlockMemory(blkmem, lpistate); 417 return XPRS_OBJ_MAXIMIZE; 419 return XPRS_OBJ_MINIMIZE; 440 assert(lhss != NULL); 441 assert(rhss != NULL); 444 for( i = 0; i < nrows; ++i ) 446 assert(lhss[i] <= rhss[i]); 447 if( lhss[i] == rhss[i] ) 449 assert(XPRS_MINUSINFINITY < rhss[i] && rhss[i] < XPRS_PLUSINFINITY); 450 lpi->senarray[i] = 'E'; 451 lpi->rhsarray[i] = rhss[i]; 452 lpi->rngarray[i] = 0.0; 454 else if( lhss[i] <= XPRS_MINUSINFINITY ) 456 assert(XPRS_MINUSINFINITY < rhss[i] && rhss[i] < XPRS_PLUSINFINITY); 457 lpi->senarray[i] = 'L'; 458 lpi->rhsarray[i] = rhss[i]; 459 lpi->rngarray[i] = 0.0; 461 else if( rhss[i] >= XPRS_PLUSINFINITY ) 463 assert(XPRS_MINUSINFINITY < lhss[i] && lhss[i] < XPRS_PLUSINFINITY); 464 lpi->senarray[i] = 'G'; 465 lpi->rhsarray[i] = lhss[i]; 466 lpi->rngarray[i] = 0.0; 471 lpi->senarray[i] = 'R'; 472 lpi->rhsarray[i] = rhss[i]; 473 lpi->rngarray[i] = rhss[i] - lhss[i]; 480 void reconvertBothSides( 491 assert(lhss != NULL); 492 assert(rhss != NULL); 494 for( i = 0; i < nrows; ++i ) 496 switch( lpi->senarray[i] ) 499 lhss[i] = lpi->rhsarray[i]; 500 rhss[i] = lpi->rhsarray[i]; 504 lhss[i] = XPRS_MINUSINFINITY; 505 rhss[i] = lpi->rhsarray[i]; 509 lhss[i] = lpi->rhsarray[i]; 510 rhss[i] = XPRS_PLUSINFINITY; 514 assert(lpi->rngarray[i] >= 0.0); 515 rhss[i] = lpi->rhsarray[i]; 516 lhss[i] = lpi->rhsarray[i] - lpi->rngarray[i]; 523 assert(lhss[i] <= rhss[i]); 539 assert(lhss != NULL); 541 for( i = 0; i < nrows; ++i ) 543 switch( lpi->senarray[i] ) 546 assert(lpi->rngarray[i] == 0.0); 547 lhss[i] = lpi->rhsarray[i]; 551 assert(lpi->rngarray[i] == 0.0); 552 lhss[i] = XPRS_MINUSINFINITY; 556 assert(lpi->rngarray[i] == 0.0); 557 lhss[i] = lpi->rhsarray[i]; 561 assert(lpi->rngarray[i] >= 0.0); 562 lhss[i] = lpi->rhsarray[i] - lpi->rngarray[i]; 584 assert(rhss != NULL); 586 for( i = 0; i < nrows; ++i ) 588 switch( lpi->senarray[i] ) 591 assert(lpi->rngarray[i] == 0.0); 592 rhss[i] = lpi->rhsarray[i]; 596 assert(lpi->rngarray[i] == 0.0); 597 rhss[i] = lpi->rhsarray[i]; 601 assert(lpi->rngarray[i] == 0.0); 602 rhss[i] = XPRS_PLUSINFINITY; 606 assert(lpi->rngarray[i] >= 0.0); 607 rhss[i] = lpi->rhsarray[i]; 627 reconvertBothSides(lpi, nrows, lhs, rhs); 628 else if( lhs != NULL ) 629 reconvertLhs(lpi, nrows, lhs); 630 else if( rhs != NULL ) 631 reconvertRhs(lpi, nrows, rhs); 639 void invalidateSolution( 656 static char xprsname[100]; 666 if( XPRSgetversion(version) == 0 ) 667 sprintf(xprsname, "Xpress %s", version); 669 sprintf(xprsname, "Xpress %d", XPVERSION); 679 return "Linear Programming Solver developed by FICO (www.fico.com/xpress)"; 690 return ( void*) lpi->xprslp; 711 assert( sizeof( SCIP_Real) == sizeof( double)); 712 assert( sizeof( SCIP_Bool) == sizeof( int)); 731 strncpy((*lpi)->name, name, 200); 733 (*lpi)->larray = NULL; 734 (*lpi)->uarray = NULL; 735 (*lpi)->senarray = NULL; 736 (*lpi)->rhsarray = NULL; 737 (*lpi)->rngarray = NULL; 738 (*lpi)->indarray = NULL; 739 (*lpi)->valarray = NULL; 740 (*lpi)->cstat = NULL; 741 (*lpi)->rstat = NULL; 742 (*lpi)->boundchgsize = 0; 743 (*lpi)->sidechgsize = 0; 745 (*lpi)->cstatsize = 0; 746 (*lpi)->rstatsize = 0; 747 (*lpi)->iterations = 0; 748 (*lpi)->solisbasic = TRUE; 749 (*lpi)->clearstate = FALSE; 750 (*lpi)->solmethod = ' '; 751 (*lpi)->par_lobjlim = -1e+40; 752 (*lpi)->par_uobjlim = +1e+40; 753 (*lpi)->par_fastlp = 0; 754 (*lpi)->par_presolve = 0; 755 (*lpi)->messagehdlr = messagehdlr; 757 CHECK_ZERO( messagehdlr, XPRScreateprob(&(*lpi)->xprslp) ); 758 invalidateSolution(*lpi); 763 CHECK_ZERO( messagehdlr, XPRSsetintcontrol((*lpi)->xprslp, XPRS_OUTPUTLOG, 0) ); 766 CHECK_ZERO( messagehdlr, XPRSloadlp((*lpi)->xprslp, (*lpi)->name, 0, 0, NULL, NULL, NULL, NULL, &zero, NULL, NULL, NULL, NULL, NULL) ); 780 assert(*lpi != NULL); 785 CHECK_ZERO( (*lpi)->messagehdlr, XPRSdestroyprob(((*lpi)->xprslp)) ); 788 CHECK_ZERO( (*lpi)->messagehdlr, XPRSfree() ); 791 BMSfreeMemoryArrayNull(&(*lpi)->larray); 792 BMSfreeMemoryArrayNull(&(*lpi)->uarray); 793 BMSfreeMemoryArrayNull(&(*lpi)->senarray); 794 BMSfreeMemoryArrayNull(&(*lpi)->rhsarray); 795 BMSfreeMemoryArrayNull(&(*lpi)->rngarray); 796 BMSfreeMemoryArrayNull(&(*lpi)->indarray); 797 BMSfreeMemoryArrayNull(&(*lpi)->valarray); 798 BMSfreeMemoryArrayNull(&(*lpi)->cstat); 799 BMSfreeMemoryArrayNull(&(*lpi)->rstat); 835 assert(lpi->xprslp != NULL); 837 SCIPdebugMessage( "loading LP in column format into Xpress: %d cols, %d rows\n", ncols, nrows); 839 invalidateSolution(lpi); 842 SCIP_CALL( ensureSidechgMem(lpi, nrows) ); 845 convertSides(lpi, nrows, lhs, rhs); 851 for( c = 0; c < ncols-1; ++c ) 853 lpi->indarray[c] = beg[c+1] - beg[c]; 854 assert(lpi->indarray[c] >= 0); 856 lpi->indarray[ncols-1] = nnonz - beg[ncols-1]; 857 assert(lpi->indarray[ncols-1] >= 0); 860 CHECK_ZERO( lpi->messagehdlr, XPRSloadlp(lpi->xprslp, lpi->name, ncols, nrows, lpi->senarray, lpi->rhsarray, 861 lpi->rngarray, obj, beg, lpi->indarray, ind, val, lb, ub) ); 886 assert(lpi->xprslp != NULL); 888 SCIPdebugMessage( "adding %d columns with %d nonzeros to Xpress\n", ncols, nnonz); 890 invalidateSolution(lpi); 896 for( c = 0; c < ncols; c++ ) 897 lpi->indarray[c] = beg[c]; 898 lpi->indarray[ncols] = nnonz; 900 CHECK_ZERO( lpi->messagehdlr, XPRSaddcols(lpi->xprslp, ncols, nnonz, obj, lpi->indarray, ind, val, lb, ub) ); 915 assert(lpi->xprslp != NULL); 917 debugCheckColrang(lpi, firstcol, lastcol); 919 SCIPdebugMessage( "deleting %d columns from Xpress\n", lastcol - firstcol + 1); 921 invalidateSolution(lpi); 924 SCIP_CALL( ensureValMem(lpi, lastcol-firstcol+1) ); 927 for( c = firstcol; c <= lastcol; c++ ) 928 lpi->indarray[c-firstcol] = c; 930 CHECK_ZERO( lpi->messagehdlr, XPRSdelcols(lpi->xprslp, lastcol-firstcol+1, lpi->indarray) ); 949 assert(lpi->xprslp != NULL); 953 invalidateSolution(lpi); 955 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_COLS, &ncols) ); 964 for( c = 0; c < ncols; c++ ) 969 lpi->indarray[ndelcols] = c; 974 dstat[c] = nkeptcols; 979 CHECK_ZERO( lpi->messagehdlr, XPRSdelcols(lpi->xprslp, ndelcols, lpi->indarray) ); 1000 assert(lpi->xprslp != NULL); 1002 SCIPdebugMessage( "adding %d rows with %d nonzeros to Xpress\n", nrows, nnonz); 1004 invalidateSolution(lpi); 1007 SCIP_CALL( ensureSidechgMem(lpi, nrows) ); 1008 SCIP_CALL( ensureValMem(lpi, nrows+1) ); 1011 convertSides(lpi, nrows, lhs, rhs); 1013 for( r = 0; r < nrows; r++ ) 1014 lpi->indarray[r] = beg[r]; 1015 lpi->indarray[nrows] = nnonz; 1017 CHECK_ZERO( lpi->messagehdlr, XPRSaddrows(lpi->xprslp, nrows, nnonz, lpi->senarray, lpi->rhsarray, lpi->rngarray, lpi->indarray, ind, val) ); 1031 assert(lpi != NULL); 1032 assert(lpi->xprslp != NULL); 1034 debugCheckRowrang(lpi, firstrow, lastrow); 1036 SCIPdebugMessage( "deleting %d rows from Xpress\n", lastrow - firstrow + 1); 1038 invalidateSolution(lpi); 1041 SCIP_CALL( ensureValMem(lpi, lastrow-firstrow+1) ); 1043 for( r = firstrow; r <= lastrow; r++ ) 1044 lpi->indarray[r-firstrow] = r; 1046 CHECK_ZERO( lpi->messagehdlr, XPRSdelrows(lpi->xprslp, lastrow-firstrow+1, lpi->indarray) ); 1064 assert(lpi != NULL); 1065 assert(lpi->xprslp != NULL); 1069 invalidateSolution(lpi); 1074 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 1080 for( r = 0; r < nrows; r++ ) 1085 lpi->indarray[ndelrows] = r; 1090 dstat[r] = nkeptrows; 1095 CHECK_ZERO( lpi->messagehdlr, XPRSdelrows(lpi->xprslp, ndelrows, lpi->indarray) ); 1107 assert(lpi != NULL); 1112 CHECK_ZERO( lpi->messagehdlr, XPRSloadlp(lpi->xprslp, lpi->name, 0, 0, NULL, NULL, NULL, NULL, &zero, NULL, NULL, NULL, NULL, NULL) ); 1126 assert(lpi != NULL); 1127 assert(lpi->xprslp != NULL); 1131 invalidateSolution(lpi); 1134 SCIP_CALL( ensureBoundchgMem(lpi, ncols) ); 1136 CHECK_ZERO( lpi->messagehdlr, XPRSchgbounds(lpi->xprslp, ncols, ind, lpi->larray, ( SCIP_Real*)lb) ); 1137 CHECK_ZERO( lpi->messagehdlr, XPRSchgbounds(lpi->xprslp, ncols, ind, lpi->uarray, ( SCIP_Real*)ub) ); 1151 assert(lpi != NULL); 1152 assert(lpi->xprslp != NULL); 1156 invalidateSolution(lpi); 1159 SCIP_CALL( ensureSidechgMem(lpi, nrows) ); 1162 convertSides(lpi, nrows, lhs, rhs); 1165 CHECK_ZERO( lpi->messagehdlr, XPRSchgrowtype(lpi->xprslp, nrows, ind, lpi->senarray) ); 1166 CHECK_ZERO( lpi->messagehdlr, XPRSchgrhs(lpi->xprslp, nrows, ind, lpi->rhsarray) ); 1167 CHECK_ZERO( lpi->messagehdlr, XPRSchgrhsrange(lpi->xprslp, nrows, ind, lpi->rngarray) ); 1180 assert(lpi != NULL); 1181 assert(lpi->xprslp != NULL); 1183 SCIPdebugMessage( "changing coefficient row %d, column %d in Xpress to %g\n", row, col, newval); 1185 invalidateSolution(lpi); 1187 CHECK_ZERO( lpi->messagehdlr, XPRSchgcoef(lpi->xprslp, row, col, newval) ); 1198 assert(lpi != NULL); 1199 assert(lpi->xprslp != NULL); 1203 invalidateSolution(lpi); 1205 CHECK_ZERO( lpi->messagehdlr, XPRSchgobjsense(lpi->xprslp, xprsObjsen(objsense)) ); 1218 assert(lpi != NULL); 1219 assert(lpi->xprslp != NULL); 1223 CHECK_ZERO( lpi->messagehdlr, XPRSchgobj(lpi->xprslp, ncols, ind, obj) ); 1242 assert(lpi != NULL); 1243 assert(lpi->xprslp != NULL); 1244 assert(scaleval != 0.0); 1246 SCIPdebugMessage( "scaling row %d with factor %g in Xpress\n", row, scaleval); 1248 invalidateSolution(lpi); 1250 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_COLS, &ncols) ); 1257 for( i = 0; i < nnonz; ++i ) 1263 if( lhs > XPRS_MINUSINFINITY ) 1265 else if( scaleval < 0.0 ) 1266 lhs = XPRS_PLUSINFINITY; 1267 if( rhs < XPRS_PLUSINFINITY ) 1269 else if( scaleval < 0.0 ) 1270 rhs = XPRS_MINUSINFINITY; 1272 if( scaleval > 0.0 ) 1301 assert(lpi != NULL); 1302 assert(lpi->xprslp != NULL); 1303 assert(scaleval != 0.0); 1305 SCIPdebugMessage( "scaling column %d with factor %g in Xpress\n", col, scaleval); 1307 invalidateSolution(lpi); 1309 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 1319 for( i = 0; i < nnonz; ++i ) 1329 if( lb > XPRS_MINUSINFINITY ) 1331 else if( scaleval < 0.0 ) 1332 lb = XPRS_PLUSINFINITY; 1333 if( ub < XPRS_PLUSINFINITY ) 1335 else if( scaleval < 0.0 ) 1336 ub = XPRS_MINUSINFINITY; 1338 if( scaleval > 0.0 ) 1364 assert(lpi != NULL); 1365 assert(lpi->xprslp != NULL); 1366 assert(nrows != NULL); 1370 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, nrows) ); 1381 assert(lpi != NULL); 1382 assert(lpi->xprslp != NULL); 1383 assert(ncols != NULL); 1387 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_COLS, ncols) ); 1398 assert(lpi != NULL); 1399 assert(lpi->xprslp != NULL); 1400 assert(nnonz != NULL); 1404 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ELEMS, nnonz) ); 1425 assert(lpi != NULL); 1426 assert(lpi->xprslp != NULL); 1429 debugCheckColrang(lpi, firstcol, lastcol); 1437 CHECK_ZERO( lpi->messagehdlr, XPRSgetlb(lpi->xprslp, lb, firstcol, lastcol) ); 1438 CHECK_ZERO( lpi->messagehdlr, XPRSgetub(lpi->xprslp, ub, firstcol, lastcol) ); 1448 assert(beg != NULL); 1449 assert(ind != NULL); 1450 assert(val != NULL); 1453 SCIP_CALL( ensureValMem(lpi, lastcol-firstcol+2) ); 1462 CHECK_ZERO( lpi->messagehdlr, XPRSgetcols(lpi->xprslp, lpi->indarray, ind, val, ntotalnonz, nnonz, firstcol, lastcol) ); 1463 assert(*nnonz <= ntotalnonz); 1464 assert(lpi->indarray[lastcol-firstcol+1] == *nnonz); 1466 for( c = 0; c < lastcol-firstcol+1; c++ ) 1467 beg[c] = lpi->indarray[c]; 1471 assert(beg == NULL); 1472 assert(ind == NULL); 1473 assert(val == NULL); 1495 assert(lpi != NULL); 1496 assert(lpi->xprslp != NULL); 1497 assert(lhss == rhss); 1499 debugCheckRowrang(lpi, firstrow, lastrow); 1505 assert(rhss != NULL); 1511 assert(rhss == NULL); 1518 assert(beg != NULL); 1519 assert(ind != NULL); 1520 assert(val != NULL); 1523 SCIP_CALL( ensureValMem(lpi, lastrow-firstrow+2) ); 1532 CHECK_ZERO( lpi->messagehdlr, XPRSgetrows(lpi->xprslp, lpi->indarray, ind, val, ntotalnonz, nnonz, firstrow, lastrow) ); 1533 assert(*nnonz <= ntotalnonz); 1534 assert(lpi->indarray[lastrow-firstrow+1] == *nnonz); 1536 for( r = 0; r < lastrow-firstrow+1; r++ ) 1537 beg[r] = lpi->indarray[r]; 1541 assert(beg == NULL); 1542 assert(ind == NULL); 1543 assert(val == NULL); 1556 int namestoragesize, 1571 int namestoragesize, 1588 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblattrib(lpi->xprslp, XPRS_OBJSENSE, &xprsobjsen) ); 1591 if( xprsobjsen < 0.0 ) 1607 assert(lpi != NULL); 1608 assert(lpi->xprslp != NULL); 1609 assert(firstcol <= lastcol); 1610 assert(vals != NULL); 1612 SCIPdebugMessage( "getting objective values %d to %d\n", firstcol, lastcol); 1614 CHECK_ZERO( lpi->messagehdlr, XPRSgetobj(lpi->xprslp, vals, firstcol, lastcol) ); 1628 assert(lpi != NULL); 1629 assert(lpi->xprslp != NULL); 1630 assert(firstcol <= lastcol); 1636 CHECK_ZERO( lpi->messagehdlr, XPRSgetlb(lpi->xprslp, lbs, firstcol, lastcol) ); 1641 CHECK_ZERO( lpi->messagehdlr, XPRSgetub(lpi->xprslp, ubs, firstcol, lastcol) ); 1656 assert(lpi != NULL); 1657 assert(lpi->xprslp != NULL); 1658 assert(firstrow <= lastrow); 1663 SCIP_CALL( ensureSidechgMem(lpi, lastrow - firstrow + 1) ); 1666 CHECK_ZERO( lpi->messagehdlr, XPRSgetrowtype(lpi->xprslp, lpi->senarray, firstrow, lastrow) ); 1667 CHECK_ZERO( lpi->messagehdlr, XPRSgetrhs(lpi->xprslp, lpi->rhsarray, firstrow, lastrow) ); 1668 CHECK_ZERO( lpi->messagehdlr, XPRSgetrhsrange(lpi->xprslp, lpi->rngarray, firstrow, lastrow) ); 1671 reconvertSides(lpi, lastrow - firstrow + 1, lhss, rhss); 1684 assert(lpi != NULL); 1685 assert(lpi->xprslp != NULL); 1688 CHECK_ZERO( lpi->messagehdlr, XPRSgetcoef(lpi->xprslp, row, col, val) ); 1707 int primalinfeasible; 1711 assert(lpi != NULL); 1712 assert(lpi->xprslp != NULL); 1714 invalidateSolution(lpi); 1717 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_PRESOLVE, 0) ); 1720 if( lpi->clearstate ) 1722 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_KEEPBASIS, 0) ); 1723 lpi->clearstate = FALSE; 1728 if( lpi->par_fastlp ) 1731 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_REFACTOR, 0) ); 1736 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_REFACTOR, 1) ); 1740 CHECK_ZERO( lpi->messagehdlr, XPRSlpoptimize(lpi->xprslp, method) ); 1743 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_LPSTATUS, &lpi->solstat) ); 1744 if( lpi->solstat == XPRS_LP_UNBOUNDED || lpi->solstat == XPRS_LP_INFEAS ) 1746 CHECK_ZERO( lpi->messagehdlr, XPRSgetunbvec(lpi->xprslp, &lpi->unbvec) ); 1752 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_PRESOLVESTATE, &state) ); 1757 CHECK_ZERO( lpi->messagehdlr, XPRSpostsolve(lpi->xprslp) ); 1760 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_SIMPLEXITER, &lpi->iterations) ); 1761 lpi->solisbasic = TRUE; 1763 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_PRIMALINFEAS, &primalinfeasible) ); 1764 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_DUALINFEAS, &dualinfeasible) ); 1765 SCIPdebugMessage( " -> Xpress returned solstat=%d, pinfeas=%d, dinfeas=%d (%d iterations)\n", 1766 lpi->solstat, primalinfeasible, dualinfeasible, lpi->iterations); 1768 if( (lpi->solstat == XPRS_LP_OPTIMAL) && (primalinfeasible || dualinfeasible) ) 1779 lpi->solmethod = 'p'; 1780 return lpiSolve(lpi, "p"); 1788 lpi->solmethod = 'd'; 1789 return lpiSolve(lpi, "d"); 1800 assert(lpi != NULL); 1801 assert(lpi->xprslp != NULL); 1803 lpi->solmethod = 'b'; 1806 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_CROSSOVER, crossover == TRUE ? -1 : 0) ); 1808 retval = lpiSolve(lpi, "b"); 1809 lpi->solisbasic = crossover; 1855 assert(lpi != NULL); 1856 assert(lpi->xprslp != NULL); 1857 assert(down != NULL); 1859 assert(downvalid != NULL); 1860 assert(upvalid != NULL); 1862 SCIPdebugMessage( "calling Xpress strong branching on variable %d (%d iterations)\n", col, itlim); 1878 dbndval[0] = EPSCEIL(psol-1.0, 1e-06); 1881 dbndval[1] = EPSFLOOR(psol+1.0, 1e-06); 1885 CHECK_ZERO( lpi->messagehdlr, XPRSstrongbranch(lpi->xprslp, 2, mbndind, cbndtype, dbndval, itlim, dobjval, mstatus) ); 1888 if( (mstatus[0] == XPRS_LP_INFEAS) || (mstatus[0] == XPRS_LP_CUTOFF_IN_DUAL) ) 1890 else if( (mstatus[0] == XPRS_LP_OPTIMAL) || (mstatus[0] == XPRS_LP_UNFINISHED) ) 1899 if( (mstatus[1] == XPRS_LP_INFEAS) || (mstatus[1] == XPRS_LP_CUTOFF_IN_DUAL) ) 1901 else if( (mstatus[1] == XPRS_LP_OPTIMAL) || (mstatus[1] == XPRS_LP_UNFINISHED) ) 1941 assert( lpi != NULL ); 1942 assert( lpi->xprslp != NULL ); 1943 assert( cols != NULL ); 1944 assert( psols != NULL ); 1945 assert( down != NULL ); 1946 assert( up != NULL ); 1947 assert( downvalid != NULL ); 1948 assert( upvalid != NULL ); 1950 SCIPdebugMessage( "calling Xpress strong branching on %d variables (%d iterations)\n", ncols, itlim); 1959 SCIP_ALLOC( BMSallocMemoryArray(&mbndind, 2*ncols) ); 1960 SCIP_ALLOC( BMSallocMemoryArray(&dbndval, 2*ncols) ); 1961 SCIP_ALLOC( BMSallocMemoryArray(&cbndtype, 2*ncols) ); 1962 SCIP_ALLOC( BMSallocMemoryArray(&dobjval, 2*ncols) ); 1963 SCIP_ALLOC( BMSallocMemoryArray(&mstatus, 2*ncols) ); 1966 for( j = 0; j < ncols; ++j ) 1968 mbndind[2*j] = cols[j]; 1969 dbndval[2*j] = EPSCEIL(psols[j] - 1.0, 1e-06); 1970 cbndtype[2*j] = 'U'; 1972 mbndind[2*j+1] = cols[j]; 1973 dbndval[2*j+1] = EPSFLOOR(psols[j] + 1.0, 1e-06); 1974 cbndtype[2*j+1] = 'L'; 1978 CHECK_ZERO( lpi->messagehdlr, XPRSstrongbranch(lpi->xprslp, 2*ncols, mbndind, cbndtype, dbndval, itlim, dobjval, mstatus) ); 1980 for( j = 0; j < ncols; ++j ) 1983 downvalid[j] = TRUE; 1986 if( (mstatus[2*j] == XPRS_LP_INFEAS) || (mstatus[2*j] == XPRS_LP_CUTOFF_IN_DUAL) ) 1988 else if( (mstatus[2*j] == XPRS_LP_OPTIMAL) || (mstatus[2*j] == XPRS_LP_UNFINISHED) ) 1989 down[j] = dobjval[2*j]; 1993 downvalid[j] = FALSE; 1997 if( (mstatus[2*j+1] == XPRS_LP_INFEAS) || (mstatus[2*j+1] == XPRS_LP_CUTOFF_IN_DUAL) ) 1999 else if( (mstatus[2*j+1] == XPRS_LP_OPTIMAL) || (mstatus[2*j+1] == XPRS_LP_UNFINISHED) ) 2000 up[j] = dobjval[2*j+1]; 2014 BMSfreeMemoryArray(&mstatus); 2015 BMSfreeMemoryArray(&dobjval); 2016 BMSfreeMemoryArray(&cbndtype); 2017 BMSfreeMemoryArray(&dbndval); 2018 BMSfreeMemoryArray(&mbndind); 2039 SCIP_CALL( lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter) ); 2061 SCIP_CALL( lpiStrongbranches(lpi, cols, ncols, psols, itlim, down, up, downvalid, upvalid, iter) ); 2082 SCIP_CALL( lpiStrongbranch(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter) ); 2104 SCIP_CALL( lpiStrongbranches(lpi, cols, ncols, psols, itlim, down, up, downvalid, upvalid, iter) ); 2122 assert(lpi != NULL); 2124 return (lpi->solstat != -1); 2137 assert(lpi != NULL); 2138 assert(lpi->xprslp != NULL); 2139 assert(primalfeasible != NULL); 2140 assert(dualfeasible != NULL); 2157 assert(lpi != NULL); 2158 assert(lpi->xprslp != NULL); 2159 assert(lpi->solstat >= 0); 2161 return (lpi->solstat == XPRS_LP_UNBOUNDED); 2173 assert(lpi != NULL); 2174 assert(lpi->xprslp != NULL); 2175 assert(lpi->solstat >= 0); 2176 assert(lpi->solstat == XPRS_LP_UNBOUNDED); 2188 assert(lpi != NULL); 2189 assert(lpi->xprslp != NULL); 2190 assert(lpi->solstat >= 0); 2199 return lpi->solstat == XPRS_LP_UNBOUNDED && lpi->solmethod == 'p'; 2207 assert(lpi != NULL); 2208 assert(lpi->xprslp != NULL); 2209 assert(lpi->solstat >= 0); 2213 return (lpi->solstat == XPRS_LP_INFEAS); 2221 assert(lpi != NULL); 2222 assert(lpi->xprslp != NULL); 2223 assert(lpi->solstat >= 0); 2228 return lpi->solstat == XPRS_LP_OPTIMAL || lpi->solstat == XPRS_LP_OPTIMAL_SCALEDINFEAS || (lpi->solstat == XPRS_LP_UNBOUNDED && lpi->solmethod == 'p'); 2238 assert(lpi != NULL); 2239 assert(lpi->xprslp != NULL); 2240 assert(lpi->solstat >= 0); 2242 return (lpi->solstat == XPRS_LP_INFEAS); 2254 assert(lpi != NULL); 2255 assert(lpi->xprslp != NULL); 2256 assert(lpi->solstat >= 0); 2268 assert(lpi != NULL); 2269 assert(lpi->xprslp != NULL); 2270 assert(lpi->solstat >= 0); 2274 return ((lpi->solstat == XPRS_LP_INFEAS) && (lpi->solmethod == 'd')); 2282 assert(lpi != NULL); 2283 assert(lpi->xprslp != NULL); 2284 assert(lpi->solstat >= 0); 2288 return (lpi->solstat == XPRS_LP_UNBOUNDED); 2296 assert(lpi != NULL); 2297 assert(lpi->xprslp != NULL); 2298 assert(lpi->solstat >= 0); 2303 return lpi->solstat == XPRS_LP_OPTIMAL || lpi->solstat == XPRS_LP_OPTIMAL_SCALEDINFEAS || (lpi->solstat == XPRS_LP_INFEAS && lpi->solmethod == 'd'); 2311 assert(lpi != NULL); 2312 assert(lpi->xprslp != NULL); 2313 assert(lpi->solstat >= 0); 2323 assert(lpi != NULL); 2324 assert(lpi->xprslp != NULL); 2325 assert(lpi->solstat >= 0); 2327 SCIPdebugMessage( "checking for stability: Xpress solstat = %d\n", lpi->solstat); 2333 if( lpi->solstat == XPRS_LP_UNBOUNDED ) 2338 retcode = XPRSgetintattrib(lpi->xprslp, XPRS_PRIMALINFEAS, &pinfeas); 2340 if( retcode != 0 || pinfeas ) 2357 assert(lpi != NULL); 2358 assert(lpi->xprslp != NULL); 2359 assert(lpi->solstat >= 0); 2361 return (lpi->solstat == XPRS_LP_CUTOFF_IN_DUAL); 2372 assert(lpi != NULL); 2373 assert(lpi->xprslp != NULL); 2374 assert(lpi->solstat >= 0); 2376 ABORT_ZERO( lpi->messagehdlr, TRUE, XPRSgetintattrib(lpi->xprslp, XPRS_SIMPLEXITER, &lpiter) ); 2377 ABORT_ZERO( lpi->messagehdlr, TRUE, XPRSgetintcontrol(lpi->xprslp, XPRS_LPITERLIMIT, &lpiterlimit) ); 2379 if( (lpi->solstat == XPRS_LP_UNFINISHED) && (lpiter >= lpiterlimit) ) 2393 assert(lpi != NULL); 2394 assert(lpi->xprslp != NULL); 2395 assert(lpi->solstat >= 0); 2397 ABORT_ZERO( lpi->messagehdlr, TRUE, XPRSgetintattrib(lpi->xprslp, XPRS_SIMPLEXITER, &lpiter) ); 2398 ABORT_ZERO( lpi->messagehdlr, TRUE, XPRSgetintcontrol(lpi->xprslp, XPRS_LPITERLIMIT, &lpiterlimit) ); 2400 if( (lpi->solstat == XPRS_LP_UNFINISHED) && (lpiter < lpiterlimit) ) 2411 assert(lpi != NULL); 2412 assert(lpi->xprslp != NULL); 2414 return lpi->solstat; 2423 assert(lpi != NULL); 2424 assert(lpi->xprslp != NULL); 2438 assert(lpi != NULL); 2439 assert(lpi->xprslp != NULL); 2443 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblattrib(lpi->xprslp, XPRS_LPOBJVAL, objval) ); 2458 assert(lpi != NULL); 2459 assert(lpi->xprslp != NULL); 2460 assert(lpi->solstat >= 0); 2464 CHECK_ZERO( lpi->messagehdlr, XPRSgetsol(lpi->xprslp, primsol, activity, dualsol, redcost) ); 2466 if( objval != NULL ) 2468 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblattrib(lpi->xprslp, XPRS_LPOBJVAL, objval) ); 2471 if( activity != NULL ) 2477 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2479 SCIP_CALL( ensureSidechgMem(lpi, nrows) ); 2481 CHECK_ZERO( lpi->messagehdlr, XPRSgetrhs(lpi->xprslp, lpi->rhsarray, 0, nrows-1) ); 2483 for( r = 0; r < nrows; r++ ) 2484 activity[r] = lpi->rhsarray[r] - activity[r]; 2498 assert(lpi != NULL); 2499 assert(lpi->xprslp != NULL); 2500 assert(ray != NULL); 2501 assert(lpi->solstat >= 0); 2503 CHECK_ZERO( lpi->messagehdlr, XPRSgetprimalray(lpi->xprslp, ray, &hasRay) ); 2519 assert(lpi != NULL); 2520 assert(lpi->xprslp != NULL); 2521 assert(lpi->solstat >= 0); 2522 assert(dualfarkas != NULL); 2524 CHECK_ZERO( lpi->messagehdlr, XPRSgetdualray(lpi->xprslp, dualfarkas, &hasRay) ); 2538 assert(lpi != NULL); 2539 assert(lpi->xprslp != NULL); 2540 assert(lpi->solstat >= 0); 2541 assert(iterations != NULL); 2543 *iterations = lpi->iterations; 2559 assert(lpi != NULL); 2560 assert(quality != NULL); 2582 assert(lpi != NULL); 2583 assert(lpi->xprslp != NULL); 2585 SCIPdebugMessage( "saving Xpress basis into %p/%p\n", ( void*)rstat, ( void*)cstat); 2587 CHECK_ZERO( lpi->messagehdlr, XPRSgetbasis(lpi->xprslp, rstat, cstat) ); 2599 assert(lpi != NULL); 2600 assert(lpi->xprslp != NULL); 2601 assert(cstat != NULL); 2602 assert(rstat != NULL); 2604 SCIPdebugMessage( "loading basis %p/%p into Xpress\n", ( void*)rstat, ( void*)cstat); 2606 invalidateSolution(lpi); 2608 CHECK_ZERO( lpi->messagehdlr, XPRSloadbasis(lpi->xprslp, rstat, cstat) ); 2610 lpi->clearstate = FALSE; 2628 assert(lpi != NULL); 2629 assert(lpi->xprslp != NULL); 2630 assert(bind != NULL); 2634 CHECK_ZERO( lpi->messagehdlr, XPRSgetpivotorder(lpi->xprslp, bind) ); 2637 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2638 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_SPAREROWS, &irspace) ); 2641 for( r = 0; r < nrows; r++ ) 2643 if( bind[r] < nrows ) 2644 bind[r] = -bind[r]-1; 2647 assert(bind[r] >= irspace); 2648 bind[r] = bind[r] - irspace; 2674 assert(lpi != NULL); 2675 assert(lpi->xprslp != NULL); 2680 if ( ninds != NULL ) 2683 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2684 BMSclearMemoryArray(coef, nrows); 2686 CHECK_ZERO( lpi->messagehdlr, XPRSbtran(lpi->xprslp, coef) ); 2714 assert(lpi != NULL); 2715 assert(lpi->xprslp != NULL); 2720 if ( ninds != NULL ) 2723 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2724 BMSclearMemoryArray(coef, nrows); 2726 CHECK_ZERO( lpi->messagehdlr, XPRSftran(lpi->xprslp, coef) ); 2756 assert(lpi != NULL); 2757 assert(lpi->xprslp != NULL); 2762 if ( ninds != NULL ) 2765 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2766 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_COLS, &ncols) ); 2771 if( binvrow == NULL ) 2773 SCIP_ALLOC( BMSallocMemoryArray(&binvrow, nrows) ); 2775 SCIP_ALLOC( BMSallocMemoryArray(&buffer, nrows) ); 2780 binv = ( double*) binvrow; 2785 for( c = 0; c < ncols; c++ ) 2792 CHECK_ZERO( lpi->messagehdlr, XPRSgetcols(lpi->xprslp, NULL, lpi->indarray, lpi->valarray, nrows, &nnonz, c, c) ); 2793 assert(nnonz <= nrows); 2796 for( i = 0; i < nnonz; i++ ) 2797 coef[c] += binv[lpi->indarray[i]] * lpi->valarray[i]; 2801 BMSfreeMemoryArrayNull(&buffer); 2829 assert(lpi != NULL); 2830 assert(lpi->xprslp != NULL); 2835 if ( ninds != NULL ) 2838 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2844 CHECK_ZERO( lpi->messagehdlr, XPRSgetcols(lpi->xprslp, NULL, lpi->indarray, lpi->valarray, nrows, &nnonz, c, c) ); 2845 assert(nnonz <= nrows); 2848 BMSclearMemoryArray(coef, nrows); 2849 for( i = 0; i < nnonz; i++ ) 2850 coef[lpi->indarray[i]] = lpi->valarray[i]; 2852 CHECK_ZERO( lpi->messagehdlr, XPRSftran(lpi->xprslp, coef) ); 2875 assert(blkmem != NULL); 2876 assert(lpi != NULL); 2877 assert(lpi->xprslp != NULL); 2878 assert(lpistate != NULL); 2883 if( !lpi->solisbasic || lpi->clearstate ) 2889 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2890 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_COLS, &ncols) ); 2895 SCIP_CALL( lpistateCreate(lpistate, blkmem, ncols, nrows) ); 2897 SCIPdebugMessage( "storing Xpress LPI state in %p (%d cols, %d rows)\n", ( void*)*lpistate, ncols, nrows); 2900 SCIP_CALL( ensureCstatMem(lpi, ncols) ); 2901 SCIP_CALL( ensureRstatMem(lpi, nrows) ); 2904 CHECK_ZERO( lpi->messagehdlr, XPRSgetbasis(lpi->xprslp, lpi->rstat, lpi->cstat) ); 2907 (*lpistate)->ncols = ncols; 2908 (*lpistate)->nrows = nrows; 2909 lpistatePack(*lpistate, lpi->cstat, lpi->rstat); 2927 assert(blkmem != NULL); 2928 assert(lpi != NULL); 2929 assert(lpi->xprslp != NULL); 2932 if( lpistate == NULL ) 2935 if( lpistate->ncols == 0 || lpistate->nrows == 0 ) 2938 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_ROWS, &nrows) ); 2939 CHECK_ZERO( lpi->messagehdlr, XPRSgetintattrib(lpi->xprslp, XPRS_COLS, &ncols) ); 2944 assert(lpistate == NULL || lpistate->ncols <= ncols); 2945 assert(lpistate == NULL || lpistate->nrows <= nrows); 2947 SCIPdebugMessage( "loading LPI state %p (%d cols, %d rows) into Xpress\n", ( void*)lpistate, lpistate->ncols, lpistate->nrows); 2950 SCIP_CALL( ensureCstatMem(lpi, ncols) ); 2951 SCIP_CALL( ensureRstatMem(lpi, nrows) ); 2954 lpistateUnpack(lpistate, lpi->cstat, lpi->rstat); 2957 for( i = lpistate->ncols; i < ncols; ++i ) 2961 CHECK_ZERO( lpi->messagehdlr, XPRSgetlb(lpi->xprslp, &bnd, i, i) ); 2966 CHECK_ZERO( lpi->messagehdlr, XPRSgetub(lpi->xprslp, &bnd, i, i) ); 2976 for( i = lpistate->nrows; i < nrows; ++i ) 2980 CHECK_ZERO( lpi->messagehdlr, XPRSloadbasis(lpi->xprslp, lpi->rstat, lpi->cstat) ); 2982 lpi->clearstate = FALSE; 2992 assert(lpi != NULL); 2995 lpi->clearstate = TRUE; 3007 assert(lpi != NULL); 3008 assert(lpistate != NULL); 3010 if( *lpistate != NULL ) 3012 lpistateFree(lpistate, blkmem); 3024 assert(lpi != NULL); 3025 return (lpistate != NULL); 3034 assert(lpi != NULL); 3035 assert(lpi->xprslp != NULL); 3039 CHECK_ZERO( lpi->messagehdlr, XPRSreadbasis(lpi->xprslp, fname, "") ); 3050 assert(lpi != NULL); 3051 assert(lpi->xprslp != NULL); 3055 CHECK_ZERO( lpi->messagehdlr, XPRSwritebasis(lpi->xprslp, fname, "") ); 3077 assert(lpinorms != NULL); 3093 assert(lpinorms == NULL); 3106 assert(lpinorms == NULL); 3129 assert(lpi != NULL); 3130 assert(lpi->xprslp != NULL); 3131 assert(ival != NULL); 3138 *ival = (int)lpi->pricing; 3142 *ival = (lpi->notfromscratch == 0); 3144 CHECK_ZERO( lpi->messagehdlr, XPRSgetintcontrol(lpi->xprslp, XPRS_KEEPBASIS, &ictrlval) ); 3145 *ival = (ictrlval == 0); 3149 CHECK_ZERO( lpi->messagehdlr, XPRSgetintcontrol(lpi->xprslp, XPRS_SCALING, &ictrlval) ); 3150 *ival = (ictrlval != 0); 3153 *ival = lpi->par_presolve; 3156 CHECK_ZERO( lpi->messagehdlr, XPRSgetintcontrol(lpi->xprslp, XPRS_OUTPUTLOG, &ictrlval) ); 3157 *ival = (ictrlval != 0); 3160 CHECK_ZERO( lpi->messagehdlr, XPRSgetintcontrol(lpi->xprslp, XPRS_LPITERLIMIT, &ictrlval) ); 3162 if( *ival >= XPRS_MAXINT ) 3163 *ival = XPRS_MAXINT; 3166 CHECK_ZERO( lpi->messagehdlr, XPRSgetintcontrol(lpi->xprslp, XPRS_THREADS, &ictrlval) ); 3183 assert(lpi != NULL); 3184 assert(lpi->xprslp != NULL); 3192 switch( lpi->pricing ) 3195 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_PRICINGALG, XPRS_PRICING_PARTIAL) ); 3198 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_PRICINGALG, XPRS_PRICING_DEVEX) ); 3203 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_PRICINGALG, XPRS_PRICING_DEFAULT) ); 3209 lpi->notfromscratch = (int)(!ival); 3210 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_KEEPBASIS, (ival == FALSE) ? 1 : 0) ); 3214 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_SCALING, (ival == TRUE) ? 35 : 0) ); 3218 lpi->par_presolve = ival; 3222 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_OUTPUTLOG, (ival == TRUE) ? 1 : 0) ); 3225 ival = MIN(ival, XPRS_MAXINT); 3226 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_LPITERLIMIT, ival) ); 3229 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_THREADS, ival) ); 3248 assert(lpi != NULL); 3249 assert(lpi->xprslp != NULL); 3250 assert(dval != NULL); 3257 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblcontrol(lpi->xprslp, XPRS_FEASTOL, &dctrlval) ); 3261 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblcontrol(lpi->xprslp, XPRS_OPTIMALITYTOL, &dctrlval) ); 3265 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblcontrol(lpi->xprslp, XPRS_BARGAPSTOP, &dctrlval) ); 3269 CHECK_ZERO( lpi->messagehdlr, XPRSgetintcontrol(lpi->xprslp, XPRS_MAXTIME, &ictrlval) ); 3270 *dval = (double) ictrlval; 3273 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblcontrol(lpi->xprslp, XPRS_MARKOWITZTOL, &dctrlval) ); 3278 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblcontrol(lpi->xprslp, XPRS_MIPABSCUTOFF, &dctrlval) ); 3283 CHECK_ZERO( lpi->messagehdlr, XPRSgetdblcontrol(lpi->xprslp, XPRS_MIPABSCUTOFF, &dctrlval) ); 3300 assert(lpi != NULL); 3301 assert(lpi->xprslp != NULL); 3308 CHECK_ZERO( lpi->messagehdlr, XPRSsetdblcontrol(lpi->xprslp, XPRS_FEASTOL, dval) ); 3311 CHECK_ZERO( lpi->messagehdlr, XPRSsetdblcontrol(lpi->xprslp, XPRS_OPTIMALITYTOL, dval) ); 3314 CHECK_ZERO( lpi->messagehdlr, XPRSsetdblcontrol(lpi->xprslp, XPRS_BARGAPSTOP, dval) ); 3318 int ival = (int) dval; 3319 CHECK_ZERO( lpi->messagehdlr, XPRSsetintcontrol(lpi->xprslp, XPRS_MAXTIME, ival) ); 3323 CHECK_ZERO( lpi->messagehdlr, XPRSsetdblcontrol(lpi->xprslp, XPRS_MARKOWITZTOL, dval) ); 3327 CHECK_ZERO( lpi->messagehdlr, XPRSsetdblcontrol(lpi->xprslp, XPRS_MIPABSCUTOFF, dval) ); 3331 CHECK_ZERO( lpi->messagehdlr, XPRSsetdblcontrol(lpi->xprslp, XPRS_MIPABSCUTOFF, dval) ); 3353 assert(lpi != NULL); 3354 return XPRS_PLUSINFINITY; 3363 assert(lpi != NULL); 3364 return (val >= XPRS_PLUSINFINITY); 3381 assert(lpi != NULL); 3382 assert(lpi->xprslp != NULL); 3386 CHECK_ZERO( lpi->messagehdlr, XPRSreadprob(lpi->xprslp, fname, "") ); 3397 assert(lpi != NULL); 3398 assert(lpi->xprslp != NULL); 3402 CHECK_ZERO( lpi->messagehdlr, XPRSwriteprob(lpi->xprslp, fname, "p") ); enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
#define CHECK_ZERO(messagehdlr, x)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasPrimalRay(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)
enum SCIP_ObjSen SCIP_OBJSEN
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, int *ind, SCIP_Real *obj)
interface methods for specific LP solvers
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
struct SCIP_Messagehdlr SCIP_MESSAGEHDLR
const char * SCIPlpiGetSolverDesc(void)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
#define XPRS_LP_OPTIMAL_SCALEDINFEAS
enum SCIP_LPParam SCIP_LPPARAM
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
SCIP_DUALPACKET ROWPACKET
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_DUALPACKET COLPACKET
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
enum SCIP_Pricing SCIP_PRICING
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS *lpinorms)
SCIP_DUALPACKET COLPACKET
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
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_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
#define XPRS_LPQUICKPRESOLVE
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_DUALPACKET ROWPACKET
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
struct SCIP_LPiState SCIP_LPISTATE
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsense)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int row, SCIP_Real *coef, int *inds, int *ninds)
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
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_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRows(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss, int *nnonz, int *beg, int *ind, SCIP_Real *val)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
int SCIPlpiGetInternalStatus(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 SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
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 SCIPlpiFree(SCIP_LPI **lpi)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
#define ABORT_ZERO(messagehdlr, retval, x)
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 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 SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE *lpistate)
#define SCIP_CALL_ABORT(x)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
|