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) 97 #ifdef SCIP_THREADSAFE 98 #if defined(_Thread_local) 101 static _Thread_local
int numlp = 0;
102 #define SCIP_REUSEENV 108 #define SCIP_REUSEENV 111 #if MSK_VERSION_MAJOR >= 9 112 #define NEAR_REL_TOLERANCE 1.0 114 #define DEBUG_PRINT_STAT 0 115 #define DEBUG_PARAM_SETTING 0 116 #define DEBUG_CHECK_DATA 0 117 #define DEBUG_EASY_REPRODUCE 0 118 #define DEBUG_DO_INTPNT_FEAS_CHECK 0 119 #define DEBUG_CHECK_STATE_TOL 1e-5 120 #define SHOW_ERRORS 0 121 #define SHOW_RELATIVE_OPTIMAL_GAP 0 122 #define ASSERT_ON_NUMERICAL_TROUBLES 0 123 #define ASSERT_ON_WARNING 0 124 #define FORCE_MOSEK_LOG 0 125 #define FORCE_MOSEK_SUMMARY 0 126 #define FORCE_NO_MAXITER 0 127 #define SETBACK_LIMIT 250 128 #define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE 129 #define SUPRESS_NAME_ERROR 1 131 #define WRITE_PRIMAL 0 132 #define WRITE_INTPNT 0 133 #if WRITE_DUAL > 0 || WRITE_PRIMAL > 0 || WRITE_INTPNT > 0 || FORCE_MOSEK_LOG > 0 || FORCE_MOSEK_SUMMARY > 0 134 #define WRITE_ABOVE 0 136 #define DEGEN_LEVEL MSK_SIM_DEGEN_FREE 137 #define ALWAYS_SOLVE_PRIMAL_FORM 1 138 #if DEBUG_PRINT_STAT > 0 139 static int numstrongbranchmaxiterup = 0;
140 static int numstrongbranchmaxiterdo = 0;
141 static int numprimalmaxiter = 0;
142 static int numdualmaxiter = 0;
143 static int numstrongbranchobjup = 0;
144 static int numstrongbranchobjdo = 0;
145 static int numprimalobj = 0;
146 static int numdualobj = 0;
149 #if DEBUG_PRINT_STAT > 0 150 static int numstrongbranchmaxiterup = 0;
151 static int numstrongbranchmaxiterdo = 0;
152 static int numprimalmaxiter = 0;
153 static int numdualmaxiter = 0;
154 static int numstrongbranchobjup = 0;
155 static int numstrongbranchobjdo = 0;
156 static int numprimalobj = 0;
157 static int numdualobj = 0;
192 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 194 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 219 MSKsoltypee whichsol,
228 res = MSK_getprosta(task, whichsol, prosta);
229 if ( res != MSK_RES_OK )
234 res = MSK_getsolsta(task, whichsol, solsta);
235 if ( res != MSK_RES_OK )
263 MSKuserhandle_t handle,
267 #if SUPRESS_NAME_ERROR 269 (void) snprintf(errstr, 32,
"MOSEK Error %d", MSK_RES_ERR_DUP_NAME);
270 if (0 == strncmp(errstr, str, strlen(errstr)))
277 #if DEBUG_CHECK_DATA > 0 282 const char* functionname
302 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
325 for( i = 0; i < numvar; i++ )
327 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, i, &tbkx[i], &tblx[i], &tbux[i]) );
330 for( i = 0; i < numcon; i++ )
332 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_CON, i, &tbkc[i], &tblc[i], &tbuc[i]) );
335 for( i = 0; i < numcon; ++i )
339 if( ( tskc[i] == MSK_SK_FIX && tbkc[i] != MSK_BK_FX ) ||
340 ( tskc[i] == MSK_SK_LOW && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_RA ) ) ||
341 ( tskc[i] == MSK_SK_UPR && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_RA ) ) )
343 SCIPerrorMessage(
"STATUS KEY ERROR i %d bkc %d skc %d %s\n", i, tbkc[i], tskc[i], functionname);
347 if( tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA )
355 if( tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA )
364 for( i = 0; i < numvar; ++i )
366 if( tbkx[i] == MSK_BK_LO || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA )
374 if( tbkx[i] == MSK_BK_UP || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA )
480 for( i = 0; i < n; i++ )
501 else if (lb[i] == ub[i])
503 assert(lb[i] - ub[i] == 0);
504 assert(ub[i] - lb[i] == 0);
509 assert(lb[i] < ub[i]);
527 assert(beg !=
NULL || nnonz == 0);
532 for(i = 0; i < n-1; i++)
535 assert(aptre[i] >= beg[i]);
539 assert(aptre[n-1] >= beg[n-1]);
543 for( i = 0; i < n; i++ )
560 assert(first <= last);
564 for( i = first; i <= last; i++ )
584 assert(dstat !=
NULL);
585 assert(count !=
NULL);
588 for( i = 0; i < n; i++ )
604 for( i = 0; i < n; i++ )
624 for( i = 0; i < len; i++ )
744 #define STR_HELPER(x) #x 745 #define STR(x) STR_HELPER(x) 747 #if MSK_VERSION_MAJOR < 9 748 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION) 750 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_REVISION) 769 return "Linear Programming Solver developed by MOSEK Optimization Software (www.mosek.com)";
781 return (
void*) lpi->
task;
791 assert( lpi !=
NULL );
792 assert( ncols >= 0 );
793 assert( intInfo !=
NULL );
795 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
842 assert(name !=
NULL);
854 #if MSK_VERSION_MAJOR < 8 859 (*lpi)->lpid =
numlp++;
864 MOSEK_CALL( MSK_linkfunctoenvstream((*lpi)->mosekenv, MSK_STREAM_LOG, (MSKuserhandle_t) messagehdlr,
printstr) );
865 #if MSK_VERSION_MAJOR < 8 870 MOSEK_CALL( MSK_makeemptytask((*lpi)->mosekenv, &((*lpi)->task)) );
872 MOSEK_CALL( MSK_linkfunctotaskstream((*lpi)->task, MSK_STREAM_LOG, (MSKuserhandle_t) messagehdlr,
printstr) );
876 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_FREE_SIMPLEX) );
878 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_SIM_SWITCH_OPTIMIZER, MSK_ON) );
879 MOSEK_CALL( MSK_puttaskname((*lpi)->task, (
char*) name) );
882 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_AIJ_HUGE, MSK_INFINITY * 2));
883 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_C_HUGE, MSK_INFINITY));
886 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_AIJ_LARGE, MSK_INFINITY * 2));
887 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_CJ_LARGE, MSK_INFINITY));
890 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_BOUND_WRN, MSK_INFINITY));
892 (*lpi)->termcode = MSK_RES_OK;
893 (*lpi)->itercount = 0;
895 (*lpi)->lastalgo = MSK_OPTIMIZER_FREE;
900 (*lpi)->aptre =
NULL;
905 (*lpi)->aptresize = 0;
906 (*lpi)->lastsolvetype = (MSKsoltypee) -1;
907 (*lpi)->lpinfo =
FALSE;
908 (*lpi)->restrictselectdef = 50;
909 (*lpi)->fromscratch =
FALSE;
910 (*lpi)->clearstate =
FALSE;
915 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_LOG, MSK_OFF) );
916 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_LOG_SIM, MSK_OFF) );
927 assert(*lpi !=
NULL);
948 MOSEK_CALL( MSK_deleteenv(&(*lpi)->mosekenv) );
983 for( j = 0; j < nnonz; j++ )
984 assert( val[j] != 0.0 );
1004 #if DEBUG_CHECK_DATA > 0 1005 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiLoadColLP") );
1023 MOSEK_CALL( MSK_inputdata(lpi->
task, nrows, ncols, nrows, ncols, obj, 0.0, beg, lpi->
aptre, ind, val,
1024 lpi->
bkc, lhs, rhs, lpi->
bkx, lb, ub) );
1028 if( colnames !=
NULL )
1032 for( c = 0; c <
ncols; c++ )
1038 if( rownames !=
NULL )
1042 for( r = 0; r <
nrows; r++ )
1048 #if DEBUG_CHECK_DATA > 0 1049 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiLoadColLP") );
1069 #if MSK_VERSION_MAJOR < 7 1075 assert(lpi !=
NULL);
1078 assert(obj !=
NULL);
1081 assert(nnonz == 0 || beg !=
NULL);
1082 assert(nnonz == 0 || ind !=
NULL);
1083 assert(nnonz == 0 || val !=
NULL);
1091 #if DEBUG_CHECK_DATA > 0 1092 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddCols") );
1104 MOSEK_CALL( MSK_putcslice(lpi->
task, oldcols, oldcols+ncols, obj) );
1105 MOSEK_CALL( MSK_putvarboundslice(lpi->
task, oldcols, oldcols+ncols, lpi->
bkx, lb, ub) );
1115 for (j = 0; j < nnonz; ++j)
1117 assert( 0 <= ind[j] && ind[j] < nrows );
1118 assert( val[j] != 0.0 );
1124 MOSEK_CALL( MSK_putacolslice(lpi->
task, oldcols, oldcols+ncols, beg, lpi->
aptre, ind, val) );
1127 if( colnames !=
NULL )
1131 for( c = 0; c <
ncols; c++ )
1137 #if DEBUG_CHECK_DATA > 0 1138 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddCols") );
1153 assert(lpi !=
NULL);
1161 #if DEBUG_CHECK_DATA > 0 1162 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelCols") );
1167 MOSEK_CALL( MSK_removevars(lpi->
task, lastcol-firstcol+1, sub) );
1171 #if DEBUG_CHECK_DATA > 0 1172 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelCols") );
1192 assert(lpi !=
NULL);
1195 assert(dstat !=
NULL);
1201 #if DEBUG_CHECK_DATA > 0 1202 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelColset") );
1210 for( i = 0; i <
ncols; i++)
1230 #if DEBUG_CHECK_DATA > 0 1231 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelColset") );
1252 assert(lpi !=
NULL);
1255 assert(nnonz == 0 || beg !=
NULL);
1256 assert(nnonz == 0 || ind !=
NULL);
1257 assert(nnonz == 0 || val !=
NULL);
1263 #if DEBUG_CHECK_DATA > 0 1264 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddRows") );
1277 MOSEK_CALL( MSK_putconboundslice(lpi->
task, oldrows, oldrows+nrows, lpi->
bkc, lhs, rhs) );
1287 for (j = 0; j < nnonz; ++j)
1289 assert( val[j] != 0.0 );
1290 assert( 0 <= ind[j] && ind[j] < ncols );
1296 MOSEK_CALL( MSK_putarowslice(lpi->
task, oldrows, oldrows+nrows, beg, lpi->
aptre, ind, val) );
1299 if( rownames !=
NULL )
1303 for( r = 0; r <
nrows; r++ )
1309 #if DEBUG_CHECK_DATA > 0 1310 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddRows") );
1325 assert(lpi !=
NULL);
1333 #if DEBUG_CHECK_DATA > 0 1334 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRows") );
1341 MOSEK_CALL( MSK_removecons(lpi->
task, lastrow-firstrow+1, sub) );
1345 #if DEBUG_CHECK_DATA > 0 1346 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRows") );
1366 assert(lpi !=
NULL);
1374 #if DEBUG_CHECK_DATA > 0 1375 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRowset") );
1384 for( i = 0; i <
nrows; i++ )
1404 #if DEBUG_CHECK_DATA > 0 1405 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRowset end") );
1419 assert(lpi !=
NULL);
1447 assert(lpi !=
NULL);
1450 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1458 #if DEBUG_CHECK_DATA > 0 1459 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgBounds") );
1464 for (i = 0; i <
ncols; ++i)
1468 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1473 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1481 #if MSK_VERSION_MAJOR < 9 1482 MOSEK_CALL( MSK_putboundlist(lpi->
task, MSK_ACC_VAR, ncols, ind, lpi->
bkx, lb, ub) );
1487 #if DEBUG_CHECK_DATA > 0 1488 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgBounds") );
1503 assert(lpi !=
NULL);
1506 assert(ind !=
NULL);
1515 #if DEBUG_CHECK_DATA > 0 1516 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgSides") );
1522 #if MSK_VERSION_MAJOR < 9 1523 MOSEK_CALL( MSK_putboundlist(lpi->
task, MSK_ACC_CON, nrows, ind, lpi->
bkc, lhs, rhs) );
1528 #if DEBUG_CHECK_DATA > 0 1529 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgSides") );
1543 assert(lpi !=
NULL);
1551 #if DEBUG_CHECK_DATA > 0 1552 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgCoef") );
1557 #if DEBUG_CHECK_DATA > 0 1558 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgCoef") );
1570 assert(lpi !=
NULL);
1591 assert(lpi !=
NULL);
1594 assert(ind !=
NULL);
1595 assert(obj !=
NULL);
1601 #if DEBUG_CHECK_DATA > 0 1602 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgObj") );
1607 #if DEBUG_CHECK_DATA > 0 1608 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgObj") );
1628 assert(lpi !=
NULL);
1636 #if DEBUG_CHECK_DATA > 0 1637 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleRow") );
1640 assert(scaleval != 0);
1657 #if MSK_VERSION_MAJOR < 9 1658 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_CON, row, &bkc, &blc, &buc) );
1660 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_CON, row, bkc, blc, buc) );
1667 #if DEBUG_CHECK_DATA > 0 1668 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleRow") );
1689 assert(lpi !=
NULL);
1697 #if DEBUG_CHECK_DATA > 0 1698 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleCol") );
1701 assert(scaleval != 0);
1717 #if MSK_VERSION_MAJOR < 9 1718 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, col, &bkx, &blx, &bux) );
1720 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
1730 #if DEBUG_CHECK_DATA > 0 1731 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleCol") );
1749 assert(lpi !=
NULL);
1752 assert(nrows !=
NULL);
1767 assert(lpi !=
NULL);
1770 assert(ncols !=
NULL);
1785 assert(lpi !=
NULL);
1788 assert(nnonz !=
NULL);
1810 assert(lpi !=
NULL);
1813 assert(first <= last);
1817 #if DEBUG_CHECK_DATA > 0 1818 SCIP_CALL( scip_checkdata(lpi,
"getASlice") );
1825 assert(beg !=
NULL);
1826 assert(ind !=
NULL);
1827 assert(val !=
NULL);
1831 #if MSK_VERSION_MAJOR < 9 1832 MOSEK_CALL( MSK_getaslicenumnz(lpi->
task, iscon ? MSK_ACC_CON : MSK_ACC_VAR, first, last+1, nnonz) );
1834 MOSEK_CALL( MSK_getaslice(lpi->
task, iscon ? MSK_ACC_CON : MSK_ACC_VAR, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1838 MOSEK_CALL( MSK_getarowslicenumnz(lpi->
task, first, last+1, nnonz) );
1840 #if MSK_VERSION_MAJOR == 9 1841 MOSEK_CALL( MSK_getarowslice(lpi->
task, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1843 MOSEK_CALL( MSK_getarowslice(lpi->
task, first, last+1, *nnonz, beg, lpi->
aptre, ind, val) );
1849 MOSEK_CALL( MSK_getacolslicenumnz(lpi->
task, first, last+1, nnonz) );
1851 #if MSK_VERSION_MAJOR == 9 1852 MOSEK_CALL( MSK_getacolslice(lpi->
task, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1854 MOSEK_CALL( MSK_getacolslice(lpi->
task, first, last+1, *nnonz, beg, lpi->
aptre, ind, val) );
1860 assert(surplus == 0);
1863 #if DEBUG_CHECK_DATA > 0 1864 SCIP_CALL( scip_checkdata(lpi,
"getASlice") );
1886 assert(lpi !=
NULL);
1896 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
1924 assert(lpi !=
NULL);
1934 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
1940 #if DEBUG_CHECK_DATA > 0 1941 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetRows") );
1947 #if DEBUG_CHECK_DATA > 0 1948 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetRows") );
1961 int namestoragesize,
1965 assert(lpi !=
NULL);
1968 assert(0 <= firstcol && firstcol <= lastcol);
1969 assert(colnames !=
NULL || namestoragesize == 0);
1970 assert(namestorage !=
NULL || namestoragesize == 0);
1971 assert(namestoragesize >= 0);
1972 assert(storageleft !=
NULL);
1986 int namestoragesize,
1990 assert(lpi !=
NULL);
1993 assert(0 <= firstrow && firstrow <= lastrow);
1994 assert(rownames !=
NULL || namestoragesize == 0);
1995 assert(namestorage !=
NULL || namestoragesize == 0);
1996 assert(namestoragesize >= 0);
1997 assert(storageleft !=
NULL);
2010 MSKobjsensee mskobjsen;
2012 assert(lpi !=
NULL);
2015 assert(objsen !=
NULL);
2033 assert(lpi !=
NULL);
2036 assert(firstcol <= lastcol);
2037 assert(vals !=
NULL);
2041 MOSEK_CALL( MSK_getcslice(lpi->
task, firstcol, lastcol+1, vals) );
2055 assert(lpi !=
NULL);
2058 assert(firstcol <= lastcol);
2062 #if DEBUG_CHECK_DATA > 0 2063 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetBounds") );
2066 #if MSK_VERSION_MAJOR < 9 2067 MOSEK_CALL( MSK_getboundslice(lpi->
task, MSK_ACC_VAR, firstcol, lastcol+1,
NULL, lbs, ubs) );
2084 assert(lpi !=
NULL);
2087 assert(firstrow <= lastrow);
2091 #if DEBUG_CHECK_DATA > 0 2092 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetSides") );
2095 #if MSK_VERSION_MAJOR < 9 2096 MOSEK_CALL( MSK_getboundslice(lpi->
task, MSK_ACC_CON, firstrow, lastrow+1,
NULL, lhss, rhss) );
2098 MOSEK_CALL( MSK_getconboundslice(lpi->
task, firstrow, lastrow+1,
NULL, lhss, rhss) );
2101 #if DEBUG_CHECK_DATA > 0 2102 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetSides") );
2116 assert(lpi !=
NULL);
2119 assert(val !=
NULL);
2123 #if DEBUG_CHECK_DATA > 0 2124 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetCoef") );
2129 #if DEBUG_CHECK_DATA > 0 2130 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetCoef") );
2149 assert(lpi !=
NULL);
2166 assert( termcode !=
NULL );
2168 #if ASSERT_ON_NUMERICAL_TROUBLES > 0 2169 if ( res == MSK_RES_TRM_MAX_NUM_SETBACKS || res == MSK_RES_TRM_NUMERICAL_PROBLEM )
2180 if ( res == MSK_RES_TRM_MAX_ITERATIONS || res == MSK_RES_TRM_MAX_TIME
2181 || res == MSK_RES_TRM_OBJECTIVE_RANGE || res == MSK_RES_TRM_STALL )
2187 *termcode = MSK_RES_OK;
2198 int itercount_primal;
2207 assert(lpi !=
NULL);
2215 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, &presolve) );
2216 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, &maxiter) );
2219 #if DEBUG_EASY_REPRODUCE 2220 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_AUTO_SORT_A_BEFORE_OPT, MSK_ON) );
2221 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_OFF) );
2223 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2226 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_AUTO_UPDATE_SOL_INFO, MSK_OFF) );
2232 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG_SIM_FREQ, 1) );
2240 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
2244 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_OFF) );
2248 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_ON) );
2251 #if ALWAYS_SOLVE_PRIMAL_FORM > 0 2253 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SOLVE_FORM, MSK_SOLVE_PRIMAL) );
2256 #if DEBUG_CHECK_DATA > 0 2257 SCIP_CALL( scip_checkdata(lpi,
"SolveWSimplex") );
2260 if( gotbasicsol && maxiter < 20000 )
2263 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION, 0) );
2264 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION, 0) );
2273 #if FORCE_NO_MAXITER > 0 2274 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, 2000000000) );
2278 #if DEBUG_CHECK_DATA > 0 2279 SCIP_CALL( scip_checkdata(lpi,
"Begin optimize with simplex") );
2282 #if FORCE_MOSEK_SUMMARY > 1 2292 #if MSK_VERSION_MAJOR < 10 2294 if( lpi->
termcode == MSK_RES_TRM_MAX_NUM_SETBACKS )
2298 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_SCALING, &scaling) );
2299 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) );
2301 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, scaling) );
2305 #if FORCE_MOSEK_SUMMARY 2317 #if DEBUG_CHECK_DATA > 0 2318 SCIP_CALL( scip_checkdata(lpi,
"End optimize with simplex") );
2322 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, presolve) );
2323 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) );
2326 MOSEK_CALL( MSK_getintinf(lpi->
task, MSK_IINF_SIM_PRIMAL_ITER, &itercount_primal) );
2327 MOSEK_CALL( MSK_getintinf(lpi->
task, MSK_IINF_SIM_DUAL_ITER, &itercount_dual) );
2329 lpi->
itercount = itercount_primal + itercount_dual;
2337 SCIPdebugMessage(
"maxiter = %d, termcode = %d, prosta = %d, solsta = %d, objval = %g : %g, iter = %d+%d\n",
2338 maxiter, lpi->
termcode, prosta, solsta, pobj, dobj, itercount_primal, itercount_dual);
2342 case MSK_SOL_STA_OPTIMAL:
2343 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS:
2344 case MSK_SOL_STA_PRIM_FEAS:
2345 case MSK_SOL_STA_DUAL_FEAS:
2346 case MSK_SOL_STA_PRIM_INFEAS_CER:
2347 case MSK_SOL_STA_DUAL_INFEAS_CER:
2352 case MSK_SOL_STA_UNKNOWN:
2354 assert( lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS || lpi->
termcode == MSK_RES_TRM_MAX_TIME ||
2355 lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE || lpi->
termcode == MSK_RES_TRM_STALL ||
2358 if ( lpi->
termcode != MSK_RES_TRM_MAX_ITERATIONS && lpi->
termcode != MSK_RES_TRM_MAX_TIME &&
2359 lpi->
termcode != MSK_RES_TRM_OBJECTIVE_RANGE )
2362 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2363 #if ASSERT_ON_WARNING 2369 #if MSK_VERSION_MAJOR < 9 2370 case MSK_SOL_STA_NEAR_OPTIMAL:
2371 case MSK_SOL_STA_NEAR_PRIM_FEAS:
2372 case MSK_SOL_STA_NEAR_DUAL_FEAS:
2373 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS:
2374 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER:
2375 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER:
2377 assert(lpi->
termcode == MSK_RES_OK);
2380 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2381 #if ASSERT_ON_WARNING 2387 case MSK_SOL_STA_INTEGER_OPTIMAL:
2388 #if MSK_VERSION_MAJOR < 9 2389 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL:
2396 #if ASSERT_ON_WARNING 2406 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
2407 case MSK_PRO_STA_PRIM_FEAS:
2408 case MSK_PRO_STA_DUAL_FEAS:
2409 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
2410 case MSK_PRO_STA_PRIM_INFEAS:
2411 case MSK_PRO_STA_DUAL_INFEAS:
2412 case MSK_PRO_STA_UNKNOWN:
2415 #if MSK_VERSION_MAJOR < 9 2416 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
2417 case MSK_PRO_STA_NEAR_PRIM_FEAS:
2418 case MSK_PRO_STA_NEAR_DUAL_FEAS:
2420 case MSK_PRO_STA_ILL_POSED:
2421 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
2422 assert(lpi->
termcode == MSK_RES_OK);
2425 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2427 #if ASSERT_ON_WARNING 2437 #if ASSERT_ON_WARNING 2445 #if SHOW_RELATIVE_OPTIMAL_GAP 2446 if ( solsta == MSK_SOL_STA_OPTIMAL && fabs(pobj) + fabs(dobj) > 1.0e-6 && fabs(pobj-dobj) > 0.0001*(fabs(pobj) + fabs(dobj)))
2448 SCIPerrorMessage(
"Simplex[%d] returned optimal solution with different objvals %g != %g reldiff %.2g%%\n",
2449 lpi->
optimizecount, pobj, dobj, 100.0 * fabs(pobj-dobj)/
MAX(fabs(pobj), fabs(dobj)));
2454 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2456 if (solsta != MSK_SOL_STA_DUAL_FEAS && solsta != MSK_SOL_STA_OPTIMAL && solsta != MSK_SOL_STA_PRIM_AND_DUAL_FEAS)
2466 if (maxiter >= 2000000000)
2468 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) );
2470 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2479 #if DEBUG_DO_INTPNT_FEAS_CHECK 2480 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER)
2488 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER)
2500 #if DEBUG_PRINT_STAT > 0 2501 SCIPdebugMessage(
"Max iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2502 lpi->
optimizecount, numstrongbranchmaxiterup, numstrongbranchmaxiterdo, numprimalmaxiter, numdualmaxiter);
2503 SCIPdebugMessage(
"Objcut iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2504 lpi->
optimizecount, numstrongbranchobjup, numstrongbranchobjdo, numprimalobj, numdualobj);
2507 #if DEBUG_CHECK_DATA > 0 2508 SCIP_CALL( scip_checkdata(lpi,
"SolveWSimplex") );
2519 assert(lpi !=
NULL);
2527 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2531 MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS) );
2534 #if DEBUG_CHECK_DATA > 0 2535 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolvePrimal") );
2538 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_PRIMAL_SIMPLEX) );
2539 lpi->
lastalgo = MSK_OPTIMIZER_PRIMAL_SIMPLEX;
2541 #if WRITE_PRIMAL > 0 2548 MSK_writedata(lpi->
task, fname);
2554 #ifdef SCIP_DISABLED_CODE 2556 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
2562 if( solsta != MSK_SOL_STA_PRIM_FEAS )
2569 #if DEBUG_PRINT_STAT > 0 2570 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2574 #if DEBUG_PRINT_STAT > 0 2575 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2579 #if DEBUG_CHECK_DATA > 0 2580 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolvePrimal") );
2591 assert(lpi !=
NULL);
2600 #if (MSK_VERSION_MAJOR < 8) || (MSK_VERSION_MAJOR == 8 && MSK_VERSION_MINOR == 0) 2601 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_INTEGER, MSK_ON) );
2603 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2607 MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS) );
2610 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_DUAL_SIMPLEX) );
2611 lpi->
lastalgo = MSK_OPTIMIZER_DUAL_SIMPLEX;
2619 MSK_writedata(lpi->
task, fname);
2625 #ifdef SCIP_DISABLED_CODE 2627 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
2633 if( solsta != MSK_SOL_STA_DUAL_FEAS )
2640 #if DEBUG_PRINT_STAT > 0 2641 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2645 #if DEBUG_PRINT_STAT > 0 2646 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2662 assert(lpi !=
NULL);
2684 #if DEBUG_CHECK_DATA > 0 2685 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolveBarrier") );
2688 #ifdef SCIP_DISABLED_CODE 2691 MSK_SIM_HOTSTART_NONE : MSK_INTPNT_HOTSTART_PRIMAL_DUAL) );
2695 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_BASIS, crossover ? MSK_BI_ALWAYS : MSK_BI_NEVER) );
2696 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_INTPNT) );
2697 lpi->
lastalgo = MSK_OPTIMIZER_INTPNT;
2699 #if MSK_VERSION_MAJOR >= 9 2700 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_INTPNT_CO_TOL_NEAR_REL, NEAR_REL_TOLERANCE) );
2703 #if WRITE_INTPNT > 0 2710 MSK_writedata(lpi->
task, fname);
2716 #if DEBUG_PRINT_STAT > 0 2717 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2729 case MSK_SOL_STA_OPTIMAL:
2730 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS:
2731 case MSK_SOL_STA_PRIM_FEAS:
2732 case MSK_SOL_STA_DUAL_FEAS:
2733 case MSK_SOL_STA_PRIM_INFEAS_CER:
2734 case MSK_SOL_STA_DUAL_INFEAS_CER:
2738 case MSK_SOL_STA_UNKNOWN:
2739 #if MSK_VERSION_MAJOR < 9 2740 case MSK_SOL_STA_NEAR_OPTIMAL:
2741 case MSK_SOL_STA_NEAR_PRIM_FEAS:
2742 case MSK_SOL_STA_NEAR_DUAL_FEAS:
2743 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS:
2744 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER:
2745 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER:
2750 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2752 #if ASSERT_ON_WARNING 2756 case MSK_SOL_STA_INTEGER_OPTIMAL:
2757 #if MSK_VERSION_MAJOR < 9 2758 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL:
2765 #if ASSERT_ON_WARNING 2774 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
2775 case MSK_PRO_STA_PRIM_FEAS:
2776 case MSK_PRO_STA_DUAL_FEAS:
2777 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
2778 case MSK_PRO_STA_PRIM_INFEAS:
2779 case MSK_PRO_STA_DUAL_INFEAS:
2781 case MSK_PRO_STA_UNKNOWN:
2782 #if MSK_VERSION_MAJOR < 9 2783 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
2784 case MSK_PRO_STA_NEAR_PRIM_FEAS:
2785 case MSK_PRO_STA_NEAR_DUAL_FEAS:
2787 case MSK_PRO_STA_ILL_POSED:
2788 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
2792 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2796 #if ASSERT_ON_WARNING 2805 #if ASSERT_ON_WARNING 2812 #if DEBUG_CHECK_DATA > 0 2813 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolveBarrier") );
2824 assert(lpi !=
NULL);
2837 assert(lpi !=
NULL);
2864 MSKobjsensee objsen;
2878 assert(lpi !=
NULL);
2884 #if DEBUG_CHECK_DATA > 0 2885 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiStrongbranch") );
2899 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, &olditerlim) );
2900 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, &oldselection) );
2901 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART, &oldhotstart) );
2903 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, itlim) );
2906 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
2908 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, &bound) );
2912 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, &bound) );
2915 #if MSK_VERSION_MAJOR < 9 2916 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, col, &bkx, &blx, &bux) );
2923 newub =
EPSCEIL(psol-1.0, 1e-06);
2925 if (newub < blx - 0.5)
2936 else if (
EPSEQ(blx, newub,1.0e-6))
2944 #if MSK_VERSION_MAJOR < 9 2945 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, newbk, blx, newub) );
2947 MOSEK_CALL( MSK_putvarbound(lpi->
task, col, newbk, blx, newub) );
2990 #if DEBUG_PRINT_STAT > 0 2991 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2992 ++numstrongbranchobjup;
2994 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2995 ++numstrongbranchmaxiterup;
3000 #if MSK_VERSION_MAJOR < 9 3001 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
3008 if (newlb > bux + 0.5)
3019 else if (
EPSEQ(bux, newlb,1.0e-6))
3027 #if MSK_VERSION_MAJOR < 9 3028 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, newbk, newlb, bux) );
3030 MOSEK_CALL( MSK_putvarbound(lpi->
task, col, newbk, newlb, bux) );
3070 #if DEBUG_PRINT_STAT > 0 3071 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
3072 ++numstrongbranchobjdo;
3074 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
3075 ++numstrongbranchmaxiterdo;
3079 #if MSK_VERSION_MAJOR < 9 3080 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
3084 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, olditerlim) );
3085 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, oldselection) );
3086 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART, oldhotstart) );
3095 #if DEBUG_CHECK_DATA > 0 3096 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiStrongbranch") );
3149 assert( cols !=
NULL );
3150 assert( psols !=
NULL );
3151 assert( down !=
NULL );
3152 assert( up !=
NULL );
3153 assert( downvalid !=
NULL );
3154 assert( upvalid !=
NULL );
3155 assert( down !=
NULL );
3160 for (j = 0; j <
ncols; ++j)
3213 assert( cols !=
NULL );
3214 assert( psols !=
NULL );
3215 assert( down !=
NULL );
3216 assert( up !=
NULL );
3217 assert( downvalid !=
NULL );
3218 assert( upvalid !=
NULL );
3219 assert( down !=
NULL );
3224 for (j = 0; j <
ncols; ++j)
3243 assert(lpi !=
NULL);
3266 assert( lpi !=
NULL );
3269 assert( primalfeasible !=
NULL );
3270 assert( dualfeasible !=
NULL );
3278 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
3279 *primalfeasible =
TRUE;
3280 *dualfeasible =
TRUE;
3282 case MSK_PRO_STA_PRIM_FEAS:
3283 *primalfeasible =
TRUE;
3284 *dualfeasible =
FALSE;
3286 case MSK_PRO_STA_DUAL_FEAS:
3287 *primalfeasible =
FALSE;
3288 *dualfeasible =
TRUE;
3290 case MSK_PRO_STA_DUAL_INFEAS:
3292 *primalfeasible = (lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX);
3293 *dualfeasible =
FALSE;
3295 case MSK_PRO_STA_UNKNOWN:
3296 case MSK_PRO_STA_PRIM_INFEAS:
3297 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
3298 case MSK_PRO_STA_ILL_POSED:
3299 #if MSK_VERSION_MAJOR < 9 3300 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
3301 case MSK_PRO_STA_NEAR_PRIM_FEAS:
3302 case MSK_PRO_STA_NEAR_DUAL_FEAS:
3304 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
3305 *primalfeasible =
FALSE;
3306 *dualfeasible =
FALSE;
3325 assert(lpi !=
NULL);
3333 return ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER
3334 || prosta == MSK_PRO_STA_DUAL_INFEAS
3335 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS );
3347 assert(lpi !=
NULL);
3355 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER);
3365 assert(lpi !=
NULL);
3372 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX);
3380 assert(lpi !=
NULL);
3394 assert(lpi !=
NULL);
3402 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));
3415 assert(lpi !=
NULL);
3423 return ( solsta == MSK_SOL_STA_PRIM_INFEAS_CER
3424 || prosta == MSK_PRO_STA_PRIM_INFEAS
3425 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS );
3437 assert(lpi !=
NULL);
3445 return (solsta == MSK_SOL_STA_PRIM_INFEAS_CER);
3453 assert(lpi !=
NULL);
3465 assert(lpi !=
NULL);
3479 assert(lpi !=
NULL);
3487 return (prosta == MSK_PRO_STA_DUAL_FEAS || prosta == MSK_PRO_STA_PRIM_AND_DUAL_FEAS);
3497 assert(lpi !=
NULL);
3505 return (solsta == MSK_SOL_STA_OPTIMAL);
3519 assert(lpi !=
NULL);
3523 return ( lpi->
termcode == MSK_RES_OK
3524 || lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS
3525 || lpi->
termcode == MSK_RES_TRM_MAX_TIME
3526 || lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE );
3534 assert(lpi !=
NULL);
3538 return ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE );
3546 assert(lpi !=
NULL);
3550 return ( lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS );
3558 assert(lpi !=
NULL);
3562 return ( lpi->
termcode == MSK_RES_TRM_MAX_TIME );
3573 assert(lpi !=
NULL);
3583 return (
int) solsta;
3592 assert(lpi !=
NULL);
3595 assert(success !=
NULL);
3610 assert(lpi !=
NULL);
3613 assert(objval !=
NULL);
3619 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3622 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, objval) );
3652 assert(lpi !=
NULL);
3658 if ( objval !=
NULL )
3660 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3663 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, objval) );
3678 if ( primsol !=
NULL && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX )
3684 if ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER )
3693 for (j = 0; j <
ncols; ++j)
3733 for( i = 0; i <
ncols; i++ )
3735 assert(sux !=
NULL);
3736 redcost[i] -= sux[i];
3750 assert(lpi !=
NULL);
3753 assert(ray !=
NULL);
3769 assert(lpi !=
NULL);
3772 assert(dualfarkas !=
NULL);
3776 MOSEK_CALL( MSK_getsolution(lpi->
task, lpi->
lastsolvetype,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, dualfarkas,
3788 assert(lpi !=
NULL);
3791 assert(iterations !=
NULL);
3811 assert(lpi !=
NULL);
3814 assert(quality !=
NULL);
3830 if (res == MSK_RES_ERR_BASIS_SINGULAR)
3866 for( i = 0; i < n; i++ )
3880 #if MSK_VERSION_MAJOR < 9 3885 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3886 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3890 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3891 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3912 #if MSK_VERSION_MAJOR < 10 3942 for( i = 0; i < m; i++ )
3955 #if MSK_VERSION_MAJOR < 9 3960 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3961 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3965 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3966 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3983 #if MSK_VERSION_MAJOR < 10 4004 for( i = 0; i < n; i++ )
4009 resstat[i] = MSK_SK_LOW;
4012 resstat[i] = MSK_SK_BAS;
4015 resstat[i] = MSK_SK_UPR;
4018 resstat[i] = MSK_SK_SUPBAS;
4037 for( i = 0; i < n; i++ )
4042 resstat[i] = MSK_SK_UPR;
4045 resstat[i] = MSK_SK_BAS;
4048 resstat[i] = MSK_SK_LOW;
4051 resstat[i] = MSK_SK_SUPBAS;
4072 assert(lpi !=
NULL);
4107 assert(lpi !=
NULL);
4114 assert(cstat !=
NULL || ncols == 0);
4115 assert(rstat !=
NULL || nrows == 0);
4140 assert(lpi !=
NULL);
4143 assert(bind !=
NULL);
4151 for (i = 0; i <
nrows; i++ )
4153 if (bind[i] < nrows)
4154 bind[i] = -1 - bind[i];
4156 bind[i] = bind[i] -
nrows;
4184 assert(lpi !=
NULL);
4187 assert(coef !=
NULL);
4194 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4200 for (i = 0; i <
nrows; ++i)
4205 if ( ninds !=
NULL && inds !=
NULL )
4211 #if MSK_VERSION_MAJOR < 10 4212 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, ninds, inds, coef) );
4214 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, *ninds, inds, coef, ninds) );
4216 assert( *ninds <= nrows );
4229 #if MSK_VERSION_MAJOR < 10 4230 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, &numnz, sub, coef) );
4232 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, numnz, sub, coef, &numnz) );
4234 assert( numnz <= nrows );
4238 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4271 assert(lpi !=
NULL);
4274 assert(coef !=
NULL);
4281 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4287 for (i = 0; i <
nrows; ++i)
4292 if ( ninds !=
NULL && inds !=
NULL )
4297 #if MSK_VERSION_MAJOR < 10 4298 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, ninds, inds, coef) );
4300 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, *ninds, inds, coef, ninds) );
4302 assert( *ninds <= nrows );
4314 #if MSK_VERSION_MAJOR < 10 4315 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, &numnz, sub, coef) );
4317 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, numnz, sub, coef, &numnz) );
4319 assert( numnz <= nrows );
4323 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4358 assert(lpi !=
NULL);
4361 assert(coef !=
NULL);
4367 if ( ninds !=
NULL )
4376 if( binvrow ==
NULL )
4388 for (i = 0; i <
ncols; ++i)
4394 for (k = 0; k < numnz; ++k)
4396 assert( 0 <= csub[k] && csub[k] < nrows );
4397 coef[i] += binv[csub[k]] * cval[k];
4431 assert(lpi !=
NULL);
4434 assert(coef !=
NULL);
4443 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4449 for (i = 0; i <
nrows; ++i)
4453 if ( ninds !=
NULL && inds !=
NULL )
4457 for (i = 0; i < numnz; ++i)
4459 assert( 0 <= inds[i] && inds[i] < nrows );
4460 coef[inds[i]] = val[i];
4465 #if MSK_VERSION_MAJOR < 10 4466 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, ninds, inds, coef) );
4468 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, *ninds, inds, coef, ninds) );
4470 assert( *ninds <= nrows );
4479 for (i = 0; i < numnz; ++i)
4481 assert( 0 <= sub[i] && sub[i] < nrows );
4482 coef[sub[i]] = val[i];
4485 #if MSK_VERSION_MAJOR < 10 4486 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, &numnz, sub, coef) );
4488 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, numnz, sub, coef, &numnz) );
4491 if ( ninds !=
NULL )
4498 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4517 assert(lpistate !=
NULL);
4518 assert(blkmem !=
NULL);
4526 (*lpistate)->solsta = MSK_SOL_STA_UNKNOWN;
4527 (*lpistate)->num = -1;
4528 (*lpistate)->ncols =
ncols;
4529 (*lpistate)->nrows =
nrows;
4541 assert(blkmem !=
NULL);
4542 assert(lpistate !=
NULL);
4543 assert(*lpistate !=
NULL);
4566 assert(lpi !=
NULL);
4577 for( i = 0; i < n; i++ )
4588 #if MSK_VERSION_MAJOR < 9 4593 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4594 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4598 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4599 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4637 assert(lpi !=
NULL);
4657 int *skxi = (
int *) lpi->
skx;
4658 int *skci = (
int *) lpi->
skc;
4660 assert(
sizeof(
int) ==
sizeof(MSKstakeye));
4661 assert(lpi !=
NULL);
4662 assert(lpistate !=
NULL);
4682 assert(
sizeof(
int) ==
sizeof(MSKstakeye));
4705 assert(lpi !=
NULL);
4708 assert(lpistate !=
NULL);
4709 assert(blkmem !=
NULL);
4716 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
4761 assert(lpi !=
NULL);
4764 assert(blkmem !=
NULL);
4765 #ifdef SCIP_DISABLED_CODE 4769 if (lpistate ==
NULL)
4775 if (lpistate->
nrows == 0 || lpistate->
ncols == 0)
4780 assert(lpistate->
nrows <= nrows);
4781 assert(lpistate->
ncols <= ncols);
4785 #ifdef SCIP_DISABLED_CODE 4792 for (i = lpistate->
ncols; i < ncols; ++i)
4796 #if MSK_VERSION_MAJOR < 9 4805 lpi->
skx[i] = MSK_SK_SUPBAS;
4807 lpi->
skx[i] = MSK_SK_UPR;
4810 lpi->
skx[i] = MSK_SK_LOW;
4812 for (i = lpistate->
nrows; i < nrows; ++i)
4813 lpi->
skc[i] = MSK_SK_BAS;
4830 assert(lpi !=
NULL);
4846 assert(lpi !=
NULL);
4849 assert(lpistate !=
NULL);
4850 assert(blkmem !=
NULL);
4854 if( *lpistate !=
NULL )
4868 assert(lpi !=
NULL);
4874 return ( lpistate !=
NULL && lpistate->
num >= 0);
4886 assert(lpi !=
NULL);
4889 assert(fname !=
NULL);
4913 assert(lpi !=
NULL);
4916 assert(fname !=
NULL);
4923 SCIPdebugMessage(
"No LP state written, since it was cleared after the last solve \n");
4932 for( v = 0; v < nvars; v++ )
4935 if( strcmp(name,
"") == 0 )
4944 for( c = 0; c < nconss; c++ )
4947 if( strcmp(name,
"") == 0 )
4958 " names instead. Note that this state cannot be read back in later!\n",
4959 v < nvars ?
"variable" :
"constraint", v < nvars ? v : c);
4963 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_HEAD, MSK_ON) );
4964 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_VARIABLES, MSK_ON) );
4965 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_CONSTRAINTS, MSK_ON) );
4990 assert(lpi !=
NULL);
4993 assert(lpinorms !=
NULL);
4994 assert(blkmem !=
NULL);
5010 assert(lpi !=
NULL);
5012 assert(lpinorms ==
NULL);
5025 assert(lpi !=
NULL);
5027 assert(lpinorms ==
NULL);
5041 "SCIP_LPPAR_FROMSCRATCH",
5042 "SCIP_LPPAR_FASTMIP",
5043 "SCIP_LPPAR_SCALING",
5044 "SCIP_LPPAR_PRESOLVING",
5045 "SCIP_LPPAR_PRICING",
5046 "SCIP_LPPAR_LPINFO",
5047 "SCIP_LPPAR_FEASTOL",
5048 "SCIP_LPPAR_DUALFEASTOL",
5049 "SCIP_LPPAR_BARRIERCONVTOL",
5050 "SCIP_LPPAR_OBJLIM",
5051 "SCIP_LPPAR_LPITLIM",
5052 "SCIP_LPPAR_LPTILIM",
5053 "SCIP_LPPAR_MARKOWITZ",
5054 "SCIP_LPPAR_ROWREPSWITCH",
5056 "SCIP_LPPAR_THREADS",
5057 "SCIP_LPPAR_CONDITIONLIMIT",
5058 "SCIP_LPPAR_TIMING",
5059 "SCIP_LPPAR_RANDOMSEED",
5060 "SCIP_LPPAR_POLISHING",
5061 "SCIP_LPPAR_REFACTOR" 5103 assert(lpi !=
NULL);
5106 assert(ival !=
NULL);
5118 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_SCALING, ival) );
5119 if( *ival == MSK_SCALING_NONE )
5121 else if( *ival == MSK_SCALING_FREE )
5123 #if MSK_VERSION_MAJOR < 10 5124 else if( *ival == MSK_SCALING_AGGRESSIVE )
5131 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, ival) );
5132 *ival = (*ival != MSK_PRESOLVE_MODE_OFF);
5138 *ival = (int) lpi->
lpinfo;
5141 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) );
5144 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_NUM_THREADS, ival) );
5147 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_REFACTOR_FREQ, ival) );
5165 (int)MSK_SIM_SELECTION_SE,
5166 (
int)MSK_SIM_SELECTION_FREE,
5167 (int)MSK_SIM_SELECTION_FULL,
5168 (
int)MSK_SIM_SELECTION_PARTIAL,
5169 (int)MSK_SIM_SELECTION_SE,
5170 (
int)MSK_SIM_SELECTION_ASE,
5171 (int)MSK_SIM_SELECTION_DEVEX,
5183 assert(lpi !=
NULL);
5197 #if MSK_VERSION_MAJOR < 10 5198 assert( ival >= 0 && ival <= 2 );
5200 assert( ival >= 0 && ival <= 1 );
5204 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_NONE) );
5205 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_NONE) );
5207 #if MSK_VERSION_MAJOR < 10 5208 else if( ival == 1 )
5210 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_FREE) );
5211 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_FREE) );
5215 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) );
5216 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_AGGRESSIVE) );
5221 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_FREE) );
5222 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_FREE) );
5229 ival ? MSK_PRESOLVE_MODE_FREE : MSK_PRESOLVE_MODE_OFF) );
5235 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_PRIMAL_SELECTION, pricing[ival]) );
5236 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, pricing[ival]) );
5250 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG, ival ? 4 : MSK_OFF) );
5251 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG_SIM, ival ? 4 : MSK_OFF) );
5256 #if DEBUG_PARAM_SETTING 5263 assert( ival >= 0 );
5264 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) );
5268 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_NUM_THREADS, ival) );
5272 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_REFACTOR_FREQ, ival) );
5288 assert(lpi !=
NULL);
5291 assert(dval !=
NULL);
5298 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_X, dval) );
5301 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_S, dval) );
5304 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) );
5308 MSKobjsensee objsen;
5310 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
5312 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, dval) );
5316 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, dval) );
5321 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) );
5338 assert(lpi !=
NULL);
5349 assert( dval > 0.0 );
5354 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_X, dval) );
5357 assert( dval > 0.0 );
5362 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_S, dval) );
5366 assert( dval >= 0.0 );
5370 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) );
5375 MSKobjsensee objsen;
5377 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
5379 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, dval) );
5383 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, dval) );
5388 assert( dval > 0.0 );
5393 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) );
5410 assert(lpi !=
NULL);
5426 assert(lpi !=
NULL);
5430 return MSK_INFINITY;
5439 assert(lpi !=
NULL);
5458 #if MSK_VERSION_MAJOR < 9 5462 assert(lpi !=
NULL);
5465 assert(fname !=
NULL);
5469 #if MSK_VERSION_MAJOR < 9 5470 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, &olddataformat) );
5471 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, MSK_DATA_FORMAT_LP) );
5473 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, olddataformat) );
5475 MOSEK_CALL( MSK_readdataformat(lpi->
task, fname, MSK_DATA_FORMAT_LP, MSK_COMPRESS_FREE) );
5487 #if MSK_VERSION_MAJOR < 9 5491 assert(lpi !=
NULL);
5494 assert(fname !=
NULL);
5495 #if MSK_VERSION_MAJOR >= 9 5497 assert(strstr(fname,
".lp") !=
NULL);
5502 #if MSK_VERSION_MAJOR < 9 5503 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, &olddataformat) );
5504 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, MSK_DATA_FORMAT_LP) );
5506 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)
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)
SCIP_DUALPACKET COLPACKET
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
packing single and dual bit values
#define BMSfreeMemoryArray(ptr)
static SCIP_RETCODE checkState(SCIP_LPI *lpi, int ncols, int nrows)
enum MSKoptimizertype_enum MSKoptimizertype
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
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)
static void convertstat_scip2mosek(const int *stat, int n, MSKstakeye *resstat)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)