37 #define MSKCONST const 44 #include "tinycthread/tinycthread.h" 47 #if defined(_WIN32) || defined(_WIN64) 48 #define snprintf _snprintf 51 #if ( MSK_VERSION_MAJOR < 7 ) 52 #error "The MOSEK interface only works for MOSEK versions 7.0.0.0 and newer" 55 #define scipmskobjsen MSKobjsensee 56 #define SENSE2MOSEK(objsen) (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE)) 60 #define MOSEK_CALL(x) do \ 62 MSKrescodee _restat_; \ 64 if( (_restat_) != MSK_RES_OK && (_restat_ ) != MSK_RES_TRM_MAX_NUM_SETBACKS ) \ 66 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \ 67 return SCIP_LPERROR; \ 73 #define SCIP_ABORT_FALSE(x) do \ 75 SCIP_RETCODE _restat_; \ 76 if( (_restat_ = (x)) != SCIP_OKAY ) \ 78 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \ 85 #define IS_POSINF(x) ((x) >= MSK_INFINITY) 86 #define IS_NEGINF(x) ((x) <= -MSK_INFINITY) 88 #ifdef SCIP_THREADSAFE 89 #if defined(_Thread_local) 92 static _Thread_local
int numlp = 0;
102 #if MSK_VERSION_MAJOR >= 9 103 #define NEAR_REL_TOLERANCE 1.0 105 #define DEBUG_PRINT_STAT 0 106 #define DEBUG_PARAM_SETTING 0 107 #define DEBUG_CHECK_DATA 0 108 #define DEBUG_EASY_REPRODUCE 0 109 #define DEBUG_DO_INTPNT_FEAS_CHECK 0 110 #define DEBUG_CHECK_STATE_TOL 1e-5 111 #define SHOW_ERRORS 0 112 #define SHOW_RELATIVE_OPTIMAL_GAP 0 113 #define ASSERT_ON_NUMERICAL_TROUBLES 0 114 #define ASSERT_ON_WARNING 0 115 #define FORCE_MOSEK_LOG 0 116 #define FORCE_MOSEK_SUMMARY 0 117 #define FORCE_NO_MAXITER 0 118 #define SETBACK_LIMIT 250 119 #define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE 120 #define SUPRESS_NAME_ERROR 1 122 #define WRITE_PRIMAL 0 123 #define WRITE_INTPNT 0 124 #if WRITE_DUAL > 0 || WRITE_PRIMAL > 0 || WRITE_INTPNT > 0 || FORCE_MOSEK_LOG > 0 || FORCE_MOSEK_SUMMARY > 0 125 #define WRITE_ABOVE 0 127 #define DEGEN_LEVEL MSK_SIM_DEGEN_FREE 128 #define ALWAYS_SOLVE_PRIMAL_FORM 1 129 #if DEBUG_PRINT_STAT > 0 130 static int numstrongbranchmaxiterup = 0;
131 static int numstrongbranchmaxiterdo = 0;
132 static int numprimalmaxiter = 0;
133 static int numdualmaxiter = 0;
134 static int numstrongbranchobjup = 0;
135 static int numstrongbranchobjdo = 0;
136 static int numprimalobj = 0;
137 static int numdualobj = 0;
140 #if DEBUG_PRINT_STAT > 0 141 static int numstrongbranchmaxiterup = 0;
142 static int numstrongbranchmaxiterdo = 0;
143 static int numprimalmaxiter = 0;
144 static int numdualmaxiter = 0;
145 static int numstrongbranchobjup = 0;
146 static int numstrongbranchobjdo = 0;
147 static int numprimalobj = 0;
148 static int numdualobj = 0;
183 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 185 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 210 MSKsoltypee whichsol,
219 res = MSK_getprosta(task, whichsol, prosta);
220 if ( res != MSK_RES_OK )
225 res = MSK_getsolsta(task, whichsol, solsta);
226 if ( res != MSK_RES_OK )
254 MSKuserhandle_t handle,
258 #if SUPRESS_NAME_ERROR 260 (void) snprintf(errstr, 32,
"MOSEK Error %d", MSK_RES_ERR_DUP_NAME);
261 if (0 == strncmp(errstr, str, strlen(errstr)))
268 #if DEBUG_CHECK_DATA > 0 273 const char* functionname
293 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
316 for( i = 0; i < numvar; i++ )
318 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, i, &tbkx[i], &tblx[i], &tbux[i]) );
321 for( i = 0; i < numcon; i++ )
323 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_CON, i, &tbkc[i], &tblc[i], &tbuc[i]) );
326 for( i = 0; i < numcon; ++i )
330 if( ( tskc[i] == MSK_SK_FIX && tbkc[i] != MSK_BK_FX ) ||
331 ( tskc[i] == MSK_SK_LOW && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_RA ) ) ||
332 ( tskc[i] == MSK_SK_UPR && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_RA ) ) )
334 SCIPerrorMessage(
"STATUS KEY ERROR i %d bkc %d skc %d %s\n", i, tbkc[i], tskc[i], functionname);
338 if( tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA )
346 if( tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA )
355 for( i = 0; i < numvar; ++i )
357 if( tbkx[i] == MSK_BK_LO || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA )
365 if( tbkx[i] == MSK_BK_UP || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA )
471 for( i = 0; i < n; i++ )
492 else if (lb[i] == ub[i])
494 assert(lb[i] - ub[i] == 0);
495 assert(ub[i] - lb[i] == 0);
500 assert(lb[i] < ub[i]);
518 assert(beg !=
NULL || nnonz == 0);
523 for(i = 0; i < n-1; i++)
526 assert(aptre[i] >= beg[i]);
530 assert(aptre[n-1] >= beg[n-1]);
534 for( i = 0; i < n; i++ )
551 assert(first <= last);
555 for( i = first; i <= last; i++ )
575 assert(dstat !=
NULL);
576 assert(count !=
NULL);
579 for( i = 0; i < n; i++ )
595 for( i = 0; i < n; i++ )
615 for( i = 0; i < len; i++ )
735 #define STR_HELPER(x) #x 736 #define STR(x) STR_HELPER(x) 738 #if MSK_VERSION_MAJOR < 9 739 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION) 741 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_REVISION) 760 return "Linear Programming Solver developed by MOSEK Optimization Software (www.mosek.com)";
772 return (
void*) lpi->
task;
782 assert( lpi !=
NULL );
783 assert( ncols >= 0 );
784 assert( intInfo !=
NULL );
786 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
833 assert(name !=
NULL);
845 #if MSK_VERSION_MAJOR < 8 850 (*lpi)->lpid =
numlp++;
855 MOSEK_CALL( MSK_linkfunctoenvstream((*lpi)->mosekenv, MSK_STREAM_LOG, (MSKuserhandle_t) messagehdlr,
printstr) );
856 #if MSK_VERSION_MAJOR < 8 861 MOSEK_CALL( MSK_makeemptytask((*lpi)->mosekenv, &((*lpi)->task)) );
863 MOSEK_CALL( MSK_linkfunctotaskstream((*lpi)->task, MSK_STREAM_LOG, (MSKuserhandle_t) messagehdlr,
printstr) );
867 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_FREE_SIMPLEX) );
869 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_SIM_SWITCH_OPTIMIZER, MSK_ON) );
870 MOSEK_CALL( MSK_puttaskname((*lpi)->task, (
char*) name) );
873 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_AIJ_HUGE, MSK_INFINITY * 2));
874 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_C_HUGE, MSK_INFINITY));
877 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_AIJ_LARGE, MSK_INFINITY * 2));
878 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_CJ_LARGE, MSK_INFINITY));
881 MOSEK_CALL( MSK_putdouparam((*lpi)->task, MSK_DPAR_DATA_TOL_BOUND_WRN, MSK_INFINITY));
883 (*lpi)->termcode = MSK_RES_OK;
884 (*lpi)->itercount = 0;
886 (*lpi)->lastalgo = MSK_OPTIMIZER_FREE;
891 (*lpi)->aptre =
NULL;
896 (*lpi)->aptresize = 0;
897 (*lpi)->lastsolvetype = (MSKsoltypee) -1;
898 (*lpi)->lpinfo =
FALSE;
899 (*lpi)->restrictselectdef = 50;
900 (*lpi)->fromscratch =
FALSE;
901 (*lpi)->clearstate =
FALSE;
906 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_LOG, MSK_OFF) );
907 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_LOG_SIM, MSK_OFF) );
918 assert(*lpi !=
NULL);
939 MOSEK_CALL( MSK_deleteenv(&(*lpi)->mosekenv) );
974 for( j = 0; j < nnonz; j++ )
975 assert( val[j] != 0.0 );
995 #if DEBUG_CHECK_DATA > 0 996 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiLoadColLP") );
1014 MOSEK_CALL( MSK_inputdata(lpi->
task, nrows, ncols, nrows, ncols, obj, 0.0, beg, lpi->
aptre, ind, val,
1015 lpi->
bkc, lhs, rhs, lpi->
bkx, lb, ub) );
1019 if( colnames !=
NULL )
1023 for( c = 0; c <
ncols; c++ )
1029 if( rownames !=
NULL )
1033 for( r = 0; r <
nrows; r++ )
1039 #if DEBUG_CHECK_DATA > 0 1040 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiLoadColLP") );
1060 #if MSK_VERSION_MAJOR < 7 1066 assert(lpi !=
NULL);
1069 assert(obj !=
NULL);
1072 assert(nnonz == 0 || beg !=
NULL);
1073 assert(nnonz == 0 || ind !=
NULL);
1074 assert(nnonz == 0 || val !=
NULL);
1082 #if DEBUG_CHECK_DATA > 0 1083 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddCols") );
1095 MOSEK_CALL( MSK_putcslice(lpi->
task, oldcols, oldcols+ncols, obj) );
1096 MOSEK_CALL( MSK_putvarboundslice(lpi->
task, oldcols, oldcols+ncols, lpi->
bkx, lb, ub) );
1106 for (j = 0; j < nnonz; ++j)
1108 assert( 0 <= ind[j] && ind[j] < nrows );
1109 assert( val[j] != 0.0 );
1115 MOSEK_CALL( MSK_putacolslice(lpi->
task, oldcols, oldcols+ncols, beg, lpi->
aptre, ind, val) );
1118 if( colnames !=
NULL )
1122 for( c = 0; c <
ncols; c++ )
1128 #if DEBUG_CHECK_DATA > 0 1129 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddCols") );
1144 assert(lpi !=
NULL);
1152 #if DEBUG_CHECK_DATA > 0 1153 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelCols") );
1158 MOSEK_CALL( MSK_removevars(lpi->
task, lastcol-firstcol+1, sub) );
1162 #if DEBUG_CHECK_DATA > 0 1163 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelCols") );
1183 assert(lpi !=
NULL);
1186 assert(dstat !=
NULL);
1192 #if DEBUG_CHECK_DATA > 0 1193 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelColset") );
1201 for( i = 0; i <
ncols; i++)
1221 #if DEBUG_CHECK_DATA > 0 1222 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelColset") );
1243 assert(lpi !=
NULL);
1246 assert(nnonz == 0 || beg !=
NULL);
1247 assert(nnonz == 0 || ind !=
NULL);
1248 assert(nnonz == 0 || val !=
NULL);
1254 #if DEBUG_CHECK_DATA > 0 1255 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddRows") );
1268 MOSEK_CALL( MSK_putconboundslice(lpi->
task, oldrows, oldrows+nrows, lpi->
bkc, lhs, rhs) );
1278 for (j = 0; j < nnonz; ++j)
1280 assert( val[j] != 0.0 );
1281 assert( 0 <= ind[j] && ind[j] < ncols );
1287 MOSEK_CALL( MSK_putarowslice(lpi->
task, oldrows, oldrows+nrows, beg, lpi->
aptre, ind, val) );
1290 if( rownames !=
NULL )
1294 for( r = 0; r <
nrows; r++ )
1300 #if DEBUG_CHECK_DATA > 0 1301 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiAddRows") );
1316 assert(lpi !=
NULL);
1324 #if DEBUG_CHECK_DATA > 0 1325 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRows") );
1332 MOSEK_CALL( MSK_removecons(lpi->
task, lastrow-firstrow+1, sub) );
1336 #if DEBUG_CHECK_DATA > 0 1337 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRows") );
1357 assert(lpi !=
NULL);
1365 #if DEBUG_CHECK_DATA > 0 1366 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRowset") );
1375 for( i = 0; i <
nrows; i++ )
1395 #if DEBUG_CHECK_DATA > 0 1396 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiDelRowset end") );
1410 assert(lpi !=
NULL);
1438 assert(lpi !=
NULL);
1441 assert(ncols == 0 || (ind !=
NULL && lb !=
NULL && ub !=
NULL));
1449 #if DEBUG_CHECK_DATA > 0 1450 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgBounds") );
1455 for (i = 0; i <
ncols; ++i)
1459 SCIPerrorMessage(
"LP Error: fixing lower bound for variable %d to infinity.\n", ind[i]);
1464 SCIPerrorMessage(
"LP Error: fixing upper bound for variable %d to -infinity.\n", ind[i]);
1472 #if MSK_VERSION_MAJOR < 9 1473 MOSEK_CALL( MSK_putboundlist(lpi->
task, MSK_ACC_VAR, ncols, ind, lpi->
bkx, lb, ub) );
1478 #if DEBUG_CHECK_DATA > 0 1479 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgBounds") );
1494 assert(lpi !=
NULL);
1497 assert(ind !=
NULL);
1506 #if DEBUG_CHECK_DATA > 0 1507 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgSides") );
1513 #if MSK_VERSION_MAJOR < 9 1514 MOSEK_CALL( MSK_putboundlist(lpi->
task, MSK_ACC_CON, nrows, ind, lpi->
bkc, lhs, rhs) );
1519 #if DEBUG_CHECK_DATA > 0 1520 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgSides") );
1534 assert(lpi !=
NULL);
1542 #if DEBUG_CHECK_DATA > 0 1543 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgCoef") );
1548 #if DEBUG_CHECK_DATA > 0 1549 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgCoef") );
1561 assert(lpi !=
NULL);
1582 assert(lpi !=
NULL);
1585 assert(ind !=
NULL);
1586 assert(obj !=
NULL);
1592 #if DEBUG_CHECK_DATA > 0 1593 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgObj") );
1598 #if DEBUG_CHECK_DATA > 0 1599 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiChgObj") );
1619 assert(lpi !=
NULL);
1627 #if DEBUG_CHECK_DATA > 0 1628 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleRow") );
1631 assert(scaleval != 0);
1648 #if MSK_VERSION_MAJOR < 9 1649 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_CON, row, &bkc, &blc, &buc) );
1651 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_CON, row, bkc, blc, buc) );
1658 #if DEBUG_CHECK_DATA > 0 1659 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleRow") );
1680 assert(lpi !=
NULL);
1688 #if DEBUG_CHECK_DATA > 0 1689 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleCol") );
1692 assert(scaleval != 0);
1708 #if MSK_VERSION_MAJOR < 9 1709 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, col, &bkx, &blx, &bux) );
1711 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
1721 #if DEBUG_CHECK_DATA > 0 1722 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiScaleCol") );
1740 assert(lpi !=
NULL);
1743 assert(nrows !=
NULL);
1758 assert(lpi !=
NULL);
1761 assert(ncols !=
NULL);
1776 assert(lpi !=
NULL);
1779 assert(nnonz !=
NULL);
1801 assert(lpi !=
NULL);
1804 assert(first <= last);
1808 #if DEBUG_CHECK_DATA > 0 1809 SCIP_CALL( scip_checkdata(lpi,
"getASlice") );
1816 assert(beg !=
NULL);
1817 assert(ind !=
NULL);
1818 assert(val !=
NULL);
1822 #if MSK_VERSION_MAJOR < 9 1823 MOSEK_CALL( MSK_getaslicenumnz(lpi->
task, iscon ? MSK_ACC_CON : MSK_ACC_VAR, first, last+1, nnonz) );
1825 MOSEK_CALL( MSK_getaslice(lpi->
task, iscon ? MSK_ACC_CON : MSK_ACC_VAR, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1829 MOSEK_CALL( MSK_getarowslicenumnz(lpi->
task, first, last+1, nnonz) );
1831 MOSEK_CALL( MSK_getarowslice(lpi->
task, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1835 MOSEK_CALL( MSK_getacolslicenumnz(lpi->
task, first, last+1, nnonz) );
1837 MOSEK_CALL( MSK_getacolslice(lpi->
task, first, last+1, *nnonz, &surplus, beg, lpi->
aptre, ind, val) );
1841 assert(surplus == 0);
1844 #if DEBUG_CHECK_DATA > 0 1845 SCIP_CALL( scip_checkdata(lpi,
"getASlice") );
1867 assert(lpi !=
NULL);
1877 assert(0 <= firstcol && firstcol <= lastcol && lastcol < ncols);
1905 assert(lpi !=
NULL);
1915 assert(0 <= firstrow && firstrow <= lastrow && lastrow < nrows);
1921 #if DEBUG_CHECK_DATA > 0 1922 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetRows") );
1928 #if DEBUG_CHECK_DATA > 0 1929 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetRows") );
1942 int namestoragesize,
1946 assert(lpi !=
NULL);
1949 assert(0 <= firstcol && firstcol <= lastcol);
1950 assert(colnames !=
NULL || namestoragesize == 0);
1951 assert(namestorage !=
NULL || namestoragesize == 0);
1952 assert(namestoragesize >= 0);
1953 assert(storageleft !=
NULL);
1967 int namestoragesize,
1971 assert(lpi !=
NULL);
1974 assert(0 <= firstrow && firstrow <= lastrow);
1975 assert(rownames !=
NULL || namestoragesize == 0);
1976 assert(namestorage !=
NULL || namestoragesize == 0);
1977 assert(namestoragesize >= 0);
1978 assert(storageleft !=
NULL);
1991 MSKobjsensee mskobjsen;
1993 assert(lpi !=
NULL);
1996 assert(objsen !=
NULL);
2014 assert(lpi !=
NULL);
2017 assert(firstcol <= lastcol);
2018 assert(vals !=
NULL);
2022 MOSEK_CALL( MSK_getcslice(lpi->
task, firstcol, lastcol+1, vals) );
2036 assert(lpi !=
NULL);
2039 assert(firstcol <= lastcol);
2043 #if DEBUG_CHECK_DATA > 0 2044 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetBounds") );
2047 #if MSK_VERSION_MAJOR < 9 2048 MOSEK_CALL( MSK_getboundslice(lpi->
task, MSK_ACC_VAR, firstcol, lastcol+1,
NULL, lbs, ubs) );
2065 assert(lpi !=
NULL);
2068 assert(firstrow <= lastrow);
2072 #if DEBUG_CHECK_DATA > 0 2073 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetSides") );
2076 #if MSK_VERSION_MAJOR < 9 2077 MOSEK_CALL( MSK_getboundslice(lpi->
task, MSK_ACC_CON, firstrow, lastrow+1,
NULL, lhss, rhss) );
2079 MOSEK_CALL( MSK_getconboundslice(lpi->
task, firstrow, lastrow+1,
NULL, lhss, rhss) );
2082 #if DEBUG_CHECK_DATA > 0 2083 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetSides") );
2097 assert(lpi !=
NULL);
2100 assert(val !=
NULL);
2104 #if DEBUG_CHECK_DATA > 0 2105 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetCoef") );
2110 #if DEBUG_CHECK_DATA > 0 2111 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiGetCoef") );
2130 assert(lpi !=
NULL);
2147 assert( termcode !=
NULL );
2149 #if ASSERT_ON_NUMERICAL_TROUBLES > 0 2150 if ( res == MSK_RES_TRM_MAX_NUM_SETBACKS || res == MSK_RES_TRM_NUMERICAL_PROBLEM )
2161 if ( res == MSK_RES_TRM_MAX_ITERATIONS || res == MSK_RES_TRM_MAX_TIME
2162 || res == MSK_RES_TRM_OBJECTIVE_RANGE || res == MSK_RES_TRM_STALL )
2168 *termcode = MSK_RES_OK;
2179 int itercount_primal;
2188 assert(lpi !=
NULL);
2196 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, &presolve) );
2197 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, &maxiter) );
2200 #if DEBUG_EASY_REPRODUCE 2201 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_AUTO_SORT_A_BEFORE_OPT, MSK_ON) );
2202 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_OFF) );
2204 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2207 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_AUTO_UPDATE_SOL_INFO, MSK_OFF) );
2213 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG_SIM_FREQ, 1) );
2221 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
2225 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_OFF) );
2229 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_ON) );
2232 #if ALWAYS_SOLVE_PRIMAL_FORM > 0 2234 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SOLVE_FORM, MSK_SOLVE_PRIMAL) );
2237 #if DEBUG_CHECK_DATA > 0 2238 SCIP_CALL( scip_checkdata(lpi,
"SolveWSimplex") );
2241 if( gotbasicsol && maxiter < 20000 )
2244 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION, 0) );
2245 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION, 0) );
2254 #if FORCE_NO_MAXITER > 0 2255 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, 2000000000) );
2259 #if DEBUG_CHECK_DATA > 0 2260 SCIP_CALL( scip_checkdata(lpi,
"Begin optimize with simplex") );
2263 #if FORCE_MOSEK_SUMMARY > 1 2273 #if MSK_VERSION_MAJOR < 10 2275 if( lpi->
termcode == MSK_RES_TRM_MAX_NUM_SETBACKS )
2279 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_SCALING, &scaling) );
2280 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) );
2282 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, scaling) );
2286 #if FORCE_MOSEK_SUMMARY 2298 #if DEBUG_CHECK_DATA > 0 2299 SCIP_CALL( scip_checkdata(lpi,
"End optimize with simplex") );
2303 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, presolve) );
2304 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) );
2307 MOSEK_CALL( MSK_getintinf(lpi->
task, MSK_IINF_SIM_PRIMAL_ITER, &itercount_primal) );
2308 MOSEK_CALL( MSK_getintinf(lpi->
task, MSK_IINF_SIM_DUAL_ITER, &itercount_dual) );
2310 lpi->
itercount = itercount_primal + itercount_dual;
2318 SCIPdebugMessage(
"maxiter = %d, termcode = %d, prosta = %d, solsta = %d, objval = %g : %g, iter = %d+%d\n",
2319 maxiter, lpi->
termcode, prosta, solsta, pobj, dobj, itercount_primal, itercount_dual);
2323 case MSK_SOL_STA_OPTIMAL:
2324 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS:
2325 case MSK_SOL_STA_PRIM_FEAS:
2326 case MSK_SOL_STA_DUAL_FEAS:
2327 case MSK_SOL_STA_PRIM_INFEAS_CER:
2328 case MSK_SOL_STA_DUAL_INFEAS_CER:
2333 case MSK_SOL_STA_UNKNOWN:
2335 assert( lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS || lpi->
termcode == MSK_RES_TRM_MAX_TIME ||
2336 lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE || lpi->
termcode == MSK_RES_TRM_STALL ||
2339 if ( lpi->
termcode != MSK_RES_TRM_MAX_ITERATIONS && lpi->
termcode != MSK_RES_TRM_MAX_TIME &&
2340 lpi->
termcode != MSK_RES_TRM_OBJECTIVE_RANGE )
2343 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2344 #if ASSERT_ON_WARNING 2350 #if MSK_VERSION_MAJOR < 9 2351 case MSK_SOL_STA_NEAR_OPTIMAL:
2352 case MSK_SOL_STA_NEAR_PRIM_FEAS:
2353 case MSK_SOL_STA_NEAR_DUAL_FEAS:
2354 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS:
2355 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER:
2356 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER:
2358 assert(lpi->
termcode == MSK_RES_OK);
2361 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2362 #if ASSERT_ON_WARNING 2368 case MSK_SOL_STA_INTEGER_OPTIMAL:
2369 #if MSK_VERSION_MAJOR < 9 2370 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL:
2377 #if ASSERT_ON_WARNING 2387 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
2388 case MSK_PRO_STA_PRIM_FEAS:
2389 case MSK_PRO_STA_DUAL_FEAS:
2390 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
2391 case MSK_PRO_STA_PRIM_INFEAS:
2392 case MSK_PRO_STA_DUAL_INFEAS:
2393 case MSK_PRO_STA_UNKNOWN:
2396 #if MSK_VERSION_MAJOR < 9 2397 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
2398 case MSK_PRO_STA_NEAR_PRIM_FEAS:
2399 case MSK_PRO_STA_NEAR_DUAL_FEAS:
2401 case MSK_PRO_STA_ILL_POSED:
2402 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
2403 assert(lpi->
termcode == MSK_RES_OK);
2406 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2408 #if ASSERT_ON_WARNING 2418 #if ASSERT_ON_WARNING 2426 #if SHOW_RELATIVE_OPTIMAL_GAP 2427 if ( solsta == MSK_SOL_STA_OPTIMAL && fabs(pobj) + fabs(dobj) > 1.0e-6 && fabs(pobj-dobj) > 0.0001*(fabs(pobj) + fabs(dobj)))
2429 SCIPerrorMessage(
"Simplex[%d] returned optimal solution with different objvals %g != %g reldiff %.2g%%\n",
2430 lpi->
optimizecount, pobj, dobj, 100.0 * fabs(pobj-dobj)/
MAX(fabs(pobj), fabs(dobj)));
2435 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2437 if (solsta != MSK_SOL_STA_DUAL_FEAS && solsta != MSK_SOL_STA_OPTIMAL && solsta != MSK_SOL_STA_PRIM_AND_DUAL_FEAS)
2447 if (maxiter >= 2000000000)
2449 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) );
2451 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2460 #if DEBUG_DO_INTPNT_FEAS_CHECK 2461 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER)
2469 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER)
2481 #if DEBUG_PRINT_STAT > 0 2482 SCIPdebugMessage(
"Max iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2483 lpi->
optimizecount, numstrongbranchmaxiterup, numstrongbranchmaxiterdo, numprimalmaxiter, numdualmaxiter);
2484 SCIPdebugMessage(
"Objcut iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2485 lpi->
optimizecount, numstrongbranchobjup, numstrongbranchobjdo, numprimalobj, numdualobj);
2488 #if DEBUG_CHECK_DATA > 0 2489 SCIP_CALL( scip_checkdata(lpi,
"SolveWSimplex") );
2500 assert(lpi !=
NULL);
2508 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2512 MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS) );
2515 #if DEBUG_CHECK_DATA > 0 2516 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolvePrimal") );
2519 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_PRIMAL_SIMPLEX) );
2520 lpi->
lastalgo = MSK_OPTIMIZER_PRIMAL_SIMPLEX;
2522 #if WRITE_PRIMAL > 0 2529 MSK_writedata(lpi->
task, fname);
2535 #ifdef SCIP_DISABLED_CODE 2537 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
2543 if( solsta != MSK_SOL_STA_PRIM_FEAS )
2550 #if DEBUG_PRINT_STAT > 0 2551 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2555 #if DEBUG_PRINT_STAT > 0 2556 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2560 #if DEBUG_CHECK_DATA > 0 2561 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolvePrimal") );
2572 assert(lpi !=
NULL);
2581 #if (MSK_VERSION_MAJOR < 8) || (MSK_VERSION_MAJOR == 8 && MSK_VERSION_MINOR == 0) 2582 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_INTEGER, MSK_ON) );
2584 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
2588 MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS) );
2591 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_DUAL_SIMPLEX) );
2592 lpi->
lastalgo = MSK_OPTIMIZER_DUAL_SIMPLEX;
2600 MSK_writedata(lpi->
task, fname);
2606 #ifdef SCIP_DISABLED_CODE 2608 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
2614 if( solsta != MSK_SOL_STA_DUAL_FEAS )
2621 #if DEBUG_PRINT_STAT > 0 2622 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2626 #if DEBUG_PRINT_STAT > 0 2627 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2643 assert(lpi !=
NULL);
2665 #if DEBUG_CHECK_DATA > 0 2666 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolveBarrier") );
2669 #ifdef SCIP_DISABLED_CODE 2672 MSK_SIM_HOTSTART_NONE : MSK_INTPNT_HOTSTART_PRIMAL_DUAL) );
2676 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_BASIS, crossover ? MSK_BI_ALWAYS : MSK_BI_NEVER) );
2677 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_INTPNT) );
2678 lpi->
lastalgo = MSK_OPTIMIZER_INTPNT;
2680 #if MSK_VERSION_MAJOR >= 9 2681 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_INTPNT_CO_TOL_NEAR_REL, NEAR_REL_TOLERANCE) );
2684 #if WRITE_INTPNT > 0 2691 MSK_writedata(lpi->
task, fname);
2697 #if DEBUG_PRINT_STAT > 0 2698 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2710 case MSK_SOL_STA_OPTIMAL:
2711 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS:
2712 case MSK_SOL_STA_PRIM_FEAS:
2713 case MSK_SOL_STA_DUAL_FEAS:
2714 case MSK_SOL_STA_PRIM_INFEAS_CER:
2715 case MSK_SOL_STA_DUAL_INFEAS_CER:
2719 case MSK_SOL_STA_UNKNOWN:
2720 #if MSK_VERSION_MAJOR < 9 2721 case MSK_SOL_STA_NEAR_OPTIMAL:
2722 case MSK_SOL_STA_NEAR_PRIM_FEAS:
2723 case MSK_SOL_STA_NEAR_DUAL_FEAS:
2724 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS:
2725 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER:
2726 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER:
2731 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2733 #if ASSERT_ON_WARNING 2737 case MSK_SOL_STA_INTEGER_OPTIMAL:
2738 #if MSK_VERSION_MAJOR < 9 2739 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL:
2746 #if ASSERT_ON_WARNING 2755 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
2756 case MSK_PRO_STA_PRIM_FEAS:
2757 case MSK_PRO_STA_DUAL_FEAS:
2758 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
2759 case MSK_PRO_STA_PRIM_INFEAS:
2760 case MSK_PRO_STA_DUAL_INFEAS:
2762 case MSK_PRO_STA_UNKNOWN:
2763 #if MSK_VERSION_MAJOR < 9 2764 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
2765 case MSK_PRO_STA_NEAR_PRIM_FEAS:
2766 case MSK_PRO_STA_NEAR_DUAL_FEAS:
2768 case MSK_PRO_STA_ILL_POSED:
2769 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
2773 lpi->
termcode = MSK_RES_TRM_NUMERICAL_PROBLEM;
2777 #if ASSERT_ON_WARNING 2786 #if ASSERT_ON_WARNING 2793 #if DEBUG_CHECK_DATA > 0 2794 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiSolveBarrier") );
2805 assert(lpi !=
NULL);
2818 assert(lpi !=
NULL);
2845 MSKobjsensee objsen;
2859 assert(lpi !=
NULL);
2865 #if DEBUG_CHECK_DATA > 0 2866 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiStrongbranch") );
2880 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, &olditerlim) );
2881 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, &oldselection) );
2882 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART, &oldhotstart) );
2884 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, itlim) );
2887 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
2889 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, &bound) );
2893 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, &bound) );
2896 #if MSK_VERSION_MAJOR < 9 2897 MOSEK_CALL( MSK_getbound(lpi->
task, MSK_ACC_VAR, col, &bkx, &blx, &bux) );
2904 newub =
EPSCEIL(psol-1.0, 1e-06);
2906 if (newub < blx - 0.5)
2917 else if (
EPSEQ(blx, newub,1.0e-6))
2925 #if MSK_VERSION_MAJOR < 9 2926 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, newbk, blx, newub) );
2928 MOSEK_CALL( MSK_putvarbound(lpi->
task, col, newbk, blx, newub) );
2971 #if DEBUG_PRINT_STAT > 0 2972 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
2973 ++numstrongbranchobjup;
2975 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
2976 ++numstrongbranchmaxiterup;
2981 #if MSK_VERSION_MAJOR < 9 2982 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
2989 if (newlb > bux + 0.5)
3000 else if (
EPSEQ(bux, newlb,1.0e-6))
3008 #if MSK_VERSION_MAJOR < 9 3009 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, newbk, newlb, bux) );
3011 MOSEK_CALL( MSK_putvarbound(lpi->
task, col, newbk, newlb, bux) );
3051 #if DEBUG_PRINT_STAT > 0 3052 if (lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE)
3053 ++numstrongbranchobjdo;
3055 if (lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS)
3056 ++numstrongbranchmaxiterdo;
3060 #if MSK_VERSION_MAJOR < 9 3061 MOSEK_CALL( MSK_putbound(lpi->
task, MSK_ACC_VAR, col, bkx, blx, bux) );
3065 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, olditerlim) );
3066 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, oldselection) );
3067 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART, oldhotstart) );
3076 #if DEBUG_CHECK_DATA > 0 3077 SCIP_CALL( scip_checkdata(lpi,
"SCIPlpiStrongbranch") );
3130 assert( cols !=
NULL );
3131 assert( psols !=
NULL );
3132 assert( down !=
NULL );
3133 assert( up !=
NULL );
3134 assert( downvalid !=
NULL );
3135 assert( upvalid !=
NULL );
3136 assert( down !=
NULL );
3141 for (j = 0; j <
ncols; ++j)
3194 assert( cols !=
NULL );
3195 assert( psols !=
NULL );
3196 assert( down !=
NULL );
3197 assert( up !=
NULL );
3198 assert( downvalid !=
NULL );
3199 assert( upvalid !=
NULL );
3200 assert( down !=
NULL );
3205 for (j = 0; j <
ncols; ++j)
3224 assert(lpi !=
NULL);
3247 assert( lpi !=
NULL );
3250 assert( primalfeasible !=
NULL );
3251 assert( dualfeasible !=
NULL );
3259 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS:
3260 *primalfeasible =
TRUE;
3261 *dualfeasible =
TRUE;
3263 case MSK_PRO_STA_PRIM_FEAS:
3264 *primalfeasible =
TRUE;
3265 *dualfeasible =
FALSE;
3267 case MSK_PRO_STA_DUAL_FEAS:
3268 *primalfeasible =
FALSE;
3269 *dualfeasible =
TRUE;
3271 case MSK_PRO_STA_DUAL_INFEAS:
3273 *primalfeasible = (lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX);
3274 *dualfeasible =
FALSE;
3276 case MSK_PRO_STA_UNKNOWN:
3277 case MSK_PRO_STA_PRIM_INFEAS:
3278 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS:
3279 case MSK_PRO_STA_ILL_POSED:
3280 #if MSK_VERSION_MAJOR < 9 3281 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS:
3282 case MSK_PRO_STA_NEAR_PRIM_FEAS:
3283 case MSK_PRO_STA_NEAR_DUAL_FEAS:
3285 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED:
3286 *primalfeasible =
FALSE;
3287 *dualfeasible =
FALSE;
3306 assert(lpi !=
NULL);
3314 return ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER
3315 || prosta == MSK_PRO_STA_DUAL_INFEAS
3316 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS );
3328 assert(lpi !=
NULL);
3336 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER);
3346 assert(lpi !=
NULL);
3353 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX);
3361 assert(lpi !=
NULL);
3375 assert(lpi !=
NULL);
3383 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));
3396 assert(lpi !=
NULL);
3404 return ( solsta == MSK_SOL_STA_PRIM_INFEAS_CER
3405 || prosta == MSK_PRO_STA_PRIM_INFEAS
3406 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS );
3418 assert(lpi !=
NULL);
3426 return (solsta == MSK_SOL_STA_PRIM_INFEAS_CER);
3434 assert(lpi !=
NULL);
3446 assert(lpi !=
NULL);
3460 assert(lpi !=
NULL);
3468 return (prosta == MSK_PRO_STA_DUAL_FEAS || prosta == MSK_PRO_STA_PRIM_AND_DUAL_FEAS);
3478 assert(lpi !=
NULL);
3486 return (solsta == MSK_SOL_STA_OPTIMAL);
3500 assert(lpi !=
NULL);
3504 return ( lpi->
termcode == MSK_RES_OK
3505 || lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS
3506 || lpi->
termcode == MSK_RES_TRM_MAX_TIME
3507 || lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE );
3515 assert(lpi !=
NULL);
3519 return ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE );
3527 assert(lpi !=
NULL);
3531 return ( lpi->
termcode == MSK_RES_TRM_MAX_ITERATIONS );
3539 assert(lpi !=
NULL);
3543 return ( lpi->
termcode == MSK_RES_TRM_MAX_TIME );
3554 assert(lpi !=
NULL);
3564 return (
int) solsta;
3573 assert(lpi !=
NULL);
3576 assert(success !=
NULL);
3591 assert(lpi !=
NULL);
3594 assert(objval !=
NULL);
3600 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3603 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, objval) );
3633 assert(lpi !=
NULL);
3639 if ( objval !=
NULL )
3641 if ( lpi->
termcode == MSK_RES_TRM_OBJECTIVE_RANGE )
3644 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, objval) );
3659 if ( primsol !=
NULL && lpi->
lastalgo == MSK_OPTIMIZER_PRIMAL_SIMPLEX )
3665 if ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER )
3674 for (j = 0; j <
ncols; ++j)
3714 for( i = 0; i <
ncols; i++ )
3716 assert(sux !=
NULL);
3717 redcost[i] -= sux[i];
3731 assert(lpi !=
NULL);
3734 assert(ray !=
NULL);
3750 assert(lpi !=
NULL);
3753 assert(dualfarkas !=
NULL);
3757 MOSEK_CALL( MSK_getsolution(lpi->
task, lpi->
lastsolvetype,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, dualfarkas,
3769 assert(lpi !=
NULL);
3772 assert(iterations !=
NULL);
3792 assert(lpi !=
NULL);
3795 assert(quality !=
NULL);
3811 if (res == MSK_RES_ERR_BASIS_SINGULAR)
3847 for( i = 0; i < n; i++ )
3861 #if MSK_VERSION_MAJOR < 9 3866 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3867 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3871 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
3872 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
3893 #if MSK_VERSION_MAJOR < 10 3923 for( i = 0; i < m; 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 ) );
3964 #if MSK_VERSION_MAJOR < 10 3985 for( i = 0; i < n; i++ )
3990 resstat[i] = MSK_SK_LOW;
3993 resstat[i] = MSK_SK_BAS;
3996 resstat[i] = MSK_SK_UPR;
3999 resstat[i] = MSK_SK_SUPBAS;
4018 for( i = 0; i < n; i++ )
4023 resstat[i] = MSK_SK_UPR;
4026 resstat[i] = MSK_SK_BAS;
4029 resstat[i] = MSK_SK_LOW;
4032 resstat[i] = MSK_SK_SUPBAS;
4053 assert(lpi !=
NULL);
4088 assert(lpi !=
NULL);
4095 assert(cstat !=
NULL || ncols == 0);
4096 assert(rstat !=
NULL || nrows == 0);
4121 assert(lpi !=
NULL);
4124 assert(bind !=
NULL);
4132 for (i = 0; i <
nrows; i++ )
4134 if (bind[i] < nrows)
4135 bind[i] = -1 - bind[i];
4137 bind[i] = bind[i] -
nrows;
4165 assert(lpi !=
NULL);
4168 assert(coef !=
NULL);
4175 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4181 for (i = 0; i <
nrows; ++i)
4186 if ( ninds !=
NULL && inds !=
NULL )
4192 #if MSK_VERSION_MAJOR < 10 4193 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, ninds, inds, coef) );
4195 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, *ninds, inds, coef, ninds) );
4197 assert( *ninds <= nrows );
4210 #if MSK_VERSION_MAJOR < 10 4211 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, &numnz, sub, coef) );
4213 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 1, numnz, sub, coef, &numnz) );
4215 assert( numnz <= nrows );
4219 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4252 assert(lpi !=
NULL);
4255 assert(coef !=
NULL);
4262 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4268 for (i = 0; i <
nrows; ++i)
4273 if ( ninds !=
NULL && inds !=
NULL )
4278 #if MSK_VERSION_MAJOR < 10 4279 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, ninds, inds, coef) );
4281 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, *ninds, inds, coef, ninds) );
4283 assert( *ninds <= nrows );
4295 #if MSK_VERSION_MAJOR < 10 4296 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, &numnz, sub, coef) );
4298 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, numnz, sub, coef, &numnz) );
4300 assert( numnz <= nrows );
4304 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4339 assert(lpi !=
NULL);
4342 assert(coef !=
NULL);
4348 if ( ninds !=
NULL )
4357 if( binvrow ==
NULL )
4369 for (i = 0; i <
ncols; ++i)
4375 for (k = 0; k < numnz; ++k)
4377 assert( 0 <= csub[k] && csub[k] < nrows );
4378 coef[i] += binv[csub[k]] * cval[k];
4412 assert(lpi !=
NULL);
4415 assert(coef !=
NULL);
4424 MOSEK_CALL( MSK_putnaintparam(lpi->
task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) );
4430 for (i = 0; i <
nrows; ++i)
4434 if ( ninds !=
NULL && inds !=
NULL )
4438 for (i = 0; i < numnz; ++i)
4440 assert( 0 <= inds[i] && inds[i] < nrows );
4441 coef[inds[i]] = val[i];
4446 #if MSK_VERSION_MAJOR < 10 4447 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, ninds, inds, coef) );
4449 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, *ninds, inds, coef, ninds) );
4451 assert( *ninds <= nrows );
4460 for (i = 0; i < numnz; ++i)
4462 assert( 0 <= sub[i] && sub[i] < nrows );
4463 coef[sub[i]] = val[i];
4466 #if MSK_VERSION_MAJOR < 10 4467 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, &numnz, sub, coef) );
4469 MOSEK_CALL( MSK_solvewithbasis(lpi->
task, 0, numnz, sub, coef, &numnz) );
4472 if ( ninds !=
NULL )
4479 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) );
4498 assert(lpistate !=
NULL);
4499 assert(blkmem !=
NULL);
4507 (*lpistate)->solsta = MSK_SOL_STA_UNKNOWN;
4508 (*lpistate)->num = -1;
4509 (*lpistate)->ncols =
ncols;
4510 (*lpistate)->nrows =
nrows;
4522 assert(blkmem !=
NULL);
4523 assert(lpistate !=
NULL);
4524 assert(*lpistate !=
NULL);
4547 assert(lpi !=
NULL);
4558 for( i = 0; i < n; i++ )
4569 #if MSK_VERSION_MAJOR < 9 4574 MOSEK_CALL( MSK_getslcslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4575 MOSEK_CALL( MSK_getsucslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4579 MOSEK_CALL( MSK_getslxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &sl ) );
4580 MOSEK_CALL( MSK_getsuxslice(lpi->
task, MSK_SOL_BAS, i, i+1, &su ) );
4618 assert(lpi !=
NULL);
4638 int *skxi = (
int *) lpi->
skx;
4639 int *skci = (
int *) lpi->
skc;
4641 assert(
sizeof(
int) ==
sizeof(MSKstakeye));
4642 assert(lpi !=
NULL);
4643 assert(lpistate !=
NULL);
4663 assert(
sizeof(
int) ==
sizeof(MSKstakeye));
4686 assert(lpi !=
NULL);
4689 assert(lpistate !=
NULL);
4690 assert(blkmem !=
NULL);
4697 MOSEK_CALL( MSK_solutiondef(lpi->
task, MSK_SOL_BAS, &gotbasicsol) );
4742 assert(lpi !=
NULL);
4745 assert(blkmem !=
NULL);
4746 #ifdef SCIP_DISABLED_CODE 4750 if (lpistate ==
NULL)
4756 if (lpistate->
nrows == 0 || lpistate->
ncols == 0)
4761 assert(lpistate->
nrows <= nrows);
4762 assert(lpistate->
ncols <= ncols);
4766 #ifdef SCIP_DISABLED_CODE 4773 for (i = lpistate->
ncols; i < ncols; ++i)
4777 #if MSK_VERSION_MAJOR < 9 4786 lpi->
skx[i] = MSK_SK_SUPBAS;
4788 lpi->
skx[i] = MSK_SK_UPR;
4791 lpi->
skx[i] = MSK_SK_LOW;
4793 for (i = lpistate->
nrows; i < nrows; ++i)
4794 lpi->
skc[i] = MSK_SK_BAS;
4811 assert(lpi !=
NULL);
4827 assert(lpi !=
NULL);
4830 assert(lpistate !=
NULL);
4831 assert(blkmem !=
NULL);
4835 if( *lpistate !=
NULL )
4849 assert(lpi !=
NULL);
4855 return ( lpistate !=
NULL && lpistate->
num >= 0);
4867 assert(lpi !=
NULL);
4870 assert(fname !=
NULL);
4894 assert(lpi !=
NULL);
4897 assert(fname !=
NULL);
4904 SCIPdebugMessage(
"No LP state written, since it was cleared after the last solve \n");
4913 for( v = 0; v < nvars; v++ )
4916 if( strcmp(name,
"") == 0 )
4925 for( c = 0; c < nconss; c++ )
4928 if( strcmp(name,
"") == 0 )
4939 " names instead. Note that this state cannot be read back in later!\n",
4940 v < nvars ?
"variable" :
"constraint", v < nvars ? v : c);
4944 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_HEAD, MSK_ON) );
4945 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_VARIABLES, MSK_ON) );
4946 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_SOL_CONSTRAINTS, MSK_ON) );
4971 assert(lpi !=
NULL);
4974 assert(lpinorms !=
NULL);
4975 assert(blkmem !=
NULL);
4991 assert(lpi !=
NULL);
4993 assert(lpinorms ==
NULL);
5006 assert(lpi !=
NULL);
5008 assert(lpinorms ==
NULL);
5022 "SCIP_LPPAR_FROMSCRATCH",
5023 "SCIP_LPPAR_FASTMIP",
5024 "SCIP_LPPAR_SCALING",
5025 "SCIP_LPPAR_PRESOLVING",
5026 "SCIP_LPPAR_PRICING",
5027 "SCIP_LPPAR_LPINFO",
5028 "SCIP_LPPAR_FEASTOL",
5029 "SCIP_LPPAR_DUALFEASTOL",
5030 "SCIP_LPPAR_BARRIERCONVTOL",
5031 "SCIP_LPPAR_OBJLIM",
5032 "SCIP_LPPAR_LPITLIM",
5033 "SCIP_LPPAR_LPTILIM",
5034 "SCIP_LPPAR_MARKOWITZ",
5035 "SCIP_LPPAR_ROWREPSWITCH",
5037 "SCIP_LPPAR_THREADS",
5038 "SCIP_LPPAR_CONDITIONLIMIT",
5039 "SCIP_LPPAR_TIMING",
5040 "SCIP_LPPAR_RANDOMSEED",
5041 "SCIP_LPPAR_POLISHING",
5042 "SCIP_LPPAR_REFACTOR" 5084 assert(lpi !=
NULL);
5087 assert(ival !=
NULL);
5099 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_SCALING, ival) );
5100 if( *ival == MSK_SCALING_NONE )
5102 else if( *ival == MSK_SCALING_FREE )
5104 #if MSK_VERSION_MAJOR < 10 5105 else if( *ival == MSK_SCALING_AGGRESSIVE )
5112 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_PRESOLVE_USE, ival) );
5113 *ival = (*ival != MSK_PRESOLVE_MODE_OFF);
5119 *ival = (int) lpi->
lpinfo;
5122 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) );
5125 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_NUM_THREADS, ival) );
5128 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_SIM_REFACTOR_FREQ, ival) );
5146 (int)MSK_SIM_SELECTION_SE,
5147 (
int)MSK_SIM_SELECTION_FREE,
5148 (int)MSK_SIM_SELECTION_FULL,
5149 (
int)MSK_SIM_SELECTION_PARTIAL,
5150 (int)MSK_SIM_SELECTION_SE,
5151 (
int)MSK_SIM_SELECTION_ASE,
5152 (int)MSK_SIM_SELECTION_DEVEX,
5164 assert(lpi !=
NULL);
5178 #if MSK_VERSION_MAJOR < 10 5179 assert( ival >= 0 && ival <= 2 );
5181 assert( ival >= 0 && ival <= 1 );
5185 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_NONE) );
5186 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_NONE) );
5188 #if MSK_VERSION_MAJOR < 10 5189 else if( ival == 1 )
5191 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_FREE) );
5192 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_FREE) );
5196 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) );
5197 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_AGGRESSIVE) );
5202 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_SCALING, MSK_SCALING_FREE) );
5203 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_INTPNT_SCALING, MSK_SCALING_FREE) );
5210 ival ? MSK_PRESOLVE_MODE_FREE : MSK_PRESOLVE_MODE_OFF) );
5216 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_PRIMAL_SELECTION, pricing[ival]) );
5217 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_DUAL_SELECTION, pricing[ival]) );
5231 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG, ival ? 4 : MSK_OFF) );
5232 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_LOG_SIM, ival ? 4 : MSK_OFF) );
5237 #if DEBUG_PARAM_SETTING 5244 assert( ival >= 0 );
5245 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) );
5249 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_NUM_THREADS, ival) );
5253 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_SIM_REFACTOR_FREQ, ival) );
5269 assert(lpi !=
NULL);
5272 assert(dval !=
NULL);
5279 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_X, dval) );
5282 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_S, dval) );
5285 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) );
5289 MSKobjsensee objsen;
5291 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
5293 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, dval) );
5297 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, dval) );
5302 MOSEK_CALL( MSK_getdouparam(lpi->
task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) );
5319 assert(lpi !=
NULL);
5330 assert( dval > 0.0 );
5335 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_X, dval) );
5338 assert( dval > 0.0 );
5343 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_BASIS_TOL_S, dval) );
5347 assert( dval >= 0.0 );
5351 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) );
5356 MSKobjsensee objsen;
5358 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE)
5360 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_UPPER_OBJ_CUT, dval) );
5364 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_LOWER_OBJ_CUT, dval) );
5369 assert( dval > 0.0 );
5374 MOSEK_CALL( MSK_putdouparam(lpi->
task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) );
5391 assert(lpi !=
NULL);
5407 assert(lpi !=
NULL);
5411 return MSK_INFINITY;
5420 assert(lpi !=
NULL);
5439 #if MSK_VERSION_MAJOR < 9 5443 assert(lpi !=
NULL);
5446 assert(fname !=
NULL);
5450 #if MSK_VERSION_MAJOR < 9 5451 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, &olddataformat) );
5452 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, MSK_DATA_FORMAT_LP) );
5454 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_READ_DATA_FORMAT, olddataformat) );
5456 MOSEK_CALL( MSK_readdataformat(lpi->
task, fname, MSK_DATA_FORMAT_LP, MSK_COMPRESS_FREE) );
5468 #if MSK_VERSION_MAJOR < 9 5472 assert(lpi !=
NULL);
5475 assert(fname !=
NULL);
5476 #if MSK_VERSION_MAJOR >= 9 5478 assert(strstr(fname,
".lp") !=
NULL);
5483 #if MSK_VERSION_MAJOR < 9 5484 MOSEK_CALL( MSK_getintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, &olddataformat) );
5485 MOSEK_CALL( MSK_putintparam(lpi->
task, MSK_IPAR_WRITE_DATA_FORMAT, MSK_DATA_FORMAT_LP) );
5487 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)
SCIP_DUALPACKET ROWPACKET
static SCIP_RETCODE handle_singular(SCIP_LPI *lpi, int *basis, MSKrescodee res)
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool *vanished)
SCIP_RETCODE SCIPlpiStrongbranchFrac(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)