46 #define MSKCONST const 53 #include "tinycthread/tinycthread.h" 56 #if defined(_WIN32) || defined(_WIN64) 57 #define snprintf _snprintf 60 #if ( MSK_VERSION_MAJOR < 7 ) 61 #error "The MOSEK interface only works for MOSEK versions 7.0.0.0 and newer" 64 #define scipmskobjsen MSKobjsensee 65 #define SENSE2MOSEK(objsen) (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE)) 69 #define MOSEK_CALL(x) do \ 71 MSKrescodee _restat_; \ 73 if( (_restat_) != MSK_RES_OK && (_restat_ ) != MSK_RES_TRM_MAX_NUM_SETBACKS ) \ 75 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \ 76 return SCIP_LPERROR; \ 82 #define SCIP_ABORT_FALSE(x) do \ 84 SCIP_RETCODE _restat_; \ 85 if( (_restat_ = (x)) != SCIP_OKAY ) \ 87 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \ 94 #define IS_POSINF(x) ((x) >= MSK_INFINITY) 95 #define IS_NEGINF(x) ((x) <= -MSK_INFINITY) 96 #define MOSEK_relDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(val2))) ) 98 #ifdef SCIP_THREADSAFE 99 #if defined(_Thread_local) 102 static _Thread_local
int numlp = 0;
103 #define SCIP_REUSEENV 109 #define SCIP_REUSEENV 112 #if MSK_VERSION_MAJOR >= 9 113 #define NEAR_REL_TOLERANCE 1.0 115 #define DEBUG_PRINT_STAT 0 116 #define DEBUG_PARAM_SETTING 0 117 #define DEBUG_CHECK_DATA 0 118 #define DEBUG_EASY_REPRODUCE 0 119 #define DEBUG_DO_INTPNT_FEAS_CHECK 0 120 #define DEBUG_CHECK_STATE_TOL 1e-5 121 #define SHOW_ERRORS 0 122 #define SHOW_RELATIVE_OPTIMAL_GAP 0 123 #define ASSERT_ON_NUMERICAL_TROUBLES 0 124 #define ASSERT_ON_WARNING 0 125 #define FORCE_MOSEK_LOG 0 126 #define FORCE_MOSEK_SUMMARY 0 127 #define FORCE_NO_MAXITER 0 128 #define SETBACK_LIMIT 250 129 #define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE 130 #define SUPRESS_NAME_ERROR 1 132 #define WRITE_PRIMAL 0 133 #define WRITE_INTPNT 0 134 #if WRITE_DUAL > 0 || WRITE_PRIMAL > 0 || WRITE_INTPNT > 0 || FORCE_MOSEK_LOG > 0 || FORCE_MOSEK_SUMMARY > 0 135 #define WRITE_ABOVE 0 137 #define DEGEN_LEVEL MSK_SIM_DEGEN_FREE 138 #define ALWAYS_SOLVE_PRIMAL_FORM 1 139 #if DEBUG_PRINT_STAT > 0 140 static int numstrongbranchmaxiterup = 0;
141 static int numstrongbranchmaxiterdo = 0;
142 static int numprimalmaxiter = 0;
143 static int numdualmaxiter = 0;
144 static int numstrongbranchobjup = 0;
145 static int numstrongbranchobjdo = 0;
146 static int numprimalobj = 0;
147 static int numdualobj = 0;
150 #if DEBUG_PRINT_STAT > 0 151 static int numstrongbranchmaxiterup = 0;
152 static int numstrongbranchmaxiterdo = 0;
153 static int numprimalmaxiter = 0;
154 static int numdualmaxiter = 0;
155 static int numstrongbranchobjup = 0;
156 static int numstrongbranchobjdo = 0;
157 static int numprimalobj = 0;
158 static int numdualobj = 0;
197 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 199 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 224 MSKsoltypee whichsol,
233 res = MSK_getprosta(task, whichsol, prosta);
234 if ( res != MSK_RES_OK )
239 res = MSK_getsolsta(task, whichsol, solsta);
240 if ( res != MSK_RES_OK )
268 MSKuserhandle_t handle,
272 #if SUPRESS_NAME_ERROR 274 (void) snprintf(errstr, 32,
"MOSEK Error %d", MSK_RES_ERR_DUP_NAME);
275 if (0 == strncmp(errstr, str, strlen(errstr)))
282 #if DEBUG_CHECK_DATA > 0 287 const char* functionname
307 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
330 for( i = 0; i < numvar; i++ )
332 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, i, &tbkx[i], &tblx[i], &tbux[i]) );
335 for( i = 0; i < numcon; i++ )
337 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_CON, i, &tbkc[i], &tblc[i], &tbuc[i]) );
340 for( i = 0; i < numcon; ++i )
344 if( ( tskc[i] == MSK_SK_FIX && tbkc[i] != MSK_BK_FX ) ||
345 ( tskc[i] == MSK_SK_LOW && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_RA ) ) ||
346 ( tskc[i] == MSK_SK_UPR && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_RA ) ) )
348 SCIPerrorMessage(
"STATUS KEY ERROR i %d bkc %d skc %d %s\n", i, tbkc[i], tskc[i], functionname);
352 if( tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA )
360 if( tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA )
369 for( i = 0; i < numvar; ++i )
371 if( tbkx[i] == MSK_BK_LO || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA )
379 if( tbkx[i] == MSK_BK_UP || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA )
485 for( i = 0; i < n; i++ )
506 else if (lb[i] == ub[i])
508 assert(lb[i] - ub[i] == 0);
509 assert(ub[i] - lb[i] == 0);
514 assert(lb[i] < ub[i]);
532 assert(beg !=
NULL || nnonz == 0);
537 for(i = 0; i < n-1; i++)
540 assert(aptre[i] >= beg[i]);
544 assert(aptre[n-1] >= beg[n-1]);
548 for( i = 0; i < n; i++ )
565 assert(first <= last);
569 for( i = first; i <= last; i++ )
589 assert(dstat !=
NULL);
590 assert(count !=
NULL);
593 for( i = 0; i < n; i++ )
609 for( i = 0; i < n; i++ )
629 for( i = 0; i < len; i++ )
749 #define STR_HELPER(x) #x 750 #define STR(x) STR_HELPER(x) 752 #if MSK_VERSION_MAJOR < 9 753 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION) 755 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_REVISION) 774 return "Linear Programming Solver developed by MOSEK Optimization Software (www.mosek.com)";
786 return (
void*) lpi->
task;
796 assert( lpi !=
NULL );
797 assert( ncols >= 0 );
798 assert( intInfo !=
NULL );
800 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
847 assert(name !=
NULL);
859 #if MSK_VERSION_MAJOR < 8 864 (*lpi)->lpid =
numlp++;
867 (*lpi)->numlp = &
numlp;
873 MOSEK_CALL( MSK_linkfunctoenvstream((*lpi)->mosekenv, MSK_STREAM_LOG, (MSKuserhandle_t) messagehdlr,
printstr) );
874 #if MSK_VERSION_MAJOR < 8 879 MOSEK_CALL( MSK_makeemptytask((*lpi)->mosekenv, &((*lpi)->task)) );
881 MOSEK_CALL( MSK_linkfunctotaskstream((*lpi)->task, MSK_STREAM_LOG, (MSKuserhandle_t) messagehdlr,
printstr) );
885 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_FREE_SIMPLEX) );
887 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_SIM_SWITCH_OPTIMIZER, MSK_ON) );
888 MOSEK_CALL( MSK_puttaskname((*lpi)->task, (
char*) name) );
891 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_AIJ_HUGE, MSK_INFINITY * 2));
892 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_C_HUGE, MSK_INFINITY));
895 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_AIJ_LARGE, MSK_INFINITY * 2));
896 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_CJ_LARGE, MSK_INFINITY));
899 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_BOUND_WRN, MSK_INFINITY));
901 (*lpi)->termcode = MSK_RES_OK;
902 (*lpi)->itercount = 0;
904 (*lpi)->lastalgo = MSK_OPTIMIZER_FREE;
909 (*lpi)->aptre =
NULL;
914 (*lpi)->aptresize = 0;
915 (*lpi)->lastsolvetype = (MSKsoltypee) -1;
916 (*lpi)->lpinfo =
FALSE;
917 (*lpi)->restrictselectdef = 50;
918 (*lpi)->fromscratch =
FALSE;
919 (*lpi)->clearstate =
FALSE;
924 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_LOG, MSK_OFF) );
925 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_LOG_SIM, MSK_OFF) );
936 assert(*lpi !=
NULL);
950 assert(*(*lpi)->numlp > 0);
953 if( *(*lpi)->numlp == 0 )
956 MOSEK_CALL( MSK_deleteenv((*lpi)->reusemosekenv) );
957 *(*lpi)->reusemosekenv =
NULL;
960 MOSEK_CALL( MSK_deleteenv(&(*lpi)->mosekenv) );
995 for( j = 0; j < nnonz; j++ )
996 assert( val[j] != 0.0 );
1000 assert(lpi !=
NULL);
1003 assert(lhs !=
NULL);
1004 assert(rhs !=
NULL);
1005 assert(obj !=
NULL);
1008 assert(beg !=
NULL);
1009 assert(ind !=
NULL);
1010 assert(val !=
NULL);
1016 #if DEBUG_CHECK_DATA > 0 1017 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiLoadColLP") );
1035 MOSEK_CALL( MSK_inputdata(lpi->
task, nrows, ncols, nrows, ncols, obj, 0.0, beg, lpi->
aptre, ind, val,
1036 lpi->
bkc, lhs, rhs, lpi->
bkx, lb, ub) );
1040 if( colnames !=
NULL )
1044 for( c = 0; c <
ncols; c++ )
1050 if( rownames !=
NULL )
1054 for( r = 0; r <
nrows; r++ )
1060 #if DEBUG_CHECK_DATA > 0 1061 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiLoadColLP") );
1081 #if MSK_VERSION_MAJOR < 7 1087 assert(lpi !=
NULL);
1090 assert(obj !=
NULL);
1093 assert(nnonz == 0 || beg !=
NULL);
1094 assert(nnonz == 0 || ind !=
NULL);
1095 assert(nnonz == 0 || val !=
NULL);
1103 #if DEBUG_CHECK_DATA > 0 1104 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddCols") );
1116 MOSEK_CALL( MSK_putcslice(lpi->
task, oldcols, oldcols+ncols, obj) );
1117 MOSEK_CALL( MSK_putvarboundslice(lpi->
task, oldcols, oldcols+ncols, lpi->
bkx, lb, ub) );
1127 for (j = 0; j < nnonz; ++j)
1129 assert( 0 <= ind[j] && ind[j] < nrows );
1130 assert( val[j] != 0.0 );
1136 MOSEK_CALL( MSK_putacolslice(lpi->
task, oldcols, oldcols+ncols, beg, lpi->
aptre, ind, val) );
1139 if( colnames !=
NULL )
1143 for( c = 0; c <
ncols; c++ )
1149 #if DEBUG_CHECK_DATA > 0 1150 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddCols") );
1165 assert(lpi !=
NULL);
1173 #if DEBUG_CHECK_DATA > 0 1174 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelCols") );
1179 MOSEK_CALL( MSK_removevars(lpi->
task, lastcol-firstcol+1, sub) );
1183 #if DEBUG_CHECK_DATA > 0 1184 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelCols") );
1204 assert(lpi !=
NULL);
1207 assert(dstat !=
NULL);
1213 #if DEBUG_CHECK_DATA > 0 1214 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelColset") );
1222 for( i = 0; i <
ncols; i++)
1242 #if DEBUG_CHECK_DATA > 0 1243 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelColset") );
1264 assert(lpi !=
NULL);
1267 assert(nnonz == 0 || beg !=
NULL);
1268 assert(nnonz == 0 || ind !=
NULL);
1269 assert(nnonz == 0 || val !=
NULL);
1275 #if DEBUG_CHECK_DATA > 0 1276 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddRows") );
1289 MOSEK_CALL( MSK_putconboundslice(lpi->
task, oldrows, oldrows+nrows, lpi->
bkc, lhs, rhs) );
1299 for (j = 0; j < nnonz; ++j)
1301 assert( val[j] != 0.0 );
1302 assert( 0 <= ind[j] && ind[j] < ncols );
1308 MOSEK_CALL( MSK_putarowslice(lpi->
task, oldrows, oldrows+nrows, beg, lpi->
aptre, ind, val) );
1311 if( rownames !=
NULL )
1315 for( r = 0; r <
nrows; r++ )
1321 #if DEBUG_CHECK_DATA > 0 1322 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddRows") );
1337 assert(lpi !=
NULL);
1345 #if DEBUG_CHECK_DATA > 0 1346 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRows") );
1353 MOSEK_CALL( MSK_removecons(lpi->
task, lastrow-firstrow+1, sub) );
1357 #if DEBUG_CHECK_DATA > 0 1358 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRows") );
1378 assert(lpi !=
NULL);
1386 #if DEBUG_CHECK_DATA > 0 1387 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRowset") );
1396 for( i = 0; i <
nrows; i++ )
1416 #if DEBUG_CHECK_DATA > 0 1417 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRowset end") );
1431 assert(lpi !=
NULL);
1459 assert(lpi !=
NULL);
1462 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1470 #if DEBUG_CHECK_DATA > 0 1471 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgBounds") );
1476 for (i = 0; i <
ncols; ++i)
1480 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1485 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1493 #if MSK_VERSION_MAJOR < 9 1494 MOSEK_CALL( MSK_putboundlist(lpi->
task, MSK_ACC_VAR, ncols, ind, lpi->
bkx, lb, ub) );
1499 #if DEBUG_CHECK_DATA > 0 1500 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgBounds") );
1515 assert(lpi !=
NULL);
1518 assert(ind !=
NULL);
1527 #if DEBUG_CHECK_DATA > 0 1528 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgSides") );
1534 #if MSK_VERSION_MAJOR < 9 1535 MOSEK_CALL( MSK_putboundlist(lpi->
task, MSK_ACC_CON, nrows, ind, lpi->
bkc, lhs, rhs) );
1540 #if DEBUG_CHECK_DATA > 0 1541 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgSides") );
1555 assert(lpi !=
NULL);
1563 #if DEBUG_CHECK_DATA > 0 1564 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgCoef") );
1569 #if DEBUG_CHECK_DATA > 0 1570 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgCoef") );
1582 assert(lpi !=
NULL);
1603 assert(lpi !=
NULL);
1606 assert(ind !=
NULL);
1607 assert(obj !=
NULL);
1613 #if DEBUG_CHECK_DATA > 0 1614 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgObj") );
1619 #if DEBUG_CHECK_DATA > 0 1620 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgObj") );
1640 assert(lpi !=
NULL);
1648 #if DEBUG_CHECK_DATA > 0 1649 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleRow") );
1652 assert(scaleval != 0);
1669 #if MSK_VERSION_MAJOR < 9 1670 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_CON, row, &bkc, &blc, &buc) );
1672 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_CON, row, bkc, blc, buc) );
1679 #if DEBUG_CHECK_DATA > 0 1680 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleRow") );
1701 assert(lpi !=
NULL);
1709 #if DEBUG_CHECK_DATA > 0 1710 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleCol") );
1713 assert(scaleval != 0);
1729 #if MSK_VERSION_MAJOR < 9 1730 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, col, &bkx, &blx, &bux) );
1732 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
1742 #if DEBUG_CHECK_DATA > 0 1743 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleCol") );
1761 assert(lpi !=
NULL);
1764 assert(nrows !=
NULL);
1779 assert(lpi !=
NULL);
1782 assert(ncols !=
NULL);
1797 assert(lpi !=
NULL);
1800 assert(nnonz !=
NULL);
1822 assert(lpi !=
NULL);
1825 assert(first <= last);
1829 #if DEBUG_CHECK_DATA > 0 1830 SCIP_CALL( scip_checkdata(lpi,
"getASlice") );
1837 assert(beg !=
NULL);
1838 assert(ind !=
NULL);
1839 assert(val !=
NULL);
1843 #if MSK_VERSION_MAJOR < 9 1844 MOSEK_CALL( MSK_getaslicenumnz(lpi->
task, iscon ? MSK_ACC_CON : MSK_ACC_VAR, first, last+1, nnonz) );
1846 MOSEK_CALL( MSK_getaslice(lpi->
task, iscon ? MSK_ACC_CON : MSK_ACC_VAR, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1850 MOSEK_CALL( MSK_getarowslicenumnz(lpi->
task, first, last+1, nnonz) );
1852 #if MSK_VERSION_MAJOR == 9 1853 MOSEK_CALL( MSK_getarowslice(lpi->
task, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1855 MOSEK_CALL( MSK_getarowslice(lpi->
task, first, last+1, *nnonz, beg, lpi->
aptre, ind, val) );
1861 MOSEK_CALL( MSK_getacolslicenumnz(lpi->
task, first, last+1, nnonz) );
1863 #if MSK_VERSION_MAJOR == 9 1864 MOSEK_CALL( MSK_getacolslice(lpi->
task, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1866 MOSEK_CALL( MSK_getacolslice(lpi->
task, first, last+1, *nnonz, beg, lpi->
aptre, ind, val) );
1872 assert(surplus == 0);
1875 #if DEBUG_CHECK_DATA > 0 1876 SCIP_CALL( scip_checkdata(lpi,
"getASlice") );
1898 assert(lpi !=
NULL);
1908 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
1936 assert(lpi !=
NULL);
1946 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
1952 #if DEBUG_CHECK_DATA > 0 1953 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetRows") );
1959 #if DEBUG_CHECK_DATA > 0 1960 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetRows") );
1973 int namestoragesize,
1977 assert(lpi !=
NULL);
1980 assert(0 <= firstcol && firstcol <= lastcol);
1981 assert(colnames !=
NULL || namestoragesize == 0);
1982 assert(namestorage !=
NULL || namestoragesize == 0);
1983 assert(namestoragesize >= 0);
1984 assert(storageleft !=
NULL);
1998 int namestoragesize,
2002 assert(lpi !=
NULL);
2005 assert(0 <= firstrow && firstrow <= lastrow);
2006 assert(rownames !=
NULL || namestoragesize == 0);
2007 assert(namestorage !=
NULL || namestoragesize == 0);
2008 assert(namestoragesize >= 0);
2009 assert(storageleft !=
NULL);
2022 MSKobjsensee mskobjsen;
2024 assert(lpi !=
NULL);
2027 assert(objsen !=
NULL);
2045 assert(lpi !=
NULL);
2048 assert(firstcol <= lastcol);
2049 assert(vals !=
NULL);
2053 MOSEK_CALL( MSK_getcslice(lpi->
task, firstcol, lastcol+1, vals) );
2067 assert(lpi !=
NULL);
2070 assert(firstcol <= lastcol);
2074 #if DEBUG_CHECK_DATA > 0 2075 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetBounds") );
2078 #if MSK_VERSION_MAJOR < 9 2079 MOSEK_CALL( MSK_getboundslice(lpi->
task, MSK_ACC_VAR, firstcol, lastcol+1,
NULL, lbs, ubs) );
2096 assert(lpi !=
NULL);
2099 assert(firstrow <= lastrow);
2103 #if DEBUG_CHECK_DATA > 0 2104 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetSides") );
2107 #if MSK_VERSION_MAJOR < 9 2108 MOSEK_CALL( MSK_getboundslice(lpi->
task, MSK_ACC_CON, firstrow, lastrow+1,
NULL, lhss, rhss) );
2110 MOSEK_CALL( MSK_getconboundslice(lpi->
task, firstrow, lastrow+1,
NULL, lhss, rhss) );
2113 #if DEBUG_CHECK_DATA > 0 2114 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetSides") );
2128 assert(lpi !=
NULL);
2131 assert(val !=
NULL);
2135 #if DEBUG_CHECK_DATA > 0 2136 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetCoef") );
2141 #if DEBUG_CHECK_DATA > 0 2142 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetCoef") );
2161 assert(lpi !=
NULL);
2178 assert( termcode !=
NULL );
2180 #if ASSERT_ON_NUMERICAL_TROUBLES > 0 2181 if ( res == MSK_RES_TRM_MAX_NUM_SETBACKS || res == MSK_RES_TRM_NUMERICAL_PROBLEM )
2192 if ( res == MSK_RES_TRM_MAX_ITERATIONS || res == MSK_RES_TRM_MAX_TIME
2193 || res == MSK_RES_TRM_OBJECTIVE_RANGE || res == MSK_RES_TRM_STALL )
2199 *termcode = MSK_RES_OK;
2210 int itercount_primal;
2219 assert(lpi !=
NULL);
2227 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, &presolve) );
2228 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, &maxiter) );
2231 #if DEBUG_EASY_REPRODUCE 2232 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_AUTO_SORT_A_BEFORE_OPT, MSK_ON) );
2233 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_OFF) );
2235 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2238 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_AUTO_UPDATE_SOL_INFO, MSK_OFF) );
2244 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG_SIM_FREQ, 1) );
2252 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
2256 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_OFF) );
2260 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_ON) );
2263 #if ALWAYS_SOLVE_PRIMAL_FORM > 0 2265 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SOLVE_FORM, MSK_SOLVE_PRIMAL) );
2268 #if DEBUG_CHECK_DATA > 0 2269 SCIP_CALL( scip_checkdata(lpi,
"SolveWSimplex") );
2272 if( gotbasicsol && maxiter < 20000 )
2275 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION, 0) );
2276 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION, 0) );
2285 #if FORCE_NO_MAXITER > 0 2286 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, 2000000000) );
2289 #if DEBUG_CHECK_DATA > 0 2290 SCIP_CALL( scip_checkdata(lpi,
"Begin optimize with simplex") );
2293 #if FORCE_MOSEK_SUMMARY > 1 2303 #if MSK_VERSION_MAJOR < 10 2305 if( lpi->
termcode == MSK_RES_TRM_MAX_NUM_SETBACKS )
2309 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_SCALING, &scaling) );
2310 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) );
2312 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, scaling) );
2316 #if FORCE_MOSEK_SUMMARY 2328 #if DEBUG_CHECK_DATA > 0 2329 SCIP_CALL( scip_checkdata(lpi,
"End optimize with simplex") );
2333 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, presolve) );
2334 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) );
2337 MOSEK_CALL( MSK_getintinf(lpi->
task, MSK_IINF_SIM_PRIMAL_ITER, &itercount_primal) );
2338 MOSEK_CALL( MSK_getintinf(lpi->
task, MSK_IINF_SIM_DUAL_ITER, &itercount_dual) );
2340 lpi->
itercount = itercount_primal + itercount_dual;
2348 SCIPdebugMessage(
"maxiter = %d, termcode = %d, prosta = %d, solsta = %d, objval = %g : %g, iter = %d+%d\n",
2349 maxiter, lpi->
termcode, prosta, solsta, pobj, dobj, itercount_primal, itercount_dual);
2353 case MSK_SOL_STA_OPTIMAL:
2354 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS:
2355 case MSK_SOL_STA_PRIM_FEAS:
2356 case MSK_SOL_STA_DUAL_FEAS:
2357 case MSK_SOL_STA_PRIM_INFEAS_CER:
2358 case MSK_SOL_STA_DUAL_INFEAS_CER:
2363 case MSK_SOL_STA_UNKNOWN:
2365 assert( lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS || lpi->
termcode == MSK_RES_TRM_MAX_TIME ||
2366 lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE || lpi->
termcode == MSK_RES_TRM_STALL ||
2369 if ( lpi->
termcode != MSK_RES_TRM_MAX_ITERATIONS && lpi->
termcode != MSK_RES_TRM_MAX_TIME &&
2370 lpi->
termcode != MSK_RES_TRM_OBJECTIVE_RANGE )
2373 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2374 #if ASSERT_ON_WARNING 2380 #if MSK_VERSION_MAJOR < 9 2381 case MSK_SOL_STA_NEAR_OPTIMAL:
2382 case MSK_SOL_STA_NEAR_PRIM_FEAS:
2383 case MSK_SOL_STA_NEAR_DUAL_FEAS:
2384 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS:
2385 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER:
2386 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER:
2388 assert(lpi->
termcode == MSK_RES_OK);
2391 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2392 #if ASSERT_ON_WARNING 2398 case MSK_SOL_STA_INTEGER_OPTIMAL:
2399 #if MSK_VERSION_MAJOR < 9 2400 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL:
2407 #if ASSERT_ON_WARNING 2417 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
2418 case MSK_PRO_STA_PRIM_FEAS:
2419 case MSK_PRO_STA_DUAL_FEAS:
2420 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
2421 case MSK_PRO_STA_PRIM_INFEAS:
2422 case MSK_PRO_STA_DUAL_INFEAS:
2423 case MSK_PRO_STA_UNKNOWN:
2426 #if MSK_VERSION_MAJOR < 9 2427 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
2428 case MSK_PRO_STA_NEAR_PRIM_FEAS:
2429 case MSK_PRO_STA_NEAR_DUAL_FEAS:
2431 case MSK_PRO_STA_ILL_POSED:
2432 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
2433 assert(lpi->
termcode == MSK_RES_OK);
2436 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2438 #if ASSERT_ON_WARNING 2448 #if ASSERT_ON_WARNING 2456 #if SHOW_RELATIVE_OPTIMAL_GAP 2457 if ( solsta == MSK_SOL_STA_OPTIMAL && fabs(pobj) + fabs(dobj) > 1.0e-6 && fabs(pobj-dobj) > 0.0001*(fabs(pobj) + fabs(dobj)))
2459 SCIPerrorMessage(
"Simplex[%d] returned optimal solution with different objvals %g != %g reldiff %.2g%%\n",
2460 lpi->
optimizecount, pobj, dobj, 100.0 * fabs(pobj-dobj)/
MAX(fabs(pobj), fabs(dobj)));
2465 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2467 if (solsta != MSK_SOL_STA_DUAL_FEAS && solsta != MSK_SOL_STA_OPTIMAL && solsta != MSK_SOL_STA_PRIM_AND_DUAL_FEAS)
2477 if (maxiter >= 2000000000)
2479 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) );
2481 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2490 #if DEBUG_DO_INTPNT_FEAS_CHECK 2491 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER)
2499 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER)
2510 #if DEBUG_PRINT_STAT > 0 2511 SCIPdebugMessage(
"Max iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2512 lpi->
optimizecount, numstrongbranchmaxiterup, numstrongbranchmaxiterdo, numprimalmaxiter, numdualmaxiter);
2513 SCIPdebugMessage(
"Objcut iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2514 lpi->
optimizecount, numstrongbranchobjup, numstrongbranchobjdo, numprimalobj, numdualobj);
2517 #if DEBUG_CHECK_DATA > 0 2518 SCIP_CALL( scip_checkdata(lpi,
"SolveWSimplex") );
2529 assert(lpi !=
NULL);
2537 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2541 MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS) );
2544 #if DEBUG_CHECK_DATA > 0 2545 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolvePrimal") );
2548 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_PRIMAL_SIMPLEX) );
2549 lpi->
lastalgo = MSK_OPTIMIZER_PRIMAL_SIMPLEX;
2551 #if WRITE_PRIMAL > 0 2558 MSK_writedata(lpi->
task, fname);
2564 #ifdef SCIP_DISABLED_CODE 2566 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
2572 if( solsta != MSK_SOL_STA_PRIM_FEAS )
2579 #if DEBUG_PRINT_STAT > 0 2580 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2584 #if DEBUG_PRINT_STAT > 0 2585 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2589 #if DEBUG_CHECK_DATA > 0 2590 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolvePrimal") );
2601 assert(lpi !=
NULL);
2610 #if (MSK_VERSION_MAJOR < 8) || (MSK_VERSION_MAJOR == 8 && MSK_VERSION_MINOR == 0) 2611 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_INTEGER, MSK_ON) );
2613 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2617 MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS) );
2620 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_DUAL_SIMPLEX) );
2621 lpi->
lastalgo = MSK_OPTIMIZER_DUAL_SIMPLEX;
2629 MSK_writedata(lpi->
task, fname);
2635 #ifdef SCIP_DISABLED_CODE 2637 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
2643 if( solsta != MSK_SOL_STA_DUAL_FEAS )
2650 #if DEBUG_PRINT_STAT > 0 2651 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2655 #if DEBUG_PRINT_STAT > 0 2656 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2672 assert(lpi !=
NULL);
2694 #if DEBUG_CHECK_DATA > 0 2695 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolveBarrier") );
2698 #ifdef SCIP_DISABLED_CODE 2701 MSK_SIM_HOTSTART_NONE : MSK_INTPNT_HOTSTART_PRIMAL_DUAL) );
2705 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_BASIS, crossover ? MSK_BI_ALWAYS : MSK_BI_NEVER) );
2706 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_INTPNT) );
2707 lpi->
lastalgo = MSK_OPTIMIZER_INTPNT;
2709 #if MSK_VERSION_MAJOR >= 9 2710 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_INTPNT_CO_TOL_NEAR_REL, NEAR_REL_TOLERANCE) );
2713 #if WRITE_INTPNT > 0 2720 MSK_writedata(lpi->
task, fname);
2726 #if DEBUG_PRINT_STAT > 0 2727 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2739 case MSK_SOL_STA_OPTIMAL:
2740 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS:
2741 case MSK_SOL_STA_PRIM_FEAS:
2742 case MSK_SOL_STA_DUAL_FEAS:
2743 case MSK_SOL_STA_PRIM_INFEAS_CER:
2744 case MSK_SOL_STA_DUAL_INFEAS_CER:
2748 case MSK_SOL_STA_UNKNOWN:
2749 #if MSK_VERSION_MAJOR < 9 2750 case MSK_SOL_STA_NEAR_OPTIMAL:
2751 case MSK_SOL_STA_NEAR_PRIM_FEAS:
2752 case MSK_SOL_STA_NEAR_DUAL_FEAS:
2753 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS:
2754 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER:
2755 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER:
2760 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2762 #if ASSERT_ON_WARNING 2766 case MSK_SOL_STA_INTEGER_OPTIMAL:
2767 #if MSK_VERSION_MAJOR < 9 2768 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL:
2775 #if ASSERT_ON_WARNING 2784 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
2785 case MSK_PRO_STA_PRIM_FEAS:
2786 case MSK_PRO_STA_DUAL_FEAS:
2787 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
2788 case MSK_PRO_STA_PRIM_INFEAS:
2789 case MSK_PRO_STA_DUAL_INFEAS:
2791 case MSK_PRO_STA_UNKNOWN:
2792 #if MSK_VERSION_MAJOR < 9 2793 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
2794 case MSK_PRO_STA_NEAR_PRIM_FEAS:
2795 case MSK_PRO_STA_NEAR_DUAL_FEAS:
2797 case MSK_PRO_STA_ILL_POSED:
2798 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
2802 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2806 #if ASSERT_ON_WARNING 2815 #if ASSERT_ON_WARNING 2822 #if DEBUG_CHECK_DATA > 0 2823 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolveBarrier") );
2834 assert(lpi !=
NULL);
2847 assert(lpi !=
NULL);
2874 MSKobjsensee objsen;
2888 assert(lpi !=
NULL);
2894 #if DEBUG_CHECK_DATA > 0 2895 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiStrongbranch") );
2909 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, &olditerlim) );
2910 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, &oldselection) );
2911 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART, &oldhotstart) );
2913 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, itlim) );
2916 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
2918 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, &bound) );
2922 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, &bound) );
2925 #if MSK_VERSION_MAJOR < 9 2926 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, col, &bkx, &blx, &bux) );
2933 newub =
EPSCEIL(psol-1.0, 1e-06);
2935 if (newub < blx - 0.5)
2946 else if (
EPSEQ(blx, newub,1.0e-6))
2954 #if MSK_VERSION_MAJOR < 9 2955 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, newbk, blx, newub) );
2957 MOSEK_CALL( MSK_putvarbound(lpi->
task, col, newbk, blx, newub) );
3000 #if DEBUG_PRINT_STAT > 0 3001 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
3002 ++numstrongbranchobjup;
3004 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
3005 ++numstrongbranchmaxiterup;
3010 #if MSK_VERSION_MAJOR < 9 3011 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
3018 if (newlb > bux + 0.5)
3029 else if (
EPSEQ(bux, newlb,1.0e-6))
3037 #if MSK_VERSION_MAJOR < 9 3038 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, newbk, newlb, bux) );
3040 MOSEK_CALL( MSK_putvarbound(lpi->
task, col, newbk, newlb, bux) );
3080 #if DEBUG_PRINT_STAT > 0 3081 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
3082 ++numstrongbranchobjdo;
3084 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
3085 ++numstrongbranchmaxiterdo;
3089 #if MSK_VERSION_MAJOR < 9 3090 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
3094 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, olditerlim) );
3095 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, oldselection) );
3096 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART, oldhotstart) );
3105 #if DEBUG_CHECK_DATA > 0 3106 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiStrongbranch") );
3159 assert( cols !=
NULL );
3160 assert( psols !=
NULL );
3161 assert( down !=
NULL );
3162 assert( up !=
NULL );
3163 assert( downvalid !=
NULL );
3164 assert( upvalid !=
NULL );
3165 assert( down !=
NULL );
3170 for (j = 0; j <
ncols; ++j)
3223 assert( cols !=
NULL );
3224 assert( psols !=
NULL );
3225 assert( down !=
NULL );
3226 assert( up !=
NULL );
3227 assert( downvalid !=
NULL );
3228 assert( upvalid !=
NULL );
3229 assert( down !=
NULL );
3234 for (j = 0; j <
ncols; ++j)
3253 assert(lpi !=
NULL);
3276 assert( lpi !=
NULL );
3279 assert( primalfeasible !=
NULL );
3280 assert( dualfeasible !=
NULL );
3288 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
3289 *primalfeasible =
TRUE;
3290 *dualfeasible =
TRUE;
3292 case MSK_PRO_STA_PRIM_FEAS:
3293 *primalfeasible =
TRUE;
3294 *dualfeasible =
FALSE;
3296 case MSK_PRO_STA_DUAL_FEAS:
3297 *primalfeasible =
FALSE;
3298 *dualfeasible =
TRUE;
3300 case MSK_PRO_STA_DUAL_INFEAS:
3302 *primalfeasible = (lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX);
3303 *dualfeasible =
FALSE;
3305 case MSK_PRO_STA_UNKNOWN:
3306 case MSK_PRO_STA_PRIM_INFEAS:
3307 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
3308 case MSK_PRO_STA_ILL_POSED:
3309 #if MSK_VERSION_MAJOR < 9 3310 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
3311 case MSK_PRO_STA_NEAR_PRIM_FEAS:
3312 case MSK_PRO_STA_NEAR_DUAL_FEAS:
3314 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
3315 *primalfeasible =
FALSE;
3316 *dualfeasible =
FALSE;
3335 assert(lpi !=
NULL);
3343 return ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER
3344 || prosta == MSK_PRO_STA_DUAL_INFEAS
3345 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS );
3357 assert(lpi !=
NULL);
3365 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER);
3375 assert(lpi !=
NULL);
3382 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX);
3390 assert(lpi !=
NULL);
3404 assert(lpi !=
NULL);
3412 return (prosta == MSK_PRO_STA_PRIM_FEAS || prosta == MSK_PRO_STA_PRIM_AND_DUAL_FEAS || (prosta == MSK_PRO_STA_DUAL_INFEAS && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX));
3425 assert(lpi !=
NULL);
3433 return ( solsta == MSK_SOL_STA_PRIM_INFEAS_CER
3434 || prosta == MSK_PRO_STA_PRIM_INFEAS
3435 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS );
3447 assert(lpi !=
NULL);
3455 return (solsta == MSK_SOL_STA_PRIM_INFEAS_CER);
3463 assert(lpi !=
NULL);
3475 assert(lpi !=
NULL);
3489 assert(lpi !=
NULL);
3497 return (prosta == MSK_PRO_STA_DUAL_FEAS || prosta == MSK_PRO_STA_PRIM_AND_DUAL_FEAS);
3507 assert(lpi !=
NULL);
3515 return (solsta == MSK_SOL_STA_OPTIMAL);
3529 assert(lpi !=
NULL);
3537 MSKobjsensee objsen;
3542 res = MSK_getobjsense(lpi->
task, &objsen);
3543 if ( res != MSK_RES_OK )
3546 if ( objsen == MSK_OBJECTIVE_SENSE_MINIMIZE )
3548 res = MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, &objlimit);
3552 res = MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, &objlimit);
3554 if ( res != MSK_RES_OK )
3557 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3560 res = MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, &objvalue);
3567 if ( res != MSK_RES_OK )
3570 if ( objsen == MSK_OBJECTIVE_SENSE_MAXIMIZE )
3579 return ( lpi->
termcode == MSK_RES_OK
3580 || lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS
3581 || lpi->
termcode == MSK_RES_TRM_MAX_TIME
3582 || lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE );
3590 assert(lpi !=
NULL);
3594 return ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE );
3602 assert(lpi !=
NULL);
3606 return ( lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS );
3614 assert(lpi !=
NULL);
3618 return ( lpi->
termcode == MSK_RES_TRM_MAX_TIME );
3629 assert(lpi !=
NULL);
3639 return (
int) solsta;
3648 assert(lpi !=
NULL);
3651 assert(success !=
NULL);
3666 assert(lpi !=
NULL);
3669 assert(objval !=
NULL);
3675 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3678 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, objval) );
3708 assert(lpi !=
NULL);
3714 if ( objval !=
NULL )
3716 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3719 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, objval) );
3734 if ( primsol !=
NULL && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX )
3740 if ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER )
3749 for (j = 0; j <
ncols; ++j)
3789 for( i = 0; i <
ncols; i++ )
3791 assert(sux !=
NULL);
3792 redcost[i] -= sux[i];
3806 assert(lpi !=
NULL);
3809 assert(ray !=
NULL);
3825 assert(lpi !=
NULL);
3828 assert(dualfarkas !=
NULL);
3832 MOSEK_CALL( MSK_getsolution(lpi->
task, lpi->
lastsolvetype,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, dualfarkas,
3844 assert(lpi !=
NULL);
3847 assert(iterations !=
NULL);
3867 assert(lpi !=
NULL);
3870 assert(quality !=
NULL);
3886 if (res == MSK_RES_ERR_BASIS_SINGULAR)
3922 for( i = 0; i < n; i++ )
3936 #if MSK_VERSION_MAJOR < 9 3941 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3942 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3946 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3947 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3968 #if MSK_VERSION_MAJOR < 10 3998 for( i = 0; i < m; i++ )
4011 #if MSK_VERSION_MAJOR < 9 4016 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4017 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4021 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4022 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4039 #if MSK_VERSION_MAJOR < 10 4060 for( i = 0; i < n; i++ )
4065 resstat[i] = MSK_SK_LOW;
4068 resstat[i] = MSK_SK_BAS;
4071 resstat[i] = MSK_SK_UPR;
4074 resstat[i] = MSK_SK_SUPBAS;
4093 for( i = 0; i < n; i++ )
4098 resstat[i] = MSK_SK_UPR;
4101 resstat[i] = MSK_SK_BAS;
4104 resstat[i] = MSK_SK_LOW;
4107 resstat[i] = MSK_SK_SUPBAS;
4128 assert(lpi !=
NULL);
4163 assert(lpi !=
NULL);
4170 assert(cstat !=
NULL || ncols == 0);
4171 assert(rstat !=
NULL || nrows == 0);
4196 assert(lpi !=
NULL);
4199 assert(bind !=
NULL);
4207 for (i = 0; i <
nrows; i++ )
4209 if (bind[i] < nrows)
4210 bind[i] = -1 - bind[i];
4212 bind[i] = bind[i] -
nrows;
4240 assert(lpi !=
NULL);
4243 assert(coef !=
NULL);
4250 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4256 for (i = 0; i <
nrows; ++i)
4261 if ( ninds !=
NULL && inds !=
NULL )
4267 #if MSK_VERSION_MAJOR < 10 4268 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, ninds, inds, coef) );
4270 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, *ninds, inds, coef, ninds) );
4272 assert( *ninds <= nrows );
4285 #if MSK_VERSION_MAJOR < 10 4286 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, &numnz, sub, coef) );
4288 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, numnz, sub, coef, &numnz) );
4290 assert( numnz <= nrows );
4294 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4327 assert(lpi !=
NULL);
4330 assert(coef !=
NULL);
4337 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4343 for (i = 0; i <
nrows; ++i)
4348 if ( ninds !=
NULL && inds !=
NULL )
4353 #if MSK_VERSION_MAJOR < 10 4354 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, ninds, inds, coef) );
4356 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, *ninds, inds, coef, ninds) );
4358 assert( *ninds <= nrows );
4370 #if MSK_VERSION_MAJOR < 10 4371 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, &numnz, sub, coef) );
4373 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, numnz, sub, coef, &numnz) );
4375 assert( numnz <= nrows );
4379 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4414 assert(lpi !=
NULL);
4417 assert(coef !=
NULL);
4423 if ( ninds !=
NULL )
4432 if( binvrow ==
NULL )
4444 for (i = 0; i <
ncols; ++i)
4450 for (k = 0; k < numnz; ++k)
4452 assert( 0 <= csub[k] && csub[k] < nrows );
4453 coef[i] += binv[csub[k]] * cval[k];
4487 assert(lpi !=
NULL);
4490 assert(coef !=
NULL);
4499 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4505 for (i = 0; i <
nrows; ++i)
4509 if ( ninds !=
NULL && inds !=
NULL )
4513 for (i = 0; i < numnz; ++i)
4515 assert( 0 <= inds[i] && inds[i] < nrows );
4516 coef[inds[i]] = val[i];
4521 #if MSK_VERSION_MAJOR < 10 4522 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, ninds, inds, coef) );
4524 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, *ninds, inds, coef, ninds) );
4526 assert( *ninds <= nrows );
4535 for (i = 0; i < numnz; ++i)
4537 assert( 0 <= sub[i] && sub[i] < nrows );
4538 coef[sub[i]] = val[i];
4541 #if MSK_VERSION_MAJOR < 10 4542 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, &numnz, sub, coef) );
4544 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, numnz, sub, coef, &numnz) );
4547 if ( ninds !=
NULL )
4554 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4573 assert(lpistate !=
NULL);
4574 assert(blkmem !=
NULL);
4582 (*lpistate)->solsta = MSK_SOL_STA_UNKNOWN;
4583 (*lpistate)->num = -1;
4584 (*lpistate)->ncols =
ncols;
4585 (*lpistate)->nrows =
nrows;
4597 assert(blkmem !=
NULL);
4598 assert(lpistate !=
NULL);
4599 assert(*lpistate !=
NULL);
4622 assert(lpi !=
NULL);
4633 for( i = 0; i < n; i++ )
4644 #if MSK_VERSION_MAJOR < 9 4649 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4650 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4654 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4655 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4693 assert(lpi !=
NULL);
4713 int *skxi = (
int *) lpi->
skx;
4714 int *skci = (
int *) lpi->
skc;
4716 assert(
sizeof(
int) ==
sizeof(MSKstakeye));
4717 assert(lpi !=
NULL);
4718 assert(lpistate !=
NULL);
4738 assert(
sizeof(
int) ==
sizeof(MSKstakeye));
4761 assert(lpi !=
NULL);
4764 assert(lpistate !=
NULL);
4765 assert(blkmem !=
NULL);
4772 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
4817 assert(lpi !=
NULL);
4820 assert(blkmem !=
NULL);
4821 #ifdef SCIP_DISABLED_CODE 4825 if (lpistate ==
NULL)
4831 if (lpistate->
nrows == 0 || lpistate->
ncols == 0)
4836 assert(lpistate->
nrows <= nrows);
4837 assert(lpistate->
ncols <= ncols);
4841 #ifdef SCIP_DISABLED_CODE 4848 for (i = lpistate->
ncols; i < ncols; ++i)
4852 #if MSK_VERSION_MAJOR < 9 4861 lpi->
skx[i] = MSK_SK_SUPBAS;
4863 lpi->
skx[i] = MSK_SK_UPR;
4866 lpi->
skx[i] = MSK_SK_LOW;
4868 for (i = lpistate->
nrows; i < nrows; ++i)
4869 lpi->
skc[i] = MSK_SK_BAS;
4886 assert(lpi !=
NULL);
4902 assert(lpi !=
NULL);
4905 assert(lpistate !=
NULL);
4906 assert(blkmem !=
NULL);
4910 if( *lpistate !=
NULL )
4924 assert(lpi !=
NULL);
4930 return ( lpistate !=
NULL && lpistate->
num >= 0);
4942 assert(lpi !=
NULL);
4945 assert(fname !=
NULL);
4969 assert(lpi !=
NULL);
4972 assert(fname !=
NULL);
4979 SCIPdebugMessage(
"No LP state written, since it was cleared after the last solve \n");
4988 for( v = 0; v < nvars; v++ )
4991 if( strcmp(name,
"") == 0 )
5000 for( c = 0; c < nconss; c++ )
5003 if( strcmp(name,
"") == 0 )
5014 " names instead. Note that this state cannot be read back in later!\n",
5015 v < nvars ?
"variable" :
"constraint", v < nvars ? v : c);
5019 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_HEAD, MSK_ON) );
5020 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_VARIABLES, MSK_ON) );
5021 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_CONSTRAINTS, MSK_ON) );
5046 assert(lpi !=
NULL);
5049 assert(lpinorms !=
NULL);
5050 assert(blkmem !=
NULL);
5066 assert(lpi !=
NULL);
5068 assert(lpinorms ==
NULL);
5081 assert(lpi !=
NULL);
5083 assert(lpinorms ==
NULL);
5097 "SCIP_LPPAR_FROMSCRATCH",
5098 "SCIP_LPPAR_FASTMIP",
5099 "SCIP_LPPAR_SCALING",
5100 "SCIP_LPPAR_PRESOLVING",
5101 "SCIP_LPPAR_PRICING",
5102 "SCIP_LPPAR_LPINFO",
5103 "SCIP_LPPAR_FEASTOL",
5104 "SCIP_LPPAR_DUALFEASTOL",
5105 "SCIP_LPPAR_BARRIERCONVTOL",
5106 "SCIP_LPPAR_OBJLIM",
5107 "SCIP_LPPAR_LPITLIM",
5108 "SCIP_LPPAR_LPTILIM",
5109 "SCIP_LPPAR_MARKOWITZ",
5110 "SCIP_LPPAR_ROWREPSWITCH",
5112 "SCIP_LPPAR_THREADS",
5113 "SCIP_LPPAR_CONDITIONLIMIT",
5114 "SCIP_LPPAR_TIMING",
5115 "SCIP_LPPAR_RANDOMSEED",
5116 "SCIP_LPPAR_POLISHING",
5117 "SCIP_LPPAR_REFACTOR" 5159 assert(lpi !=
NULL);
5162 assert(ival !=
NULL);
5174 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_SCALING, ival) );
5175 if( *ival == MSK_SCALING_NONE )
5177 else if( *ival == MSK_SCALING_FREE )
5179 #if MSK_VERSION_MAJOR < 10 5180 else if( *ival == MSK_SCALING_AGGRESSIVE )
5187 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, ival) );
5188 *ival = (*ival != MSK_PRESOLVE_MODE_OFF);
5194 *ival = (int) lpi->
lpinfo;
5197 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) );
5200 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_NUM_THREADS, ival) );
5203 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_REFACTOR_FREQ, ival) );
5221 (int)MSK_SIM_SELECTION_SE,
5222 (
int)MSK_SIM_SELECTION_FREE,
5223 (int)MSK_SIM_SELECTION_FULL,
5224 (
int)MSK_SIM_SELECTION_PARTIAL,
5225 (int)MSK_SIM_SELECTION_SE,
5226 (
int)MSK_SIM_SELECTION_ASE,
5227 (int)MSK_SIM_SELECTION_DEVEX,
5239 assert(lpi !=
NULL);
5253 #if MSK_VERSION_MAJOR < 10 5254 assert( ival >= 0 && ival <= 2 );
5256 assert( ival >= 0 && ival <= 1 );
5260 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_NONE) );
5261 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_NONE) );
5263 #if MSK_VERSION_MAJOR < 10 5264 else if( ival == 1 )
5266 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_FREE) );
5267 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_FREE) );
5271 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) );
5272 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_AGGRESSIVE) );
5277 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_FREE) );
5278 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_FREE) );
5285 ival ? MSK_PRESOLVE_MODE_FREE : MSK_PRESOLVE_MODE_OFF) );
5291 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_PRIMAL_SELECTION, pricing[ival]) );
5292 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, pricing[ival]) );
5306 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG, ival ? 4 : MSK_OFF) );
5307 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG_SIM, ival ? 4 : MSK_OFF) );
5312 #if DEBUG_PARAM_SETTING 5319 assert( ival >= 0 );
5320 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) );
5324 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_NUM_THREADS, ival) );
5328 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_REFACTOR_FREQ, ival) );
5344 assert(lpi !=
NULL);
5347 assert(dval !=
NULL);
5354 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_X, dval) );
5357 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_S, dval) );
5360 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) );
5364 MSKobjsensee objsen;
5366 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
5368 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, dval) );
5372 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, dval) );
5377 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) );
5394 assert(lpi !=
NULL);
5405 assert( dval > 0.0 );
5410 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_X, dval) );
5413 assert( dval > 0.0 );
5418 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_S, dval) );
5422 assert( dval >= 0.0 );
5426 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) );
5431 MSKobjsensee objsen;
5433 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
5435 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, dval) );
5439 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, dval) );
5444 assert( dval > 0.0 );
5449 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) );
5466 assert(lpi !=
NULL);
5482 assert(lpi !=
NULL);
5486 return MSK_INFINITY;
5495 assert(lpi !=
NULL);
5514 #if MSK_VERSION_MAJOR < 9 5518 assert(lpi !=
NULL);
5521 assert(fname !=
NULL);
5525 #if MSK_VERSION_MAJOR < 9 5526 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, &olddataformat) );
5527 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, MSK_DATA_FORMAT_LP) );
5529 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, olddataformat) );
5531 MOSEK_CALL( MSK_readdataformat(lpi->
task, fname, MSK_DATA_FORMAT_LP, MSK_COMPRESS_FREE) );
5543 #if MSK_VERSION_MAJOR < 9 5547 assert(lpi !=
NULL);
5550 assert(fname !=
NULL);
5551 #if MSK_VERSION_MAJOR >= 9 5553 assert(strstr(fname,
".lp") !=
NULL);
5558 #if MSK_VERSION_MAJOR < 9 5559 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, &olddataformat) );
5560 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, MSK_DATA_FORMAT_LP) );
5562 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, olddataformat) );
static SCIP_RETCODE ensureBkxMem(SCIP_LPI *lpi, int ncols)
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
static void scale_bound(MSKboundkeye *bk, double *bl, double *bu, double s)
static void invalidateSolution(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPISTATE *lpistate)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
#define MOSEK_relDiff(val1, val2)
static SCIP_RETCODE checkState1(SCIP_LPI *lpi, int n, MSKstakeye *sk, SCIP_Bool isrow)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
static SCIP_RETCODE ensureBkcMem(SCIP_LPI *lpi, int nrows)
static SCIP_RETCODE ensureAptreMem(SCIP_LPI *lpi, int n)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
enum SCIP_ObjSen SCIP_OBJSEN
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
interface methods for specific LP solvers
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
static void convertstat_scip2mosek_slack(const int *stat, int n, MSKstakeye *resstat)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
static SCIP_RETCODE convertstat_mosek2scip_slack(SCIP_LPI *lpi, SCIP_Bool iscon, MSKstakeye *sk, int m, int *stat)
enum SCIP_Retcode SCIP_RETCODE
static SCIP_RETCODE getASlice(SCIP_LPI *lpi, SCIP_Bool iscon, int first, int last, int *nnonz, int *beg, int *ind, double *val)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
enum SCIP_LPParam SCIP_LPPARAM
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
#define BMSallocMemoryArray(ptr, num)
static void MSKAPI printstr(MSKuserhandle_t handle, const char *str)
MSKoptimizertype lastalgo
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_Bool SCIPlpiHasDualSolve(void)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
#define BMSfreeMemory(ptr)
SCIP_RETCODE SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
enum SCIP_Pricing SCIP_PRICING
SCIP_RETCODE SCIPlpiClearState(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 SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int row, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
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_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_DUALPACKET COLPACKET
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
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)