53#include "tinycthread/tinycthread.h"
56#if defined(_WIN32) || defined(_WIN64)
57#define snprintf _snprintf
60#if ( MSK_VERSION_MAJOR < 7 )
61#error "The MOSEK interface only works for MOSEK versions 7.0.0.0 and newer"
64#define scipmskobjsen MSKobjsensee
65#define SENSE2MOSEK(objsen) (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE))
69#define MOSEK_CALL(x) do \
71 MSKrescodee _restat_; \
73 if( (_restat_) != MSK_RES_OK && (_restat_ ) != MSK_RES_TRM_MAX_NUM_SETBACKS ) \
75 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \
76 return SCIP_LPERROR; \
82#define SCIP_ABORT_FALSE(x) do \
84 SCIP_RETCODE _restat_; \
85 if( (_restat_ = (x)) != SCIP_OKAY ) \
87 SCIPerrorMessage("LP Error: MOSEK returned %d.\n", (int)_restat_); \
94#define IS_POSINF(x) ((x) >= MSK_INFINITY)
95#define IS_NEGINF(x) ((x) <= -MSK_INFINITY)
96#define MOSEK_relDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(val2))) )
99 #if defined(_Thread_local)
103 #define SCIP_REUSEENV
109 #define SCIP_REUSEENV
112#if MSK_VERSION_MAJOR >= 9
113#define NEAR_REL_TOLERANCE 1.0
115#define DEBUG_PRINT_STAT 0
116#define DEBUG_PARAM_SETTING 0
117#define DEBUG_CHECK_DATA 0
118#define DEBUG_EASY_REPRODUCE 0
119#define DEBUG_DO_INTPNT_FEAS_CHECK 0
120#define DEBUG_CHECK_STATE_TOL 1e-5
122#define SHOW_RELATIVE_OPTIMAL_GAP 0
123#define ASSERT_ON_NUMERICAL_TROUBLES 0
124#define ASSERT_ON_WARNING 0
125#define FORCE_MOSEK_LOG 0
126#define FORCE_MOSEK_SUMMARY 0
127#define FORCE_NO_MAXITER 0
128#define SETBACK_LIMIT 250
129#define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE
130#define SUPRESS_NAME_ERROR 1
132#define WRITE_PRIMAL 0
133#define WRITE_INTPNT 0
134#if WRITE_DUAL > 0 || WRITE_PRIMAL > 0 || WRITE_INTPNT > 0 || FORCE_MOSEK_LOG > 0 || FORCE_MOSEK_SUMMARY > 0
137#define DEGEN_LEVEL MSK_SIM_DEGEN_FREE
138#define ALWAYS_SOLVE_PRIMAL_FORM 1
139#if DEBUG_PRINT_STAT > 0
150#if DEBUG_PRINT_STAT > 0
197#define COLS_PER_PACKET SCIP_DUALPACKETSIZE
199#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE
272#if SUPRESS_NAME_ERROR
282#if DEBUG_CHECK_DATA > 0
485 for(
i = 0;
i < n;
i++ )
506 else if (lb[
i] == ub[
i])
537 for(
i = 0;
i < n-1;
i++)
548 for(
i = 0;
i < n;
i++ )
569 for(
i = first;
i <= last;
i++ )
593 for(
i = 0;
i < n;
i++ )
609 for(
i = 0;
i < n;
i++ )
629 for(
i = 0;
i < len;
i++ )
749#define STR_HELPER(x) #x
750#define STR(x) STR_HELPER(x)
752#if MSK_VERSION_MAJOR < 9
753 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION)
755 #define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_REVISION)
774 return "Linear Programming Solver developed by MOSEK Optimization Software (www.mosek.com)";
786 return (
void*) lpi->
task;
800 SCIPerrorMessage(
"SCIPlpiSetIntegralityInformation() has not been implemented yet.\n");
859#if MSK_VERSION_MAJOR < 8
864 (*lpi)->lpid =
numlp++;
867 (*lpi)->numlp = &
numlp;
874#if MSK_VERSION_MAJOR < 8
902 (*lpi)->itercount = 0;
909 (*lpi)->aptre =
NULL;
914 (*lpi)->aptresize = 0;
915 (*lpi)->lastsolvetype = (MSKsoltypee) -1;
916 (*lpi)->lpinfo =
FALSE;
917 (*lpi)->restrictselectdef = 50;
918 (*lpi)->fromscratch =
FALSE;
919 (*lpi)->clearstate =
FALSE;
920 (*lpi)->messagehdlr = messagehdlr;
950 assert(*(*lpi)->numlp > 0);
953 if( *(*lpi)->numlp == 0 )
957 *(*lpi)->reusemosekenv =
NULL;
978 const SCIP_Real*
obj,
983 const SCIP_Real* lhs,
984 const SCIP_Real* rhs,
995 for(
j = 0;
j < nnonz;
j++ )
1016#if DEBUG_CHECK_DATA > 0
1035 MOSEK_CALL(
MSK_inputdata(lpi->
task, nrows, ncols, nrows, ncols,
obj, 0.0,
beg, lpi->
aptre,
ind, val,
1036 lpi->
bkc, lhs, rhs, lpi->
bkx, lb, ub) );
1040 if( colnames !=
NULL )
1044 for(
c = 0;
c < ncols;
c++ )
1050 if( rownames !=
NULL )
1054 for(
r = 0;
r < nrows;
r++ )
1060#if DEBUG_CHECK_DATA > 0
1071 const SCIP_Real*
obj,
1072 const SCIP_Real* lb,
1073 const SCIP_Real* ub,
1078 const SCIP_Real* val
1081#if MSK_VERSION_MAJOR < 7
1103#if DEBUG_CHECK_DATA > 0
1127 for (
j = 0;
j < nnonz; ++
j)
1139 if( colnames !=
NULL )
1143 for(
c = 0;
c < ncols;
c++ )
1149#if DEBUG_CHECK_DATA > 0
1173#if DEBUG_CHECK_DATA > 0
1183#if DEBUG_CHECK_DATA > 0
1213#if DEBUG_CHECK_DATA > 0
1222 for(
i = 0;
i < ncols;
i++)
1242#if DEBUG_CHECK_DATA > 0
1253 const SCIP_Real* lhs,
1254 const SCIP_Real* rhs,
1259 const SCIP_Real* val
1275#if DEBUG_CHECK_DATA > 0
1299 for (
j = 0;
j < nnonz; ++
j)
1311 if( rownames !=
NULL )
1315 for(
r = 0;
r < nrows;
r++ )
1321#if DEBUG_CHECK_DATA > 0
1345#if DEBUG_CHECK_DATA > 0
1357#if DEBUG_CHECK_DATA > 0
1386#if DEBUG_CHECK_DATA > 0
1396 for(
i = 0;
i < nrows;
i++ )
1416#if DEBUG_CHECK_DATA > 0
1453 const SCIP_Real* lb,
1470#if DEBUG_CHECK_DATA > 0
1476 for (
i = 0;
i < ncols; ++
i)
1493#if MSK_VERSION_MAJOR < 9
1499#if DEBUG_CHECK_DATA > 0
1511 const SCIP_Real* lhs,
1512 const SCIP_Real* rhs
1527#if DEBUG_CHECK_DATA > 0
1534#if MSK_VERSION_MAJOR < 9
1540#if DEBUG_CHECK_DATA > 0
1563#if DEBUG_CHECK_DATA > 0
1569#if DEBUG_CHECK_DATA > 0
1600 const SCIP_Real*
obj
1613#if DEBUG_CHECK_DATA > 0
1619#if DEBUG_CHECK_DATA > 0
1648#if DEBUG_CHECK_DATA > 0
1669#if MSK_VERSION_MAJOR < 9
1679#if DEBUG_CHECK_DATA > 0
1709#if DEBUG_CHECK_DATA > 0
1729#if MSK_VERSION_MAJOR < 9
1742#if DEBUG_CHECK_DATA > 0
1829#if DEBUG_CHECK_DATA > 0
1843#if MSK_VERSION_MAJOR < 9
1852#if MSK_VERSION_MAJOR == 9
1863#if MSK_VERSION_MAJOR == 9
1875#if DEBUG_CHECK_DATA > 0
1952#if DEBUG_CHECK_DATA > 0
1959#if DEBUG_CHECK_DATA > 0
2074#if DEBUG_CHECK_DATA > 0
2078#if MSK_VERSION_MAJOR < 9
2103#if DEBUG_CHECK_DATA > 0
2107#if MSK_VERSION_MAJOR < 9
2113#if DEBUG_CHECK_DATA > 0
2135#if DEBUG_CHECK_DATA > 0
2141#if DEBUG_CHECK_DATA > 0
2174 MSKrescodee* termcode,
2180#if ASSERT_ON_NUMERICAL_TROUBLES > 0
2231#if DEBUG_EASY_REPRODUCE
2263#if ALWAYS_SOLVE_PRIMAL_FORM > 0
2268#if DEBUG_CHECK_DATA > 0
2285#if FORCE_NO_MAXITER > 0
2289#if DEBUG_CHECK_DATA > 0
2293#if FORCE_MOSEK_SUMMARY > 1
2303#if MSK_VERSION_MAJOR < 10
2316#if FORCE_MOSEK_SUMMARY
2328#if DEBUG_CHECK_DATA > 0
2348 SCIPdebugMessage(
"maxiter = %d, termcode = %d, prosta = %d, solsta = %d, objval = %g : %g, iter = %d+%d\n",
2374#if ASSERT_ON_WARNING
2380#if MSK_VERSION_MAJOR < 9
2392#if ASSERT_ON_WARNING
2399#if MSK_VERSION_MAJOR < 9
2407#if ASSERT_ON_WARNING
2426#if MSK_VERSION_MAJOR < 9
2438#if ASSERT_ON_WARNING
2448#if ASSERT_ON_WARNING
2456#if SHOW_RELATIVE_OPTIMAL_GAP
2459 SCIPerrorMessage(
"Simplex[%d] returned optimal solution with different objvals %g != %g reldiff %.2g%%\n",
2477 if (maxiter >= 2000000000)
2490#if DEBUG_DO_INTPNT_FEAS_CHECK
2510#if DEBUG_PRINT_STAT > 0
2511 SCIPdebugMessage(
"Max iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2513 SCIPdebugMessage(
"Objcut iter stat : Count %d branchup = %d branchlo = %d primal %d dual %d\n",
2517#if DEBUG_CHECK_DATA > 0
2544#if DEBUG_CHECK_DATA > 0
2564#ifdef SCIP_DISABLED_CODE
2579#if DEBUG_PRINT_STAT > 0
2584#if DEBUG_PRINT_STAT > 0
2589#if DEBUG_CHECK_DATA > 0
2610#if (MSK_VERSION_MAJOR < 8) || (MSK_VERSION_MAJOR == 8 && MSK_VERSION_MINOR == 0)
2635#ifdef SCIP_DISABLED_CODE
2650#if DEBUG_PRINT_STAT > 0
2655#if DEBUG_PRINT_STAT > 0
2694#if DEBUG_CHECK_DATA > 0
2698#ifdef SCIP_DISABLED_CODE
2709#if MSK_VERSION_MAJOR >= 9
2726#if DEBUG_PRINT_STAT > 0
2749#if MSK_VERSION_MAJOR < 9
2762#if ASSERT_ON_WARNING
2767#if MSK_VERSION_MAJOR < 9
2775#if ASSERT_ON_WARNING
2792#if MSK_VERSION_MAJOR < 9
2806#if ASSERT_ON_WARNING
2815#if ASSERT_ON_WARNING
2822#if DEBUG_CHECK_DATA > 0
2894#if DEBUG_CHECK_DATA > 0
2925#if MSK_VERSION_MAJOR < 9
2954#if MSK_VERSION_MAJOR < 9
3000#if DEBUG_PRINT_STAT > 0
3010#if MSK_VERSION_MAJOR < 9
3037#if MSK_VERSION_MAJOR < 9
3080#if DEBUG_PRINT_STAT > 0
3089#if MSK_VERSION_MAJOR < 9
3105#if DEBUG_CHECK_DATA > 0
3170 for (
j = 0;
j < ncols; ++
j)
3234 for (
j = 0;
j < ncols; ++
j)
3270 SCIP_Bool* primalfeasible,
3271 SCIP_Bool* dualfeasible
3289 *primalfeasible =
TRUE;
3290 *dualfeasible =
TRUE;
3293 *primalfeasible =
TRUE;
3294 *dualfeasible =
FALSE;
3297 *primalfeasible =
FALSE;
3298 *dualfeasible =
TRUE;
3303 *dualfeasible =
FALSE;
3309#if MSK_VERSION_MAJOR < 9
3315 *primalfeasible =
FALSE;
3316 *dualfeasible =
FALSE;
3639 return (
int) solsta;
3699 SCIP_Real* activity,
3749 for (
j = 0;
j < ncols; ++
j)
3789 for(
i = 0;
i < ncols;
i++ )
3792 redcost[
i] -=
sux[
i];
3822 SCIP_Real* dualfarkas
3832 MOSEK_CALL(
MSK_getsolution(lpi->
task, lpi->
lastsolvetype,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, dualfarkas,
3922 for(
i = 0;
i < n;
i++ )
3936#if MSK_VERSION_MAJOR < 9
3968#if MSK_VERSION_MAJOR < 10
3998 for(
i = 0;
i < m;
i++ )
4011#if MSK_VERSION_MAJOR < 9
4039#if MSK_VERSION_MAJOR < 10
4060 for(
i = 0;
i < n;
i++ )
4093 for(
i = 0;
i < n;
i++ )
4207 for (
i = 0;
i < nrows;
i++ )
4209 if (
bind[
i] < nrows)
4256 for (
i = 0;
i < nrows; ++
i)
4267#if MSK_VERSION_MAJOR < 10
4285#if MSK_VERSION_MAJOR < 10
4343 for (
i = 0;
i < nrows; ++
i)
4353#if MSK_VERSION_MAJOR < 10
4370#if MSK_VERSION_MAJOR < 10
4444 for (
i = 0;
i < ncols; ++
i)
4505 for (
i = 0;
i < nrows; ++
i)
4515 assert( 0 <= inds[
i] && inds[
i] < nrows );
4516 coef[inds[
i]] = val[
i];
4521#if MSK_VERSION_MAJOR < 10
4538 coef[
sub[
i]] = val[
i];
4541#if MSK_VERSION_MAJOR < 10
4583 (*lpistate)->num = -1;
4584 (*lpistate)->ncols = ncols;
4585 (*lpistate)->nrows = nrows;
4633 for(
i = 0;
i < n;
i++ )
4644#if MSK_VERSION_MAJOR < 9
4821#ifdef SCIP_DISABLED_CODE
4825 if (lpistate ==
NULL)
4831 if (lpistate->
nrows == 0 || lpistate->
ncols == 0)
4841#ifdef SCIP_DISABLED_CODE
4848 for (
i = lpistate->
ncols;
i < ncols; ++
i)
4852#if MSK_VERSION_MAJOR < 9
4868 for (
i = lpistate->
nrows;
i < nrows; ++
i)
4910 if( *lpistate !=
NULL )
4930 return ( lpistate !=
NULL && lpistate->
num >= 0);
4979 SCIPdebugMessage(
"No LP state written, since it was cleared after the last solve \n");
4988 for( v = 0; v <
nvars; v++ )
4991 if(
strcmp(name,
"") == 0 )
5000 for(
c = 0;
c < nconss;
c++ )
5003 if(
strcmp(name,
"") == 0 )
5014 " names instead. Note that this state cannot be read back in later!\n",
5015 v <
nvars ?
"variable" :
"constraint", v <
nvars ? v :
c);
5097 "SCIP_LPPAR_FROMSCRATCH",
5098 "SCIP_LPPAR_FASTMIP",
5099 "SCIP_LPPAR_SCALING",
5100 "SCIP_LPPAR_PRESOLVING",
5101 "SCIP_LPPAR_PRICING",
5102 "SCIP_LPPAR_LPINFO",
5103 "SCIP_LPPAR_FEASTOL",
5104 "SCIP_LPPAR_DUALFEASTOL",
5105 "SCIP_LPPAR_BARRIERCONVTOL",
5106 "SCIP_LPPAR_OBJLIM",
5107 "SCIP_LPPAR_LPITLIM",
5108 "SCIP_LPPAR_LPTILIM",
5109 "SCIP_LPPAR_MARKOWITZ",
5110 "SCIP_LPPAR_ROWREPSWITCH",
5112 "SCIP_LPPAR_THREADS",
5113 "SCIP_LPPAR_CONDITIONLIMIT",
5114 "SCIP_LPPAR_TIMING",
5115 "SCIP_LPPAR_RANDOMSEED",
5116 "SCIP_LPPAR_POLISHING",
5117 "SCIP_LPPAR_REFACTOR"
5179#if MSK_VERSION_MAJOR < 10
5219 static int pricing[7] =
5253#if MSK_VERSION_MAJOR < 10
5263#if MSK_VERSION_MAJOR < 10
5264 else if(
ival == 1 )
5312#if DEBUG_PARAM_SETTING
5514#if MSK_VERSION_MAJOR < 9
5525#if MSK_VERSION_MAJOR < 9
5543#if MSK_VERSION_MAJOR < 9
5551#if MSK_VERSION_MAJOR >= 9
5558#if MSK_VERSION_MAJOR < 9
void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count)
void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count)
packing single and dual bit values
unsigned int SCIP_DUALPACKET
SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
static SCIP_RETCODE convertstat_mosek2scip_slack(SCIP_LPI *lpi, SCIP_Bool iscon, MSKstakeye *sk, int m, int *stat)
SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen)
static void lpistateUnpack(const SCIP_LPISTATE *lpistate, MSKstakeye *skx, MSKstakeye *skc)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
SCIP_RETCODE SCIPlpiClear(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiClearState(SCIP_LPI *lpi)
static SCIP_RETCODE getSolutionStatus(SCIP_LPI *lpi, MSKprostae *prosta, MSKsolstae *solsta)
SCIP_Bool SCIPlpiExistsDualRay(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiExistsPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat)
SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
static MSKrescodee filterTRMrescode(SCIP_MESSAGEHDLR *messagehdlr, MSKrescodee *termcode, MSKrescodee res)
SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray)
SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiSetIntegralityInformation(SCIP_LPI *lpi, int ncols, int *intInfo)
SCIP_Bool SCIPlpiIsDualInfeasible(SCIP_LPI *lpi)
static SCIP_RETCODE checkState1(SCIP_LPI *lpi, int n, MSKstakeye *sk, SCIP_Bool isrow)
static SCIP_RETCODE lpistatePack(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
static SCIP_RETCODE SolveWSimplex(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
static SCIP_RETCODE checkState(SCIP_LPI *lpi, int ncols, int nrows)
SCIP_RETCODE SCIPlpiStrongbranchFrac(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPINORMS *lpinorms)
SCIP_RETCODE SCIPlpiGetNNonz(SCIP_LPI *lpi, int *nnonz)
SCIP_Bool SCIPlpiHasPrimalSolve(void)
SCIP_RETCODE SCIPlpiStrongbranchInt(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
SCIP_Bool SCIPlpiHasBarrierSolve(void)
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas)
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval)
int SCIPlpiGetInternalStatus(SCIP_LPI *lpi)
static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
static SCIP_RETCODE getASlice(SCIP_LPI *lpi, SCIP_Bool iscon, int first, int last, int *nnonz, int *beg, int *ind, double *val)
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success)
SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
static SCIP_RETCODE handle_singular(SCIP_LPI *lpi, int *basis, MSKrescodee res)
SCIP_RETCODE SCIPlpiStrongbranchesFrac(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiReadLP(SCIP_LPI *lpi, const char *fname)
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
SCIP_Bool SCIPlpiIsTimelimExc(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, const int *cstat, const int *rstat)
SCIP_Bool SCIPlpiHasPrimalRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow)
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)
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 SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int row, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
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)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
const char * SCIPlpiGetSolverDesc(void)
SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover)
static void convertstat_scip2mosek(const int *stat, int n, MSKstakeye *resstat)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
SCIP_Bool SCIPlpiHasDualSolve(void)
SCIP_RETCODE SCIPlpiEndStrongbranch(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
SCIP_RETCODE SCIPlpiStrongbranchesInt(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_Bool SCIPlpiHasDualRay(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiDelColset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
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)
static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
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_Bool SCIPlpiIsDualUnbounded(SCIP_LPI *lpi)
static SCIP_RETCODE convertstat_mosek2scip(SCIP_LPI *lpi, SCIP_Bool iscon, MSKstakeye *sk, int n, int *stat)
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
static void convertstat_scip2mosek_slack(const int *stat, int n, MSKstakeye *resstat)
void * SCIPlpiGetSolverPointer(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *obj)
SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
SCIP_Bool SCIPlpiIsStable(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetNCols(SCIP_LPI *lpi, int *ncols)
SCIP_RETCODE SCIPlpiInterrupt(SCIP_LPI *lpi, SCIP_Bool interrupt)
SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol)
SCIP_RETCODE SCIPlpiDelRowset(SCIP_LPI *lpi, int *dstat)
SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval)
SCIP_RETCODE SCIPlpiGetNRows(SCIP_LPI *lpi, int *nrows)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
assert(minobj< SCIPgetCutoffbound(scip))
interface methods for specific LP solvers
static SCIP_RETCODE getIndicesRange(int first, int last, int **sub)
static void MSKAPI printstr(MSKuserhandle_t handle, const char *str)
static SCIP_RETCODE getEndptrs(int n, const int *beg, int nnonz, MSKint32t *aptre)
#define MOSEK_relDiff(val1, val2)
static SCIP_RETCODE setbase(SCIP_LPI *lpi)
static void generateMskBoundkeys(int n, const double *lb, const double *ub, MSKboundkeye *bk)
static int rowpacketNum(int nrows)
static const char * paramname[]
static SCIP_RETCODE getbase(SCIP_LPI *lpi, int ncols, int nrows)
static SCIP_RETCODE ensureBkxMem(SCIP_LPI *lpi, int ncols)
#define DEBUG_CHECK_STATE_TOL
static MSKenv_t reusemosekenv
SCIP_DUALPACKET ROWPACKET
static void scale_bound(MSKboundkeye *bk, double *bl, double *bu, double s)
static SCIP_RETCODE ensureAptreMem(SCIP_LPI *lpi, int n)
#define SCIP_ABORT_FALSE(x)
enum MSKoptimizertype_enum MSKoptimizertype
SCIP_DUALPACKET COLPACKET
static SCIP_RETCODE getIndicesFromDense(int *dstat, int n, int *count, int **sub)
#define SENSE2MOSEK(objsen)
static void scale_vec(int len, double *vec, double s)
static int colpacketNum(int ncols)
static const char * paramty2str(SCIP_LPPARAM type)
#define STRONGBRANCH_PRICING
static SCIP_RETCODE ensureStateMem(SCIP_LPI *lpi, int ncols, int nrows)
static MSKrescodee MSK_getsolutionstatus(MSKtask_t task, MSKsoltypee whichsol, MSKprostae *prosta, MSKsolstae *solsta)
static SCIP_RETCODE ensureBkcMem(SCIP_LPI *lpi, int nrows)
static void invalidateSolution(SCIP_LPI *lpi)
SCIP_DUALPACKET ROWPACKET
SCIP_DUALPACKET COLPACKET
#define BMSfreeMemory(ptr)
#define BMSfreeBlockMemory(mem, ptr)
#define BMSallocBlockMemory(mem, ptr)
#define BMSreallocMemoryArray(ptr, num)
#define BMSallocMemoryArray(ptr, num)
#define BMSfreeMemoryArray(ptr)
#define BMSallocBlockMemoryArray(mem, ptr, num)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
struct BMS_BlkMem BMS_BLKMEM
#define BMSfreeMemoryArrayNull(ptr)
#define BMSallocMemory(ptr)
void SCIPmessagePrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
public methods for message output
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool *vanished)
MSKoptimizertype lastalgo
MSKsoltypee lastsolvetype
SCIP_MESSAGEHDLR * messagehdlr
@ SCIP_PRICING_STEEPQSTART
@ SCIP_PRICING_LPIDEFAULT
enum SCIP_Pricing SCIP_PRICING
enum SCIP_LPParam SCIP_LPPARAM
@ SCIP_LPPAR_BARRIERCONVTOL
@ SCIP_LPPAR_CONDITIONLIMIT
@ SCIP_LPPAR_ROWREPSWITCH
enum SCIP_LPSolQuality SCIP_LPSOLQUALITY
enum SCIP_ObjSen SCIP_OBJSEN
enum SCIP_Retcode SCIP_RETCODE