|
Go to the documentation of this file. 24 #define MSKCONST const 32 #if defined(_WIN32) || defined(_WIN64) 33 #define snprintf _snprintf 36 #define scipmskobjsen MSKobjsensee 37 #define SENSE2MOSEK(objsen) (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE)) 39 #define MOSEK_CALL(x) do \ 41 MSKrescodee _restat_; \ 43 if( (_restat_) != MSK_RES_OK && (_restat_ ) != MSK_RES_TRM_MAX_NUM_SETBACKS ) \ 45 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \ 46 return SCIP_LPERROR; \ 52 #define SCIP_ABORT_FALSE(x) do \ 55 if( (_restat_ = (x)) != SCIP_OKAY ) \ 57 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \ 64 #define IS_POSINF(x) ((x) >= SCIP_DEFAULT_INFINITY) 65 #define IS_NEGINF(x) ((x) <= -SCIP_DEFAULT_INFINITY) 81 #define DEBUG_PARAM_SETTING 0 82 #define DEBUG_PRINT_STAT 0 83 #define DEBUG_CHECK_DATA 0 84 #define DEBUG_EASY_REPRODUCE 0 85 #define DEBUG_DO_INTPNT_FEAS_CHECK 0 86 #define DEBUG_CHECK_STATE_TOL 1e-5 88 #define ASSERT_ON_NUMERICAL_TROUBLES 0 89 #define ASSERT_ON_WARNING 0 90 #define FORCE_MOSEK_LOG 0 91 #define FORCE_MOSEK_SUMMARY 0 92 #define FORCE_NO_MAXITER 0 93 #define FORCE_SILENCE 1 94 #define SETBACK_LIMIT 250 95 #define SCIP_CONTROLS_PRICING 1 96 #define SCIP_CONTROLS_TOLERANCES 1 97 #define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE 98 #define SUPRESS_NAME_ERROR 1 100 #define WRITE_PRIMAL 0 101 #define WRITE_INTPNT 0 102 #define WRITE_ABOVE 0 103 #define DEGEN_LEVEL MSK_SIM_DEGEN_FREE 104 #define ALWAYS_SOLVE_PRIMAL 1 106 #if MSK_VERSION_MAJOR >= 7 113 MSKrescodee MSK_getsolutionstatus( 115 MSKsoltypee whichsol, 122 MOSEK_CALL( MSK_getprosta(task, whichsol, prosta) ); 126 MOSEK_CALL( MSK_getsolsta(task, whichsol, solsta) ); 150 #define COLS_PER_PACKET SCIP_DUALPACKETSIZE 152 #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE 189 #if SUPRESS_NAME_ERROR && !FORCE_SILENCE 191 snprintf(errstr,32, "MOSEK Error %d",MSK_RES_ERR_DUP_NAME); 192 if (0 == strncmp(errstr,str,strlen(errstr))) 199 #if DEBUG_CHECK_DATA > 0 203 const char* functionname 219 MOSEK_CALL( MSK_solutiondef(lpi-> task, MSK_SOL_BAS, &gotbasicsol) ); 242 for( i = 0; i < numvar; i++ ) 244 MOSEK_CALL( MSK_getbound(lpi-> task,MSK_ACC_VAR,i,&tbkx[i],&tblx[i],&tbux[i]) ); 247 for( i = 0; i < numcon; i++ ) 249 MOSEK_CALL( MSK_getbound(lpi-> task,MSK_ACC_CON,i,&tbkc[i],&tblc[i],&tbuc[i]) ); 252 for( i = 0; i < numcon; ++i ) 256 if( ( tskc[i] == MSK_SK_FIX && tbkc[i] != MSK_BK_FX ) || 257 ( tskc[i] == MSK_SK_LOW && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_RA ) ) || 258 ( tskc[i] == MSK_SK_UPR && !(tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_RA ) ) ) 260 SCIPerrorMessage( "STATUS KEY ERROR i %d bkc %d skc %d %s\n", i, tbkc[i], tskc[i], functionname); 264 if( tbkc[i] == MSK_BK_LO || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA ) 272 if( tbkc[i] == MSK_BK_UP || tbkc[i] == MSK_BK_FX || tbkc[i] == MSK_BK_RA ) 281 for( i = 0; i < numvar; ++i ) 283 if( tbkx[i] == MSK_BK_LO || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA ) 291 if( tbkx[i] == MSK_BK_UP || tbkx[i] == MSK_BK_FX || tbkx[i] == MSK_BK_RA ) 334 assert(msklb != NULL); 335 assert(mskub != NULL); 337 for( i = 0; i < n; i++ ) 343 msklb[i] = -MSK_INFINITY; 346 mskub[i] = MSK_INFINITY; 360 mskub[i] = MSK_INFINITY; 363 else if (lb[i] == ub[i]) 365 assert(lb[i]-ub[i]==0); 366 assert(ub[i]-lb[i]==0); 371 assert(lb[i] < ub[i]); 389 assert(beg != NULL || nnonz == 0); 400 for(i = 0; i < n-1; i++) 402 (*aptre)[i] = beg[i+1]; 403 assert((*aptre)[i] >= beg[i]); 406 (*aptre)[n-1] = nnonz; 407 assert((*aptre)[n-1] >= beg[n-1]); 411 for( i = 0; i < n; i++ ) 428 assert(first <= last); 432 for( i = first; i <= last; i++ ) 452 assert(dstat != NULL); 455 for( i = 0; i < n; i++ ) 471 for( i = 0; i < n; i++ ) 490 for( i = 0; i < len; i++ ) 508 if (s < 0) *bk = MSK_BK_UP; 512 if (s < 0) *bk = MSK_BK_LO; 617 return "Linear Programming Solver developed by MOSEK Optimization Software (www.mosek.com)"; 625 return ( void*) lpi-> task; 651 #if MSK_VERSION_MAJOR < 7 670 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_FREE_SIMPLEX) ); 672 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_SIM_SWITCH_OPTIMIZER, MSK_ON) ); 674 MOSEK_CALL( MSK_putintparam((*lpi)->task, MSK_IPAR_SIM_HOTSTART, MSK_SIM_HOTSTART_STATUS_KEYS) ); 675 MOSEK_CALL( MSK_puttaskname((*lpi)->task, ( char*) name) ); 677 (*lpi)->termcode = MSK_RES_OK; 678 (*lpi)->itercount = 0; 696 assert(*lpi != NULL); 764 #if DEBUG_CHECK_DATA > 0 765 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiLoadColLP") ); 788 MOSEK_CALL( MSK_inputdata(lpi-> task, nrows, ncols, nrows, ncols, obj, 0.0, beg, aptre, ind, val, 789 bkc, blc, buc, bkx, blx, bux) ); 809 #if DEBUG_CHECK_DATA > 0 810 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiLoadColLP") ); 830 #if MSK_VERSION_MAJOR < 7 845 #if DEBUG_CHECK_DATA > 0 846 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiAddCols") ); 859 #if MSK_VERSION_MAJOR < 7 867 MOSEK_CALL( MSK_appendvars(lpi-> task, ncols, obj, aptrb, aptre, ind, val, bkx, blx, bux) ); 873 MOSEK_CALL( MSK_putcslice(lpi-> task, oldcols, oldcols+ncols, obj) ); 874 MOSEK_CALL( MSK_putvarboundslice(lpi-> task, oldcols, oldcols+ncols, bkx, blx, bux) ); 879 MOSEK_CALL( MSK_putacolslice(lpi-> task, oldcols, oldcols+ncols, beg, aptre, ind, val) ); 888 #if DEBUG_CHECK_DATA > 0 889 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiAddCols") ); 910 #if DEBUG_CHECK_DATA > 0 911 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelCols") ); 917 #if MSK_VERSION_MAJOR < 7 918 MOSEK_CALL( MSK_remove(lpi-> task,MSK_ACC_VAR, lastcol-firstcol+1, sub) ); 925 #if DEBUG_CHECK_DATA > 0 926 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelCols") ); 952 #if DEBUG_CHECK_DATA > 0 953 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelColset") ); 962 for( i = 0; i < ncols; i++) 978 #if MSK_VERSION_MAJOR < 7 986 #if DEBUG_CHECK_DATA > 0 987 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelColset") ); 1006 #if MSK_VERSION_MAJOR < 7 1016 assert(lpi != NULL); 1021 #if DEBUG_CHECK_DATA > 0 1022 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiAddRows") ); 1036 #if MSK_VERSION_MAJOR < 7 1044 MOSEK_CALL( MSK_appendcons(lpi-> task, nrows, aptrb, aptre, ind, val, bkc, blc, buc) ); 1050 MOSEK_CALL( MSK_putconboundslice(lpi-> task, oldrows, oldrows+nrows, bkc, blc, buc) ); 1055 MOSEK_CALL( MSK_putarowslice(lpi-> task, oldrows, oldrows+nrows, beg, aptre, ind, val) ); 1064 #if DEBUG_CHECK_DATA > 0 1065 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiAddRows") ); 1081 assert(lpi != NULL); 1086 #if DEBUG_CHECK_DATA > 0 1087 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelRows") ); 1094 #if MSK_VERSION_MAJOR < 7 1095 MOSEK_CALL( MSK_remove(lpi-> task, MSK_ACC_CON, lastrow-firstrow+1, sub) ); 1097 MOSEK_CALL( MSK_removecons(lpi-> task, lastrow-firstrow+1, sub) ); 1102 #if DEBUG_CHECK_DATA > 0 1103 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelRows") ); 1124 assert(lpi != NULL); 1129 #if DEBUG_CHECK_DATA > 0 1130 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelRowset") ); 1139 for( i = 0; i < nrows; i++ ) 1155 #if MSK_VERSION_MAJOR < 7 1163 #if DEBUG_CHECK_DATA > 0 1164 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiDelRowset end") ); 1179 assert(lpi != NULL); 1207 assert(lpi != NULL); 1212 #if DEBUG_CHECK_DATA > 0 1213 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgBounds") ); 1224 MOSEK_CALL( MSK_putboundlist(lpi-> task, MSK_ACC_VAR, ncols, ind, bkx, blx, bux) ); 1230 #if DEBUG_CHECK_DATA > 0 1231 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgBounds") ); 1251 assert(lpi != NULL); 1256 #if DEBUG_CHECK_DATA > 0 1257 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgSides") ); 1268 MOSEK_CALL( MSK_putboundlist(lpi-> task, MSK_ACC_CON, nrows, ind, bkc, blc, buc) ); 1274 #if DEBUG_CHECK_DATA > 0 1275 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgSides") ); 1290 assert(lpi != NULL); 1295 #if DEBUG_CHECK_DATA > 0 1296 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgCoef") ); 1301 #if DEBUG_CHECK_DATA > 0 1302 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgCoef") ); 1315 assert(lpi != NULL); 1334 assert(lpi != NULL); 1339 #if DEBUG_CHECK_DATA > 0 1340 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgObj") ); 1345 #if DEBUG_CHECK_DATA > 0 1346 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiChgObj") ); 1367 assert(lpi != NULL); 1372 #if DEBUG_CHECK_DATA > 0 1373 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiScaleRow") ); 1376 assert(scaleval != 0); 1378 #if MSK_VERSION_MAJOR < 7 1379 MOSEK_CALL( MSK_getavecnumnz(lpi-> task, MSK_ACC_CON, row, &nnonz) ); 1389 #if MSK_VERSION_MAJOR < 7 1390 MOSEK_CALL( MSK_getavec(lpi-> task, MSK_ACC_CON, row, &nnonz, sub, val) ); 1392 MOSEK_CALL( MSK_putavec(lpi-> task, MSK_ACC_CON, row, nnonz, sub, val) ); 1403 MOSEK_CALL( MSK_getbound(lpi-> task, MSK_ACC_CON, row, &bkc, &blc, &buc) ); 1405 MOSEK_CALL( MSK_putbound(lpi-> task, MSK_ACC_CON, row, bkc, blc, buc) ); 1407 #if DEBUG_CHECK_DATA > 0 1408 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiScaleRow") ); 1430 assert(lpi != NULL); 1435 #if DEBUG_CHECK_DATA > 0 1436 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiScaleCol") ); 1439 assert(scaleval != 0); 1440 #if MSK_VERSION_MAJOR < 7 1441 MOSEK_CALL( MSK_getavecnumnz(lpi-> task, MSK_ACC_VAR, col, &nnonz) ); 1451 #if MSK_VERSION_MAJOR < 7 1452 MOSEK_CALL( MSK_getavec(lpi-> task, MSK_ACC_VAR, col, &nnonz, sub, val) ); 1454 MOSEK_CALL( MSK_putavec(lpi-> task, MSK_ACC_VAR, col, nnonz, sub, val) ); 1465 MOSEK_CALL( MSK_getbound(lpi-> task, MSK_ACC_VAR, col, &bkx, &blx, &bux) ); 1467 MOSEK_CALL( MSK_putbound(lpi-> task, MSK_ACC_VAR, col, bkx, blx, bux) ); 1472 #if DEBUG_CHECK_DATA > 0 1473 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiScaleCol") ); 1492 assert(lpi != NULL); 1509 assert(lpi != NULL); 1526 assert(lpi != NULL); 1551 assert(lpi != NULL); 1553 assert(first <= last); 1557 #if DEBUG_CHECK_DATA > 0 1558 SCIP_CALL( scip_checkdata(lpi, "getASlice") ); 1565 assert(beg != NULL); 1566 assert(ind != NULL); 1567 assert(val != NULL); 1571 MOSEK_CALL( MSK_getaslicenumnz(lpi-> task, iscon, first, last+1,nnonz) ); 1573 MOSEK_CALL( MSK_getaslice(lpi-> task, iscon, first, last+1, *nnonz, &surplus, beg, aptre, ind, val) ); 1575 assert(surplus == 0); 1580 #if DEBUG_CHECK_DATA > 0 1581 SCIP_CALL( scip_checkdata(lpi, "getASlice") ); 1604 assert(lpi != NULL); 1632 assert(lpi != NULL); 1637 #if DEBUG_CHECK_DATA > 0 1638 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetRows") ); 1645 #if DEBUG_CHECK_DATA > 0 1646 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetRows") ); 1659 int namestoragesize, 1674 int namestoragesize, 1701 assert(lpi != NULL); 1706 MOSEK_CALL( MSK_getcslice(lpi-> task, firstcol, lastcol+1, vals) ); 1721 assert(lpi != NULL); 1726 #if DEBUG_CHECK_DATA > 0 1727 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetBounds") ); 1730 MOSEK_CALL( MSK_getboundslice(lpi-> task, MSK_ACC_VAR, firstcol, lastcol+1, NULL, lbs, ubs) ); 1745 assert(lpi != NULL); 1750 #if DEBUG_CHECK_DATA > 0 1751 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetSides") ); 1754 MOSEK_CALL( MSK_getboundslice(lpi-> task, MSK_ACC_CON, firstrow, lastrow+1, NULL, lhss, rhss) ); 1756 #if DEBUG_CHECK_DATA > 0 1757 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetSides") ); 1772 assert(lpi != NULL); 1777 #if DEBUG_CHECK_DATA > 0 1778 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetCoef") ); 1783 #if DEBUG_CHECK_DATA > 0 1784 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiGetCoef") ); 1803 assert(lpi != NULL); 1806 MOSEK_CALL( MSK_getsolutionstatus ( lpi-> task, MSK_SOL_BAS, prosta, solsta) ); 1819 if ( res == MSK_RES_TRM_MAX_ITERATIONS || res == MSK_RES_TRM_MAX_TIME 1820 || res == MSK_RES_TRM_OBJECTIVE_RANGE || res == MSK_RES_TRM_STALL 1822 || res == MSK_RES_TRM_MAX_NUM_SETBACKS 1823 || res == MSK_RES_TRM_NUMERICAL_PROBLEM 1828 if (res == MSK_RES_TRM_MAX_NUM_SETBACKS || res == MSK_RES_TRM_NUMERICAL_PROBLEM) 1832 #if ASSERT_ON_WARNING 1841 *termcode = MSK_RES_OK; 1851 int itercount_primal; 1860 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_PRESOLVE_USE, &presolve) ); 1861 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, &maxiter) ); 1863 #if DEBUG_EASY_REPRODUCE 1864 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_AUTO_SORT_A_BEFORE_OPT, MSK_ON) ); 1865 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_OFF) ); 1867 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 1870 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_AUTO_UPDATE_SOL_INFO, MSK_OFF) ); 1877 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_LOG_SIM_FREQ, 1) ); 1889 MOSEK_CALL( MSK_solutiondef(lpi-> task, MSK_SOL_BAS, &gotbasicsol) ); 1893 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_OFF) ); 1897 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_ON) ); 1900 #if ALWAYS_SOLVE_PRIMAL > 0 1901 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_SOLVE_FORM, MSK_SOLVE_PRIMAL) ); 1904 #if DEBUG_CHECK_DATA > 0 1905 SCIP_CALL( scip_checkdata(lpi, "SolveWSimplex") ); 1909 assert(lpi != NULL); 1912 if( gotbasicsol && maxiter < 20000 ) 1915 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION, 0) ); 1920 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, 2000000000) ); 1924 #if DEBUG_CHECK_DATA > 0 1925 SCIP_CALL( scip_checkdata(lpi, "Begin optimize with simplex") ); 1928 #if FORCE_MOSEK_SUMMARY > 1 1937 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_LOG_SIM_FREQ, 100) ); 1943 if( lpi-> termcode == MSK_RES_TRM_MAX_NUM_SETBACKS ) 1945 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_SCALING, MSK_SCALING_AGGRESSIVE) ); 1950 #if FORCE_MOSEK_SUMMARY 1957 #if DEBUG_CHECK_DATA > 0 1958 SCIP_CALL( scip_checkdata(lpi, "End optimize with simplex") ); 1961 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_PRESOLVE_USE, presolve) ); 1962 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) ); 1964 MOSEK_CALL( MSK_getintinf(lpi-> task, MSK_IINF_SIM_PRIMAL_ITER, &itercount_primal) ); 1965 MOSEK_CALL( MSK_getintinf(lpi-> task, MSK_IINF_SIM_DUAL_ITER, &itercount_dual) ); 1967 lpi-> itercount = itercount_primal + itercount_dual; 1971 MOSEK_CALL( MSK_getsolutionstatus(lpi-> task, MSK_SOL_BAS, &prosta, &solsta) ); 1973 #if DEBUG_PRINT_STAT 1974 SCIPdebugMessage( "maxiter = %d, termcode = %d, prosta = %d, solsta = %d, objval = %g : %g, iter = %d+%d\n", 1975 maxiter, lpi-> termcode, prosta, solsta, pobj, dobj, itercount_primal, itercount_dual); 1979 "objval = %g : %g, iter = %d+%d\n", 1980 maxiter,lpi-> termcode,prosta,solsta, 1981 pobj,dobj,itercount_primal,itercount_dual); 1986 case MSK_SOL_STA_OPTIMAL: 1987 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS: 1988 case MSK_SOL_STA_PRIM_FEAS: 1989 case MSK_SOL_STA_DUAL_FEAS: 1990 case MSK_SOL_STA_PRIM_INFEAS_CER: 1991 case MSK_SOL_STA_DUAL_INFEAS_CER: 1992 case MSK_SOL_STA_UNKNOWN: 1994 case MSK_SOL_STA_NEAR_OPTIMAL: 1995 case MSK_SOL_STA_NEAR_PRIM_FEAS: 1996 case MSK_SOL_STA_NEAR_DUAL_FEAS: 1997 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS: 1998 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER: 1999 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER: 2003 lpi-> termcode = MSK_RES_TRM_NUMERICAL_PROBLEM; 2005 #if ASSERT_ON_WARNING 2009 case MSK_SOL_STA_INTEGER_OPTIMAL: 2010 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL: 2012 #if SHOW_ERRORS && !FORCE_SILENCE 2016 #if ASSERT_ON_WARNING 2025 case MSK_PRO_STA_PRIM_AND_DUAL_FEAS: 2026 case MSK_PRO_STA_PRIM_FEAS: 2027 case MSK_PRO_STA_DUAL_FEAS: 2028 case MSK_PRO_STA_PRIM_AND_DUAL_INFEAS: 2029 case MSK_PRO_STA_PRIM_INFEAS: 2030 case MSK_PRO_STA_DUAL_INFEAS: 2031 case MSK_PRO_STA_UNKNOWN: 2033 case MSK_PRO_STA_NEAR_PRIM_AND_DUAL_FEAS: 2034 case MSK_PRO_STA_NEAR_PRIM_FEAS: 2035 case MSK_PRO_STA_NEAR_DUAL_FEAS: 2036 case MSK_PRO_STA_ILL_POSED: 2037 case MSK_PRO_STA_PRIM_INFEAS_OR_UNBOUNDED: 2041 lpi-> termcode = MSK_RES_TRM_NUMERICAL_PROBLEM; 2043 #if ASSERT_ON_WARNING 2048 #if SHOW_ERRORS && !FORCE_SILENCE 2052 #if ASSERT_ON_WARNING 2059 if( solsta == MSK_SOL_STA_OPTIMAL && fabs(dobj)+fabs(dobj) > 1.0e-6 && fabs(pobj-dobj)>0.0001*(fabs(pobj)+fabs(dobj))) 2061 SCIPerrorMessage( "Simplex[%d] returned optimal solution with different objvals %g != %g reldiff %.2g%%\n", 2062 optimizecount, pobj, dobj, 100*fabs(pobj-dobj)/ MAX(fabs(pobj),fabs(dobj))); 2065 if (lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE) 2067 if(solsta != MSK_SOL_STA_DUAL_FEAS && solsta != MSK_SOL_STA_OPTIMAL && solsta != MSK_SOL_STA_PRIM_AND_DUAL_FEAS) 2080 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE) 2082 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_UPPER_OBJ_CUT, &bound) ); 2084 if (1.0e-6*(fabs(bound)+fabs(dobj)) < bound-dobj) 2094 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_LOWER_OBJ_CUT, &bound) ); 2096 if (1.0e-6*(fabs(bound)+fabs(dobj)) < dobj-bound) 2107 if (maxiter >= 2000000000) 2109 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, maxiter) ); 2111 if (lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS) 2120 #if DEBUG_DO_INTPNT_FEAS_CHECK 2121 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER) 2127 MOSEK_CALL(MSK_getsolutionstatus ( lpi-> task, MSK_SOL_BAS, &prosta, &solsta)); 2129 if (solsta == MSK_SOL_STA_PRIM_INFEAS_CER || solsta == MSK_SOL_STA_DUAL_INFEAS_CER) 2141 #if DEBUG_PRINT_STAT > 0 2142 SCIPdebugMessage( "Max iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n", 2144 SCIPdebugMessage( "Objcut iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n", 2148 #if DEBUG_CHECK_DATA > 0 2149 SCIP_CALL( scip_checkdata(lpi, "SolveWSimplex") ); 2164 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 2166 #if DEBUG_CHECK_DATA > 0 2167 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiSolvePrimal") ); 2170 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_PRIMAL_SIMPLEX) ); 2172 #if WRITE_PRIMAL > 0 2179 MSK_writedata(lpi-> task,fname); 2185 if ( lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE ) 2192 if( solsta != MSK_SOL_STA_PRIM_FEAS ) 2198 if (lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE) 2201 if (lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS) 2204 #if DEBUG_CHECK_DATA > 0 2205 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiSolvePrimal") ); 2221 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_INTEGER, MSK_ON) ); 2222 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 2223 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_DUAL_SIMPLEX) ); 2231 MSK_writedata(lpi-> task,fname); 2237 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_LOG_SIM_FREQ, 1) ); 2242 if ( lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE ) 2248 if( solsta != MSK_SOL_STA_DUAL_FEAS ) 2254 if (lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE) 2257 if (lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS) 2270 assert(lpi != NULL); 2293 #if DEBUG_CHECK_DATA > 0 2294 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiSolveBarrier") ); 2297 MOSEK_CALL( MSK_putintparam(lpi-> task,MSK_IPAR_INTPNT_BASIS, crossover ? MSK_BI_ALWAYS : MSK_BI_NEVER) ); 2298 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_OPTIMIZER, MSK_OPTIMIZER_INTPNT) ); 2301 #if WRITE_INTPNT > 0 2308 MSK_writedata(lpi-> task,fname); 2314 if (lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS) 2324 MOSEK_CALL( MSK_getsolutionstatus ( lpi-> task, MSK_SOL_BAS, &prosta, &solsta) ); 2330 #if DEBUG_CHECK_DATA > 0 2331 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiSolveBarrier") ); 2371 MSKobjsensee objsen; 2387 #if DEBUG_CHECK_DATA > 0 2388 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiStrongbranch") ); 2392 assert(lpi != NULL); 2406 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, &olditerlim) ); 2407 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_DUAL_SELECTION, &oldselection) ); 2408 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART, &oldhotstart) ); 2410 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, itlim) ); 2413 if (objsen == MSK_OBJECTIVE_SENSE_MINIMIZE) 2415 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_UPPER_OBJ_CUT, &bound) ); 2419 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_LOWER_OBJ_CUT, &bound) ); 2422 MOSEK_CALL( MSK_getbound(lpi-> task, MSK_ACC_VAR, col, &bkx, &blx, &bux) ); 2426 newub = EPSCEIL(psol-1.0, 1e-06); 2428 if (newub < blx - 0.5) 2439 else if ( EPSEQ(blx,newub,1.0e-6)) 2447 MOSEK_CALL( MSK_putbound(lpi-> task, MSK_ACC_VAR, col, newbk, blx, newub) ); 2488 if (lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE) 2491 if (lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS) 2496 MOSEK_CALL( MSK_putbound(lpi-> task, MSK_ACC_VAR, col, bkx, blx, bux) ); 2500 if (newlb > bux + 0.5) 2511 else if ( EPSEQ(bux,newlb,1.0e-6)) 2519 MOSEK_CALL( MSK_putbound(lpi-> task, MSK_ACC_VAR, col, newbk, newlb, bux) ); 2557 if (lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE) 2560 if (lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS) 2564 MOSEK_CALL( MSK_putbound(lpi-> task, MSK_ACC_VAR, col, bkx, blx, bux) ); 2565 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, olditerlim) ); 2566 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_DUAL_SELECTION, oldselection) ); 2567 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART, oldhotstart) ); 2574 #if DEBUG_CHECK_DATA > 0 2575 SCIP_CALL( scip_checkdata(lpi, "SCIPlpiStrongbranch") ); 2622 assert( iter != NULL ); 2623 assert( cols != NULL ); 2624 assert( psols != NULL ); 2625 assert( down != NULL ); 2626 assert( up != NULL ); 2627 assert( downvalid != NULL ); 2628 assert( upvalid != NULL ); 2629 assert( down != NULL ); 2634 for (j = 0; j < ncols; ++j) 2681 assert( iter != NULL ); 2682 assert( cols != NULL ); 2683 assert( psols != NULL ); 2684 assert( down != NULL ); 2685 assert( up != NULL ); 2686 assert( downvalid != NULL ); 2687 assert( upvalid != NULL ); 2688 assert( down != NULL ); 2693 for (j = 0; j < ncols; ++j) 2716 assert(lpi != NULL); 2723 return (solsta == MSK_SOL_STA_OPTIMAL); 2738 assert(lpi != NULL); 2750 case MSK_SOL_STA_OPTIMAL: 2751 case MSK_SOL_STA_PRIM_AND_DUAL_FEAS: 2755 case MSK_SOL_STA_PRIM_FEAS: 2758 case MSK_SOL_STA_DUAL_FEAS: 2761 case MSK_SOL_STA_UNKNOWN: 2762 case MSK_SOL_STA_NEAR_OPTIMAL: 2763 case MSK_SOL_STA_NEAR_PRIM_FEAS: 2764 case MSK_SOL_STA_NEAR_DUAL_FEAS: 2765 case MSK_SOL_STA_NEAR_PRIM_AND_DUAL_FEAS: 2766 case MSK_SOL_STA_PRIM_INFEAS_CER: 2767 case MSK_SOL_STA_DUAL_INFEAS_CER: 2768 case MSK_SOL_STA_NEAR_PRIM_INFEAS_CER: 2769 case MSK_SOL_STA_NEAR_DUAL_INFEAS_CER: 2770 case MSK_SOL_STA_INTEGER_OPTIMAL: 2771 case MSK_SOL_STA_NEAR_INTEGER_OPTIMAL: 2777 if( primalfeasible != NULL ) 2778 *primalfeasible = pfeas; 2780 if( dualfeasible != NULL ) 2781 *dualfeasible = dfeas; 2797 assert(lpi != NULL); 2804 return ( solsta == MSK_SOL_STA_DUAL_INFEAS_CER 2805 || prosta == MSK_PRO_STA_DUAL_INFEAS 2806 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS); 2819 assert(lpi != NULL); 2826 return (solsta == MSK_SOL_STA_DUAL_INFEAS_CER); 2853 assert(lpi != NULL); 2860 return (prosta == MSK_PRO_STA_PRIM_FEAS || prosta == MSK_PRO_STA_PRIM_AND_DUAL_FEAS); 2874 assert(lpi != NULL); 2881 return ( solsta == MSK_SOL_STA_PRIM_INFEAS_CER 2882 || prosta == MSK_PRO_STA_PRIM_INFEAS 2883 || prosta == MSK_PRO_STA_PRIM_AND_DUAL_INFEAS); 2896 assert(lpi != NULL); 2903 return (solsta == MSK_SOL_STA_PRIM_INFEAS_CER); 2930 assert(lpi != NULL); 2937 return (prosta == MSK_PRO_STA_DUAL_FEAS || prosta == MSK_PRO_STA_PRIM_AND_DUAL_FEAS); 2949 assert(lpi != NULL); 2956 return (solsta == MSK_SOL_STA_OPTIMAL); 2965 assert(lpi != NULL); 2968 return ( lpi-> termcode == MSK_RES_OK 2969 || lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS 2970 || lpi-> termcode == MSK_RES_TRM_MAX_TIME 2971 || lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE); 2980 assert(lpi != NULL); 2983 return lpi-> termcode == MSK_RES_TRM_OBJECTIVE_RANGE; 2992 assert(lpi != NULL); 2995 return lpi-> termcode == MSK_RES_TRM_MAX_ITERATIONS; 3004 assert(lpi != NULL); 3007 return lpi-> termcode == MSK_RES_TRM_MAX_TIME; 3019 assert(lpi != NULL); 3038 assert(lpi != NULL); 3055 assert(lpi != NULL); 3082 assert(lpi != NULL); 3101 for( i = 0; i < ncols; i++ ) 3103 assert(sux != NULL); 3104 redcost[i] -= sux[i]; 3120 assert(lpi != NULL); 3138 assert(lpi != NULL); 3143 MOSEK_CALL( MSK_getsolution(lpi-> task, MSK_SOL_BAS, NULL, NULL, NULL, NULL, NULL, NULL, NULL, dualfarkas, 3158 assert(lpi != NULL); 3177 assert(lpi != NULL); 3178 assert(quality != NULL); 3193 if (res == MSK_RES_ERR_BASIS_SINGULAR) 3224 for( i = 0; i < n; i++ ) 3282 for( i = 0; i < n; i++ ) 3330 for( i = 0; i < n; i++ ) 3335 resstat[i] = MSK_SK_LOW; 3338 resstat[i] = MSK_SK_BAS; 3341 resstat[i] = MSK_SK_UPR; 3344 resstat[i] = MSK_SK_SUPBAS; 3363 for( i = 0; i < n; i++ ) 3368 resstat[i] = MSK_SK_UPR; 3371 resstat[i] = MSK_SK_BAS; 3374 resstat[i] = MSK_SK_LOW; 3377 resstat[i] = MSK_SK_SUPBAS; 3398 assert(lpi != NULL); 3432 assert(lpi != NULL); 3459 assert(lpi != NULL); 3467 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_OFF) ); 3473 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 3476 for (i = 0; i < nrows; i++ ) 3478 if (bind[i] < nrows) 3479 bind[i] = -1 - bind[i]; 3481 bind[i] = bind[i] - nrows; 3514 assert(lpi != NULL); 3518 MOSEK_CALL( MSK_putnaintparam(lpi-> task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_OFF) ); 3521 if ( ninds != NULL && inds != NULL ) 3523 for (i = 0; i < nrows; ++i) 3530 MOSEK_CALL( MSK_solvewithbasis(lpi-> task, 0, ninds, inds, coef) ); 3531 assert( *ninds <= nrows ); 3540 for (i = 0; i < nrows; ++i) 3547 MOSEK_CALL( MSK_solvewithbasis(lpi-> task, 0, &numnz, sub, coef) ); 3548 assert( numnz <= nrows ); 3552 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 3579 assert(lpi != NULL); 3585 MOSEK_CALL( MSK_putnaintparam(lpi-> task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_ON) ); 3588 if ( ninds != NULL && inds != NULL ) 3590 for (i = 0; i < nrows; ++i) 3597 MOSEK_CALL( MSK_solvewithbasis(lpi-> task, 1, ninds, inds, coef) ); 3598 assert( *ninds <= nrows ); 3607 for (i = 0; i < nrows; ++i) 3614 MOSEK_CALL( MSK_solvewithbasis(lpi-> task, 1, &numnz, sub, coef) ); 3618 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 3654 assert(lpi != NULL); 3667 if( binvrow == NULL ) 3679 for (i = 0; i < ncols; ++i) 3683 #if MSK_VERSION_MAJOR < 7 3684 MOSEK_CALL( MSK_getavec(lpi-> task, MSK_ACC_VAR, i, &numnz, csub, cval) ); 3690 for (k = 0; k < numnz; ++k) 3691 coef[i] += binv[csub[k]] * cval[k]; 3694 if ( ninds != NULL ) 3728 assert(lpi != NULL); 3732 #if MSK_VERSION_MAJOR < 7 3733 MOSEK_CALL( MSK_getavecnumnz(lpi-> task, MSK_ACC_VAR, c, &numnz) ); 3740 if ( ninds != NULL && inds != NULL ) 3742 for (i = 0; i < nrows; ++i) 3745 #if MSK_VERSION_MAJOR < 7 3746 MOSEK_CALL( MSK_getavec(lpi-> task, MSK_ACC_VAR, c, &numnz, inds, val) ); 3751 for (i = 0; i < numnz; ++i) 3752 coef[inds[i]] = val[i]; 3754 MOSEK_CALL( MSK_putnaintparam(lpi-> task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_OFF) ); 3755 MOSEK_CALL( MSK_solvewithbasis(lpi-> task, 0, ninds, inds, coef) ); 3762 for (i = 0; i < nrows; ++i) 3765 #if MSK_VERSION_MAJOR < 7 3766 MOSEK_CALL( MSK_getavec(lpi-> task, MSK_ACC_VAR, c, &numnz, sub, val) ); 3771 for (i = 0; i < numnz; ++i) 3772 coef[sub[i]] = val[i]; 3774 MOSEK_CALL( MSK_putnaintparam(lpi-> task, MSK_IPAR_BASIS_SOLVE_USE_PLUS_ONE_, MSK_OFF) ); 3775 MOSEK_CALL( MSK_solvewithbasis(lpi-> task, 0, &numnz, sub, coef) ); 3781 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART_LU, MSK_ON) ); 3800 assert(lpistate != NULL); 3801 assert(blkmem != NULL); 3811 lpistate[0]-> solsta = MSK_SOL_STA_UNKNOWN; 3812 lpistate[0]-> num = -1; 3827 assert(blkmem != NULL); 3828 assert(lpistate != NULL); 3829 assert(*lpistate != NULL); 3843 MSKaccmodee accmode, 3850 for( i = 0; i < n; i++ ) 3905 int *skxi = ( int *) lpi-> skx; 3906 int *skci = ( int *) lpi-> skc; 3908 assert( sizeof( int) == sizeof(MSKstakeye)); 3927 assert( sizeof( int) == sizeof(MSKstakeye)); 3950 assert(lpi != NULL); 3952 assert(lpistate != NULL); 3956 MOSEK_CALL( MSK_solutiondef(lpi-> task, MSK_SOL_BAS, &gotbasicsol) ); 4002 assert(lpi != NULL); 4005 if (lpistate == NULL) 4011 if (lpistate-> nrows == 0 || lpistate-> ncols == 0) 4016 assert(lpistate-> nrows <= nrows); 4017 assert(lpistate-> ncols <= ncols); 4025 for (i = lpistate-> ncols; i < ncols; ++i) 4034 lpi-> skx[i] = MSK_SK_SUPBAS; 4036 lpi-> skx[i] = MSK_SK_UPR; 4039 lpi-> skx[i] = MSK_SK_LOW; 4041 for (i = lpistate-> nrows; i < nrows; ++i) 4042 lpi-> skc[i] = MSK_SK_BAS; 4057 assert(lpi != NULL); 4073 assert(lpi != NULL); 4078 if( *lpistate != NULL ) 4093 assert(lpi != NULL); 4098 return ( lpistate != NULL && lpistate-> num >= 0); 4108 assert(lpi != NULL); 4127 assert(lpi != NULL); 4131 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_WRITE_SOL_HEAD, MSK_ON) ); 4132 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_WRITE_SOL_VARIABLES, MSK_ON) ); 4133 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_WRITE_SOL_CONSTRAINTS, MSK_ON) ); 4159 assert(lpinorms != NULL); 4175 assert(lpinorms == NULL); 4188 assert(lpinorms == NULL); 4202 "SCIP_LPPAR_FROMSCRATCH", 4203 "SCIP_LPPAR_FASTMIP", 4204 "SCIP_LPPAR_SCALING", 4205 "SCIP_LPPAR_PRESOLVING", 4206 "SCIP_LPPAR_PRICING", 4207 "SCIP_LPPAR_LPINFO", 4208 "SCIP_LPPAR_FEASTOL", 4209 "SCIP_LPPAR_DUALFEASTOL", 4210 "SCIP_LPPAR_BARRIERCONVTOL", 4211 "SCIP_LPPAR_LOBJLIM", 4212 "SCIP_LPPAR_UOBJLIM", 4213 "SCIP_LPPAR_LPITLIM", 4214 "SCIP_LPPAR_LPTILIM", 4215 "SCIP_LPPAR_MARKOWITZ", 4216 "SCIP_LPPAR_ROWREPSWITCH", 4218 "SCIP_LPPAR_THREADS" 4258 assert(lpi != NULL); 4264 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_HOTSTART, ival) ); 4265 *ival = (*ival == MSK_SIM_HOTSTART_NONE); 4270 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_SCALING, ival) ); 4271 *ival = (*ival != MSK_SCALING_NONE); 4274 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_PRESOLVE_USE, ival) ); 4275 *ival = (*ival != MSK_PRESOLVE_MODE_OFF); 4282 *ival = (*ival == MSK_ON); 4285 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) ); 4303 #if SCIP_CONTROLS_PRICING 4306 MSK_SIM_SELECTION_SE, 4307 MSK_SIM_SELECTION_SE, 4308 MSK_SIM_SELECTION_FULL, 4309 MSK_SIM_SELECTION_PARTIAL, 4310 MSK_SIM_SELECTION_SE, 4311 MSK_SIM_SELECTION_ASE, 4312 MSK_SIM_SELECTION_DEVEX, 4329 assert(lpi != NULL); 4336 ival ? MSK_SIM_HOTSTART_NONE : MSK_SIM_HOTSTART_STATUS_KEYS ) ); 4341 scaling = (ival ? MSK_SCALING_FREE : MSK_SCALING_NONE); 4342 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_SCALING, scaling) ); 4343 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_INTPNT_SCALING, scaling) ); 4347 ival ? MSK_PRESOLVE_MODE_FREE : MSK_PRESOLVE_MODE_OFF) ); 4387 #if SCIP_CONTROLS_PRICING 4388 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_PRIMAL_SELECTION, pricing[ival]) ); 4390 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_DUAL_SELECTION, pricing[ival]) ); 4395 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_DUAL_RESTRICT_SELECTION, 0) ); 4397 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_PRIMAL_RESTRICT_SELECTION, 0) ); 4400 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_PRIMAL_SELECTION, MSK_SIM_SELECTION_FREE) ); 4402 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_DUAL_SELECTION, MSK_SIM_SELECTION_FREE) ); 4410 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_LOG, ival ? MSK_ON : MSK_OFF) ); 4414 #if DEBUG_PARAM_SETTING 4421 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_SIM_MAX_ITERATIONS, ival) ); 4440 assert(lpi != NULL); 4445 #if SCIP_CONTROLS_TOLERANCES 4447 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_BASIS_TOL_X, dval) ); 4450 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_BASIS_TOL_S, dval) ); 4453 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) ); 4457 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_LOWER_OBJ_CUT, dval) ); 4460 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_UPPER_OBJ_CUT, dval) ); 4463 MOSEK_CALL( MSK_getdouparam(lpi-> task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) ); 4483 assert(lpi != NULL); 4490 #if SCIP_CONTROLS_TOLERANCES 4495 MOSEK_CALL( MSK_putdouparam(lpi-> task, MSK_DPAR_BASIS_TOL_X, dval) ); 4502 MOSEK_CALL( MSK_putdouparam(lpi-> task, MSK_DPAR_BASIS_TOL_S, dval) ); 4505 MOSEK_CALL( MSK_putdouparam(lpi-> task, MSK_DPAR_INTPNT_TOL_REL_GAP, dval) ); 4509 MOSEK_CALL( MSK_putdouparam(lpi-> task, MSK_DPAR_LOWER_OBJ_CUT, dval) ); 4512 MOSEK_CALL( MSK_putdouparam(lpi-> task, MSK_DPAR_UPPER_OBJ_CUT, dval) ); 4515 MOSEK_CALL( MSK_putdouparam(lpi-> task, MSK_DPAR_OPTIMIZER_MAX_TIME, dval) ); 4537 assert(lpi != NULL); 4540 return MSK_INFINITY; 4550 assert(lpi != NULL); 4573 assert(lpi != NULL); 4576 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_READ_DATA_FORMAT, &olddataformat) ); 4577 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_READ_DATA_FORMAT, MSK_DATA_FORMAT_LP) ); 4579 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_READ_DATA_FORMAT, olddataformat) ); 4595 assert(lpi != NULL); 4598 MOSEK_CALL( MSK_getintparam(lpi-> task, MSK_IPAR_WRITE_DATA_FORMAT, &olddataformat) ); 4599 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_WRITE_DATA_FORMAT, MSK_DATA_FORMAT_LP) ); 4601 MOSEK_CALL( MSK_putintparam(lpi-> task, MSK_IPAR_WRITE_DATA_FORMAT, olddataformat) );
SCIP_RETCODE SCIPlpiGetRows(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs, int *nnonz, int *beg, int *ind, SCIP_Real *val)
#define BMSfreeMemoryArray(ptr)
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
static MSKrescodee filterTRMrescode(SCIP_MESSAGEHDLR *messagehdlr, MSKrescodee *termcode, MSKrescodee res)
#define BMSallocBlockMemory(mem, ptr)
#define ASSERT_ON_NUMERICAL_TROUBLES
static void scale_bound(MSKboundkeye *bk, double *bl, double *bu, double s)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
const char * SCIPlpiGetSolverName(void)
enum SCIP_ObjSen SCIP_OBJSEN
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int row, SCIP_Real *coef, int *inds, int *ninds)
interface methods for specific LP solvers
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, int *ind, SCIP_Real *obj)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
static void convertstat_scip2mosek(int *stat, int n, MSKstakeye *resstat)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
static SCIP_RETCODE getEndptrs(int n, const int *beg, int nnonz, int **aptre)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
SCIP_RETCODE SCIPlpiAddCols(SCIP_LPI *lpi, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiStrongbranchInt(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
enum SCIP_LPParam SCIP_LPPARAM
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
static int numstrongbranchobjup
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int row, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
enum SCIP_Pricing SCIP_PRICING
static int numstrongbranchmaxiterdo
static SCIP_RETCODE convertstat_mosek2scip_slack(SCIP_LPI *lpi, MSKaccmodee acc, MSKstakeye *sk, int n, int *stat)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
static SCIP_RETCODE SolveWSimplex(SCIP_LPI *lpi)
static SCIP_RETCODE lpistatePack(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
static SCIP_RETCODE getSolutionStatus(SCIP_LPI *lpi, MSKprostae *prosta, MSKsolstae *solsta)
SCIP_DUALPACKET COLPACKET
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_DUALPACKET COLPACKET
static int numdualmaxiter
static void MSKAPI printstr(void *handle, const char *str)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
packing single and dual bit values
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_RETCODE SCIPlpiLoadColLP(SCIP_LPI *lpi, SCIP_OBJSEN objsen, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
static SCIP_RETCODE convertstat_mosek2scip(SCIP_LPI *lpi, MSKaccmodee acc, MSKstakeye *sk, int n, int *stat)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
SCIP_DUALPACKET ROWPACKET
#define BMSallocMemory(ptr)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
static SCIP_RETCODE SCIPlpiStrongbranch(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
static void lpistateUnpack(SCIP_LPISTATE *lpistate, MSKstakeye *skx, MSKstakeye *skc)
static SCIP_RETCODE setbase(SCIP_LPI *lpi)
#define DEBUG_CHECK_STATE_TOL
static SCIP_RETCODE handle_singular(SCIP_LPI *lpi, int *basis, MSKrescodee res)
static SCIP_RETCODE getbase(SCIP_LPI *lpi, int ncols, int nrows)
static SCIP_RETCODE getASlice(SCIP_LPI *lpi, MSKaccmodee iscon, int first, int last, int *nnonz, int *beg, int *ind, double *val)
#define BMSreallocMemoryArray(ptr, num)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
#define BMSfreeMemory(ptr)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
static SCIP_RETCODE checkState1(SCIP_LPI *lpi, int n, MSKstakeye *sk, MSKaccmodee accmode, char xc)
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
static int numstrongbranchmaxiterup
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
static void scale_vec(int len, double *vec, double s)
#define SCIP_ABORT_FALSE(x)
static SCIP_RETCODE ensureStateMem(SCIP_LPI *lpi, int ncols, int nrows)
#define BMSallocBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
static const char * paramty2str(SCIP_LPPARAM type)
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)
static const char * paramname[]
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiStrongbranchesInt(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
static SCIP_RETCODE getIndicesFromDense(int *dstat, int n, int *count, int **sub)
#define BMSfreeBlockMemory(mem, ptr)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_RETCODE SCIPlpiGetCols(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lb, SCIP_Real *ub, int *nnonz, int *beg, int *ind, SCIP_Real *val)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
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 SCIP_RETCODE checkState(SCIP_LPI *lpi, int ncols, int nrows)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
static int rowpacketNum(int nrows)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
static int numstrongbranchobjdo
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
#define STRONGBRANCH_PRICING
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
SCIP_DUALPACKET ROWPACKET
SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
static void generateMskBounds(int n, const double *lb, const double *ub, MSKboundkeye *bk, double *msklb, double *mskub)
static int colpacketNum(int ncols)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
static SCIP_RETCODE getIndicesRange(int first, int last, int **sub)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_MESSAGEHDLR * messagehdlr
static int numprimalmaxiter
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
#define SENSE2MOSEK(objsen)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
#define BMSallocMemoryArray(ptr, num)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
static void convertstat_scip2mosek_slack(int *stat, int n, MSKstakeye *resstat)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE *lpistate)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
const char * SCIPlpiGetSolverDesc(void)
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS *lpinorms)
|